Re: [U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT: SECURE_BOOT means environment is nowhere

2019-11-17 Thread Priyanka Jain


>-Original Message-
>From: Tom Rini 
>Sent: Friday, November 15, 2019 6:51 PM
>To: Priyanka Jain 
>Cc: u-boot@lists.denx.de
>Subject: Re: [U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT:
>SECURE_BOOT means environment is nowhere
>
>On Fri, Nov 15, 2019 at 12:43:48PM +, Priyanka Jain wrote:
>>
>>
>> >-Original Message-
>> >From: U-Boot  On Behalf Of Tom Rini
>> >Sent: Thursday, November 14, 2019 8:24 PM
>> >To: u-boot@lists.denx.de
>> >Subject: [U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT:
>> >SECURE_BOOT means environment is nowhere
>> >
>> >Signed-off-by: Tom Rini 
>> >---
>> > board/freescale/t104xrdb/spl.c | 2 ++
>> > 1 file changed, 2 insertions(+)
>> >
>> >diff --git a/board/freescale/t104xrdb/spl.c
>> >b/board/freescale/t104xrdb/spl.c index 7b0eb8edf51d..76b5160cf903
>> >100644
>> >--- a/board/freescale/t104xrdb/spl.c
>> >+++ b/board/freescale/t104xrdb/spl.c
>> >@@ -106,6 +106,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
>> >#endif
>> >
>> >/* relocate environment function pointers etc. */
>> >+#ifndef CONFIG_NXP_ESBC
>> Can we use some ENV related config instead of this?
>
>We could but I think that's more fragile / complex:
>

>> > #ifdef CONFIG_SPL_NAND_BOOT
>> >nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
>> >(uchar *)CONFIG_ENV_ADDR);
>> >@@ -120,6 +121,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
>
>The endif goes here since we have cases on NAND / MMC / SPI loading the
>environment and then we say it's now valid (and where it is).  We could
>do:
>#if defined(CONFIG_ENV_IS_IN_NAND) || defined(CONFIG_ENV_IS_IN_MMC)
>|| \
>   defined(CONFIG_ENV_IS_IN__SPI_FLASH)
>
This looks better as this is env related code. 
>if you prefer instead of CONFIG_NXP_ESBC
>
>--
>Tom 
-priyankajain

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT: SECURE_BOOT means environment is nowhere

2019-11-15 Thread Tom Rini
On Fri, Nov 15, 2019 at 12:43:48PM +, Priyanka Jain wrote:
> 
> 
> >-Original Message-
> >From: U-Boot  On Behalf Of Tom Rini
> >Sent: Thursday, November 14, 2019 8:24 PM
> >To: u-boot@lists.denx.de
> >Subject: [U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT:
> >SECURE_BOOT means environment is nowhere
> >
> >Signed-off-by: Tom Rini 
> >---
> > board/freescale/t104xrdb/spl.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> >diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
> >index 7b0eb8edf51d..76b5160cf903 100644
> >--- a/board/freescale/t104xrdb/spl.c
> >+++ b/board/freescale/t104xrdb/spl.c
> >@@ -106,6 +106,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)  #endif
> >
> > /* relocate environment function pointers etc. */
> >+#ifndef CONFIG_NXP_ESBC
> Can we use some ENV related config instead of this?

We could but I think that's more fragile / complex:

> > #ifdef CONFIG_SPL_NAND_BOOT
> > nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
> > (uchar *)CONFIG_ENV_ADDR);
> >@@ -120,6 +121,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

The endif goes here since we have cases on NAND / MMC / SPI loading the
environment and then we say it's now valid (and where it is).  We could
do:
#if defined(CONFIG_ENV_IS_IN_NAND) || defined(CONFIG_ENV_IS_IN_MMC) || \
defined(CONFIG_ENV_IS_IN__SPI_FLASH)

if you prefer instead of CONFIG_NXP_ESBC

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT: SECURE_BOOT means environment is nowhere

2019-11-15 Thread Priyanka Jain


>-Original Message-
>From: U-Boot  On Behalf Of Tom Rini
>Sent: Thursday, November 14, 2019 8:24 PM
>To: u-boot@lists.denx.de
>Subject: [U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT:
>SECURE_BOOT means environment is nowhere
>
>Signed-off-by: Tom Rini 
>---
> board/freescale/t104xrdb/spl.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
>index 7b0eb8edf51d..76b5160cf903 100644
>--- a/board/freescale/t104xrdb/spl.c
>+++ b/board/freescale/t104xrdb/spl.c
>@@ -106,6 +106,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)  #endif
>
>   /* relocate environment function pointers etc. */
>+#ifndef CONFIG_NXP_ESBC
Can we use some ENV related config instead of this?
> #ifdef CONFIG_SPL_NAND_BOOT
>   nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
>   (uchar *)CONFIG_ENV_ADDR);
>@@ -120,6 +121,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

-priyankajain
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 4/5] T1042RDB_PI_NAND_SECURE_BOOT: SECURE_BOOT means environment is nowhere

2019-11-14 Thread Tom Rini
Signed-off-by: Tom Rini 
---
 board/freescale/t104xrdb/spl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
index 7b0eb8edf51d..76b5160cf903 100644
--- a/board/freescale/t104xrdb/spl.c
+++ b/board/freescale/t104xrdb/spl.c
@@ -106,6 +106,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #endif
 
/* relocate environment function pointers etc. */
+#ifndef CONFIG_NXP_ESBC
 #ifdef CONFIG_SPL_NAND_BOOT
nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
(uchar *)CONFIG_ENV_ADDR);
@@ -120,6 +121,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

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot