board_r: Detect ifc-nor flash at run-time
authorPankit Garg <pankit.garg@nxp.com>
Thu, 30 Apr 2020 10:24:05 +0000 (15:54 +0530)
committerPriyanka Jain <priyanka.jain@nxp.com>
Tue, 19 May 2020 03:52:08 +0000 (09:22 +0530)
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>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
common/board_r.c

index 96034b874e560f832a7f1f338b848fa2a850a30e..b04e6ad2a9b52af975d70ac990ca2a89f99b0c12 100644 (file)
@@ -369,11 +369,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())