From 71ba5d33991342c566b92961b5c98e99861e20c0 Mon Sep 17 00:00:00 2001 From: Terry Lv Date: Wed, 15 Sep 2010 22:29:07 +0800 Subject: ENGR00131578: Add android recovery mode support for mx53 Add android recovery mode support for mx53. Signed-off-by: Terry Lv --- board/freescale/common/recovery.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'board/freescale/common') 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 #include #include "recovery.h" - -#ifndef CONFIG_MXC_KPD -#error "error! keypad must be configured to support recovery" -#endif +#ifdef CONFIG_MXC_KPD #include +#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 */ -- cgit v1.1