summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorguoyin.chen <guoyin.chen@freescale.com>2013-08-22 18:00:38 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2013-08-22 18:05:44 +0800
commit877fd9eea1858585c8939e05173feb612c42a95f (patch)
treead7c11f5543f39e0a10cb6475c3c82225d4e15d7 /board
parent117c045334ad694165ce0a0a5b054ab160257f41 (diff)
downloadu-boot-imx-877fd9eea1858585c8939e05173feb612c42a95f.zip
u-boot-imx-877fd9eea1858585c8939e05173feb612c42a95f.tar.gz
u-boot-imx-877fd9eea1858585c8939e05173feb612c42a95f.tar.bz2
ENGR00276287 Adjust key mapping for 6sl evkjb4.3_1.1.1-gajb4.3_1.1.0-gajb4.3_1.0.0-gajb4.3_1.0.0-beta
Unify ways to enter recovery mode manually with CONFIG_MXC_KPD Each board config should define the key CONFIG_VOL_DOWN_KEY&CONFIG_POWER_KEY which are used to enter recovery mode manually Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/common/recovery.c28
-rw-r--r--board/freescale/mx6sl_evk/mx6sl_evk.c11
2 files changed, 5 insertions, 34 deletions
diff --git a/board/freescale/common/recovery.c b/board/freescale/common/recovery.c
index 31a8076..cd6d40c 100644
--- a/board/freescale/common/recovery.c
+++ b/board/freescale/common/recovery.c
@@ -25,15 +25,14 @@
#include <mxc_keyb.h>
#endif
-extern int check_powerkey_pressed(void);
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)
+#define PRESSED_VOL_DOWN 0x01
+#define PRESSED_POWER 0x02
+#define RECOVERY_KEY_MASK (PRESSED_VOL_DOWN | PRESSED_POWER)
inline int test_key(int value, struct kpp_key_info *ki)
{
@@ -53,35 +52,18 @@ int check_key_pressing(void)
udelay(1000);
keys = mxc_kpp_getc(&key_info);
- if (!check_powerkey_pressed())
- keys = 0;
-
-#ifdef CONFIG_MX6SL_EVK
- /* For mx6sl-evk, hold power+vol_down when boot
- will enter recovery mode */
printf("Detecting VOL_DOWN+POWER key for recovery(%d:%d) ...\n",
keys, keys ? key_info->val : 0);
- if (keys > 0) {
- for (i = 0; i < keys; i++) {
- if (test_key(CONFIG_VOL_DOWN_KEY, &key_info[i])) {
- ret = 1;
- break;
- }
- }
- }
-#else
- puts("Detecting HOME+POWER key for recovery ...\n");
if (keys > 1) {
for (i = 0; i < keys; i++) {
if (test_key(CONFIG_POWER_KEY, &key_info[i]))
- state |= PRESSED_HOME;
- else if (test_key(CONFIG_HOME_KEY, &key_info[i]))
state |= PRESSED_POWER;
+ else if (test_key(CONFIG_VOL_DOWN_KEY, &key_info[i]))
+ state |= PRESSED_VOL_DOWN;
}
}
if ((state & RECOVERY_KEY_MASK) == RECOVERY_KEY_MASK)
ret = 1;
-#endif
if (key_info)
free(key_info);
return ret;
diff --git a/board/freescale/mx6sl_evk/mx6sl_evk.c b/board/freescale/mx6sl_evk/mx6sl_evk.c
index e29761e..8af6b75 100644
--- a/board/freescale/mx6sl_evk/mx6sl_evk.c
+++ b/board/freescale/mx6sl_evk/mx6sl_evk.c
@@ -1003,17 +1003,6 @@ int setup_mxc_kpd(void)
return 0;
}
-
-int check_powerkey_pressed(void)
-{
- mxc_iomux_v3_setup_pad(MX6SL_PAD_WDOG_B__GPIO_3_18);
- gpio_direction_input(GPIO_POWER_KEY);
- udelay(5);
- if (gpio_get_value(GPIO_POWER_KEY) == 0)
- return 1;
- return 0;
-}
-
#endif