From 306fca12fb21829be552a6262e310a90664a8cc2 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Fri, 17 May 2019 02:42:33 -0700 Subject: [PATCH] MLK-20510-3 mx7ulp: Change is_boot_from_usb to use get_boot_device The get_boot_device will return USB type from ROM info if booting from serial download, so change the is_boot_from_usb to use this function. Signed-off-by: Ye Li --- arch/arm/include/asm/arch-mx7ulp/imx-regs.h | 5 +++-- arch/arm/mach-imx/mx7ulp/soc.c | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h index 5d01db75fa..40b983b8e6 100644 --- a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h +++ b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h @@ -1143,8 +1143,9 @@ struct usbphy_regs { u32 usb1_pfda_ctrl1_tog; /* 0x14c */ }; - -#define is_boot_from_usb(void) (!(readl(USB_PHY0_BASE_ADDR) & (1<<20))) +#include +bool is_usb_boot(void); +#define is_boot_from_usb is_usb_boot #define disconnect_from_pc(void) writel(0x0, USBOTG0_RBASE + 0x140) struct bootrom_sw_info { diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c index 4b256a7edb..7d5bb805fc 100644 --- a/arch/arm/mach-imx/mx7ulp/soc.c +++ b/arch/arm/mach-imx/mx7ulp/soc.c @@ -415,6 +415,11 @@ enum boot_device get_boot_device(void) return boot_dev; } +bool is_usb_boot(void) +{ + return get_boot_device() == USB_BOOT; +} + #ifdef CONFIG_FSL_FASTBOOT #ifdef CONFIG_SERIAL_TAG void get_board_serial(struct tag_serialnr *serialnr) -- 2.17.1