summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Jiejing <jiejing.zhang@freescale.com>2011-11-18 15:32:51 +0800
committerZhang Jiejing <jiejing.zhang@freescale.com>2011-12-16 13:06:13 +0800
commit0bd5a854aea75b6fd95cd6729a01ce06e2b5c771 (patch)
tree93a837fc4cbe942119bf36e1377a9b3b47f7a057
parent079b1c7864ba8a57f90faab13502fe344c17a4ce (diff)
downloadu-boot-imx-0bd5a854aea75b6fd95cd6729a01ce06e2b5c771.zip
u-boot-imx-0bd5a854aea75b6fd95cd6729a01ce06e2b5c771.tar.gz
u-boot-imx-0bd5a854aea75b6fd95cd6729a01ce06e2b5c771.tar.bz2
ENGR00162491 Android: MX53_SMD: enter recovery mode by key.
Implement a key press check on recovery mode check. User can press Vol- key to enter recovery mode when boot. Idealy, should be a combo key press together, but on SMD it only can Vol+ or Vol- but it can't press together. More usuful for user and less bug. Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
-rw-r--r--board/freescale/mx53_smd/mx53_smd.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/board/freescale/mx53_smd/mx53_smd.c b/board/freescale/mx53_smd/mx53_smd.c
index 39ada2a..61c1384 100644
--- a/board/freescale/mx53_smd/mx53_smd.c
+++ b/board/freescale/mx53_smd/mx53_smd.c
@@ -998,9 +998,11 @@ struct reco_envs supported_reco_envs[BOOT_DEV_NUM] = {
int check_recovery_cmd_file(void)
{
disk_partition_t info;
+ int button_pressed = 0;
ulong part_length;
int filelen = 0;
char *env;
+ u32 reg;
int i;
/* For test only */
@@ -1074,7 +1076,20 @@ int check_recovery_cmd_file(void)
break;
}
- return (filelen > 0) ? 1 : 0;
+ /* Check Recovery Combo Button press or not.
+ * @TODO: Need At least Two key, but in SMD board,
+ * only can use one Volume key. */
+ mxc_request_iomux(MX53_PIN_ATA_DATA14, IOMUX_CONFIG_ALT1);
+ readl(GPIO2_BASE_ADDR + GPIO_GDIR);
+ reg &= ~(1<<14);
+ writel(reg, GPIO2_BASE_ADDR + GPIO_GDIR);
+ reg = readl(GPIO2_BASE_ADDR + GPIO_PSR);
+ if (!(reg & (1 << 14))) { /* Vol - is low assert */
+ button_pressed = 1;
+ printf("Recovery key pressed\n");
+ }
+
+ return (filelen > 0 || button_pressed);
}
#endif