diff options
-rw-r--r-- | arch/arm/mach-mvebu/spl.c | 13 | ||||
-rw-r--r-- | board/CZ.NIC/turris_omnia/turris_omnia.c | 10 |
2 files changed, 13 insertions, 10 deletions
diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index bfcba2e73b..ca2d5a59d7 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; diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index 5ddd873d02..3eca08bafc 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -282,16 +282,6 @@ static bool omnia_detect_wwan_usb3(const char *wwan_slot) return false; } -void *env_sf_get_env_addr(void) -{ - /* SPI Flash is mapped to address 0xD4000000 only in SPL */ -#ifdef CONFIG_SPL_BUILD - return (void *)0xD4000000 + CONFIG_ENV_OFFSET; -#else - return NULL; -#endif -} - int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) { #ifdef CONFIG_SPL_ENV_SUPPORT |