diff mbox series

board_r: Detect ifc-nor flash at run-time

Message ID 20200430102405.2712-1-rajesh.bhagat@nxp.com
State New
Headers show
Series board_r: Detect ifc-nor flash at run-time | expand

Commit Message

Rajesh Bhagat April 30, 2020, 10:24 a.m. UTC
From: Pankit Garg <pankit.garg at nxp.com>

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 at nxp.com>
---
 common/board_r.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Priyanka Jain (OSS) May 20, 2020, 10:59 a.m. UTC | #1
>-----Original Message-----
>From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Rajesh Bhagat
>Sent: Thursday, April 30, 2020 3:54 PM
>To: u-boot at lists.denx.de
>Cc: Priyanka Jain <priyanka.jain at nxp.com>; Pankit Garg
><pankit.garg at nxp.com>
>Subject: [PATCH] board_r: Detect ifc-nor flash at run-time
>
>From: Pankit Garg <pankit.garg at nxp.com>
>
>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 at nxp.com>
>---
Applied to u-boot-fsl-qoriq. Awaiting upstream.

Thanks
Priyanka
diff mbox series

Patch

diff --git a/common/board_r.c b/common/board_r.c
index 0bbeaa7594..2279736863 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -370,11 +370,19 @@  static int initr_binman(void)
 }
 
 #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())