Skip to contentSkip to conversation

board_r: Detect ifc-nor flash at run-time

PATCH New Pankit Garg 2 participants 2 messages Nov 19, 2019 – Nov 20, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 common/board_r.c | 8 ++++++++
 1 file changed, 8 insertions(+)
common/board_r.c +8 -0
index d6fb5047a2..f967a93af5 100644
@@ -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())
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 board_r: Detect ifc-nor flash at run-time

Quoted 24 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Pankit Garg
Sent: Tuesday, November 19, 2019 3:01 PM
To: u-boot at lists.denx.de
Cc: Pankit Garg <[email protected]>
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.

---
common/board_r.c | 8 ++++++++

1 file changed, 8 insertions(+)
common/board_r.c index renamed from common/board_r.c +0 -0

d6fb5047a2..f967a93af5 100644

common/board_r.c static int initr_manual_reloc_cmdtable(void) #endif · line 347

Quoted 5 lines
common/board_r.c +3 -0
@@ -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.

Quoted 14 lines
common/board_r.c +5 -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())
--
Quoted 2 lines

2.17.1

-priyankajain