diff options
author | Pali Rohár <pali@kernel.org> | 2022-08-08 19:13:43 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-08-23 10:48:59 +0200 |
commit | 397626ced67427538d85aded42135e20a7fb393a (patch) | |
tree | 350a0539f6f2e77da4733f899087874bff3c2320 /arch/arm | |
parent | 1d323d83061fae8f94a9118b8db3384daef26216 (diff) |
arm: mvebu: Define env_sf_get_env_addr() for all Armada boards in SPL
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 <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-mvebu/spl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index bfcba2e73ba..ca2d5a59d77 100644 --- a/arch/arm/mach-mvebu/spl.c +++ b/arch/arm/mach-mvebu/spl.c @@ -299,6 +299,19 @@ int board_return_to_bootrom(struct spl_image_info *spl_image, hang(); } +/* + * 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. + */ +#if defined(CONFIG_SPL_ENV_IS_IN_SPI_FLASH) && \ + CONFIG_ENV_SPI_BUS == 0 && CONFIG_ENV_SPI_CS == 0 && \ + CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE <= 64*1024*1024 +void *env_sf_get_env_addr(void) +{ + return (void *)0xD4000000 + CONFIG_ENV_OFFSET; +} +#endif + void board_init_f(ulong dummy) { int ret; |