Commit 75dca16d authored by Ye Li's avatar Ye Li Committed by Jason Liu

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: 's avatarYe Li <ye.li@nxp.com>
Acked-by: 's avatarPeng Fan <peng.fan@nxp.com>
parent 67bb87f1
......@@ -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;
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment