summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-09-03 21:11:39 -0500
committerYe Li <ye.li@nxp.com>2017-09-04 04:40:15 -0500
commita27827ef5e28df350664f0699d5e68ffa1a5147e (patch)
tree973d61c27a1af270e2035c053cba829eb9e123dc
parent0b454dac9434aae891bc6b9c0dc179508d9d2fc1 (diff)
MLK-16361-2 imx8qm/qxp: Use sw_info for USB boot check
The sw_info in handover structure has included the boot device info provided by SC ROM. We can exploit this info, no need to check the USB2 PHY PWD register. Signed-off-by: Ye Li <ye.li@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/cpu/armv8/imx8/cpu.c5
-rw-r--r--arch/arm/include/asm/arch-imx8/imx-regs.h8
2 files changed, 8 insertions, 5 deletions
diff --git a/arch/arm/cpu/armv8/imx8/cpu.c b/arch/arm/cpu/armv8/imx8/cpu.c
index 745bd8b3e5..4b32852f81 100644
--- a/arch/arm/cpu/armv8/imx8/cpu.c
+++ b/arch/arm/cpu/armv8/imx8/cpu.c
@@ -631,6 +631,11 @@ enum boot_device get_boot_device(void)
return boot_dev;
}
+bool is_usb_boot(void)
+{
+ return get_boot_device() == USB_BOOT;
+}
+
int print_bootinfo(void)
{
enum boot_device bt_dev;
diff --git a/arch/arm/include/asm/arch-imx8/imx-regs.h b/arch/arm/include/asm/arch-imx8/imx-regs.h
index e8a6d7d1c4..910a3d8db6 100644
--- a/arch/arm/include/asm/arch-imx8/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8/imx-regs.h
@@ -61,12 +61,10 @@
#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
#include <asm/types.h>
+#include <stdbool.h>
-/*
- * If ROM fail back to USB recover mode, USBPH0_PWD will be clear to use USB
- * If boot from the other mode, USB0_PWD will keep reset value
- */
-#define is_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20)))
+bool is_usb_boot(void);
+#define is_boot_from_usb is_usb_boot
#define disconnect_from_pc(void) writel(0x0, USB_BASE_ADDR + 0x140)
struct usbphy_regs {