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 93D39C433F5 for ; Tue, 15 Feb 2022 19:00:46 +0000 (UTC) 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) 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=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=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 Content-Type: text/plain; charset=UTF-8 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.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 --- 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)); -- 2.20.1