diff options
author | Sanshan Zhang <sanshan.zhang@nxp.com> | 2017-01-25 09:13:35 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-04-05 19:48:23 +0800 |
commit | 9fe1f23c2bcb263a91a2044cb0105963844dcc06 (patch) | |
tree | 09ed4f3f94b7b4c4b83087593da14adcef6bf37a /board | |
parent | dcba1e63bb9aff5a26d42a6c5b5418f5b8215ccf (diff) | |
download | u-boot-imx-9fe1f23c2bcb263a91a2044cb0105963844dcc06.zip u-boot-imx-9fe1f23c2bcb263a91a2044cb0105963844dcc06.tar.gz u-boot-imx-9fe1f23c2bcb263a91a2044cb0105963844dcc06.tar.bz2 |
MA-9213 imx: mx7ulp-evk: Add android support
Add android features on i.MX7ULP EVK board.
Implement the code to get boot device and the serial number on mx7ulp.
TODO: will add the code which check misc partition after porting BCB.
Change-Id: I9d06fecba303fa4dfdcaf73da1b6246444697bba
Signed-off-by: Sanshan Zhang <sanshan.zhang@nxp.com>
(cherry picked from commit 4c60cba3a017b921aebb84dd1268c898e549c99a)
Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mx7ulp_evk/mx7ulp_evk.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/board/freescale/mx7ulp_evk/mx7ulp_evk.c b/board/freescale/mx7ulp_evk/mx7ulp_evk.c index eea41fb..a7ceb91 100644 --- a/board/freescale/mx7ulp_evk/mx7ulp_evk.c +++ b/board/freescale/mx7ulp_evk/mx7ulp_evk.c @@ -14,6 +14,14 @@ #include <dm.h> #include <asm/imx-common/video.h> +#ifdef CONFIG_FSL_FASTBOOT +#include <fastboot.h> +#include <asm/imx-common/boot_mode.h> +#ifdef CONFIG_ANDROID_RECOVERY +#include <recovery.h> +#endif /*CONFIG_ANDROID_RECOVERY*/ +#endif /*CONFIG_FASTBOOT*/ + DECLARE_GLOBAL_DATA_PTR; #define UART_PAD_CTRL (PAD_CTL_PUS_UP) @@ -204,3 +212,53 @@ int board_late_init(void) return 0; } + +#ifdef CONFIG_FSL_FASTBOOT +void board_fastboot_setup(void) +{ + switch (get_boot_device()) { +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) + case SD1_BOOT: + case MMC1_BOOT: + if (!getenv("fastboot_dev")) + setenv("fastboot_dev", "mmc0"); + if (!getenv("bootcmd")) + setenv("bootcmd", "boota mmc0"); + break; +#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ + default: + printf("unsupported boot devices\n"); + break; + } +} + +#ifdef CONFIG_ANDROID_RECOVERY +int check_recovery_cmd_file(void) +{ + int recovery_mode = 0; + recovery_mode = recovery_check_and_clean_flag(); + return recovery_mode; +} + +void board_recovery_setup(void) +{ + int bootdev = get_boot_device(); + switch (bootdev) { +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) + case SD1_BOOT: + case MMC1_BOOT: + if (!getenv("bootcmd_android_recovery")) + setenv("bootcmd_android_recovery", "boota mmc0 recovery"); + break; +#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ + default: + printf("Unsupported bootup device for recovery: dev: %d\n", + bootdev); + return; + } + + printf("setup env for recovery..\n"); + setenv("bootcmd", "run bootcmd_android_recovery"); +} +#endif /*CONFIG_ANDROID_RECOVERY*/ +#endif /*CONFIG_FSL_FASTBOOT*/ |