From patchwork Thu Mar 19 10:21:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 243922 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Thu, 19 Mar 2020 11:21:14 +0100 Subject: [PATCH 3/3] configs:stm32mp1: activate env config in SPL In-Reply-To: <20200319102114.8644-1-patrick.delaunay@st.com> References: <20200319102114.8644-1-patrick.delaunay@st.com> Message-ID: <20200319102114.8644-2-patrick.delaunay@st.com> Activate env config in SPL with CONFIG_SPL_ENV_SUPPORT and use CONFIG_IS_ENABLED macro to test the activated CONFIG_$(SPL_)ENV_IS_IN_... in env_get_location. Signed-off-by: Patrick Delaunay --- board/st/stm32mp1/stm32mp1.c | 8 ++++---- configs/stm32mp15_basic_defconfig | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index effba41ad1..474033d640 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -785,21 +785,21 @@ enum env_location env_get_location(enum env_operation op, int prio) return ENVL_UNKNOWN; switch (bootmode & TAMP_BOOT_DEVICE_MASK) { -#ifdef CONFIG_ENV_IS_IN_MMC +#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) case BOOT_FLASH_SD: case BOOT_FLASH_EMMC: return ENVL_MMC; #endif -#ifdef CONFIG_ENV_IS_IN_EXT4 +#if CONFIG_IS_ENABLED(ENV_IS_IN_EXT4) case BOOT_FLASH_SD: case BOOT_FLASH_EMMC: return ENVL_EXT4; #endif -#ifdef CONFIG_ENV_IS_IN_UBI +#if CONFIG_IS_ENABLED(ENV_IS_IN_UBI) case BOOT_FLASH_NAND: return ENVL_UBI; #endif -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH +#if CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH) case BOOT_FLASH_NOR: return ENVL_SPI_FLASH; #endif diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index dd55a8b632..c63002628c 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -16,6 +16,7 @@ CONFIG_FIT=y CONFIG_BOOTCOMMAND="run bootcmd_stm32mp" CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=3 +CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_POWER_SUPPORT=y @@ -63,6 +64,8 @@ CONFIG_ENV_UBI_PART="UBI" CONFIG_ENV_UBI_VOLUME="uboot_config" CONFIG_ENV_UBI_VOLUME_REDUND="uboot_config_r" CONFIG_SYS_RELOC_GD_ENV_ADDR=y +# CONFIG_SPL_ENV_IS_NOWHERE is not set +# CONFIG_SPL_ENV_IS_IN_SPI_FLASH is not set CONFIG_STM32_ADC=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y