diff options
author | zhang sanshan <sanshan.zhang@nxp.com> | 2017-05-10 10:14:27 +0800 |
---|---|---|
committer | Zhang Bo <bo.zhang@nxp.com> | 2017-06-21 12:21:03 +0800 |
commit | 81c9431f562bbeb2b6b1efb0f99e023ed818dc5d (patch) | |
tree | 8190ae0c64722f89dbcec4ad5c0874f41183b8e2 /board | |
parent | 31da76c496511b3d640ac1008b630b3ec939e168 (diff) | |
download | u-boot-imx-81c9431f562bbeb2b6b1efb0f99e023ed818dc5d.zip u-boot-imx-81c9431f562bbeb2b6b1efb0f99e023ed818dc5d.tar.gz u-boot-imx-81c9431f562bbeb2b6b1efb0f99e023ed818dc5d.tar.bz2 |
MA-9375 [Android IMX] uboot: enable BCB and bootctrl
* Add API to read\write MISC partition.
* get the boot mode from BCB command when boot up.
* get the boot up tactics from bootctrl.
Change-Id: Icbba6340e10983dddc1b04804ecc012a3a3c57d0
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/common/Makefile | 2 | ||||
-rw-r--r-- | board/freescale/common/recovery_keypad.c (renamed from board/freescale/common/recovery.c) | 24 | ||||
-rw-r--r-- | board/freescale/common/recovery_keypad.h | 13 | ||||
-rw-r--r-- | board/freescale/mx6qsabreauto/mx6qsabreauto.c | 93 | ||||
-rw-r--r-- | board/freescale/mx6sabresd/mx6sabresd.c | 89 | ||||
-rw-r--r-- | board/freescale/mx6slevk/mx6slevk.c | 76 | ||||
-rw-r--r-- | board/freescale/mx6sxsabreauto/mx6sxsabreauto.c | 82 | ||||
-rw-r--r-- | board/freescale/mx6sxsabresd/mx6sxsabresd.c | 73 | ||||
-rw-r--r-- | board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 83 | ||||
-rw-r--r-- | board/freescale/mx7dsabresd/mx7dsabresd.c | 59 | ||||
-rw-r--r-- | board/freescale/mx7ulp_evk/mx7ulp_evk.c | 8 |
11 files changed, 43 insertions, 559 deletions
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile index 66cdf0c..21830be 100644 --- a/board/freescale/common/Makefile +++ b/board/freescale/common/Makefile @@ -66,7 +66,7 @@ obj-$(CONFIG_DM_PMIC_PFUZE100) += pfuze_dm.o obj-$(CONFIG_MXC_EPDC) += epdc_setup.o obj-y += mmc.o ifdef CONFIG_FSL_FASTBOOT -obj-${CONFIG_ANDROID_RECOVERY} += recovery.o +obj-${CONFIG_ANDROID_RECOVERY} += recovery_keypad.o endif obj-$(CONFIG_LS102XA_STREAM_ID) += ls102xa_stream_id.o diff --git a/board/freescale/common/recovery.c b/board/freescale/common/recovery_keypad.c index 396bc73..f73f88b 100644 --- a/board/freescale/common/recovery.c +++ b/board/freescale/common/recovery_keypad.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2010-2016 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2017 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -21,7 +22,7 @@ inline int test_key(int value, struct kpp_key_info *ki) return (ki->val == value) && (ki->evt == KDepress); } -int check_key_pressing(void) +int is_recovery_keypad_pressing(void) { struct kpp_key_info *key_info = NULL; int state = 0, keys, i; @@ -52,27 +53,8 @@ int check_key_pressing(void) } #else /* If not using mxc keypad, currently we will detect power key on board */ -int check_key_pressing(void) +int is_recovery_keypad_pressing(void) { return 0; } #endif - -void setup_recovery_env(void) -{ - board_recovery_setup(); -} - -/* export to lib_arm/board.c */ -void check_recovery_mode(void) -{ - if (check_key_pressing()) { - puts("Fastboot: Recovery key pressing got!\n"); - setup_recovery_env(); - } else if (check_recovery_cmd_file()) { - puts("Fastboot: Recovery command file found!\n"); - setup_recovery_env(); - } else { - puts("Fastboot: Normal\n"); - } -} diff --git a/board/freescale/common/recovery_keypad.h b/board/freescale/common/recovery_keypad.h new file mode 100644 index 0000000..d315cea --- /dev/null +++ b/board/freescale/common/recovery_keypad.h @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2017 NXP + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __RECOVERY_KEYPAD_H_ +#define __RECOVERY_KEYPAD_H_ + +int is_recovery_keypad_pressing(void); + +#endif diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 159d9f3..1ea4185 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2012-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -1136,51 +1137,6 @@ int checkboard(void) } #ifdef CONFIG_FSL_FASTBOOT -void board_fastboot_setup(void) -{ - switch (get_boot_device()) { -#if defined(CONFIG_FASTBOOT_STORAGE_SATA) - case SATA_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "sata"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota sata"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_SATA*/ -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc0"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc0"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "nand"); - if (!getenv("fbparts")) - setenv("fbparts", ANDROID_FASTBOOT_NAND_PARTS); - if (!getenv("bootcmd")) - setenv("bootcmd", - "nand read ${loadaddr} ${boot_nand_offset} " - "${boot_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - default: - printf("unsupported boot devices\n"); - break; - } -} - #ifdef CONFIG_ANDROID_RECOVERY #define GPIO_VOL_DN_KEY IMX_GPIO_NR(5, 14) @@ -1188,12 +1144,9 @@ iomux_v3_cfg_t const recovery_key_pads[] = { (MX6_PAD_DISP0_DAT20__GPIO5_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL)), }; -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { int button_pressed = 0; - int recovery_mode = 0; - - recovery_mode = recovery_check_and_clean_flag(); /* Check Recovery Combo Button press or not. */ imx_iomux_v3_setup_multiple_pads(recovery_key_pads, @@ -1207,49 +1160,9 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; + return button_pressed; } -void board_recovery_setup(void) -{ - int bootdev = get_boot_device(); - - switch (bootdev) { -#if defined(CONFIG_FASTBOOT_STORAGE_SATA) - case SATA_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota sata recovery"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_SATA*/ -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc0 recovery"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc1 recovery"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "nand read ${loadaddr} ${recovery_nand_offset} " - "${recovery_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - 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_FSL_FASTBOOT*/ diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index b655347..2a09e2f 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -1353,47 +1353,6 @@ int checkboard(void) } #ifdef CONFIG_FSL_FASTBOOT - -void board_fastboot_setup(void) -{ - switch (get_boot_device()) { -#if defined(CONFIG_FASTBOOT_STORAGE_SATA) - case SATA_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "sata"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota sata"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_SATA*/ -#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", "boota mmc0"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; - case MMC4_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc2"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc2"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ - default: - printf("unsupported boot devices\n"); - break; - } - -} - #ifdef CONFIG_ANDROID_RECOVERY #define GPIO_VOL_DN_KEY IMX_GPIO_NR(1, 5) @@ -1401,12 +1360,9 @@ iomux_v3_cfg_t const recovery_key_pads[] = { (MX6_PAD_GPIO_5__GPIO1_IO05 | MUX_PAD_CTRL(NO_PAD_CTRL)), }; -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { int button_pressed = 0; - int recovery_mode = 0; - - recovery_mode = recovery_check_and_clean_flag(); /* Check Recovery Combo Button press or not. */ imx_iomux_v3_setup_multiple_pads(recovery_key_pads, @@ -1420,48 +1376,7 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; -} - -void board_recovery_setup(void) -{ - int bootdev = get_boot_device(); - - switch (bootdev) { -#if defined(CONFIG_FASTBOOT_STORAGE_SATA) - case SATA_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "boota sata recovery"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_SATA*/ -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD2_BOOT: - case MMC2_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "boota mmc0 recovery"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "boota mmc1 recovery"); - break; - case MMC4_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "boota mmc2 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"); + return button_pressed; } #endif /*CONFIG_ANDROID_RECOVERY*/ diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index 33e7ef6..7a11f13 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 - 2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -37,6 +38,7 @@ #ifdef CONFIG_FSL_FASTBOOT #include <fsl_fastboot.h> #ifdef CONFIG_ANDROID_RECOVERY +#include "../common/recovery_keypad.h" #include <recovery.h> #endif #endif /*CONFIG_FSL_FASTBOOT*/ @@ -915,83 +917,13 @@ int setup_mxc_kpd(void) #endif /*CONFIG_MXC_KPD*/ #ifdef CONFIG_FSL_FASTBOOT -void board_fastboot_setup(void) -{ - switch (get_boot_device()) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc0"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc0"); - break; - case SD2_BOOT: - case MMC2_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc2"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc2"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ - default: - printf("unsupported boot devices\n"); - break; - } - -} - #ifdef CONFIG_ANDROID_RECOVERY -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(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 SD1_BOOT: - case MMC1_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "boota mmc0 recovery"); - break; - case SD2_BOOT: - case MMC2_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "boota mmc1 recovery"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "boota mmc2 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"); + return is_recovery_keypad_pressing(); } #endif /*CONFIG_ANDROID_RECOVERY*/ - #endif /*CONFIG_FSL_FASTBOOT*/ diff --git a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c index 648dbf0..71c51eb 100644 --- a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c +++ b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. + * Copyright 2017 nxp * * Author: Ye Li <ye.li@nxp.com> * @@ -32,6 +33,7 @@ #include <fsl_fastboot.h> #ifdef CONFIG_ANDROID_RECOVERY #include <recovery.h> +#include "../common/recovery_keypad.h" #endif #endif /*CONFIG_FSL_FASTBOOT*/ @@ -557,88 +559,12 @@ int checkboard(void) } #ifdef CONFIG_FSL_FASTBOOT -void board_fastboot_setup(void) -{ - switch (get_boot_device()) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc0"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc0"); - break; - case SD4_BOOT: - case MMC4_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "nand"); - if (!getenv("fbparts")) - setenv("fbparts", ANDROID_FASTBOOT_NAND_PARTS); - if (!getenv("bootcmd")) - setenv("bootcmd", - "nand read ${loadaddr} ${boot_nand_offset} " - "${boot_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - - default: - printf("unsupported boot devices\n"); - break; - } -} - #ifdef CONFIG_ANDROID_RECOVERY -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { - int recovery_mode = 0; - - recovery_mode = recovery_check_and_clean_flag(); - - return recovery_mode; + return is_recovery_keypad_pressing(); } -void board_recovery_setup(void) -{ - int bootdev = get_boot_device(); - - switch (bootdev) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc0 recovery"); - break; - case SD4_BOOT: - case MMC4_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc1 recovery"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "nand read ${loadaddr} ${recovery_nand_offset} " - "${recovery_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - 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_FSL_FASTBOOT*/ diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index f99048a..608bd1d 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -977,38 +978,6 @@ int checkboard(void) } #ifdef CONFIG_FSL_FASTBOOT -void board_fastboot_setup(void) -{ - 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", "boota mmc0"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; - case SD4_BOOT: - case MMC4_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc2"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc2"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ - default: - printf("unsupported boot devices\n"); - break; - } -} - #ifdef CONFIG_ANDROID_RECOVERY #define GPIO_VOL_DN_KEY IMX_GPIO_NR(1, 19) @@ -1016,12 +985,9 @@ iomux_v3_cfg_t const recovery_key_pads[] = { (MX6_PAD_CSI_DATA05__GPIO1_IO_19 | MUX_PAD_CTRL(BUTTON_PAD_CTRL)), }; -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { int button_pressed = 0; - int recovery_mode = 0; - - recovery_mode = recovery_check_and_clean_flag(); /* Check Recovery Combo Button press or not. */ imx_iomux_v3_setup_multiple_pads(recovery_key_pads, @@ -1035,42 +1001,9 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; -} - -void board_recovery_setup(void) -{ - int bootdev = get_boot_device(); - - switch (bootdev) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD2_BOOT: - case MMC2_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc0 recovery"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc1 recovery"); - break; - case SD4_BOOT: - case MMC4_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc2 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"); + return button_pressed; } #endif /*CONFIG_ANDROID_RECOVERY*/ - #endif /*CONFIG_FSL_FASTBOOT*/ #ifdef CONFIG_SPL_BUILD diff --git a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c index 8b707b6..325b6df 100644 --- a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +++ b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -928,89 +929,13 @@ int checkboard(void) } #ifdef CONFIG_FSL_FASTBOOT -void board_fastboot_setup(void) -{ - switch (get_boot_device()) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc0"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc0"); - break; - case SD2_BOOT: - case MMC2_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "nand"); - if (!getenv("fbparts")) - setenv("fbparts", ANDROID_FASTBOOT_NAND_PARTS); - if (!getenv("bootcmd")) - setenv("bootcmd", - "nand read ${loadaddr} ${boot_nand_offset} " - "${boot_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - - default: - printf("unsupported boot devices\n"); - break; - } -} - #ifdef CONFIG_ANDROID_RECOVERY -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { - int recovery_mode = 0; - - recovery_mode = recovery_check_and_clean_flag(); - - return recovery_mode; + /* No key defined for this board */ + return 0; } -void board_recovery_setup(void) -{ - int bootdev = get_boot_device(); - - switch (bootdev) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc0 recovery"); - break; - case SD2_BOOT: - case MMC2_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc1 recovery"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "nand read ${loadaddr} ${recovery_nand_offset} " - "${recovery_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - - 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_FSL_FASTBOOT*/ diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index 216f5b3..b97de36 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -689,31 +689,6 @@ int checkboard(void) } #ifdef CONFIG_FSL_FASTBOOT -void board_fastboot_setup(void) -{ - switch (get_boot_device()) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc0"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc0"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ - default: - printf("unsupported boot devices\n"); - break; - } -} - #ifdef CONFIG_ANDROID_RECOVERY /* Use S3 button for recovery key */ @@ -722,12 +697,9 @@ iomux_v3_cfg_t const recovery_key_pads[] = { (MX7D_PAD_SD2_WP__GPIO5_IO10 | MUX_PAD_CTRL(BUTTON_PAD_CTRL)), }; -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { int button_pressed = 0; - int recovery_mode = 0; - - recovery_mode = recovery_check_and_clean_flag(); /* Check Recovery Combo Button press or not. */ imx_iomux_v3_setup_multiple_pads(recovery_key_pads, @@ -741,35 +713,8 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; + return button_pressed; } -void board_recovery_setup(void) -{ - int bootdev = get_boot_device(); - - switch (bootdev) { -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc0 recovery"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc1 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_FSL_FASTBOOT*/ diff --git a/board/freescale/mx7ulp_evk/mx7ulp_evk.c b/board/freescale/mx7ulp_evk/mx7ulp_evk.c index a7ceb91..a35f724 100644 --- a/board/freescale/mx7ulp_evk/mx7ulp_evk.c +++ b/board/freescale/mx7ulp_evk/mx7ulp_evk.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * SPDX-License-Identifier: GPL-2.0+ */ @@ -233,11 +234,10 @@ void board_fastboot_setup(void) } #ifdef CONFIG_ANDROID_RECOVERY -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { - int recovery_mode = 0; - recovery_mode = recovery_check_and_clean_flag(); - return recovery_mode; + /* TODO: uboot can get the key event from M4 core*/ + return 0; } void board_recovery_setup(void) |