From: Ye Li Date: Fri, 17 May 2019 09:42:33 +0000 (-0700) Subject: MLK-20510-3 mx7ulp: Change is_boot_from_usb to use get_boot_device X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~516 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=cc216825ff95cd2b7326b66aef2bb512f6d1824e;p=u-boot.git 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 (cherry picked from commit 306fca12fb21829be552a6262e310a90664a8cc2) (cherry picked from commit 4880a6a4c93fd7141d4cc1de5b987c8efdf2cc2a) --- diff --git a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h index 80395ae3a1..3abb166ee5 100644 --- a/arch/arm/include/asm/arch-mx7ulp/imx-regs.h +++ b/arch/arm/include/asm/arch-mx7ulp/imx-regs.h @@ -1152,7 +1152,9 @@ struct bootrom_sw_info { u32 reserved_3[3]; }; -#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) #endif diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c index 63002e42df..2ae816e302 100644 --- a/arch/arm/mach-imx/mx7ulp/soc.c +++ b/arch/arm/mach-imx/mx7ulp/soc.c @@ -460,6 +460,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)