[PATCH 0/2] apalis/colibri imx6/imx6ull/imx7: Add fastboot supp

This patch series introduces Fastboot support on all Apalis iMX6, Colibri iMX6, Colibri iMX6ULL and Colibri iMX7 machines. It includes the necessary configurations in their respective defconfig files and implements logic in the boards files to determine whether SDP or Fastboot will be utilized.
Hiago De Franco (2): apalis/colibri imx6/imx6ull/imx7: defconfig: Enable fastboot support board: apalis/colibri imx6/imx6ull/imx7: Add fastboot bootcmd support
board/toradex/apalis_imx6/apalis_imx6.c | 13 ++++++++----- board/toradex/colibri-imx6ull/colibri-imx6ull.c | 13 ++++++++----- board/toradex/colibri_imx6/colibri_imx6.c | 13 ++++++++----- board/toradex/colibri_imx7/colibri_imx7.c | 14 +++++++++----- configs/apalis_imx6_defconfig | 3 +++ configs/colibri-imx6ull-emmc_defconfig | 3 +++ configs/colibri-imx6ull_defconfig | 3 +++ configs/colibri_imx6_defconfig | 3 +++ configs/colibri_imx7_defconfig | 3 +++ configs/colibri_imx7_emmc_defconfig | 4 ++-- 10 files changed, 50 insertions(+), 22 deletions(-)

Add fastboot support for Apalis iMX6, Colibri iMX6, Colibri iMX6ULL and Colibri iMX7 boards. Remove CONFIG_FASTBOOT_BUF_SIZE from colibri_imx7_emmc_defconfig to get the default value of 0x7000000 instead of 0x10000000, to make it consistent with the other boards.
Signed-off-by: Hiago De Franco hiago.franco@toradex.com --- configs/apalis_imx6_defconfig | 3 +++ configs/colibri-imx6ull-emmc_defconfig | 3 +++ configs/colibri-imx6ull_defconfig | 3 +++ configs/colibri_imx6_defconfig | 3 +++ configs/colibri_imx7_defconfig | 3 +++ configs/colibri_imx7_emmc_defconfig | 4 ++-- 6 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig index aa9cf77960..570ade5119 100644 --- a/configs/apalis_imx6_defconfig +++ b/configs/apalis_imx6_defconfig @@ -87,6 +87,9 @@ CONFIG_DWC_AHSATA=y CONFIG_LBA48=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_ENV=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x14420000 +CONFIG_FASTBOOT_UUU_SUPPORT=y CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MXC=y diff --git a/configs/colibri-imx6ull-emmc_defconfig b/configs/colibri-imx6ull-emmc_defconfig index 2fead59f5f..20cba723ee 100644 --- a/configs/colibri-imx6ull-emmc_defconfig +++ b/configs/colibri-imx6ull-emmc_defconfig @@ -64,6 +64,9 @@ CONFIG_SERVERIP="192.168.10.1" CONFIG_BOUNCE_BUFFER=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_ENV=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x81100000 +CONFIG_FASTBOOT_UUU_SUPPORT=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y CONFIG_SUPPORT_EMMC_BOOT=y diff --git a/configs/colibri-imx6ull_defconfig b/configs/colibri-imx6ull_defconfig index 5164374c67..d904621f5e 100644 --- a/configs/colibri-imx6ull_defconfig +++ b/configs/colibri-imx6ull_defconfig @@ -75,6 +75,9 @@ CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000 +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x81100000 +CONFIG_FASTBOOT_UUU_SUPPORT=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y CONFIG_FSL_USDHC=y diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig index 51f3eeca75..cd68264eca 100644 --- a/configs/colibri_imx6_defconfig +++ b/configs/colibri_imx6_defconfig @@ -85,6 +85,9 @@ CONFIG_SERVERIP="192.168.10.1" CONFIG_BOUNCE_BUFFER=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_ENV=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x14420000 +CONFIG_FASTBOOT_UUU_SUPPORT=y CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_SYS_I2C_MXC=y diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig index eba2b41c84..e24a606bc4 100644 --- a/configs/colibri_imx7_defconfig +++ b/configs/colibri_imx7_defconfig @@ -72,6 +72,9 @@ CONFIG_BOUNCE_BUFFER=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x81100000 +CONFIG_FASTBOOT_UUU_SUPPORT=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_MXC=y CONFIG_FSL_USDHC=y diff --git a/configs/colibri_imx7_emmc_defconfig b/configs/colibri_imx7_emmc_defconfig index 49a51e9272..687dbb5e3e 100644 --- a/configs/colibri_imx7_emmc_defconfig +++ b/configs/colibri_imx7_emmc_defconfig @@ -62,9 +62,9 @@ CONFIG_SERVERIP="192.168.10.1" CONFIG_BOOTCOUNT_LIMIT=y CONFIG_BOOTCOUNT_ENV=y CONFIG_USB_FUNCTION_FASTBOOT=y -CONFIG_FASTBOOT_BUF_ADDR=0x82000000 -CONFIG_FASTBOOT_BUF_SIZE=0x10000000 +CONFIG_FASTBOOT_BUF_ADDR=0x81100000 CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_UUU_SUPPORT=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 CONFIG_FASTBOOT_CMD_OEM_FORMAT=y CONFIG_DM_I2C=y

