diff options
author | Zhang Jiejing <jiejing.zhang@freescale.com> | 2011-11-18 15:32:51 +0800 |
---|---|---|
committer | Lily Zhang <r58066@freescale.com> | 2011-12-02 16:25:19 +0800 |
commit | 7bd63aa694c68169f3dbdf4dd0ea6fe1a05ea2b6 (patch) | |
tree | a63427b9e8e7c7ce803b096625a8e2a356a522d1 | |
parent | d583f31284793824bc82efe91d23c44f2fd3195f (diff) | |
download | u-boot-imx-7bd63aa694c68169f3dbdf4dd0ea6fe1a05ea2b6.zip u-boot-imx-7bd63aa694c68169f3dbdf4dd0ea6fe1a05ea2b6.tar.gz u-boot-imx-7bd63aa694c68169f3dbdf4dd0ea6fe1a05ea2b6.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>
(cherry picked from commit 9c9807eec87cb3b51e8d90adc0601d7bae5b6f2c)
-rw-r--r-- | board/freescale/mx53_smd/mx53_smd.c | 17 |
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 1266cfa..a84205e 100644 --- a/board/freescale/mx53_smd/mx53_smd.c +++ b/board/freescale/mx53_smd/mx53_smd.c @@ -1009,9 +1009,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 */ @@ -1085,7 +1087,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 |