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 1E0D6C61DA3 for ; Tue, 21 Feb 2023 22:48:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F8A6859FF; Tue, 21 Feb 2023 23:48:36 +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="BhiwnFXq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0112485A6E; Tue, 21 Feb 2023 23:48:35 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::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 D86A88590C for ; Tue, 21 Feb 2023 23:48:32 +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 ams.source.kernel.org (Postfix) with ESMTPS id 8EB92B80F01 for ; Tue, 21 Feb 2023 22:48:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AD7DC433D2 for ; Tue, 21 Feb 2023 22:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677019711; bh=xCC8OtSsBGFUjuRKKL+YNDZV7fqZR5dR1S1qfkK+4qY=; h=Resent-From:Resent-Date:Resent-To:From:To:Cc:Subject:Date: In-Reply-To:References:From; b=BhiwnFXqu9AEXOiEEMSPad7GFRUW6kgvvVWtnr34wZfDEuei34lFVNVSB4OavFsTZ L6vV5CigpXITRbc/v5N4Wo9u0zRfGOKxo5+Ys+8JIZYJqoiBwEB4kUC6WOyiMJcgLZ MJY7n7tSekm8JYMJcQEWtoKlKcXeewmlbk4JlcOVbiFWyA/eX25VR0od6AKwuHwYuR 1G5u2nn8nvEWiZICMWQuV6s3CFbUgXKdhA4m0W2ZRQxfaycuBC6yBEFu6Dz0CbiWLT puaZR8QWbGcDL4steTAR5jEHPr2sUfXEwMTFERtrRHAvcZbQYgL6L9YM0DWKqh8WyI sJxfj/JkOEHyw== Received: by pali.im (Postfix) id D543670C; Tue, 21 Feb 2023 23:48:28 +0100 (CET) Resent-From: Pali =?utf-8?B?Um9ow6Fy?= Resent-Date: Tue, 21 Feb 2023 23:48:28 +0100 Resent-Message-ID: <20230221224828.vtso65bfvk5p4giu@pali> Resent-To: u-boot@lists.denx.de Received: by pali.im (Postfix) id 3A83EAC9; Tue, 21 Feb 2023 21:22:33 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Cc: Stefan Roese , Tony Dinh , Josua Mayer Subject: [PATCH RFC u-boot-mvebu 33/59] tools: kwbimage: Fix dumping NAND_BADBLK_LOCATION Date: Tue, 21 Feb 2023 21:18:59 +0100 Message-Id: <20230221201925.9644-34-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230221201925.9644-1-pali@kernel.org> References: <20230221201925.9644-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.6 at phobos.denx.de X-Virus-Status: Clean Value 0x0 for NAND_BADBLK_LOCATION/nandbadblklocation means that BBI is on the first or second page and value 0x1 means that BBI is on the last page. This indicates also NAND Flash Technology, value 0x0 is SLC NAND and value 0x1 is MLC NAND. Therefore we need to dump NAND_BADBLK_LOCATION also when it is zero. Note that in v0 images, nandbadblklocation field overlaps with ddrinitdelay field in one union. ddrinitdelay is used in Kirkwood and nandbadblklocation is used in Dove. For Dove images is_v0_ext should be set, so use it to distinguish if nandbadblklocation is available or not. In v1 images there is always nandbadblklocation field. Fixes: 1a8e6b63e24f ("tools: kwbimage: Dump kwbimage config file on '-p -1' option") Signed-off-by: Pali Rohár --- tools/kwbimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index a6f6f1578c79..4e9ba5ddfae2 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -2187,7 +2187,7 @@ static int kwbimage_generate_config(void *ptr, struct image_tool_params *params) if (version != 0 && mhdr->blockid == IBR_HDR_NAND_ID) fprintf(f, "NAND_BLKSZ 0x%x\n", (unsigned)mhdr->nandblocksize); - if (mhdr->blockid == IBR_HDR_NAND_ID && (mhdr->nandbadblklocation != 0 || is_v0_ext)) + if (mhdr->blockid == IBR_HDR_NAND_ID && (version != 0 || is_v0_ext)) fprintf(f, "NAND_BADBLK_LOCATION 0x%x\n", (unsigned)mhdr->nandbadblklocation); if (version == 0 && mhdr->blockid == IBR_HDR_SATA_ID) -- 2.20.1