On Thu, Nov 9, 2023 at 2:44 PM Hiago De Franco hiagofranco@gmail.com wrote:
Add fastboot support for Apalis iMX6, Colibri iMX6, Colibri iMX6ULL and Colibri iMX7 boards. Remove CONFIG_FASTBOOT_BUF_SIZE from colibri_imx7_emmc_defconfig to get the default value of 0x7000000 instead of 0x10000000, to make it consistent with the other boards.
Signed-off-by: Hiago De Franco hiago.franco@toradex.com
Reviewed-by: Fabio Estevam festevam@gmail.com

This commit adds support for Fastboot boot commands by checking both CONFIG_CMD_USB_SDP and CONFIG_USB_FUNCTION_FASTBOOT. If either of these configurations is set, it indicates that the board is in recovery mode and can use either SDP or Fastboot.
The default option remains the SDP command, but if CONFIG_CMD_FASTBOOT is set, it changes to 'fastboot usb 0' as the boot command.
Signed-off-by: Hiago De Franco hiago.franco@toradex.com --- board/toradex/apalis_imx6/apalis_imx6.c | 13 ++++++++----- board/toradex/colibri-imx6ull/colibri-imx6ull.c | 13 ++++++++----- board/toradex/colibri_imx6/colibri_imx6.c | 13 ++++++++----- board/toradex/colibri_imx7/colibri_imx7.c | 14 +++++++++----- 4 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index fa6b7226fe..6fc14b5858 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -701,13 +701,16 @@ int board_late_init(void) env_set("board_rev", env_str); #endif /* CONFIG_BOARD_LATE_INIT */
-#ifdef CONFIG_CMD_USB_SDP - if (is_boot_from_usb()) { - printf("Serial Downloader recovery mode, using sdp command\n"); + if (IS_ENABLED(CONFIG_USB) && is_boot_from_usb()) { env_set("bootdelay", "0"); - env_set("bootcmd", "sdp 0"); + if (IS_ENABLED(CONFIG_CMD_USB_SDP)) { + printf("Serial Downloader recovery mode, using sdp command\n"); + env_set("bootcmd", "sdp 0"); + } else if (IS_ENABLED(CONFIG_CMD_FASTBOOT)) { + printf("Fastboot recovery mode, using fastboot command\n"); + env_set("bootcmd", "fastboot usb 0"); + } } -#endif /* CONFIG_CMD_USB_SDP */
return 0; } diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c b/board/toradex/colibri-imx6ull/colibri-imx6ull.c index 48fdb1e097..58f62a8a47 100644 --- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c +++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c @@ -187,13 +187,16 @@ int board_late_init(void) add_board_boot_modes(board_boot_modes); #endif
-#ifdef CONFIG_CMD_USB_SDP - if (is_boot_from_usb()) { - printf("Serial Downloader recovery mode, using sdp command\n"); + if (IS_ENABLED(CONFIG_USB) && is_boot_from_usb()) { env_set("bootdelay", "0"); - env_set("bootcmd", "sdp 0"); + if (IS_ENABLED(CONFIG_CMD_USB_SDP)) { + printf("Serial Downloader recovery mode, using sdp command\n"); + env_set("bootcmd", "sdp 0"); + } else if (IS_ENABLED(CONFIG_CMD_FASTBOOT)) { + printf("Fastboot recovery mode, using fastboot command\n"); + env_set("bootcmd", "fastboot usb 0"); + } } -#endif /* CONFIG_CMD_USB_SDP */
#if defined(CONFIG_VIDEO) setup_lcd(); diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index e6c9b10570..32940690a7 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -621,13 +621,16 @@ int board_late_init(void) env_set("board_rev", env_str); #endif
-#ifdef CONFIG_CMD_USB_SDP - if (is_boot_from_usb()) { - printf("Serial Downloader recovery mode, using sdp command\n"); + if (IS_ENABLED(CONFIG_USB) && is_boot_from_usb()) { env_set("bootdelay", "0"); - env_set("bootcmd", "sdp 0"); + if (IS_ENABLED(CONFIG_CMD_USB_SDP)) { + printf("Serial Downloader recovery mode, using sdp command\n"); + env_set("bootcmd", "sdp 0"); + } else if (IS_ENABLED(CONFIG_CMD_FASTBOOT)) { + printf("Fastboot recovery mode, using fastboot command\n"); + env_set("bootcmd", "fastboot usb 0"); + } } -#endif /* CONFIG_CMD_USB_SDP */
return 0; } diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index f0356af008..7ef2e24307 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -360,13 +360,17 @@ int board_late_init(void) setup_lcd(); #endif
-#if defined(CONFIG_CMD_USB_SDP) - if (is_boot_from_usb()) { - printf("Serial Downloader recovery mode, using sdp command\n"); + if (IS_ENABLED(CONFIG_USB) && is_boot_from_usb()) { env_set("bootdelay", "0"); - env_set("bootcmd", "sdp 0"); + if (IS_ENABLED(CONFIG_CMD_USB_SDP)) { + printf("Serial Downloader recovery mode, using sdp command\n"); + env_set("bootcmd", "sdp 0"); + } else if (IS_ENABLED(CONFIG_CMD_FASTBOOT)) { + printf("Fastboot recovery mode, using fastboot command\n"); + env_set("bootcmd", "fastboot usb 0"); + } } -#endif + if (is_emmc) env_set("variant", "-emmc"); else

