Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AE79C433EF for ; Fri, 15 Oct 2021 04:08:22 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E9DD6058D for ; Fri, 15 Oct 2021 04:08:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5E9DD6058D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 167C183809; Fri, 15 Oct 2021 06:08:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="fdeyQgJ3"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MHhIuoBm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BDD2783820; Fri, 15 Oct 2021 06:08:17 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 49F83837F2 for ; Fri, 15 Oct 2021 06:08:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 27AA75C009F; Fri, 15 Oct 2021 00:08:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 15 Oct 2021 00:08:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=ryytPC1bRdmoPCQ5BdS+D7YmpY wpKF8zNqsWxA2XnJ8=; b=fdeyQgJ303KYqb4XxsIhYp4khM7XlSEa4KHTlS0WHP LZ6Qe/FNQ4XWVtcAR87jAI9lArcwlIfPNE97xNdPAB+iZQFc2cXieK+52f2735fn JI18oH8QSA5FblZXcCzu6SncSJaX6xqR1gBsxh4wrRpnAhpgX3L0IEzU/DrMRaLD 6Hui2Ckyt2DoeEn8kYriZmDf8TcVK/ahZZSKM2rRKDDHw7JHZ9HH92Rq3nCzFQAK EcUf8vg4ZjsfLmt5fmm3EljBejWlcuOPs6vQ2FlerKWV+QhMK1fG0s6nFiMYLHOy 3HLo0LKpkHt3S420IB1ytREXcG/Jeyw2GwIkkeiajxGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ryytPC1bRdmoPCQ5B dS+D7YmpYwpKF8zNqsWxA2XnJ8=; b=MHhIuoBme/T6E9ZFfoSt2D3sxfV74pF1e 5hWOCiNC4qH1FfPZH3q2S1q/oaj6ABOD7yTpJC76gtzNgEn9NR7Ik8lLoF+F3Qt8 ZAXWidqV+ULgI0FsQkmcV4+aI9Q/q6E8oWmuJiSJANbBoXV3UQ4t79n4pNN9g4Dv TgSrd4jaTl+PpaYmgz1KnKfi133fSEcFd7Kx0QBrpWPClIVZUPQ/v6c7KcNMeGsf imBPU3c25xhH9Kll9FRFYrMstwWekx2nYTZAoxFKXjv0FLFIqwqLFBc7Pv+w+miR hSNa5tfoM1K/K5+AwzD8z7Qhrchee/TBTQILQmSfQwAOyGRQXPn0g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddufedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeegheeihfeigedujeeufeefjedugfeghfeivdfhhefhkeduvedtueekveeh ledukeenucffohhmrghinheplhhinhhugidqshhunhigihdrohhrghdpfhgvughorhgrph hrohhjvggtthdrohhrghdpghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdroh hrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Oct 2021 00:08:12 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Samuel Holland Subject: [RFC PATCH 0/1] tools: mkimage: Add Allwinner TOC1 support Date: Thu, 14 Oct 2021 23:08:09 -0500 Message-Id: <20211015040811.56856-1-samuel@sholland.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The SPL port for the Allwinner D1 RISC-V SoC will probably take a while longer than porting U-Boot proper, as none of the relevant drivers are set up for DM in SPL. In the meantime, we are using[1][2] a fork[3] of Allwinner's boot0 loader, which they also call "spl" in their BSP. boot0 uses this TOC1 image format. The vendor tools for generating TOC1 images require a binary config file generated by their FEX compiler. Instead of trying to support that, I made up a simple human-readable config file format. I didn't see any existing platform-agnostic parser for multi-image containers in mkimage. I am sending this as RFC because it is only of temporary/limited use. It only works with one specific fork of boot0 which was modified to "behave" (the the original vendor version monkey-patches a custom header inside the U-Boot image during boot). So it will be obsolete once U-Boot SPL is ported. And it is Yet Another Image Format. On the other hand, it does work, and it is currently being used. [1]: https://linux-sunxi.org/Allwinner_Nezha#U-Boot [2]: https://fedoraproject.org/wiki/Architectures/RISC-V/Allwinner [3]: https://github.com/smaeul/sun20i_d1_spl Samuel Holland (1): tools: mkimage: Add Allwinner TOC1 support common/image.c | 1 + include/image.h | 1 + include/sunxi_image.h | 26 ++++ tools/Makefile | 1 + tools/sunxi_toc1.c | 318 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 347 insertions(+) create mode 100644 tools/sunxi_toc1.c -- 2.32.0