summaryrefslogtreecommitdiff
path: root/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/freescale/mx6sxsabreauto/mx6sxsabreauto.c')
-rw-r--r--board/freescale/mx6sxsabreauto/mx6sxsabreauto.c82
1 files changed, 4 insertions, 78 deletions
diff --git a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
index 648dbf0..71c51eb 100644
--- a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
+++ b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 nxp
*
* Author: Ye Li <ye.li@nxp.com>
*
@@ -32,6 +33,7 @@
#include <fsl_fastboot.h>
#ifdef CONFIG_ANDROID_RECOVERY
#include <recovery.h>
+#include "../common/recovery_keypad.h"
#endif
#endif /*CONFIG_FSL_FASTBOOT*/
@@ -557,88 +559,12 @@ int checkboard(void)
}
#ifdef CONFIG_FSL_FASTBOOT
-void board_fastboot_setup(void)
-{
- switch (get_boot_device()) {
-#if defined(CONFIG_FASTBOOT_STORAGE_MMC)
- case SD3_BOOT:
- case MMC3_BOOT:
- if (!getenv("fastboot_dev"))
- setenv("fastboot_dev", "mmc0");
- if (!getenv("bootcmd"))
- setenv("bootcmd", "boota mmc0");
- break;
- case SD4_BOOT:
- case MMC4_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 is_recovery_key_pressing(void)
{
- int recovery_mode = 0;
-
- recovery_mode = recovery_check_and_clean_flag();
-
- return recovery_mode;
+ return is_recovery_keypad_pressing();
}
-void board_recovery_setup(void)
-{
- int bootdev = get_boot_device();
-
- switch (bootdev) {
-#if defined(CONFIG_FASTBOOT_STORAGE_MMC)
- case SD3_BOOT:
- case MMC3_BOOT:
- if (!getenv("bootcmd_android_recovery"))
- setenv("bootcmd_android_recovery", "boota mmc0 recovery");
- break;
- case SD4_BOOT:
- case MMC4_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*/