diff options
author | Ye.Li <B37916@freescale.com> | 2013-12-24 17:21:32 +0800 |
---|---|---|
committer | Ye.Li <B37916@freescale.com> | 2013-12-27 16:25:08 +0800 |
commit | 75e45a284361b8b04d74bf7dd0d2300611171c27 (patch) | |
tree | 4fd31801c9784c67d7db0a32db645bb2acb1efd3 /board | |
parent | 92d33d1d1b29fc8143a12443fde983359895d3c0 (diff) | |
download | u-boot-imx-75e45a284361b8b04d74bf7dd0d2300611171c27.zip u-boot-imx-75e45a284361b8b04d74bf7dd0d2300611171c27.tar.gz u-boot-imx-75e45a284361b8b04d74bf7dd0d2300611171c27.tar.bz2 |
ENGR00292902 ARM:imx6sl:evk Add android fastboot supporting
The imx6slevk has keyboards on the board, so add mxc_keyb driver to
support the recovery keys pressing checking. The key mapping table
is defined in "mx6slevkandroid.h" with CONFIG_MXC_KPD enabled.
Signed-off-by: Ye.Li <B37916@freescale.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mx6slevk/mx6slevk.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index b393698..bc119b3 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -16,6 +16,7 @@ #include <asm/arch/sys_proto.h> #include <asm/gpio.h> #include <asm/imx-common/iomux-v3.h> +#include <asm/imx-common/boot_mode.h> #include <asm/io.h> #include <asm/sizes.h> #include <common.h> @@ -30,6 +31,12 @@ #include <lcd.h> #include <mxc_epdc_fb.h> #endif +#ifdef CONFIG_FASTBOOT +#include <fastboot.h> +#ifdef CONFIG_ANDROID_RECOVERY +#include <recovery.h> +#endif +#endif /*CONFIG_FASTBOOT*/ DECLARE_GLOBAL_DATA_PTR; @@ -625,6 +632,62 @@ u32 get_board_rev(void) return get_cpu_rev(); } +#ifdef CONFIG_FASTBOOT + +void board_fastboot_setup(void) +{ + /*current uboot BSP only supports USDHC2*/ + switch (get_boot_device()) { +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) + case SD2_BOOT: + case MMC2_BOOT: + if (!getenv("fastboot_dev")) + setenv("fastboot_dev", "mmc0"); + if (!getenv("bootcmd")) + setenv("bootcmd", "booti mmc0"); + break; +#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ + default: + printf("unsupported boot devices\n"); + break; + } + +} + +#ifdef CONFIG_ANDROID_RECOVERY +int check_recovery_cmd_file(void) +{ + return recovery_check_and_clean_flag(); +} + +void board_recovery_setup(void) +{ + int bootdev = get_boot_device(); + + /*current uboot BSP only supports USDHC2*/ + switch (bootdev) { +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) + case SD2_BOOT: + case MMC2_BOOT: + if (!getenv("bootcmd_android_recovery")) + setenv("bootcmd_android_recovery", + "booti mmc0 recovery"); + break; +#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ + default: + printf("Unsupported bootup device for recovery: dev: %d\n", + bootdev); + return; + } + + printf("setup env for recovery..\n"); + setenv("bootcmd", "run bootcmd_android_recovery"); +} + +#endif /*CONFIG_ANDROID_RECOVERY*/ + +#endif /*CONFIG_FASTBOOT*/ + int checkboard(void) { puts("Board: MX6SLEVK\n"); @@ -632,6 +695,30 @@ int checkboard(void) return 0; } +#ifdef CONFIG_MXC_KPD +#define MX6SL_KEYPAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \ + PAD_CTL_PUS_100K_UP | PAD_CTL_DSE_120ohm) + +iomux_v3_cfg_t const mxc_kpd_pads[] = { + (MX6_PAD_KEY_COL0__KPP_COL_0 | MUX_PAD_CTRL(NO_PAD_CTRL)), + (MX6_PAD_KEY_COL1__KPP_COL_1 | MUX_PAD_CTRL(NO_PAD_CTRL)), + (MX6_PAD_KEY_COL2__KPP_COL_2 | MUX_PAD_CTRL(NO_PAD_CTRL)), + (MX6_PAD_KEY_COL3__KPP_COL_3 | MUX_PAD_CTRL(NO_PAD_CTRL)), + + (MX6_PAD_KEY_ROW0__KPP_ROW_0 | MUX_PAD_CTRL(MX6SL_KEYPAD_CTRL)), + (MX6_PAD_KEY_ROW1__KPP_ROW_1 | MUX_PAD_CTRL(MX6SL_KEYPAD_CTRL)), + (MX6_PAD_KEY_ROW2__KPP_ROW_2 | MUX_PAD_CTRL(MX6SL_KEYPAD_CTRL)), + (MX6_PAD_KEY_ROW3__KPP_ROW_3 | MUX_PAD_CTRL(MX6SL_KEYPAD_CTRL)), +}; +int setup_mxc_kpd(void) +{ + imx_iomux_v3_setup_multiple_pads(mxc_kpd_pads, + ARRAY_SIZE(mxc_kpd_pads)); + + return 0; +} +#endif /*CONFIG_MXC_KPD*/ + #ifdef CONFIG_IMX_UDC iomux_v3_cfg_t const otg_udc_pads[] = { (MX6_PAD_EPDC_PWRCOM__ANATOP_USBOTG1_ID | MUX_PAD_CTRL(NO_PAD_CTRL)), |