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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2463C433F5 for ; Tue, 26 Oct 2021 04:46:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EE6A46109D for ; Tue, 26 Oct 2021 04:46:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EE6A46109D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 251CD8351A; Tue, 26 Oct 2021 06:46:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1635223598; bh=Ba8RcPLz5Ys+GxYrZ9CcXrNqV6QrV+AaJkhWTmnDqp4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vepC6BNryr6GsLzmzE1Cio+hkyRL5KUWQOHbM0xZTbRCtQLhdRb5tss/sbAFLz2wf TG/QyaTR+I9uwzUw0RNHcpNjQCvmNwG0GFsc8/56pE1CmoJDo8gYNUxSWzZEBBmzg5 QH7+/DobVH6/WiQvpoCJd6kViqfiV0vO7diR0l/jNaOcC2gw+BTy6/421RUMChO2hE +T564SADJnFuU0yyg0itBrgYsiT1V8q/SDebM6J+x/wKijRMFnIb93g8mDPonxDlUT isRLlq8aCwAtb85YunFgpv6sywl3YO//NJRXDIIV+Ke8Fywd7zkr/9FJyiXl6CxxwW 1XlL63/q3L9FA== Received: by phobos.denx.de (Postfix, from userid 109) id C7B078352E; Tue, 26 Oct 2021 06:46:36 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (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 2EDD0833CB for ; Tue, 26 Oct 2021 06:46:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (unknown [91.198.250.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4HdfRZ0kyQzQjnX; Tue, 26 Oct 2021 06:46:34 +0200 (CEST) Subject: Re: [PATCH 1/3] tools: kwbimage: Add support for NAND_PAGE_SIZE command also for v1 images To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de References: <20211022103748.25651-1-pali@kernel.org> <20211022103748.25651-2-pali@kernel.org> From: Stefan Roese Message-ID: Date: Tue, 26 Oct 2021 06:46:30 +0200 MIME-Version: 1.0 In-Reply-To: <20211022103748.25651-2-pali@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC6E01300 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 22.10.21 12:37, Pali Rohár wrote: > The NAND_PAGE_SIZE command is already supported by mkimage for v0 images, > but not for v1 images. > > A38x and A39x BootROM supports reading NAND flash page size from v1 image > in the same way as Kirkwood BootROM from v0 image. It it documented in A38x > and A39x Functional Specification. > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > tools/kwbimage.c | 3 +++ > tools/kwbimage.h | 2 +- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/kwbimage.c b/tools/kwbimage.c > index e9324baddba4..67c0c628ae9f 100644 > --- a/tools/kwbimage.c > +++ b/tools/kwbimage.c > @@ -1231,6 +1231,9 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params, > 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; > diff --git a/tools/kwbimage.h b/tools/kwbimage.h > index 126d482fe722..f1ba95c2fa5b 100644 > --- a/tools/kwbimage.h > +++ b/tools/kwbimage.h > @@ -73,7 +73,7 @@ struct ext_hdr_v0 { > struct main_hdr_v1 { > uint8_t blockid; /* 0x0 */ > uint8_t flags; /* 0x1 */ > - uint16_t reserved2; /* 0x2-0x3 */ > + uint16_t nandpagesize; /* 0x2-0x3 */ > uint32_t blocksize; /* 0x4-0x7 */ > uint8_t version; /* 0x8 */ > uint8_t headersz_msb; /* 0x9 */ > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de