All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de, Vignesh R <vigneshr@ti.com>
Subject: Re: [PATCH] mtd: sf: Set SF parameters as env variables
Date: Thu, 2 Dec 2021 11:27:08 +0530	[thread overview]
Message-ID: <CAMty3ZB9ajDE27D3htGSdZ+hSVKUsy0tLOGD_x1NsKEXKLOsRA@mail.gmail.com> (raw)
In-Reply-To: <cd397667-c205-9d7b-de13-d78f6d219893@denx.de>

On Thu, Dec 2, 2021 at 11:19 AM Marek Vasut <marex@denx.de> wrote:
>
> On 12/2/21 06:47, Jagan Teki wrote:
> > On Tue, Sep 14, 2021 at 8:59 AM Marek Vasut <marex@denx.de> wrote:
> >>
> >> Set the SF page size, erase block size and total size as an environment
> >> variable after "sf probe". This lets us discern boards with multiple
> >> distinct SPI flash options and also e.g. set mtdparts accordingly.
> >>
> >> Signed-off-by: Marek Vasut <marex@denx.de>
> >> Cc: Jagan Teki <jagan@amarulasolutions.com>
> >> Cc: Vignesh R <vigneshr@ti.com>
> >> ---
> >>   drivers/mtd/spi/spi-nor-core.c | 4 ++++
> >>   1 file changed, 4 insertions(+)
> >>
> >> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
> >> index d5d905fa5a1..448653b9931 100644
> >> --- a/drivers/mtd/spi/spi-nor-core.c
> >> +++ b/drivers/mtd/spi/spi-nor-core.c
> >> @@ -15,6 +15,7 @@
> >>   #include <dm.h>
> >>   #include <dm/device_compat.h>
> >>   #include <dm/devres.h>
> >> +#include <env.h>
> >>   #include <linux/bitops.h>
> >>   #include <linux/err.h>
> >>   #include <linux/errno.h>
> >> @@ -3829,8 +3830,11 @@ int spi_nor_scan(struct spi_nor *nor)
> >>   #ifndef CONFIG_SPL_BUILD
> >>          printf("SF: Detected %s with page size ", nor->name);
> >>          print_size(nor->page_size, ", erase size ");
> >> +       env_set_hex("sf_pagesize", nor->page_size);
> >>          print_size(nor->erase_size, ", total ");
> >> +       env_set_hex("sf_erasesize", nor->erase_size);
> >>          print_size(nor->size, "");
> >> +       env_set_hex("sf_size", nor->size);
> >>          puts("\n");
> >
> > I feel this unnecessarily add env variables which are not needed for
> > those SF enabled boards, isn't it?
>
> So, how do you determine current SPI NOR size from U-Boot shell ?

I think we need to know the size for those who enabled mtd command (or
mtdparts), any way to preserve it via mtd command or set the env via
mtd command side.

Jagan.

  reply	other threads:[~2021-12-02  5:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14  3:28 [PATCH] mtd: sf: Set SF parameters as env variables Marek Vasut
2021-09-23 18:53 ` Pratyush Yadav
2021-09-23 20:00   ` Marek Vasut
2021-10-07 12:40     ` Pratyush Yadav
2021-10-07 12:46       ` Marek Vasut
2021-11-28 21:56         ` Marek Vasut
2021-12-02  9:14           ` Pratyush Yadav
2021-12-02 16:41       ` Sean Anderson
2021-12-02  5:47 ` Jagan Teki
2021-12-02  5:49   ` Marek Vasut
2021-12-02  5:57     ` Jagan Teki [this message]
2021-12-02  6:03       ` Marek Vasut

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=CAMty3ZB9ajDE27D3htGSdZ+hSVKUsy0tLOGD_x1NsKEXKLOsRA@mail.gmail.com \
    --to=jagan@amarulasolutions.com \
    --cc=marex@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /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.