summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/mx6/soc.c
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2018-10-10 01:16:13 -0700
committerYe Li <ye.li@nxp.com>2018-10-10 02:00:44 -0700
commita3457bfd99930007644fbd6f1ad89764ce836e5d (patch)
tree61d6e5ecdde18a0a2ed7adcb908f74c7c10a003d /arch/arm/mach-imx/mx6/soc.c
parenta176f9de5446787a9c4fd85bbef73db88ec9075b (diff)
MLK-19869-1 imx6: improve the is_boot_from_usb implementation
Currently the is_boot_from_usb is checking the USB PHY Powerdown bit. This way has a defect that if we run any usb function in u-boot the checking will always return true. This patch improves the way to avoid such problem above. A new arch-specific flag is added to indicate if it is USB boot. We check the USB PHY PWD bit at early of boot stage then set that flag. So any following calling of is_boot_from_usb will return correct value. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 0efb6ecdb9a40fdbccc3fd7ce69eb31cd82c9ab8)
Diffstat (limited to 'arch/arm/mach-imx/mx6/soc.c')
-rw-r--r--arch/arm/mach-imx/mx6/soc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index 8950bcaffd..0cdd27c301 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -29,6 +29,8 @@
#include <fsl_caam.h>
#endif
+DECLARE_GLOBAL_DATA_PTR;
+
enum ldo_reg {
LDO_ARM,
LDO_SOC,
@@ -520,8 +522,19 @@ static void imx_set_pcie_phy_power_down(void)
}
}
+bool is_usb_boot(void)
+{
+ if (gd->flags & GD_FLG_ARCH_MX6_USB_BOOT)
+ return true;
+
+ return false;
+}
+
int arch_cpu_init(void)
{
+ if (is_usbphy_power_on())
+ gd->flags |= GD_FLG_ARCH_MX6_USB_BOOT;
+
if (!is_mx6sl() && !is_mx6sx()
&& !is_mx6ul() && !is_mx6ull()
&& !is_mx6sll()) {