From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 162E7C02190 for ; Wed, 29 Jan 2025 22:37:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB43380C85; Wed, 29 Jan 2025 23:37:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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; secure) header.d=kwiboo.se header.i=@kwiboo.se header.b="T86Mo5o9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B5E080AE5; Wed, 29 Jan 2025 23:37:11 +0100 (CET) Received: from smtp.forwardemail.net (smtp.forwardemail.net [207.246.76.47]) (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 E106C81EEF for ; Wed, 29 Jan 2025 23:37:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=SRS0=e4db=UW=kwiboo.se=jonas@fe-bounces.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1738190227; bh=YRwoQu/NI1tLn6cZ7Tx97f0/zKgLtIH7H59u6fRODrg=; b=T86Mo5o9qGLdWlwBE2RylgYABdPVgDls+2vhs/c+rBLTYu01apaCBaOIiaeyJZ4yksYODJiLZ nW7rULEK1qETtAXMFeD4utIur2e/9Y95COrIC88SpeD9KQcffv3pDjsZzGP5M4AB77LNiuxww0h 148HM7X6jedlxWI4EjboPZ6mOpxBbwW+Yfz6YeCsxC/UAt0MZBXm61d29TdQ+iYXiLBJPMY9sqw +uyc3uSq36+EjEYgx3iIj6MewZ6lDHcffWXVZCTCiJrH+V+8Zz15ZkOa6s4eoGn+hH415ikffLT Zph3hLAWhWRUVxPdVPQqWKD6LwFyxvNbiC7Rb0Iy94lw== X-Forward-Email-ID: 679aad903590a80aa97f8e56 X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 207.246.76.47 X-Forward-Email-Version: 0.4.40 X-Forward-Email-Website: https://forwardemail.net X-Complaints-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Report-Abuse-To: abuse@forwardemail.net From: Jonas Karlman To: Kever Yang , Simon Glass , Philipp Tomsich , Tom Rini Cc: u-boot@lists.denx.de, Jonas Karlman Subject: [PATCH 6/6] rockchip: mkimage: Add option for image load address and flag Date: Wed, 29 Jan 2025 22:36:32 +0000 Message-ID: <20250129223641.1888833-7-jonas@kwiboo.se> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250129223641.1888833-1-jonas@kwiboo.se> References: <20250129223641.1888833-1-jonas@kwiboo.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean The v2 image format supports defining a load address and flag for each embedded image. Add initial support for writing the image load address and flag to the v2 image format header. This may later be used for RK3576 to embed a minimal initial image that if required to fix booting from SD-card due to a BootROM issue. Signed-off-by: Jonas Karlman --- tools/rkcommon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/rkcommon.c b/tools/rkcommon.c index 4ff48e81a636..952b76297dd9 100644 --- a/tools/rkcommon.c +++ b/tools/rkcommon.c @@ -150,12 +150,16 @@ static struct spl_info spl_infos[] = { * * @file: image file path * @size: aligned size of image in bytes + * @address: image load address + * @flag: no use */ struct spl_params { struct { char *file; uint32_t size; + uint32_t address; + uint32_t flag; } images[4]; }; @@ -366,7 +370,8 @@ static void rkcommon_set_header0_v2(void *buf, struct image_tool_params *params) image_sector_count = spl_params.images[i].size / RK_BLK_SIZE; hdr->images[i].offset = cpu_to_le16(sector_offset); hdr->images[i].size = cpu_to_le16(image_sector_count); - hdr->images[i].address = 0xFFFFFFFF; + hdr->images[i].address = spl_params.images[i].address ?: 0xFFFFFFFF; + hdr->images[i].flag = spl_params.images[i].flag; hdr->images[i].counter = cpu_to_le32(i + 1); image_ptr = buf + sector_offset * RK_BLK_SIZE; do_sha256_hash(image_ptr, spl_params.images[i].size, -- 2.48.1