From 1627b8fd466be9cb0248be08f39b52a6e80337f1 Mon Sep 17 00:00:00 2001 From: Zhang Jiejing Date: Fri, 25 May 2012 18:42:52 +0800 Subject: ENGR00210918-2 cleanup android support, build pass all boards - move recovery.h to common inlcude place. - move supported_reco_envs to soc related, not board related, - user can change this via configure header, don't needs this in every board file. - pass build for all mx5/mx6 android configs. Signed-off-by: Zhang Jiejing --- cpu/arm_cortexa8/mx50/generic.c | 58 ++++++++++++++++++++++++++++++++++++++++- cpu/arm_cortexa8/mx51/generic.c | 31 +++++++++++++++++++++- cpu/arm_cortexa8/mx53/generic.c | 58 ++++++++++++++++++++++++++++++++++++++++- cpu/arm_cortexa8/mx6/generic.c | 46 ++++++++++++++++++++++++++++++++ 4 files changed, 190 insertions(+), 3 deletions(-) (limited to 'cpu') diff --git a/cpu/arm_cortexa8/mx50/generic.c b/cpu/arm_cortexa8/mx50/generic.c index e1f55d1..0faa3b8 100644 --- a/cpu/arm_cortexa8/mx50/generic.c +++ b/cpu/arm_cortexa8/mx50/generic.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. All Rights Reserved. * * See file CREDITS for list of people who contributed to this * project. @@ -33,6 +33,10 @@ #include #endif +#ifdef CONFIG_ANDROID_RECOVERY +#include +#endif + enum pll_clocks { PLL1_CLK = MXC_DPLL1_BASE, PLL2_CLK = MXC_DPLL2_BASE, @@ -1140,3 +1144,55 @@ int arch_cpu_init(void) } #endif +#ifdef CONFIG_ANDROID_RECOVERY +struct reco_envs supported_reco_envs[BOOT_DEV_NUM] = { + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, +#ifdef CONFIG_CMD_UBI + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_NAND, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_NAND, + }, +#endif +}; +#endif + +#ifdef CONFIG_FASTBOOT +/* check if the recovery bit is set by kernel, it can be set by kernel + * issue a command '# reboot fastboot' */ +int fastboot_check_and_clean_flag(void) +{ + return 0; +} +#endif + diff --git a/cpu/arm_cortexa8/mx51/generic.c b/cpu/arm_cortexa8/mx51/generic.c index b116922..f3b9751 100644 --- a/cpu/arm_cortexa8/mx51/generic.c +++ b/cpu/arm_cortexa8/mx51/generic.c @@ -2,7 +2,7 @@ * (C) Copyright 2007 * Sascha Hauer, Pengutronix * - * (C) Copyright 2009-2011 Freescale Semiconductor, Inc. + * (C) Copyright 2009-2012 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -37,6 +37,9 @@ #include #include #endif +#ifdef CONFIG_ANDROID_RECOVERY +#include +#endif #include #include "crm_regs.h" @@ -1105,3 +1108,29 @@ void ipu_clk_disable(void) reg |= (0x1 << 18); writel(reg, CCM_BASE_ADDR + CLKCTL_CLPCR); } + +#ifdef CONFIG_ANDROID_RECOVERY +struct reco_envs supported_reco_envs[BOOT_DEV_NUM] = { + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, +}; +#endif + +#ifdef CONFIG_FASTBOOT +/* check if the recovery bit is set by kernel, it can be set by kernel + * issue a command '# reboot fastboot' */ +int fastboot_check_and_clean_flag(void) +{ + return 0; +} +#endif diff --git a/cpu/arm_cortexa8/mx53/generic.c b/cpu/arm_cortexa8/mx53/generic.c index e53a720..7a6d95e 100644 --- a/cpu/arm_cortexa8/mx53/generic.c +++ b/cpu/arm_cortexa8/mx53/generic.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. + * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -33,6 +33,10 @@ #include #endif +#ifdef CONFIG_ANDROID_RECOVERY +#include +#endif + enum pll_clocks { PLL1_CLK = MXC_DPLL1_BASE, PLL2_CLK = MXC_DPLL2_BASE, @@ -1166,3 +1170,55 @@ U_BOOT_CMD( "download_mode - enter i.MX serial/usb download mode\n", ""); #endif + + +#ifdef CONFIG_ANDROID_RECOVERY +struct reco_envs supported_reco_envs[BOOT_DEV_NUM] = { + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = NULL, + .args = NULL, + }, +}; +#endif + +#ifdef CONFIG_FASTBOOT +/* check if the recovery bit is set by kernel, it can be set by kernel + * issue a command '# reboot fastboot' */ +int fastboot_check_and_clean_flag(void) +{ + return 0; +} +#endif + diff --git a/cpu/arm_cortexa8/mx6/generic.c b/cpu/arm_cortexa8/mx6/generic.c index 43893ee..a762498 100644 --- a/cpu/arm_cortexa8/mx6/generic.c +++ b/cpu/arm_cortexa8/mx6/generic.c @@ -41,6 +41,10 @@ #include #endif +#ifdef CONFIG_ANDROID_RECOVERY +#include +#endif + #include enum pll_clocks { @@ -1203,3 +1207,45 @@ U_BOOT_CMD( "download_mode - enter i.MX serial/usb download mode", ""); #endif + + +#ifdef CONFIG_ANDROID_RECOVERY +struct reco_envs supported_reco_envs[BOOT_DEV_NUM] = { + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = NULL, + .args = NULL, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC, + .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC, + }, + { + .cmd = NULL, + .args = NULL, + }, +}; +#endif -- cgit v1.1