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 77087C433EF for ; Thu, 17 Feb 2022 09:45:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D37383B57; Thu, 17 Feb 2022 10:45:30 +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="SHE8ZHm8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A2D5C83A30; Thu, 17 Feb 2022 10:44:48 +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 A657083B67 for ; Thu, 17 Feb 2022 10:44: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=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 5716961CD2; Thu, 17 Feb 2022 09:44:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0BC3C340EC; Thu, 17 Feb 2022 09:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645091060; bh=uCgxb4G/kdKbHqvNoLKJoefivnG8L2E8KVRfDHyf/lQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SHE8ZHm8fE7q3/2LiR5pEWYhL8XNrSDGWPqr4YXcISu/Z5IDVd2jIdA74HrwbmSTF 0/7yloVz52xsctmAD9QCbfJZ72tm6HZDfJs8MFnM/DyKIbUhXDKgAVshaEGj09i0gs DeyFjFxvMvT5fxWExd7dKbm4yKn++hLhhfnRPq5/eVP4rgIGSKTFVW1wtgPDLy/OBv K99EXSQxEdXytNub70y88KMfmHXYcs8NgDb4B0G8PEwsejfp13xfnie1wPy9DWBjEt qVouBQb59LFQKnuVn83zi30e5h1nWgekik11GeCfLamKLbeftD69qDVl+8/a77gkkB /LPC4Df7WaE6Q== Received: by pali.im (Postfix) id 58B8F1187; Thu, 17 Feb 2022 10:44:20 +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 v2 5/7] tools: kwbimage: Add support for NAND_BLKSZ and NAND_BADBLK_LOCATION for v0 images Date: Thu, 17 Feb 2022 10:43:38 +0100 Message-Id: <20220217094340.9048-6-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220217094340.9048-1-pali@kernel.org> References: <20220215185925.16060-1-pali@kernel.org> <20220217094340.9048-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 Tested-by: Tony Dinh Reviewed-by: Stefan Roese --- tools/kwbimage.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index 73788d8d892f..bf8ab0f19251 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -998,9 +998,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