[U-Boot,PATCHv2,4/5] T1042RDB_PI_NAND_SECURE_BOOT: Guard t104xrdb SPL env code
diff mbox series

Message ID 20191119010210.24477-4-trini@konsulko.com
State Accepted
Commit 8160c38ca1fde4386db5a4ee07e86e397a4914df
Delegated to: Tom Rini
Headers show
Series
  • [U-Boot,PATCHv2,1/5] smart-gateway-mt7688: Rework build time check for overwriting factory data
Related show

Commit Message

Tom Rini Nov. 19, 2019, 1:02 a.m. UTC
We can only configure and set the environment in SPL when we have a
particular environment location set that is not "nowhere" like it is in
SECURE_BOOT designs.  Update the code to reflect that.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v2:
- Rework the guard to be if env is nand/mmc/spi, redo commit message.
---
 board/freescale/t104xrdb/spl.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Priyanka Jain Nov. 19, 2019, 5:51 a.m. UTC | #1
>-----Original Message-----
>From: Tom Rini <trini@konsulko.com>
>Sent: Tuesday, November 19, 2019 6:32 AM
>To: u-boot@lists.denx.de
>Cc: Priyanka Jain <priyanka.jain@nxp.com>
>Subject: [PATCHv2 4/5] T1042RDB_PI_NAND_SECURE_BOOT: Guard t104xrdb
>SPL env code
>
>We can only configure and set the environment in SPL when we have a
>particular environment location set that is not "nowhere" like it is in
>SECURE_BOOT designs.  Update the code to reflect that.
>
>Cc: Priyanka Jain <priyanka.jain@nxp.com>
>Signed-off-by: Tom Rini <trini@konsulko.com>
>---
>Changes in v2:
>- Rework the guard to be if env is nand/mmc/spi, redo commit message.
>---
> board/freescale/t104xrdb/spl.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
>index 7b0eb8edf51d..7df371df4df5 100644
>--- a/board/freescale/t104xrdb/spl.c
>+++ b/board/freescale/t104xrdb/spl.c
>@@ -106,6 +106,8 @@ void board_init_r(gd_t *gd, ulong dest_addr)  #endif
>
> 	/* relocate environment function pointers etc. */
>+#if defined(CONFIG_ENV_IS_IN_NAND) || defined(CONFIG_ENV_IS_IN_MMC)
>|| \
>+	defined(CONFIG_ENV_IS_IN_SPI_FLASH)
> #ifdef CONFIG_SPL_NAND_BOOT
> 	nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
> 			    (uchar *)CONFIG_ENV_ADDR);
>@@ -120,6 +122,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)  #endif
> 	gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
> 	gd->env_valid = ENV_VALID;
>+#endif
>
> 	i2c_init_all();
>
>--
>2.17.1
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Tom Rini Nov. 21, 2019, 5:17 p.m. UTC | #2
On Mon, Nov 18, 2019 at 08:02:09PM -0500, Tom Rini wrote:

> We can only configure and set the environment in SPL when we have a
> particular environment location set that is not "nowhere" like it is in
> SECURE_BOOT designs.  Update the code to reflect that.
> 
> Cc: Priyanka Jain <priyanka.jain@nxp.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>

Applied to u-boot/master, thanks!

Patch
diff mbox series

diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
index 7b0eb8edf51d..7df371df4df5 100644
--- a/board/freescale/t104xrdb/spl.c
+++ b/board/freescale/t104xrdb/spl.c
@@ -106,6 +106,8 @@  void board_init_r(gd_t *gd, ulong dest_addr)
 #endif
 
 	/* relocate environment function pointers etc. */
+#if defined(CONFIG_ENV_IS_IN_NAND) || defined(CONFIG_ENV_IS_IN_MMC) || \
+	defined(CONFIG_ENV_IS_IN_SPI_FLASH)
 #ifdef CONFIG_SPL_NAND_BOOT
 	nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
 			    (uchar *)CONFIG_ENV_ADDR);
@@ -120,6 +122,7 @@  void board_init_r(gd_t *gd, ulong dest_addr)
 #endif
 	gd->env_addr  = (ulong)(CONFIG_ENV_ADDR);
 	gd->env_valid = ENV_VALID;
+#endif
 
 	i2c_init_all();