MLK-14991-2 imx8qm_arm2/imx8qxp_arm2: Add print for boot device
authorYe Li <ye.li@nxp.com>
Wed, 31 May 2017 08:25:30 +0000 (03:25 -0500)
committerJason Liu <jason.hui.liu@nxp.com>
Thu, 2 Nov 2017 18:36:52 +0000 (02:36 +0800)
Add a print for current boot device to u-boot console.

Signed-off-by: Ye Li <ye.li@nxp.com>
arch/arm/cpu/armv8/imx8/cpu.c
arch/arm/include/asm/arch-imx8/sys_proto.h
board/freescale/imx8qm_arm2/imx8qm_arm2.c
board/freescale/imx8qxp_arm2/imx8qxp_arm2.c

index 6a926b0..6edcafa 100644 (file)
@@ -621,3 +621,48 @@ enum boot_device get_boot_device(void)
 
        return boot_dev;
 }
+
+int print_bootinfo(void)
+{
+       enum boot_device bt_dev;
+       bt_dev = get_boot_device();
+
+       puts("Boot:  ");
+       switch (bt_dev) {
+       case SD1_BOOT:
+               puts("SD0\n");
+               break;
+       case SD2_BOOT:
+               puts("SD1\n");
+               break;
+       case SD3_BOOT:
+               puts("SD2\n");
+               break;
+       case MMC1_BOOT:
+               puts("MMC0\n");
+               break;
+       case MMC2_BOOT:
+               puts("MMC1\n");
+               break;
+       case MMC3_BOOT:
+               puts("MMC2\n");
+               break;
+       case FLEXSPI_BOOT:
+               puts("FLEXSPI\n");
+               break;
+       case SATA_BOOT:
+               puts("SATA\n");
+               break;
+       case NAND_BOOT:
+               puts("NAND\n");
+               break;
+       case USB_BOOT:
+               puts("USB\n");
+               break;
+       default:
+               printf("Unknown device %u\n", bt_dev);
+               break;
+       }
+
+       return 0;
+}
index aee4592..705b9ed 100644 (file)
@@ -38,6 +38,7 @@ struct rom_sw_info_t {
        uint32_t rsvd[3];
 };
 
+int print_bootinfo(void);
 int init_qspi_power(void);
 int init_usb_power(void);
 int init_i2c_power(unsigned i2c_num);
index e0a65b5..a518027 100644 (file)
@@ -24,6 +24,7 @@
 #include <imx8_hsio.h>
 #include <usb.h>
 #include <asm/arch/iomux.h>
+#include <asm/arch/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -571,6 +572,8 @@ int checkboard(void)
        puts("Board: iMX8QM DDR4 ARM2\n");
 #endif
 
+       print_bootinfo();
+
        /* Note:  After reloc, ipcHndl will no longer be valid.  If handle
         *        returned by sc_ipc_open matches SC_IPC_CH, use this
         *        macro (valid after reloc) for subsequent SCI calls.
index 788ad0b..5d03ce3 100644 (file)
@@ -24,6 +24,7 @@
 #include <imx8_hsio.h>
 #include <usb.h>
 #include <asm/arch/iomux.h>
+#include <asm/arch/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -500,6 +501,8 @@ int checkboard(void)
 {
        puts("Board: iMX8QXP LPDDR4 ARM2\n");
 
+       print_bootinfo();
+
        /* Note:  After reloc, ipcHndl will no longer be valid.  If handle
         *        returned by sc_ipc_open matches SC_IPC_CH, use this
         *        macro (valid after reloc) for subsequent SCI calls.