From ae7ffee7fe9f9b2e217d051971a98e1f28290cb1 Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Thu, 9 Jul 2015 11:19:13 +0800 Subject: MLK-11228-1 android: Integrate community fastboot with FSL i.MX fastboot 1. Replace the UDC driver with community's USB gadget d_dnl driver. 2. Integrate the FSL SD/SATA/NAND flash operations, since the GPT and EFI partitions are not support by i.MX. 3. Add FDT support to community's android image. 4. Change the booti command to boota, due to the booti has been used for ARM64 image boot. 5. Modify boota implementation to load ramdisk and fdt to their loading addresses specified in boot.img header, while bootm won't do it for android image. 6. Modify the android image HAB implementation. Authenticate the boot.img on the "load_addr" for both SD and NAND. 7. Enable new configuration CONFIG_FSL_FASTBOOT for Freescale's fastboot with relevant header file "fsl_fastboot.h". While disabling the configuration, the community fastboot is used. 8. Use community's way to combine cmdline in boot.img and u-boot environment, not overwrite the cmdline in boot.img Signed-off-by: Ye.Li --- arch/arm/cpu/armv7/mx6/soc.c | 58 +++----------------------------------------- arch/arm/cpu/armv7/mx7/soc.c | 23 +++--------------- 2 files changed, 6 insertions(+), 75 deletions(-) (limited to 'arch/arm/cpu') diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index 2283702..7ad2757 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -24,15 +24,11 @@ #include #include #include -#ifdef CONFIG_FASTBOOT +#ifdef CONFIG_FSL_FASTBOOT #ifdef CONFIG_ANDROID_RECOVERY #include #endif #endif -#ifdef CONFIG_IMX_UDC -#include -#include -#endif enum ldo_reg { LDO_ARM, @@ -1020,7 +1016,7 @@ void v7_outer_cache_disable(void) #endif #endif /* !CONFIG_SYS_L2CACHE_OFF */ -#ifdef CONFIG_FASTBOOT +#ifdef CONFIG_FSL_FASTBOOT #ifdef CONFIG_ANDROID_RECOVERY #define ANDROID_RECOVERY_BOOT (1 << 7) @@ -1064,52 +1060,4 @@ int fastboot_check_and_clean_flag(void) return flag_set; } -#endif /*CONFIG_FASTBOOT*/ - -#ifdef CONFIG_IMX_UDC -void set_usboh3_clk(void) -{ - udc_pins_setting(); -} - -void set_usb_phy1_clk(void) -{ - /* make sure pll3 is enable here */ - struct mxc_ccm_reg *ccm_regs = (struct mxc_ccm_reg *)CCM_BASE_ADDR; - - writel((BM_ANADIG_USB1_CHRG_DETECT_EN_B | - BM_ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B), - &ccm_regs->usb1_chrg_detect_set); - - writel(BM_ANADIG_USB1_PLL_480_CTRL_EN_USB_CLKS, - &ccm_regs->analog_usb1_pll_480_ctrl_set); -} -void enable_usb_phy1_clk(unsigned char enable) -{ - if (enable) - writel(BM_USBPHY_CTRL_CLKGATE, - USB_PHY0_BASE_ADDR + HW_USBPHY_CTRL_CLR); - else - writel(BM_USBPHY_CTRL_CLKGATE, - USB_PHY0_BASE_ADDR + HW_USBPHY_CTRL_SET); -} - -void reset_usb_phy1(void) -{ - /* Reset USBPHY module */ - u32 temp; - temp = readl(USB_PHY0_BASE_ADDR + HW_USBPHY_CTRL); - temp |= BM_USBPHY_CTRL_SFTRST; - writel(temp, USB_PHY0_BASE_ADDR + HW_USBPHY_CTRL); - udelay(10); - - /* Remove CLKGATE and SFTRST */ - temp = readl(USB_PHY0_BASE_ADDR + HW_USBPHY_CTRL); - temp &= ~(BM_USBPHY_CTRL_CLKGATE | BM_USBPHY_CTRL_SFTRST); - writel(temp, USB_PHY0_BASE_ADDR + HW_USBPHY_CTRL); - udelay(10); - - /* Power up the PHY */ - writel(0, USB_PHY0_BASE_ADDR + HW_USBPHY_PWD); -} -#endif +#endif /*CONFIG_FSL_FASTBOOT*/ diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c index 586a6f2..c459797 100644 --- a/arch/arm/cpu/armv7/mx7/soc.c +++ b/arch/arm/cpu/armv7/mx7/soc.c @@ -18,7 +18,7 @@ #include #include #include -#ifdef CONFIG_FASTBOOT +#ifdef CONFIG_FSL_FASTBOOT #ifdef CONFIG_ANDROID_RECOVERY #include #endif @@ -394,7 +394,7 @@ void reset_misc(void) #endif } -#ifdef CONFIG_FASTBOOT +#ifdef CONFIG_FSL_FASTBOOT #ifdef CONFIG_ANDROID_RECOVERY #define ANDROID_RECOVERY_BOOT (1 << 7) @@ -442,21 +442,4 @@ int fastboot_check_and_clean_flag(void) return flag_set; } -#endif /*CONFIG_FASTBOOT*/ - -#ifdef CONFIG_IMX_UDC -void set_usb_phy1_clk(void) -{ - /* TODO */ -} -void enable_usb_phy1_clk(unsigned char enable) -{ -} - -void reset_usb_phy1(void) -{ - /* Reset USBPHY module */ - setbits_le32(&src_reg->usbophy1_rcr, 0x00000001); -} - -#endif +#endif /*CONFIG_FSL_FASTBOOT*/ -- cgit v1.1