diff options
author | Chen Guoyin <guoyin.chen@nxp.com> | 2016-11-15 17:57:25 +0800 |
---|---|---|
committer | Chen Guoyin <guoyin.chen@nxp.com> | 2016-11-16 18:36:34 +0800 |
commit | a5a753d62da1c6352235845629470e5337f4f347 (patch) | |
tree | f50e64b95766bc861fe18bb2dfd584576fa2e76c /board/freescale | |
parent | 7f652587219cf14755c07c35e9271b45f150b518 (diff) | |
download | u-boot-imx-a5a753d62da1c6352235845629470e5337f4f347.zip u-boot-imx-a5a753d62da1c6352235845629470e5337f4f347.tar.gz u-boot-imx-a5a753d62da1c6352235845629470e5337f4f347.tar.bz2 |
MA-9012 Support boot commands from bcb info
* Remove recovery/bootloader mode checking based on snvs register
* Use the API fastboot_run_bootmode() as the entry to check different
boot mode
* Set boot mode based on commands stored in bcb structure to align
Android's bootloader_message_writer.cpp
bootonce-bootloader -- > Fastboot mode
boot-recovery -- > Recovery mode
* Rename the recovery.c as recovery_keypad.c as only handle keypad
Change-Id: If34bee0c78bdca252e33296d61443d01a8fc8e96
Signed-off-by: Chen Guoyin <guoyin.chen@nxp.com>
Diffstat (limited to 'board/freescale')
-rw-r--r-- | board/freescale/common/Makefile | 2 | ||||
-rw-r--r-- | board/freescale/common/recovery_keypad.c (renamed from board/freescale/common/recovery.c) | 28 | ||||
-rw-r--r-- | board/freescale/common/recovery_keypad.h | 12 | ||||
-rw-r--r-- | board/freescale/mx6qsabreauto/mx6qsabreauto.c | 9 | ||||
-rw-r--r-- | board/freescale/mx6sabresd/mx6sabresd.c | 9 | ||||
-rw-r--r-- | board/freescale/mx6slevk/mx6slevk.c | 5 | ||||
-rw-r--r-- | board/freescale/mx6sxsabreauto/mx6sxsabreauto.c | 11 | ||||
-rw-r--r-- | board/freescale/mx6sxsabresd/mx6sxsabresd.c | 9 | ||||
-rw-r--r-- | board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 11 | ||||
-rw-r--r-- | board/freescale/mx6ul_nxpu_iopb/mx6ul_nxpu_iopb.c | 9 | ||||
-rw-r--r-- | board/freescale/mx7dsabresd/mx7dsabresd.c | 7 |
11 files changed, 40 insertions, 72 deletions
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile index 0c7fa21..49421bb 100644 --- a/board/freescale/common/Makefile +++ b/board/freescale/common/Makefile @@ -63,7 +63,7 @@ obj-$(CONFIG_ZM7300) += zm7300.o obj-$(CONFIG_POWER_PFUZE100) += pfuze.o obj-$(CONFIG_MXC_EPDC) += epdc_setup.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 9fa31c4..37e13dc 100644 --- a/board/freescale/common/recovery.c +++ b/board/freescale/common/recovery_keypad.c @@ -21,7 +21,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,32 +52,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(); -#ifdef CONFIG_BCB_SUPPORT - } else if (recovery_check_and_clean_command()) { - puts("Fastboot: BCB command found\n"); - setup_recovery_env(); -#endif - } 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..e8b0276 --- /dev/null +++ b/board/freescale/common/recovery_keypad.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. All Rights Reserved. + * + * 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 21362a4..5a3ee29 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2015 Freescale Semiconductor, Inc. + * Copyright (C) 2012-2016 Freescale Semiconductor, Inc. * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -1027,12 +1027,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, @@ -1045,7 +1042,7 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; + return button_pressed; } void board_recovery_setup(void) diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 716e2d7..5070c65 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2015 Freescale Semiconductor, Inc. + * Copyright (C) 2012-2016 Freescale Semiconductor, Inc. * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -1241,12 +1241,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, @@ -1259,7 +1256,7 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; + return button_pressed; } void board_recovery_setup(void) diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index b94fdf0..d19709f 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -38,6 +38,7 @@ #include <fsl_fastboot.h> #ifdef CONFIG_ANDROID_RECOVERY #include <recovery.h> +#include "../common/recovery_keypad.h" #endif #endif /*CONFIG_FSL_FASTBOOT*/ @@ -874,9 +875,9 @@ void board_fastboot_setup(void) } #ifdef CONFIG_ANDROID_RECOVERY -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { - return recovery_check_and_clean_flag(); + return is_recovery_keypad_pressing(); } void board_recovery_setup(void) diff --git a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c index 43a2e3f..4b65b2a 100644 --- a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c +++ b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. + * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */ @@ -48,6 +48,7 @@ #include <fsl_fastboot.h> #ifdef CONFIG_ANDROID_RECOVERY #include <recovery.h> +#include "../common/recovery_keypad.h" #endif #endif /*CONFIG_FSL_FASTBOOT*/ @@ -883,13 +884,9 @@ 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; + return is_recovery_keypad_pressing(); } void board_recovery_setup(void) diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 3b238e7..2ce9138 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. + * Copyright (C) 2014-2016 Freescale Semiconductor, Inc. * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -965,12 +965,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, @@ -983,7 +980,7 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; + return button_pressed; } void board_recovery_setup(void) diff --git a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c index c09e2ae..9bed1da 100644 --- a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +++ b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Freescale Semiconductor, Inc. + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */ @@ -1031,13 +1031,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; + /* No key defined for this board */ + return 0; } void board_recovery_setup(void) diff --git a/board/freescale/mx6ul_nxpu_iopb/mx6ul_nxpu_iopb.c b/board/freescale/mx6ul_nxpu_iopb/mx6ul_nxpu_iopb.c index 4b681ba..9ebabca 100644 --- a/board/freescale/mx6ul_nxpu_iopb/mx6ul_nxpu_iopb.c +++ b/board/freescale/mx6ul_nxpu_iopb/mx6ul_nxpu_iopb.c @@ -618,13 +618,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; + /* No key defined for this board */ + return 0; } void board_recovery_setup(void) diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index b6123b9..26babf7 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -1173,12 +1173,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, @@ -1191,7 +1188,7 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; + return button_pressed; } void board_recovery_setup(void) |