On Thu, Nov 9, 2023 at 1:44 PM Hiago De Franco hiagofranco@gmail.com wrote:
This commit adds support for Fastboot boot commands by checking both
Just a nit: use imperative mood - "Add support for Fastboot....".
CONFIG_CMD_USB_SDP and CONFIG_USB_FUNCTION_FASTBOOT. If either of these configurations is set, it indicates that the board is in recovery mode and can use either SDP or Fastboot.
The default option remains the SDP command, but if CONFIG_CMD_FASTBOOT is set, it changes to 'fastboot usb 0' as the boot command.
Signed-off-by: Hiago De Franco hiago.franco@toradex.com
Reviewed-by: Fabio Estevam festevam@gmail.com

On Thu, Nov 9, 2023 at 9:44 PM Hiago De Franco hiagofranco@gmail.com wrote:
This patch series introduces Fastboot support on all Apalis iMX6, Colibri iMX6, Colibri iMX6ULL and Colibri iMX7 machines. It includes the necessary configurations in their respective defconfig files and implements logic in the boards files to determine whether SDP or Fastboot will be utilized.
Hiago De Franco (2): apalis/colibri imx6/imx6ull/imx7: defconfig: Enable fastboot support board: apalis/colibri imx6/imx6ull/imx7: Add fastboot bootcmd support
Applied all to u-boot-imx next, thanks.
participants (2)
-
Fabio Estevam
-
Hiago De Franco