diff --git a/board/qca/arm/common/board_init.c b/board/qca/arm/common/board_init.c index 9991ca62dd..9f032d21e3 100644 --- a/board/qca/arm/common/board_init.c +++ b/board/qca/arm/common/board_init.c @@ -135,10 +135,11 @@ int board_init(void) printf("BUG: unsupported flash type : %d\n", sfi->flash_type); BUG(); } - if (sfi->flash_type == SMEM_BOOT_SPI_FLASH) { +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH saveenv = sf_saveenv; env_name_spec = sf_env_name_spec; +#endif #ifdef CONFIG_QCA_MMC } else if (sfi->flash_type == SMEM_BOOT_MMC_FLASH) { saveenv = mmc_saveenv; diff --git a/board/qca/arm/common/env.c b/board/qca/arm/common/env.c index 7509ca5b2a..f35122d33f 100644 --- a/board/qca/arm/common/env.c +++ b/board/qca/arm/common/env.c @@ -16,9 +16,12 @@ #include extern void nand_env_relocate_spec(void); -extern void sf_env_relocate_spec(void); extern int nand_env_init(void); + +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH +extern void sf_env_relocate_spec(void); extern int sf_env_init(void); +#endif #ifdef CONFIG_QCA_MMC extern int mmc_env_init(void); @@ -42,7 +45,9 @@ int env_init(void) &sfi.flash_density); if (sfi.flash_type == SMEM_BOOT_SPI_FLASH) { +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH ret = sf_env_init(); +#endif #ifdef CONFIG_QCA_MMC } else if (sfi.flash_type == SMEM_BOOT_MMC_FLASH) { ret = mmc_env_init(); @@ -66,8 +71,10 @@ void env_relocate_spec(void) if (sfi.flash_type == SMEM_BOOT_NO_FLASH) { set_default_env("!flashless boot"); +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH } else if (sfi.flash_type == SMEM_BOOT_SPI_FLASH) { sf_env_relocate_spec(); +#endif #ifdef CONFIG_QCA_MMC } else if (sfi.flash_type == SMEM_BOOT_MMC_FLASH) { mmc_env_relocate_spec();