Browse Source

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>
(cherry picked from commit a27827ef5e)
Ye Li 3 years ago
parent
commit
de34ecb201
2 changed files with 8 additions and 5 deletions
  1. +5
    -0
      arch/arm/cpu/armv8/imx8/cpu.c
  2. +3
    -5
      arch/arm/include/asm/arch-imx8/imx-regs.h

+ 5
- 0
arch/arm/cpu/armv8/imx8/cpu.c View File

@ -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;


+ 3
- 5
arch/arm/include/asm/arch-imx8/imx-regs.h View File

@ -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 {


Loading…
Cancel
Save