From 312a10f16bf3e8b68066fa359d4dd6a887b5fd55 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Tue, 29 May 2018 15:30:39 +0000 Subject: fastboot: Move fastboot to drivers/fastboot Separate CMD_FASTBOOT from FASTBOOT and move code and configuration to drivers/fastboot. Switch dependencies on FASTBOOT to USB_FUNCTION_FASTBOOT as anyone who wants FASTBOOT before this series wants USB_FUNCTION_FASTBOOT. Split USB_FUNCTION_FASTBOOT from FASTBOOT so they retain their existing behaviour. Signed-off-by: Alex Kiernan Reviewed-by: Simon Glass Acked-by: Joe Hershberger --- board/ti/common/Kconfig | 1 - 1 file changed, 1 deletion(-) (limited to 'board') diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig index c21eb8c2d2..b1956b8100 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig @@ -25,7 +25,6 @@ config TI_COMMON_CMD_OPTIONS imply CMD_EXT2 imply CMD_EXT4 imply CMD_EXT4_WRITE - imply CMD_FASTBOOT if FASTBOOT imply CMD_FAT imply FAT_WRITE if CMD_FAT imply CMD_FS_GENERIC -- cgit From 8a65bd63720b813d8082a2c14bdde5ade4673d87 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Tue, 29 May 2018 15:30:46 +0000 Subject: fastboot: Rename fb_set_reboot_flag to fastboot_set_reboot_flag Rename fb_set_reboot_flag to fastboot_set_reboot_flag so it matches all other fastboot code in the global name space. Fix the guards around them so that they're dependent on FASTBOOT, not just USB_FUNCTION_FASTBOOT. Move the weak implementation of fastboot_set_reboot_flag to fb_common.c so we can call it from non-USB fastboot code. Signed-off-by: Alex Kiernan Reviewed-by: Simon Glass Acked-by: Joe Hershberger --- board/amazon/kc1/kc1.c | 2 +- board/lg/sniper/sniper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/amazon/kc1/kc1.c b/board/amazon/kc1/kc1.c index d9ca18363c..031fd11092 100644 --- a/board/amazon/kc1/kc1.c +++ b/board/amazon/kc1/kc1.c @@ -161,7 +161,7 @@ void get_board_serial(struct tag_serialnr *serialnr) omap_die_id_get_board_serial(serialnr); } -int fb_set_reboot_flag(void) +int fastboot_set_reboot_flag(void) { return omap_reboot_mode_store("b"); } diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c index 34a7a11f05..a7de4c2167 100644 --- a/board/lg/sniper/sniper.c +++ b/board/lg/sniper/sniper.c @@ -173,7 +173,7 @@ void reset_misc(void) omap_reboot_mode_store(reboot_mode); } -int fb_set_reboot_flag(void) +int fastboot_set_reboot_flag(void) { return omap_reboot_mode_store("b"); } -- cgit From 413b90777f8d9949083688e491e3f4e329d8a5b9 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Tue, 29 May 2018 15:30:49 +0000 Subject: ti: fastboot: Move weak overrides to board files Overriding fastboot_set_reboot_flag() in arch/arm/mach-omap2/boot-common.c leaves it applying all boards that derive from this, not just the ones which have support for Android bootloader flow. Move the weak function override to the relevant board files. Signed-off-by: Alex Kiernan Reviewed-by: Simon Glass --- board/ti/am57xx/board.c | 10 ++++++++++ board/ti/dra7xx/evm.c | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'board') diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index fd9d20779b..177a3246c3 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -1178,5 +1178,15 @@ void board_tee_image_process(ulong tee_image, size_t tee_size) secure_tee_install((u32)tee_image); } +#if CONFIG_IS_ENABLED(FASTBOOT) && !CONFIG_IS_ENABLED(ENV_IS_NOWHERE) +int fastboot_set_reboot_flag(void) +{ + printf("Setting reboot to fastboot flag ...\n"); + env_set("dofastboot", "1"); + env_save(); + return 0; +} +#endif + U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_TEE, board_tee_image_process); #endif diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 6918f4de01..bbe54450ae 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -1188,5 +1188,15 @@ void board_tee_image_process(ulong tee_image, size_t tee_size) secure_tee_install((u32)tee_image); } +#if CONFIG_IS_ENABLED(FASTBOOT) && !CONFIG_IS_ENABLED(ENV_IS_NOWHERE) +int fastboot_set_reboot_flag(void) +{ + printf("Setting reboot to fastboot flag ...\n"); + env_set("dofastboot", "1"); + env_save(); + return 0; +} +#endif + U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_TEE, board_tee_image_process); #endif -- cgit