diff mbox series

[v2,3/3] configs:stm32mp1: activate env config in SPL

Message ID 20200615091824.3022-3-patrick.delaunay@st.com
State Superseded
Headers show
Series stm32mp1: board: add support of CONFIG_ENV_IS_IN_MMC | expand

Commit Message

Patrick Delaunay June 15, 2020, 9:18 a.m. UTC
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.

Reviewed-by: Patrice Chotard <patrice.chotard at st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---

(no changes since v1)

 board/st/stm32mp1/stm32mp1.c      | 8 ++++----
 configs/stm32mp15_basic_defconfig | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Patrice CHOTARD July 28, 2020, 3:28 p.m. UTC | #1
On 6/15/20 11:18 AM, Patrick Delaunay wrote:
> 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.

>

> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

> ---

>

> (no changes since v1)

>

>  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 b695e8bc6b..7abb90d1d4 100644

> --- a/board/st/stm32mp1/stm32mp1.c

> +++ b/board/st/stm32mp1/stm32mp1.c

> @@ -833,22 +833,22 @@ 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:

>  	case BOOT_FLASH_SPINAND:

>  		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 acf9331b4b..31597dbc40 100644

> --- a/configs/stm32mp15_basic_defconfig

> +++ b/configs/stm32mp15_basic_defconfig

> @@ -18,6 +18,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

> @@ -61,6 +62,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_SET_DFU_ALT_INFO=y

>  CONFIG_USB_FUNCTION_FASTBOOT=y

Applied to u-boot-stm/master

Thanks

Patrice
diff mbox series

Patch

diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index b695e8bc6b..7abb90d1d4 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -833,22 +833,22 @@  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:
 	case BOOT_FLASH_SPINAND:
 		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 acf9331b4b..31597dbc40 100644
--- a/configs/stm32mp15_basic_defconfig
+++ b/configs/stm32mp15_basic_defconfig
@@ -18,6 +18,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
@@ -61,6 +62,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_SET_DFU_ALT_INFO=y
 CONFIG_USB_FUNCTION_FASTBOOT=y