MLK-14996-2 imx8qm/qxp: add boot from usb support
authorPeng Fan <peng.fan@nxp.com>
Thu, 1 Jun 2017 07:05:46 +0000 (15:05 +0800)
committerJason Liu <jason.hui.liu@nxp.com>
Thu, 2 Nov 2017 18:36:52 +0000 (02:36 +0800)
Add boot from usb support.
Follow same flow as i.mx6 chips.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/include/asm/arch-imx8/imx-regs.h

index 376bf00..c8c5977 100644 (file)
 
 #define ROM_SW_INFO_ADDR       0x00000890
 
+#define OTG_BASE_ADDR          0x5b0d0000
+#define USB_PHY0_BASE_ADDR     0x5b100000
+
+/*
+ * 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)))
+#define        disconnect_from_pc(void) writel(0x0, OTG_BASE_ADDR + 0x140)
+
 #endif /* __ASM_ARCH_IMX_REGS_H__ */