From patchwork Tue Feb 15 18:59:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1593217 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qjXAOEat; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jyr5X1hqXz9s0B for ; Wed, 16 Feb 2022 06:00:48 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D528283A51; Tue, 15 Feb 2022 20:00:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="qjXAOEat"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1074881DDF; Tue, 15 Feb 2022 19:59:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 68B42839E8 for ; Tue, 15 Feb 2022 19:59:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1ED9D61741; Tue, 15 Feb 2022 18:59:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 644AEC340EB; Tue, 15 Feb 2022 18:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644951585; bh=3I7ZZpbWc0rxND240vnDa776xhZogM5tWbmXEALKG2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qjXAOEatGTyiziguTkFXi/wLW6l19W1Nt2tx5TMsWeYIy04KZnDMd5itFNXYibczU iZDsfdKEcdp3I//ITuhRQBMLSUVlQLBT/OEugfgiuRlWeKLyflvuvp67kg/cD2pPXr ZUYtdCCt3f8E+MWwbQyKqxKIVibY9Ltz2hXhJT2ZvT1bUghT3t6lQ1FLXyi9VCXQFf QL83ErBwuSGnDF8H6XU8SLQdDc1F+gsHV+h/1/Al3JROWj0zi9VDhInGC9jsl9jQ/g vvTkI6yz13UGJVI3uvbMq4zci8GYaYomssZaUnmQThYpEq+2yCgRcRnFO0GRldpG6f brZNn/KX5eFTQ== Received: by pali.im (Postfix) id 1DED3F13; Tue, 15 Feb 2022 19:59:45 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , =?utf-8?q?Marek_Beh=C3=BAn?= , Tony Dinh Cc: u-boot@lists.denx.de Subject: [PATCH u-boot-marvell 5/7] tools: kwbimage: Add support for NAND_BLKSZ and NAND_BADBLK_LOCATION for v0 images Date: Tue, 15 Feb 2022 19:59:23 +0100 Message-Id: <20220215185925.16060-6-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220215185925.16060-1-pali@kernel.org> References: <20220215185925.16060-1-pali@kernel.org> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean These two commands are currently not processed when generating v0 images. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- tools/kwbimage.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 8fd30516c9d4..e455c10dc744 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -985,9 +985,15 @@ static void *image_create_v0(size_t *imagesz, struct image_tool_params *params, e = image_find_option(IMAGE_CFG_NAND_ECC_MODE); if (e) main_hdr->nandeccmode = e->nandeccmode; + e = image_find_option(IMAGE_CFG_NAND_BLKSZ); + if (e) + main_hdr->nandblocksize = e->nandblksz / (64 * 1024); e = image_find_option(IMAGE_CFG_NAND_PAGESZ); if (e) main_hdr->nandpagesize = cpu_to_le16(e->nandpagesz); + e = image_find_option(IMAGE_CFG_NAND_BADBLK_LOCATION); + if (e) + main_hdr->nandbadblklocation = e->nandbadblklocation; main_hdr->checksum = image_checksum8(image, sizeof(struct main_hdr_v0));