Commit 0ec2a019117bb2d59b9672a145b4684313d92782

Authored by Adrian Alonso
1 parent 17a30851ad

MLK-13131: mx6qarm2: add fastboot and recovery support

Add fastboot and recovery mode support for mx6qarm

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
(Cherry picked from commit 505e899ce582118da28ca1f4487ce7f179225bd7)

Showing 1 changed file with 33 additions and 0 deletions Side-by-side Diff

board/freescale/mx6qarm2/mx6qarm2.c
... ... @@ -12,6 +12,7 @@
12 12 #include <asm/errno.h>
13 13 #include <asm/gpio.h>
14 14 #include <asm/imx-common/iomux-v3.h>
  15 +#include <asm/imx-common/boot_mode.h>
15 16 #include <mmc.h>
16 17 #include <fsl_esdhc.h>
17 18 #include <miiphy.h>
... ... @@ -19,6 +20,13 @@
19 20 #include <usb.h>
20 21 #include <asm/arch/sys_proto.h>
21 22  
  23 +#ifdef CONFIG_FSL_FASTBOOT
  24 +#include <fsl_fastboot.h>
  25 +#ifdef CONFIG_ANDROID_RECOVERY
  26 +#include <recovery.h>
  27 +#endif
  28 +#endif /*CONFIG_FSL_FASTBOOT*/
  29 +
22 30 DECLARE_GLOBAL_DATA_PTR;
23 31  
24 32 #define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
... ... @@ -327,5 +335,30 @@
327 335 {
328 336 return;
329 337 }
  338 +#endif
  339 +
  340 +#ifdef CONFIG_FSL_FASTBOOT
  341 +void board_fastboot_setup(void)
  342 +{
  343 + if (!getenv("fastboot_dev"))
  344 + setenv("fastboot_dev", "mmc0");
  345 + if (!getenv("bootcmd"))
  346 + setenv("bootcmd", "boota mmc0");
  347 +}
  348 +
  349 +#ifdef CONFIG_ANDROID_RECOVERY
  350 +int check_recovery_cmd_file(void) {
  351 + return 0;
  352 +}
  353 +
  354 +void board_recovery_setup(void)
  355 +{
  356 + if (!getenv("bootcmd_android_recovery"))
  357 + setenv("bootcmd_android_recovery", "boota mmc0 recovery");
  358 +
  359 + printf("setup env for recovery..\n");
  360 + setenv("bootcmd", "run bootcmd_android_recovery");
  361 +}
  362 +#endif
330 363 #endif