MLK-18333-2 imx8m: add QSPI boot dev
authorPeng Fan <peng.fan@nxp.com>
Thu, 17 May 2018 07:15:59 +0000 (15:15 +0800)
committerYe Li <ye.li@nxp.com>
Sat, 25 May 2019 16:47:02 +0000 (09:47 -0700)
When boot type could not be detected from rom sw info,
read sbmr1 to detect, here we only use it to detect FLEXSPI
boot, because ROM not update it in rom sw info.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 3735aedbf6dbebfac830089618ca334c419f43bd)
(cherry picked from commit 8324d0f37a3dc8c2516dad439aa6b91d77eebcbc)

arch/arm/mach-imx/cpu.c
arch/arm/mach-imx/spl.c

index 4c2780e..50fa654 100644 (file)
@@ -513,12 +513,14 @@ enum boot_device get_boot_device(void)
        case BOOT_TYPE_SPINOR:
                boot_dev = SPI_NOR_BOOT;
                break;
-#ifdef CONFIG_IMX8M
        case BOOT_TYPE_USB:
                boot_dev = USB_BOOT;
                break;
-#endif
        default:
+#ifdef CONFIG_IMX8M
+               if (((readl(SRC_BASE_ADDR + 0x58) & 0x00007FFF) >> 12) == 0x4)
+                       boot_dev = QSPI_BOOT;
+#endif
                break;
        }
 
index 03c3707..e434520 100644 (file)
@@ -164,6 +164,8 @@ u32 spl_boot_device(void)
                return BOOT_DEVICE_NAND;
        case SPI_NOR_BOOT:
                return BOOT_DEVICE_SPI;
+       case QSPI_BOOT:
+               return BOOT_DEVICE_NOR;
        case USB_BOOT:
                return BOOT_DEVICE_BOARD;
        default: