summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinyu Chen <xinyu.chen@freescale.com>2010-09-10 17:17:12 +0800
committerXinyu Chen <xinyu.chen@freescale.com>2010-09-10 17:23:18 +0800
commitdaae245a544d8b23dfa74c6108c35cebef81b8e7 (patch)
treea35f6e1eb2b46e6a7431d4f071ebe5299917d093
parent7bbe5d7a5203a07496ec372ab55563a2e230d03e (diff)
downloadu-boot-imx-daae245a544d8b23dfa74c6108c35cebef81b8e7.zip
u-boot-imx-daae245a544d8b23dfa74c6108c35cebef81b8e7.tar.gz
u-boot-imx-daae245a544d8b23dfa74c6108c35cebef81b8e7.tar.bz2
ENGR00127368 UBOOT: Make the android recovery code common for platformsrel_imx_2.6.31_10.09.00
Move the android recovery codes into common/recovery.c. Cut the keypad detecting time. Now we only need detect there's POWER and HOME key pressing at the time scanning keyboard matrix. So user must hold these two keys when bootup to enter recovery mode. This can reduce the uboot boot time with recovery mode configured. Later /cache file checking for recovery command should be merged into the common/recovery.c Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
-rw-r--r--board/freescale/common/Makefile1
-rw-r--r--board/freescale/common/recovery.c103
-rw-r--r--board/freescale/common/recovery.h19
-rw-r--r--board/freescale/mx51_3stack/mx51_3stack.c149
-rw-r--r--board/freescale/mx51_bbg/mx51_bbg.c156
-rw-r--r--drivers/input/mxc_keyb.c64
-rw-r--r--include/asm-arm/arch-mx51/keypad.h10
-rw-r--r--include/asm-arm/arch-mx51/mx51.h5
-rw-r--r--include/configs/mx51_3stack_android.h7
-rw-r--r--include/configs/mx51_bbg_android.h14
-rw-r--r--include/mxc_keyb.h4
-rw-r--r--lib_arm/board.c4
12 files changed, 210 insertions, 326 deletions
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 02a824d..fac485d 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -41,6 +41,7 @@ COBJS-${CONFIG_MPC8541CDS} += cds_pci_ft.o
COBJS-${CONFIG_MPC8548CDS} += cds_pci_ft.o
COBJS-${CONFIG_MPC8555CDS} += cds_pci_ft.o
+COBJS-${CONFIG_ANDROID_RECOVERY} += recovery.o
SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))
diff --git a/board/freescale/common/recovery.c b/board/freescale/common/recovery.c
new file mode 100644
index 0000000..d133a9d
--- /dev/null
+++ b/board/freescale/common/recovery.c
@@ -0,0 +1,103 @@
+/*
+ * Freescale Android Recovery mode checking routing
+
+ * Copyright (C) 2010 Freescale Semiconductor, Inc.
+ *
+ * This software may be used and distributed according to the
+ * terms of the GNU Public License, Version 2, incorporated
+ * herein by reference.
+ *
+ */
+#include <common.h>
+#include <malloc.h>
+#include "recovery.h"
+
+#ifndef CONFIG_MXC_KPD
+#error "error! keypad must be configured to support recovery"
+#endif
+#include <mxc_keyb.h>
+
+#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);
+}
+
+int check_key_pressing(void)
+{
+ struct kpp_key_info *key_info;
+ int state = 0, keys, i;
+
+ mxc_kpp_init();
+
+ puts("Detecting HOME+POWER key for recovery ...\n");
+
+ /* Check for home + power */
+ keys = mxc_kpp_getc(&key_info);
+ if (keys < 2)
+ return 0;
+
+ 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;
+ }
+
+ free(key_info);
+
+ if ((state & RECOVERY_KEY_MASK) == RECOVERY_KEY_MASK)
+ return 1;
+
+ return 0;
+}
+
+extern struct reco_envs supported_reco_envs[];
+
+void setup_recovery_env(void)
+{
+ char *env, *boot_args, *boot_cmd;
+ int bootdev = get_boot_device();
+
+ boot_cmd = supported_reco_envs[bootdev].cmd;
+ boot_args = supported_reco_envs[bootdev].args;
+
+ if (boot_cmd == NULL) {
+ printf("Unsupported bootup device for recovery\n");
+ return;
+ }
+
+ printf("setup env for recovery..\n");
+
+ env = getenv("bootargs_android_recovery");
+ /* Set env to recovery mode */
+ if (!env)
+ setenv("bootargs_android", boot_args);
+ else
+ setenv("bootargs_android", env);
+
+ env = getenv("bootcmd_android_recovery");
+ if (!env)
+ setenv("bootcmd_android", boot_cmd);
+ else
+ setenv("bootcmd_android", env);
+ setenv("bootcmd", "run bootcmd_android");
+
+}
+
+/* export to lib_arm/board.c */
+void check_recovery_mode(void)
+{
+ if (check_key_pressing())
+ setup_recovery_env();
+ else if (check_recovery_cmd_file()) {
+ puts("Recovery command file founded!\n");
+ setup_recovery_env();
+ }
+}
diff --git a/board/freescale/common/recovery.h b/board/freescale/common/recovery.h
new file mode 100644
index 0000000..9958330
--- /dev/null
+++ b/board/freescale/common/recovery.h
@@ -0,0 +1,19 @@
+/*
+ * Android Recovery supported header file
+ *
+ * Copyright (C) 2010 Freescale Semiconductor.
+ *
+ * This software may be used and distributed according to the
+ * terms of the GNU Public License, Version 2, incorporated
+ * herein by reference.
+ */
+
+#ifndef __RECOVERY_H_
+#define __RECOVERY_H_
+
+struct reco_envs {
+ char *cmd;
+ char *args;
+};
+
+#endif
diff --git a/board/freescale/mx51_3stack/mx51_3stack.c b/board/freescale/mx51_3stack/mx51_3stack.c
index 1289118..77da23c 100644
--- a/board/freescale/mx51_3stack/mx51_3stack.c
+++ b/board/freescale/mx51_3stack/mx51_3stack.c
@@ -43,7 +43,8 @@
#include <asm/arch/mmu.h>
#endif
-#ifdef CONFIG_FSL_ANDROID
+#ifdef CONFIG_ANDROID_RECOVERY
+#include "../common/recovery.h"
#include <mxc_keyb.h>
#include <part.h>
#include <ext2fs.h>
@@ -611,125 +612,21 @@ int board_init(void)
return 0;
}
-#ifdef BOARD_LATE_INIT
-
-#if defined(CONFIG_FSL_ANDROID) && defined(CONFIG_MXC_KPD)
-static int waiting_for_func_key_pressing(void)
-{
- struct kpp_key_info key_info = {0, 0};
- int switch_delay = CONFIG_ANDROID_BOOTMOD_DELAY;
- int state = 0, boot_mode_switch = 0;
-
- mxc_kpp_init();
-
- puts("Press home + power to enter recovery mode ...\n");
-
- while ((switch_delay > 0) && (!boot_mode_switch)) {
- int i;
-
- --switch_delay;
- /* delay 100 * 10ms */
- for (i = 0; !boot_mode_switch && i < 100; ++i) {
- /* A state machine to scan home + power key */
- /* Check for home + power */
- if (mxc_kpp_getc(&key_info)) {
- switch (state) {
- case 0:
- /* First press */
- if (TEST_HOME_KEY_DEPRESS(key_info.val, key_info.evt)) {
- /* Press Home */
- state = 1;
- } else if (TEST_POWER_KEY_DEPRESS(key_info.val, key_info.evt)) {
- state = 2;
- } else {
- state = 0;
- }
- break;
- case 1:
- /* Home is already pressed, try to detect Power */
- if (TEST_POWER_KEY_DEPRESS(key_info.val,
- key_info.evt)) {
- boot_mode_switch = 1;
- } else {
- if (TEST_HOME_KEY_DEPRESS(key_info.val,
- key_info.evt))
- state = 2;
- else
- state = 0;
- }
- break;
- case 2:
- /* Power is already pressed, try to detect Home */
- if (TEST_HOME_KEY_DEPRESS(key_info.val,
- key_info.evt)) {
- boot_mode_switch = 1;
- } else {
- if (TEST_POWER_KEY_DEPRESS(key_info.val,
- key_info.evt))
- state = 1;
- else
- state = 0;
- }
- break;
- default:
- break;
- }
-
- if (1 == boot_mode_switch)
- return 1;
- }
- }
- for (i = 0; i < 100; ++i)
- udelay(10000);
- }
-
- return 0;
-}
-
-static int switch_to_recovery_mode(void)
-{
- char *env = NULL;
- char *boot_args = NULL;
- char *boot_cmd = NULL;
-
- printf("Boot mode switched to recovery mode!\n");
-
- switch (get_boot_device()) {
- case MMC_BOOT:
- boot_args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC;
- boot_cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC;
- break;
- case NAND_BOOT:
- boot_args = CONFIG_ANDROID_RECOVERY_BOOTARGS_NAND;
- boot_cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_NAND;
- break;
- case SPI_NOR_BOOT:
- printf("Recovery mode not supported in SPI NOR boot\n");
- return -1;
- break;
- case UNKNOWN_BOOT:
- default:
- printf("Unknown boot device!\n");
- return -1;
- break;
- }
-
- env = getenv("bootargs_android_recovery");
- /* Set env to recovery mode */
- if (!env)
- setenv("bootargs_android", boot_args);
- else
- setenv("bootargs_android", env);
-
- env = getenv("bootcmd_android_recovery");
- if (!env)
- setenv("bootcmd_android", boot_cmd);
- else
- setenv("bootcmd_android", env);
- setenv("bootcmd", "run bootcmd_android");
-
- return 0;
-}
+#ifdef CONFIG_ANDROID_RECOVERY
+struct reco_envs supported_reco_envs[END_BOOT] = {
+ {
+ .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_NAND,
+ .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_NAND,
+ },
+ {
+ .cmd = NULL,
+ .args = NULL,
+ },
+ {
+ .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC,
+ .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC,
+ },
+};
static int check_mmc_recovery_cmd_file(int dev_num, int part_num, char *path)
{
@@ -905,19 +802,9 @@ static int check_recovery_cmd_file(void)
}
#endif
+#ifdef BOARD_LATE_INIT
int board_late_init(void)
{
-#if defined(CONFIG_FSL_ANDROID) && defined(CONFIG_MXC_KPD)
- if (waiting_for_func_key_pressing())
- switch_to_recovery_mode();
- else {
- if (check_recovery_cmd_file()) {
- puts("Recovery command file detected!\n");
- switch_to_recovery_mode();
- }
- }
-#endif
-
return 0;
}
#endif
diff --git a/board/freescale/mx51_bbg/mx51_bbg.c b/board/freescale/mx51_bbg/mx51_bbg.c
index 30fed3d..83e8ca7 100644
--- a/board/freescale/mx51_bbg/mx51_bbg.c
+++ b/board/freescale/mx51_bbg/mx51_bbg.c
@@ -52,8 +52,8 @@
#include <asm/imx_iim.h>
#endif
-#ifdef CONFIG_FSL_ANDROID
-#include <mxc_keyb.h>
+#ifdef CONFIG_ANDROID_RECOVERY
+#include "../common/recovery.h"
#include <part.h>
#include <ext2fs.h>
#include <linux/mtd/mtd.h>
@@ -873,131 +873,23 @@ int board_init(void)
return 0;
}
-#ifdef BOARD_LATE_INIT
-#if defined(CONFIG_FSL_ANDROID) && defined(CONFIG_MXC_KPD)
-inline int waiting_for_func_key_pressing(void)
-{
- struct kpp_key_info key_info = {0, 0};
- int switch_delay = CONFIG_ANDROID_BOOTMOD_DELAY;
- int state = 0, boot_mode_switch = 0;
-
- mxc_kpp_init();
-
- puts("Press home + power to enter recovery mode ...\n");
-
- while ((switch_delay > 0) && (!boot_mode_switch)) {
- int i;
-
- --switch_delay;
- /* delay 100 * 10ms */
- for (i = 0; !boot_mode_switch && i < 100; ++i) {
- /* A state machine to scan home + power key */
- /* Check for home + power */
- if (mxc_kpp_getc(&key_info)) {
- switch (state) {
- case 0:
- /* First press */
- if (TEST_HOME_KEY_DEPRESS(key_info.val, key_info.evt)) {
- /* Press Home */
- state = 1;
- } else if (TEST_POWER_KEY_DEPRESS(key_info.val, key_info.evt)) {
- /* Press Power */
- state = 2;
- } else {
- state = 0;
- }
- break;
- case 1:
- /* Home is already pressed, try to detect Power */
- if (TEST_POWER_KEY_DEPRESS(key_info.val,
- key_info.evt)) {
- /* Switch */
- boot_mode_switch = 1;
- } else {
- if (TEST_HOME_KEY_DEPRESS(key_info.val,
- key_info.evt)) {
- /* Not switch */
- state = 2;
- } else
- state = 0;
- }
- break;
- case 2:
- /* Power is already pressed, try to detect Home */
- if (TEST_HOME_KEY_DEPRESS(key_info.val,
- key_info.evt)) {
- /* Switch */
- boot_mode_switch = 1;
- } else {
- if (TEST_POWER_KEY_DEPRESS(key_info.val,
- key_info.evt)) {
- /* Not switch */
- state = 1;
- } else
- state = 0;
- }
- break;
- default:
- break;
- }
-
- if (1 == boot_mode_switch)
- return 1;
- }
- }
- for (i = 0; i < 100; ++i)
- udelay(10000);
- }
-
- return 0;
-}
-
-inline int switch_to_recovery_mode(void)
-{
- char *env = NULL;
- char *boot_args = NULL;
- char *boot_cmd = NULL;
-
- printf("Boot mode switched to recovery mode!\n");
-
- switch (get_boot_device()) {
- case MMC_BOOT:
- boot_args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC;
- boot_cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC;
- break;
- case NAND_BOOT:
- printf("Recovery mode not supported in NAND boot\n");
- return -1;
- break;
- case SPI_NOR_BOOT:
- printf("Recovery mode not supported in SPI NOR boot\n");
- return -1;
- break;
- case UNKNOWN_BOOT:
- default:
- printf("Unknown boot device!\n");
- return -1;
- break;
- }
-
- env = getenv("bootargs_android_recovery");
- /* Set env to recovery mode */
- if (!env)
- setenv("bootargs_android", boot_args);
- else
- setenv("bootargs_android", env);
-
- env = getenv("bootcmd_android_recovery");
- if (!env)
- setenv("bootcmd_android", boot_cmd);
- else
- setenv("bootcmd_android", env);
- setenv("bootcmd", "run bootcmd_android");
-
- return 0;
-}
+#ifdef CONFIG_ANDROID_RECOVERY
+struct reco_envs supported_reco_envs[END_BOOT] = {
+ {
+ .cmd = NULL,
+ .args = NULL,
+ },
+ {
+ .cmd = NULL,
+ .args = NULL,
+ },
+ {
+ .cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC,
+ .args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC,
+ },
+};
-inline int check_recovery_cmd_file(void)
+int check_recovery_cmd_file(void)
{
disk_partition_t info;
ulong part_length;
@@ -1064,6 +956,7 @@ inline int check_recovery_cmd_file(void)
}
#endif
+#ifdef BOARD_LATE_INIT
int board_late_init(void)
{
#ifdef CONFIG_I2C_MXC
@@ -1076,17 +969,6 @@ int board_late_init(void)
setup_core_voltage_spi();
#endif
-#if defined(CONFIG_FSL_ANDROID) && defined(CONFIG_MXC_KPD)
- if (waiting_for_func_key_pressing())
- switch_to_recovery_mode();
- else {
- if (check_recovery_cmd_file()) {
- puts("Recovery command file founded!\n");
- switch_to_recovery_mode();
- }
- }
-#endif
-
return 0;
}
#endif
diff --git a/drivers/input/mxc_keyb.c b/drivers/input/mxc_keyb.c
index ec65ab5..fae3b69 100644
--- a/drivers/input/mxc_keyb.c
+++ b/drivers/input/mxc_keyb.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -326,33 +326,40 @@ static int mxc_kpp_reset(void)
return 0;
}
-int mxc_kpp_getc(struct kpp_key_info *key_info)
+int mxc_kpp_getc(struct kpp_key_info **key_info)
{
int col, row;
- static int key_cnt;
+ int key_cnt;
unsigned short reg_val;
short scancode = 0;
+ int index = 0;
+ struct kpp_key_info *keyi;
reg_val = __raw_readw(KPSR);
- if (!key_cnt) {
- if (reg_val & KBD_STAT_KPKD) {
- /*
- * Disable key press(KDIE status bit) interrupt
- */
- reg_val &= ~KBD_STAT_KDIE;
- __raw_writew(reg_val, KPSR);
+ if (reg_val & KBD_STAT_KPKD) {
+ /*
+ * Disable key press(KDIE status bit) interrupt
+ */
+ reg_val &= ~KBD_STAT_KDIE;
+ __raw_writew(reg_val, KPSR);
#ifdef KPP_DEBUG
- mxc_kpp_dump_regs();
+ mxc_kpp_dump_regs();
#endif
- key_cnt = mxc_kpp_scan_matrix();
- } else {
- return 0;
- }
+ key_cnt = mxc_kpp_scan_matrix();
+ } else {
+ return 0;
}
+ if (key_cnt <= 0)
+ return 0;
+
+ *key_info = keyi =
+ (struct kpp_key_info *)malloc
+ (sizeof(struct kpp_key_info) * key_cnt);
+
/*
* This switch case statement is the
* implementation of state machine of debounc
@@ -399,15 +406,16 @@ int mxc_kpp_getc(struct kpp_key_info *key_info)
scancode =
press_scancode[row][col];
- key_info->val = mxckpd_keycodes[scancode];
- key_info->evt = KDepress;
+ keyi[index].val = mxckpd_keycodes[scancode];
+ keyi[index++].evt = KDepress;
KPP_PRINTF("KStateFirstDown: scan=%d val=%d\n",
scancode, mxckpd_keycodes[scancode]);
+ if (index >= key_cnt)
+ goto key_detect;
+
kpp_dev.iKeyState = KStateDown;
press_scancode[row][col] = -1;
-
- goto key_detect;
}
}
}
@@ -420,29 +428,23 @@ int mxc_kpp_getc(struct kpp_key_info *key_info)
scancode =
scancode - MXC_KEYRELEASE;
- key_info->val = mxckpd_keycodes[scancode];
- key_info->evt = KRelease;
+ keyi[index].val = mxckpd_keycodes[scancode];
+ keyi[index++].evt = KRelease;
KPP_PRINTF("KStateFirstUp: scan=%d val=%d\n",
scancode, mxckpd_keycodes[scancode]);
+ if (index >= key_cnt)
+ goto key_detect;
kpp_dev.iKeyState = KStateUp;
release_scancode[row][col] = -1;
-
- goto key_detect;
}
}
}
- return 0;
-
key_detect:
- /* udelay(KScanRate); */
- key_cnt = mxc_kpp_scan_matrix();
-
- if (0 == key_cnt)
- mxc_kpp_reset();
- return 1;
+ mxc_kpp_reset();
+ return key_cnt;
}
/*!
diff --git a/include/asm-arm/arch-mx51/keypad.h b/include/asm-arm/arch-mx51/keypad.h
index 5846364..1e67547 100644
--- a/include/asm-arm/arch-mx51/keypad.h
+++ b/include/asm-arm/arch-mx51/keypad.h
@@ -52,14 +52,4 @@
#define KEY_MENU 139 /* Menu (show menu) */
#define KEY_BACK 158 /* AC Back */
-#if defined(CONFIG_MX51_BBG)
-#define TEST_HOME_KEY_DEPRESS(k, e) (((k) == (KEY_F1)) && (((e) == (KDepress))))
-#define TEST_POWER_KEY_DEPRESS(k, e) (((k) == (KEY_F3)) && (((e) == (KDepress))))
-#elif defined(CONFIG_MX51_3DS)
-#define TEST_HOME_KEY_DEPRESS(k, e) (((k) == (KEY_MENU)) && (((e) == (KDepress))))
-#define TEST_POWER_KEY_DEPRESS(k, e) (((k) == (KEY_F2)) && (((e) == (KDepress))))
-#else
-# error Undefined board type!
-#endif
-
#endif
diff --git a/include/asm-arm/arch-mx51/mx51.h b/include/asm-arm/arch-mx51/mx51.h
index 11aba01..816e792 100644
--- a/include/asm-arm/arch-mx51/mx51.h
+++ b/include/asm-arm/arch-mx51/mx51.h
@@ -441,10 +441,11 @@
#ifndef __ASSEMBLER__
enum boot_device {
- UNKNOWN_BOOT,
- NAND_BOOT,
+ UNKNOWN_BOOT = -1,
+ NAND_BOOT = 0,
SPI_NOR_BOOT,
MMC_BOOT,
+ END_BOOT,
};
enum mxc_clock {
diff --git a/include/configs/mx51_3stack_android.h b/include/configs/mx51_3stack_android.h
index 3189269..81eb819 100644
--- a/include/configs/mx51_3stack_android.h
+++ b/include/configs/mx51_3stack_android.h
@@ -114,7 +114,9 @@
*/
#include <asm/arch/keypad.h>
-#define CONFIG_FSL_ANDROID
+#define CONFIG_ANDROID_RECOVERY
+#define CONFIG_POWER_KEY KEY_F2
+#define CONFIG_HOME_KEY KEY_MENU
#define CONFIG_MXC_KPD
#define CONFIG_MXC_KEYMAPPING \
@@ -135,7 +137,6 @@
#define CONFIG_ANDROID_RECOVERY_BOOTCMD_NAND \
"run bootargs_base bootargs_android;nand read ${loadaddr} 0x300000 0x250000;bootm"
#define CONFIG_ANDROID_RECOVERY_CMD_FILE "/recovery/command"
-#define CONFIG_ANDROID_BOOTMOD_DELAY 3
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
#define CONFIG_ANDROID_UBIFS_PARTITION_NM "ROOT"
#define CONFIG_ANDROID_CACHE_PARTITION_NAND "cache"
@@ -162,7 +163,7 @@
#undef CONFIG_CMD_IMLS
-#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTDELAY 1
#define CONFIG_PRIME "FEC0"
diff --git a/include/configs/mx51_bbg_android.h b/include/configs/mx51_bbg_android.h
index 79aae09..4641222 100644
--- a/include/configs/mx51_bbg_android.h
+++ b/include/configs/mx51_bbg_android.h
@@ -88,7 +88,9 @@
*/
#include <asm/arch/keypad.h>
-#define CONFIG_FSL_ANDROID
+#define CONFIG_ANDROID_RECOVERY
+#define CONFIG_POWER_KEY KEY_F3
+#define CONFIG_HOME_KEY KEY_F1
#define CONFIG_MTD_DEVICE
#define CONFIG_MTD_PARTITIONS
@@ -102,13 +104,6 @@
KEY_7, KEY_8, KEY_9, KEY_F3, KEY_DOWN, KEY_F4, \
KEY_0, KEY_OK, KEY_ESC, KEY_ENTER, KEY_MENU, KEY_BACK, \
}
- /*
- { \
- KEY_3, KEY_2, KEY_0, KEY_OK, KEY_ESC, KEY_ENTER,
- KEY_F1, KEY_4, KEY_6, KEY_5,
- KEY_LEFT, KEY_1, KEY_ , KEY_8, KEY_9, KEY_RIGHT,
- }
- */
#define CONFIG_MXC_KPD_COLMAX 6
#define CONFIG_MXC_KPD_ROWMAX 4
#define CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC \
@@ -116,7 +111,6 @@
#define CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC \
"run bootargs_base bootargs_android;mmc read 0 ${loadaddr} 0x800 0x1280;bootm"
#define CONFIG_ANDROID_RECOVERY_CMD_FILE "/recovery/command"
-#define CONFIG_ANDROID_BOOTMOD_DELAY 3
#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6
/* allow to overwrite serial and ethaddr */
@@ -140,7 +134,7 @@
#undef CONFIG_CMD_IMLS
-#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTDELAY 1
#define CONFIG_PRIME "FEC0"
diff --git a/include/mxc_keyb.h b/include/mxc_keyb.h
index a4b0a4e..6f605ad 100644
--- a/include/mxc_keyb.h
+++ b/include/mxc_keyb.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -196,6 +196,6 @@ struct kpp_key_info {
};
int mxc_kpp_init(void);
-int mxc_kpp_getc(struct kpp_key_info *);
+int mxc_kpp_getc(struct kpp_key_info **);
#endif /* __MXC_KEYB_H__ */
diff --git a/lib_arm/board.c b/lib_arm/board.c
index d6864bc..bc2b0bc 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -461,6 +461,10 @@ extern void davinci_eth_set_mac_addr (const u_int8_t *addr);
board_late_init ();
#endif
+#ifdef CONFIG_ANDROID_RECOVERY
+ check_recovery_mode();
+#endif
+
#if defined(CONFIG_CMD_NET)
#if defined(CONFIG_NET_MULTI)
puts ("Net: ");