am57xx: Add fastboot support
cover am57xx: Add fastboot support
This patch series adds fastboot support for AM57x EVM boards.
As AM57x EVM USB controller index is 1 (as opposed to regular 0), some changes had to be done to deal with this.
Sam Protsenko (4):
fastboot: Add CONFIG_FASTBOOT_USB_DEV option
ti_omap5_common: Respect USB controller number in fastboot
configs: am57xx: Enable download gadget
configs: am57xx: Enable fastboot
cmd/fastboot/Kconfig | 8 ++++++++ configs/am57xx_evm_defconfig | 18 ++++++++++++++++++ configs/am57xx_evm_nodt_defconfig | 18 ++++++++++++++++++ configs/am57xx_hs_evm_defconfig | 18 ++++++++++++++++++ include/configs/ti_omap5_common.h | 6 +++++- 5 files changed, 67 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.3
PATCH 1/4 fastboot: Add CONFIG_FASTBOOT_USB_DEV option
Some boards (like AM57x EVM) has USB OTG controller other than 0. So in order to use correct controller number in compiled environment we should define CONFIG_FASTBOOT_USB_DEV option.
For example, when doing "fastboot reboot-bootloader" we want to enter fastboot mode automatically. But to do so we need to provide controller number to "fastboot" command. If this procedure is defined in some config which is common to bunch of boards, and boards have different USB controller numbers, we can't just hardcode "fastboot 0" in the environment. We need to use configurable option, which this patch adds.
--- cmd/fastboot/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
cmd/fastboot/Kconfig +8 -0
@@ -41,6 +41,14 @@ config FASTBOOT_BUF_SIZE downloads. This buffer should be as large as possible for a platform. Define this to the size available RAM for fastboot. +config FASTBOOT_USB_DEV + int "USB controller number" + default 0 + help + Some boards have USB OTG controller other than 0. Define this + option so it can be used in compiled environment (e.g. in + CONFIG_BOOTCOMMAND). + config FASTBOOT_FLASH bool "Enable FASTBOOT FLASH command" help
Signature · 1 line
2.9.3
PATCH 2/4 ti_omap5_common: Respect USB controller number in fastboot
In reply to Sam ProtsenkoOn "fastboot reboot-bootloader" we check "dofastboot" variable and do "fastboot 0" command in U-Boot if it's 1. But there are boards which have USB controller number other than 0, so it should be respected when performing "fastboot" command.
This patch reuses CONFIG_FASTBOOT_USB_DEV option toprovide correct USB controller number to "fastboot" command.
--- include/configs/ti_omap5_common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/configs/ti_omap5_common.h +5 -1
@@ -110,11 +110,15 @@DFUARGS \ NETARGS \ +#ifndef CONFIG_FASTBOOT_USB_DEV +#define CONFIG_FASTBOOT_USB_DEV 0 +#endif #define CONFIG_BOOTCOMMAND \ "if test ${dofastboot} -eq 1; then " \ "echo Boot fastboot requested, resetting dofastboot ...;" \ "setenv dofastboot 0; saveenv;" \ - "echo Booting into fastboot ...; fastboot 0;" \ + "echo Booting into fastboot ...; " \ + "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ "fi;" \ "run findfdt; " \ "run envboot; " \
Signature · 1 line
2.9.3
PATCH 3/4 configs: am57xx: Enable download gadget
In reply to Sam ProtsenkoEnable USB download gadget (needed for fastboot support) and all dependencies.
--- configs/am57xx_evm_defconfig | 9 +++++++++ configs/am57xx_evm_nodt_defconfig | 9 +++++++++ configs/am57xx_hs_evm_defconfig | 9 +++++++++ 3 files changed, 27 insertions(+)
configs/am57xx_evm_defconfig +9 -0
@@ -59,5 +59,14 @@ CONFIG_TI_QSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GADGET=y +CONFIG_USB_DWC3_OMAP=y +CONFIG_USB_DWC3_PHY_OMAP=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_G_DNL_MANUFACTURER="Texas Instruments" +CONFIG_G_DNL_VENDOR_NUM=0x0451 +CONFIG_G_DNL_PRODUCT_NUM=0xd022 CONFIG_SPL_OF_LIBFDT=y
configs/am57xx_evm_nodt_defconfig +9 -0
@@ -36,5 +36,14 @@ CONFIG_TI_QSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GADGET=y +CONFIG_USB_DWC3_OMAP=y +CONFIG_USB_DWC3_PHY_OMAP=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_G_DNL_MANUFACTURER="Texas Instruments" +CONFIG_G_DNL_VENDOR_NUM=0x0451 +CONFIG_G_DNL_PRODUCT_NUM=0xd022 CONFIG_OF_LIBFDT=y
configs/am57xx_hs_evm_defconfig +9 -0
@@ -54,5 +54,14 @@ CONFIG_TI_QSPI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GADGET=y +CONFIG_USB_DWC3_OMAP=y +CONFIG_USB_DWC3_PHY_OMAP=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_G_DNL_MANUFACTURER="Texas Instruments" +CONFIG_G_DNL_VENDOR_NUM=0x0451 +CONFIG_G_DNL_PRODUCT_NUM=0xd022 CONFIG_SPL_OF_LIBFDT=y
Signature · 1 line
2.9.3
PATCH 4/4 configs: am57xx: Enable fastboot
In reply to Sam Protsenko--- configs/am57xx_evm_defconfig | 9 +++++++++ configs/am57xx_evm_nodt_defconfig | 9 +++++++++ configs/am57xx_hs_evm_defconfig | 9 +++++++++ 3 files changed, 27 insertions(+)
configs/am57xx_evm_defconfig +9 -0
@@ -16,6 +16,15 @@ CONFIG_SPL_STACK_R=y CONFIG_SPL_DMA_SUPPORT=y CONFIG_SPL_OS_BOOT=y CONFIG_HUSH_PARSER=y +CONFIG_FASTBOOT=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_CMD_FASTBOOT=y +CONFIG_ANDROID_BOOT_IMAGE=y +CONFIG_FASTBOOT_BUF_ADDR=0x82000000 +CONFIG_FASTBOOT_BUF_SIZE=0x2f000000 +CONFIG_FASTBOOT_USB_DEV=1 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=1 CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMLS is not set CONFIG_CMD_ASKENV=y
configs/am57xx_evm_nodt_defconfig +9 -0
@@ -9,6 +9,15 @@ CONFIG_SPL=y CONFIG_SPL_DMA_SUPPORT=y CONFIG_SPL_OS_BOOT=y CONFIG_HUSH_PARSER=y +CONFIG_FASTBOOT=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_CMD_FASTBOOT=y +CONFIG_ANDROID_BOOT_IMAGE=y +CONFIG_FASTBOOT_BUF_ADDR=0x82000000 +CONFIG_FASTBOOT_BUF_SIZE=0x2f000000 +CONFIG_FASTBOOT_USB_DEV=1 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=1 CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMLS is not set CONFIG_CMD_ASKENV=y
configs/am57xx_hs_evm_defconfig +9 -0
@@ -17,6 +17,15 @@ CONFIG_SPL=y CONFIG_SPL_STACK_R=y CONFIG_SPL_DMA_SUPPORT=y CONFIG_HUSH_PARSER=y +CONFIG_FASTBOOT=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_CMD_FASTBOOT=y +CONFIG_ANDROID_BOOT_IMAGE=y +CONFIG_FASTBOOT_BUF_ADDR=0x82000000 +CONFIG_FASTBOOT_BUF_SIZE=0x2f000000 +CONFIG_FASTBOOT_USB_DEV=1 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=1 CONFIG_CMD_BOOTZ=y # CONFIG_CMD_IMLS is not set CONFIG_CMD_ASKENV=y
Signature · 1 line
2.9.3
PATCH 1/4 fastboot: Add CONFIG_FASTBOOT_USB_DEV option
In reply to Sam ProtsenkoQuoted 4 lines · Sam Protsenko
Some boards (like AM57x EVM) has USB OTG controller other than 0. So in order to use correct controller number in compiled environment we should define
CONFIG_FASTBOOT_USB_DEVoption.
Quoted 8 lines
For example, when doing "fastboot reboot-bootloader" we want to enter fastboot mode automatically. But to do so we need to provide controller number to "fastboot" command. If this procedure is defined in some config which is common to bunch of boards, and boards have different USB controller numbers, we can't just hardcode "fastboot 0" in the environment. We need to use configurable option, which this patch adds.
Signed-off-by Sam Protsenko <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161021/1f5f6ab4/attachment.sig>
PATCH 2/4 ti_omap5_common: Respect USB controller number in fastboot
In reply to Sam ProtsenkoQuoted 18 lines · Sam Protsenko
On "fastboot reboot-bootloader" we check "dofastboot" variable and do "fastboot 0" command in U-Boot if it's 1. But there are boards which have USB controller number other than 0, so it should be respected when performing "fastboot" command.
This patch reuses
CONFIG_FASTBOOT_USB_DEVoption toprovide correct USB controller number to "fastboot" command.Signed-off-by Sam Protsenko <[email protected]>--- include/configs/ti_omap5_common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/configs/ti_omap5_common.h +0
-0
include/configs/ti_omap5_common.h line 115
Quoted 6 lines
include/configs/ti_omap5_common.h +3
-0@@ -110,11 +110,15 @@DFUARGS \ NETARGS \ +#ifndef CONFIG_FASTBOOT_USB_DEV +#define CONFIG_FASTBOOT_USB_DEV 0 +#endif
We don't need this hunk, it will always be defined now.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161021/b11828e3/attachment.sig>
PATCH 3/4 configs: am57xx: Enable download gadget
In reply to Sam ProtsenkoQuoted 4 lines · Sam Protsenko
Enable USB download gadget (needed for fastboot support) and all dependencies.
Signed-off-by Sam Protsenko <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161021/ab121fd2/attachment.sig>
PATCH 4/4 configs: am57xx: Enable fastboot
In reply to Sam ProtsenkoQuoted 1 line · Sam Protsenko
Signed-off-by Sam Protsenko <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161021/d20791ce/attachment.sig>
PATCH 2/4 ti_omap5_common: Respect USB controller number in fastboot
In reply to Tom RiniQuoted 23 lines · Tom Rini
Quoted 21 lines · Sam Protsenko
On "fastboot reboot-bootloader" we check "dofastboot" variable and do "fastboot 0" command in U-Boot if it's 1. But there are boards which have USB controller number other than 0, so it should be respected when performing "fastboot" command.
This patch reuses
CONFIG_FASTBOOT_USB_DEVoption toprovide correct USB controller number to "fastboot" command.Signed-off-by Sam Protsenko <[email protected]>--- include/configs/ti_omap5_common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)include/configs/ti_omap5_common.h +0
-0@@ -110,11 +110,15 @@DFUARGS \NETARGS \
Quoted 6 lines
include/configs/ti_omap5_common.h line 115
Quoted 3 lines
include/configs/ti_omap5_common.h +3
-0+#ifndef CONFIG_FASTBOOT_USB_DEV +#define CONFIG_FASTBOOT_USB_DEV 0 +#endif We don't need this hunk, it will always be defined now.
Tom,
I fixed that and resent the whole patchset. Please reexamine v2.
Thanks.
Quoted 2 lines
--
Tom