[U-Boot] DA850evm SPI Flash Partitions between Linux and U-boot are Inconsistent

Sekhar Nori nsekhar at ti.com
Tue Aug 29 09:13:54 UTC 2017


Hi Adam,

On Sunday 27 August 2017 08:31 PM, Adam Ford wrote:
> I was trying to enable MTD Partitions to make loading the Kernel and
> FS easier from within U-Boot
> 
> The da850evm spi-flash partitions in Linux show
> 
> "U-Boot-SPL" @ offset 0, size 64K
> "U-Boot"; @ offset 0x00010000, size 512K
> "U-Boot-Env"; @ offset 0x00090000

According to board/davinci/da8xxevm/README.da850, we support AIS image
format for SPI boot. This is a single image containing SPL and U-Boot.

Given this, I think having separate partitions for SPL and U-Boot does
not make sense since thats not how its going to be used.

> 
> However U-Boot shows the following:
> 
> CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000 which would make the SPL partition 32K.
> CONFIG_SYS_SPI_U_BOOT_SIZE      0x40000 and the size of U-boot 256K
> instead of 512k.
> 
> CONFIG_ENV_SIZE                 (64 << 10)
> CONFIG_ENV_OFFSET           (512 << 10) which is 0x80000 instead of
> Linux's 0x90000
> 
> It seems to me like the U-Boot and Linux should try and synchronize
> their partitions tables.

Right.

> For people who want to burn Linux into the SPI flash it seems there
> there should be some consistency.  I tried making the U-boot settings
> match the Linux ones, but it seems to hang between SPL and U-Boot, so
> I think the U-Boot offset in Linux might need to match U-Boot.  Can
> you guys make some recomendations as to which is correct?

I have not tried it, but looks like the partitions we need are

"SPL/U-Boot AIS" @ offset 0, size 512K
"U-Boot Environment" @ offset 512K, size 64K
"Kernel/Spare" @ offset 576K, size 7552K
"Mac Address" @ offset 8128K, size 64K (read only)

With an 8M flash, I think its futile to try to fit a modern filesystem
on the flash.

If you are using DT boot, we cannot really change the partitions in
device-tree because of DT backward-compatibility requirements. But we
can fix da850evm_spiflash_part[] table in
arch/arm/mach-davinci/board-da850-evm.c.

To help DT boot, we can pass fixed up mtdparts through environment
variables. Something like what is done in 3f18ff07c81b ("ARM: keystone:
Pass SPI MTD partition table via kernel command line").

Thanks,
Sekhar


More information about the U-Boot mailing list