Skip to contentSkip to conversation

board_r: Detect ifc-nor flash at run-time

PATCH New Pankit Garg 1 participant 1 message Apr 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
changes for v2:
- change commit id subject

 common/board_r.c | 8 ++++++++
 1 file changed, 8 insertions(+)
common/board_r.c +8 -0
index 472987d..681379c 100644
@@ -327,11 +327,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
1.9.1