summaryrefslogtreecommitdiff
path: root/board/freescale/common
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-09-15 22:29:07 +0800
committerTerry Lv <r65388@freescale.com>2010-09-20 13:25:43 +0800
commit71ba5d33991342c566b92961b5c98e99861e20c0 (patch)
treeea4f11cddc74960823c08a2811c92ba48bd3b038 /board/freescale/common
parent6537dffd192344d8c786a037bce9f41db5448fc9 (diff)
downloadu-boot-imx-71ba5d33991342c566b92961b5c98e99861e20c0.zip
u-boot-imx-71ba5d33991342c566b92961b5c98e99861e20c0.tar.gz
u-boot-imx-71ba5d33991342c566b92961b5c98e99861e20c0.tar.bz2
ENGR00131578: Add android recovery mode support for mx53
Add android recovery mode support for mx53. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'board/freescale/common')
-rw-r--r--board/freescale/common/recovery.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/board/freescale/common/recovery.c b/board/freescale/common/recovery.c
index d133a9d..9f488b8 100644
--- a/board/freescale/common/recovery.c
+++ b/board/freescale/common/recovery.c
@@ -11,19 +11,19 @@
#include <common.h>
#include <malloc.h>
#include "recovery.h"
-
-#ifndef CONFIG_MXC_KPD
-#error "error! keypad must be configured to support recovery"
-#endif
+#ifdef CONFIG_MXC_KPD
#include <mxc_keyb.h>
+#endif
+
+extern int check_recovery_cmd_file(void);
+extern enum boot_device get_boot_device(void);
+
+#ifdef CONFIG_MXC_KPD
#define PRESSED_HOME 0x01
#define PRESSED_POWER 0x02
#define RECOVERY_KEY_MASK (PRESSED_HOME | PRESSED_POWER)
-extern int check_recovery_cmd_file(void);
-extern enum boot_device get_boot_device(void);
-
inline int test_key(int value, struct kpp_key_info *ki)
{
return (ki->val == value) && (ki->evt == KDepress);
@@ -57,6 +57,13 @@ int check_key_pressing(void)
return 0;
}
+#else
+/* If not using mxc keypad, currently we will detect power key on board */
+int check_key_pressing(void)
+{
+ return 0;
+}
+#endif
extern struct reco_envs supported_reco_envs[];
@@ -78,17 +85,16 @@ void setup_recovery_env(void)
env = getenv("bootargs_android_recovery");
/* Set env to recovery mode */
if (!env)
- setenv("bootargs_android", boot_args);
+ setenv("bootargs_android_recovery", boot_args);
else
- setenv("bootargs_android", env);
+ setenv("bootargs_android_recovery", env);
env = getenv("bootcmd_android_recovery");
if (!env)
- setenv("bootcmd_android", boot_cmd);
+ setenv("bootcmd_android_recovery", boot_cmd);
else
- setenv("bootcmd_android", env);
- setenv("bootcmd", "run bootcmd_android");
-
+ setenv("bootcmd_android_recovery", env);
+ setenv("bootcmd", "run bootcmd_android_recovery");
}
/* export to lib_arm/board.c */