Message ID | 20191119092645.15147-1-pankit.garg@nxp.com |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show |
Series | [U-Boot] board_r: Detect ifc-nor flash at run-time | expand |
>-----Original Message----- >From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Pankit Garg >Sent: Tuesday, November 19, 2019 3:01 PM >To: u-boot@lists.denx.de >Cc: Pankit Garg <pankit.garg@nxp.com> >Subject: [U-Boot] [PATCH] board_r: Detect ifc-nor flash at run-time > >CONFIG_MTD_NOR_FLASH flag needs to be enable for all boot sources,as all >flash drivers need to compile in TFA Boot.Probe ifc nor flash only when there is >nor flash available on board.So needs to detect ifc-nor flash at run-time for >probing. > >Signed-off-by: Pankit Garg <pankit.garg@nxp.com> >--- > common/board_r.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/common/board_r.c b/common/board_r.c index >d6fb5047a2..f967a93af5 100644 >--- a/common/board_r.c >+++ b/common/board_r.c >@@ -343,11 +343,19 @@ static int initr_manual_reloc_cmdtable(void) #endif > > #if defined(CONFIG_MTD_NOR_FLASH) >+__weak int is_flash_available(void) >+{ >+ return 1; Does it means that Flash is not present on board? If yes, then better return 0. >+} >+ > static int initr_flash(void) > { > ulong flash_size = 0; > bd_t *bd = gd->bd; > >+ if (!is_flash_available()) >+ return 0; >+ > puts("Flash: "); > > if (board_flash_wp_on()) >-- >2.17.1 > -priyankajain
diff --git a/common/board_r.c b/common/board_r.c index d6fb5047a2..f967a93af5 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -343,11 +343,19 @@ static int initr_manual_reloc_cmdtable(void) #endif #if defined(CONFIG_MTD_NOR_FLASH) +__weak int is_flash_available(void) +{ + return 1; +} + static int initr_flash(void) { ulong flash_size = 0; bd_t *bd = gd->bd; + if (!is_flash_available()) + return 0; + puts("Flash: "); if (board_flash_wp_on())
CONFIG_MTD_NOR_FLASH flag needs to be enable for all boot sources,as all flash drivers need to compile in TFA Boot.Probe ifc nor flash only when there is nor flash available on board.So needs to detect ifc-nor flash at run-time for probing. Signed-off-by: Pankit Garg <pankit.garg@nxp.com> --- common/board_r.c | 8 ++++++++ 1 file changed, 8 insertions(+)