From: Sean Anderson <seanga2@gmail.com>
To: Mihai Sain <mihai.sain@microchip.com>,
trini@konsulko.com, sjg@chromium.org, u-boot@lists.denx.de,
dario.binacchi@amarulasolutions.com,
michael@amarulasolutions.com
Subject: Re: [PATCH v2] cmd: nand: Add support to print the manufacturer, model and size
Date: Mon, 18 Mar 2024 09:58:35 -0400 [thread overview]
Message-ID: <fd3fff48-a789-c3f1-6b06-1e5efa13deea@gmail.com> (raw)
In-Reply-To: <20240318134219.20040-1-mihai.sain@microchip.com>
On 3/18/24 09:42, Mihai Sain wrote:
> Add support to nand info for printing the manufacturer,model and size.
> The manufacturer and model are printed only for ONFI flashes.
>
> U-Boot> nand info
>
> Device 0: nand0, sector size 256 KiB
> Manufacturer MACRONIX
> Model MX30LF4G28AD
> Device size 512 MiB
> Page size 4096 b
> OOB size 256 b
> Erase size 262144 b
> ecc strength 8 bits
> ecc step size 512 b
> subpagesize 4096 b
> options 0x00004200
> bbt options 0x00028000
>
> Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
>
> Changes in v2:
> --------------
> * use #ifdef directive for ONFI flashes.
> * use unsigned int for chipsize.
> ---
> cmd/nand.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/cmd/nand.c b/cmd/nand.c
> index fe834c4ac5..5773246d64 100644
> --- a/cmd/nand.c
> +++ b/cmd/nand.c
> @@ -418,6 +418,11 @@ static void nand_print_and_set_info(int idx)
> printf("%dx ", chip->numchips);
> printf("%s, sector size %u KiB\n",
> mtd->name, mtd->erasesize >> 10);
> +#ifdef CONFIG_SYS_NAND_ONFI_DETECTION
> + printf(" Manufacturer %s \n", chip->onfi_params.manufacturer);
> + printf(" Model %s \n", chip->onfi_params.model);
> +#endif
> + printf(" Device size %8u MiB\n", (unsigned int)(chip->chipsize >> 20));
> printf(" Page size %8d b\n", mtd->writesize);
> printf(" OOB size %8d b\n", mtd->oobsize);
> printf(" Erase size %8d b\n", mtd->erasesize);
Can you refactor the logic out of the end of nand_detect as a separate
function and use that instead? That will cover more cases (e.g. JEDEC).
--Sean
prev parent reply other threads:[~2024-03-18 13:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-18 13:42 [PATCH v2] cmd: nand: Add support to print the manufacturer, model and size Mihai Sain
2024-03-18 13:58 ` Sean Anderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fd3fff48-a789-c3f1-6b06-1e5efa13deea@gmail.com \
--to=seanga2@gmail.com \
--cc=dario.binacchi@amarulasolutions.com \
--cc=michael@amarulasolutions.com \
--cc=mihai.sain@microchip.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.