summaryrefslogtreecommitdiff
path: root/board/freescale/mx6ul_14x14_evk
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2016-03-10 10:49:49 +0800
committerYe Li <ye.li@nxp.com>2017-04-05 19:48:23 +0800
commitdcba1e63bb9aff5a26d42a6c5b5418f5b8215ccf (patch)
tree1dd0fcac4684e61d06d1ae684e77f8e83249f539 /board/freescale/mx6ul_14x14_evk
parentd0d678fd9bbe9b115e06107f392229104de9b233 (diff)
downloadu-boot-imx-dcba1e63bb9aff5a26d42a6c5b5418f5b8215ccf.zip
u-boot-imx-dcba1e63bb9aff5a26d42a6c5b5418f5b8215ccf.tar.gz
u-boot-imx-dcba1e63bb9aff5a26d42a6c5b5418f5b8215ccf.tar.bz2
MLK-12527-3 android: Add board support to enable android fastboot
Add board level support for android fastboot feature. Each board has a android specified header file for defining android related configuraitons. And add build targets for their android uboot images building. For mx6qsabreauto, mx6sabresd and mx7dsabresd, we enable the android fastboot exclusive with DFU. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 43fe988af28c5e51fb23aa846e04bc9698256926)
Diffstat (limited to 'board/freescale/mx6ul_14x14_evk')
-rw-r--r--board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
index 7293859..1c67d99 100644
--- a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
+++ b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
@@ -31,6 +31,13 @@
#include <usb/ehci-ci.h>
#include <asm/imx-common/video.h>
+#ifdef CONFIG_FSL_FASTBOOT
+#include <fsl_fastboot.h>
+#ifdef CONFIG_ANDROID_RECOVERY
+#include <recovery.h>
+#endif
+#endif /*CONFIG_FSL_FASTBOOT*/
+
DECLARE_GLOBAL_DATA_PTR;
#define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
@@ -915,6 +922,94 @@ int checkboard(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;
+ case SD2_BOOT:
+ case MMC2_BOOT:
+ if (!getenv("fastboot_dev"))
+ setenv("fastboot_dev", "mmc1");
+ if (!getenv("bootcmd"))
+ setenv("bootcmd", "boota mmc1");
+ break;
+#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/
+#if defined(CONFIG_FASTBOOT_STORAGE_NAND)
+ case NAND_BOOT:
+ if (!getenv("fastboot_dev"))
+ setenv("fastboot_dev", "nand");
+ if (!getenv("fbparts"))
+ setenv("fbparts", ANDROID_FASTBOOT_NAND_PARTS);
+ if (!getenv("bootcmd"))
+ setenv("bootcmd",
+ "nand read ${loadaddr} ${boot_nand_offset} "
+ "${boot_nand_size};boota ${loadaddr}");
+ break;
+#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/
+
+ 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;
+ case SD2_BOOT:
+ case MMC2_BOOT:
+ if (!getenv("bootcmd_android_recovery"))
+ setenv("bootcmd_android_recovery", "boota mmc1 recovery");
+ break;
+#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/
+#if defined(CONFIG_FASTBOOT_STORAGE_NAND)
+ case NAND_BOOT:
+ if (!getenv("bootcmd_android_recovery"))
+ setenv("bootcmd_android_recovery",
+ "nand read ${loadaddr} ${recovery_nand_offset} "
+ "${recovery_nand_size};boota ${loadaddr}");
+ break;
+#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/
+
+ 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*/
+
#ifdef CONFIG_SPL_BUILD
#include <libfdt.h>
#include <spl.h>