arm64: imx8mp: Gracefully handle disabled ENV_IS_IN_SPI_FLASH
PATCH 1/1 arm64: imx8mp: Gracefully handle disabled ENV_IS_IN_SPI_FLASH
In case ENV_IS_IN_SPI_FLASH is disabled, returning ENVL_SPI_FLASH leads to failure to find environment driver on start up. Fix this by testing whether ENV_IS_IN_SPI_FLASH is enabled and if not, then return ENVL_NOWHERE instead.
---
Cc: Christoph Niedermaier <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c +3 -1
@@ -186,5 +186,7 @@ int board_late_init(void)enum env_location env_get_location (enum env_operation op,int prio) { -return prio ?ENVL_UNKNOWN :ENVL_SPI_FLASH ; +return prio ?ENVL_UNKNOWN :CONFIG_IS_ENABLED (ENV_IS_IN_SPI_FLASH , + (ENVL_SPI_FLASH ), + (ENVL_NOWHERE )); }
Signature · 1 line
2.47.2
Quoted 21 lines · Marek Vasut
In case
ENV_IS_IN_SPI_FLASHis disabled, returningENVL_SPI_FLASHleads to failure to find environment driver on start up. Fix this by testing whetherENV_IS_IN_SPI_FLASHis enabled and if not, then returnENVL_NOWHEREinstead.Signed-off-by Marek Vasut <[email protected]>---
Cc: Christoph Niedermaier <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
Cc: [email protected]--- board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c +0
-0
board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c int board_late_init(void) · line 192
Quoted 8 lines
board/dhelectronics/dh_imx8mp/imx8mp_dhcom_pdk2.c +3
-1@@ -186,5 +186,7 @@ int board_late_init(void)enum env_location env_get_location (enum env_operation op,int prio) { -return prio ?ENVL_UNKNOWN :ENVL_SPI_FLASH ; +return prio ?ENVL_UNKNOWN :CONFIG_IS_ENABLED (ENV_IS_IN_SPI_FLASH , + (ENVL_SPI_FLASH ), + (ENVL_NOWHERE )); }
+CC Fabio too ... hmmm, get maintainers is acting up a bit today.
Fabio Estevam
reviewerQuoted 7 lines · Marek Vasut
In case
ENV_IS_IN_SPI_FLASHis disabled, returningENVL_SPI_FLASHleads to failure to find environment driver on start up. Fix this by testing whetherENV_IS_IN_SPI_FLASHis enabled and if not, then returnENVL_NOWHEREinstead.Signed-off-by Marek Vasut <[email protected]>
Applied to u-boot-imx/next, thanks.