[PATCH] mtd: sf: Set SF parameters as env variables

Pratyush Yadav p.yadav at ti.com
Thu Oct 7 14:40:12 CEST 2021


On 23/09/21 10:00PM, Marek Vasut wrote:
> On 9/23/21 8:53 PM, Pratyush Yadav wrote:
> > On 14/09/21 05:28AM, Marek Vasut 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.
> > 
> > I don't quite follow the rationale for making these environment
> > variables. Wouldn't you be better off finding this info out via mtd or
> > sf command?
> 
> I need to use that info in a script, that's why these env vars.

Ok. Honestly, it doesn't feel quite right to me.

I haven't played with U-Boot's shell too much but is there no way to 
assign variables from command outputs? For example, can we do something 
like `foo=$(cat a.txt)`? If that is possible, maybe add some new 
subcommands to "sf" that return this information?

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.


More information about the U-Boot mailing list