On Tuesday 09 August 2022 11:20:12 Marek Behún wrote: > On Mon, 8 Aug 2022 19:13:43 +0200 > Pali Rohár <p...@kernel.org> wrote: > > > SPI0 CS0 Flash is mapped to address range 0xD4000000 - 0xD7FFFFFF by > > BootROM. > > Proper U-Boot removes this direct mapping. So it is available only in SPL. > > This applies for all 32-bit Armada BootROMs. SPL mvebu code is used only on > > 32-bit Armada SoCs. So move env_sf_get_env_addr() function from Turris > > Omnia board to common SPL mvebu code and add proper checks for SPI0 CS0. > > > > Signed-off-by: Pali Rohár <p...@kernel.org> > > Do we know that this will work for all flash memories used on those > other boards? Some boards may have non-compliant SPI-NORs soldered on. > > But if BootROM on those boards also uses this mapping to read flash, it > should be okay...
IIRC this range is used by BootROM for reading SPL. Ok, I can imagine some very special configuration where SPL kwbimage is stored on eMMC, eMMC is used for BootROM booting, but ENV is stored on non-standard SPI flash, which BootROM cannot access, but U-Boot yes. So maybe I should add another #ifdef guard e.g. ? #ifdef CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI