Skip to contentSkip to conversation

am57xx: Add fastboot support

PATCH New Sam Protsenko 2 participants 14 messages Oct 24, 2016 – Nov 22, 2016

lore
Share & tools
lore
#0 lore raw

v2 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.

Changes in v2:
- PATCH 2/4: Remove unnecessary check for CONFIG_FASTBOOT_USB_DEV in ti_omap5_common.h

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 |  3 ++-
 5 files changed, 64 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 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.

---
Changes in v2: None

 cmd/fastboot/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
cmd/fastboot/Kconfig +8 -0
index 5d2facc..d555d0a 100644
@@ -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
#2 lore raw

PATCH v2 1/4 fastboot: Add CONFIG_FASTBOOT_USB_DEV option

Quoted 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_DEV option.

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.

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/20161024/b0a2c964/attachment.sig>
#3 lore raw

PATCH v2 1/4 fastboot: Add CONFIG_FASTBOOT_USB_DEV option

In reply to Sam Protsenko
Quoted 11 lines · Semen 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_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.

Quoted 2 lines

Applied to u-boot/master, thanks!

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/20161121/2100bf31/attachment.sig>
#4 lore raw

PATCH v2 2/4 ti_omap5_common: Respect USB controller number in fastboot

In reply to 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_DEV option toprovide correct USB controller number to "fastboot" command.

---
Changes in v2:
- Remove unnecessary check for CONFIG_FASTBOOT_USB_DEV

 include/configs/ti_omap5_common.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/configs/ti_omap5_common.h +2 -1
index 29b7d96..b85fae3 100644
@@ -114,7 +114,8 @@
 	"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
#5 lore raw

PATCH v2 2/4 ti_omap5_common: Respect USB controller number in fastboot

Quoted 9 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_DEV option toprovide correct USB controller number to "fastboot" command.

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/20161024/b03567ac/attachment.sig>
#6 lore raw

PATCH v2 2/4 ti_omap5_common: Respect USB controller number in fastboot

In reply to Sam Protsenko
Quoted 10 lines · Semen 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_DEV option toprovide correct USB controller number to "fastboot" command.

Applied to u-boot/master, thanks!

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/20161121/5f4ec7bd/attachment.sig>
#7 lore raw

PATCH v2 3/4 configs: am57xx: Enable download gadget

In reply to Sam Protsenko

Enable USB download gadget (needed for fastboot support) and all dependencies.

---
Changes in v2: None

 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
index 5acd4e7..89e927e 100644
@@ -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
index 9588a55..73e541d 100644
@@ -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
index a80e882..b25e21b 100644
@@ -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
#8 lore raw

PATCH v2 3/4 configs: am57xx: Enable download gadget

Quoted 4 lines · Sam Protsenko

Enable USB download gadget (needed for fastboot support) and all dependencies.

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/20161024/e3872cbf/attachment.sig>
#9 lore raw

PATCH v2 3/4 configs: am57xx: Enable download gadget

In reply to Sam Protsenko
Quoted 5 lines · Semen Protsenko

Enable USB download gadget (needed for fastboot support) and all dependencies.

Applied to u-boot/master, thanks!

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/20161121/1c22ce1f/attachment.sig>
#10 lore raw

PATCH v2 4/4 configs: am57xx: Enable fastboot

In reply to Sam Protsenko

---
Changes in v2: None

 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
index 89e927e..888a2fd 100644
@@ -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
index 73e541d..9da40bb 100644
@@ -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
index b25e21b..e27b214 100644
@@ -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
#11 lore raw

PATCH v2 4/4 configs: am57xx: Enable fastboot

Quoted 1 line · Sam Protsenko
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/20161024/906ff366/attachment.sig>
#13 lore raw

PATCH v2 4/4 configs: am57xx: Enable fastboot

In reply to Sam Protsenko
Quoted 2 lines · Semen Protsenko

Applied to u-boot/master, thanks!

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/20161121/e9d658c4/attachment.sig>