[PATCH 2/2] arm: mvebu: Espressobin: Setup MTD partitions when booting kernel

Pali Rohár pali at kernel.org
Thu Aug 20 13:12:32 CEST 2020


On Thursday 20 August 2020 10:51:28 Pali Rohár wrote:
> On Thursday 20 August 2020 10:17:55 Stefan Roese wrote:
> > On 20.08.20 09:40, Pali Rohár wrote:
> > > On Thursday 20 August 2020 07:02:18 Stefan Roese wrote:
> > > > Can't you just use "mtdparts=" kernel cmdline parameter instead to pass
> > > > the MTD layout to the kernel?
> > > 
> > > Maybe it is possible too, I have not tried it.
> > > 
> > > I thought that more common is to update DTS file by uboot when loading
> > > kernel as it is already done e.g. for ethernet MAC address on
> > > Espressobin.
> > 
> > Updating the MAC address is very common, yes. But passing the
> > MTD partition layout via the mtdparts= cmdline is also very
> > common and used very frequently. From my experience, its the
> > defacto recommended method to pass this info and also easier than
> > generating these DTS lines via some code.
> > 
> > Please take a look at the mtdparts U-Boot command and its usage
> > in other targets.
> > 
> > > Also I see that uboot has function fdt_fixup_mtdparts() via
> > > CONFIG_FDT_FIXUP_PARTITIONS option which do this, but uses uboot MTD
> > > code which IIRC cannot initialize SPI NOR.
> > 
> > Why not?
> 
> I had an impression that U-Boot does not support.
> 
> > SPI NOR is also integrated into the U-Boot MTD world as
> > well. Please see this GARDENA MT7688 target, which uses SPI NOR &
> > SPI NAND:
> 
> Ok, I'm going to look at it.

With following config

CONFIG_MTD=y
CONFIG_CMD_MTD=y
CONFIG_CMD_MTDPARTS=y
CONFIG_SPI_FLASH_MTD=y
CONFIG_MTDIDS_DEFAULT="nor0=nor0"

I get following result:

=> mtd list
List of MTD devices:
No MTD device found
=> mtdparts 
Device nor0 not found!
=> sf probe
SF: Detected w25q32dw with page size 256 Bytes, erase size 4 KiB, total 4 MiB
=> mtdparts 
=> mtd list 
List of MTD devices:
* nor0
  - type: NOR flash
  - block size: 0x1000 bytes
  - min I/O: 0x1 bytes
  - 0x000000000000-0x000000400000 : "nor0"

So main problem is that MTD does not work until I call 'sf probe' in
uboot command line.


More information about the U-Boot mailing list