Skip to contentSkip to conversation

arm: am57xx: Add Fastboot support to AM57XX EVM

PATCH New Semen Protsenko 3 participants 20 messages Mar 8, 2016 – Mar 9, 2016

lore
Share & tools
lore
#0 lore raw

cover arm: am57xx: Add Fastboot support to AM57XX EVM

Hi All,

This patch series add Fastboot support to TexasInstruments AM57XX EVM board and improves eMMC support. The most of code was borrowed from DRA7 EVM (since this board is very similar to DRA7 EVM).

Next commands were tested:
- fastboot devices
- fastboot getvar
- fastboot oem format
- fastboot flash

Sam Protsenko (6):
arm: am57xx: Enable USB gadget in AM57XX
arm: am57xx: Enable Fastboot
arm: am57xx: Define Android partition table
arm: am57xx: Set serial# variable
arm: am57xx: Enable 8-bit eMMC access on AM57XX EVM
arm: am57xx: Keep environment in eMMC

 board/ti/am57xx/board.c      |  1 +
 include/configs/am57xx_evm.h | 58 +++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 53 insertions(+), 6 deletions(-)
#1 lore raw

PATCH 1/6 arm: am57xx: Enable USB gadget in AM57XX

From: Sam Protsenko <[email protected]>

Enable dwc3, dwc3-omap and PHY for dwc3.
Also enable USB gadget.

---
 include/configs/am57xx_evm.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
include/configs/am57xx_evm.h +14 -0
index 6308cab..9191d61 100644
@@ -77,6 +77,20 @@
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB3PHY1_HOST
 
+/* USB GADGET */
+#define CONFIG_USB_DWC3_PHY_OMAP
+#define CONFIG_USB_DWC3_OMAP
+#define CONFIG_USB_DWC3
+#define CONFIG_USB_DWC3_GADGET
+
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_GADGET_VBUS_DRAW	2
+#define CONFIG_G_DNL_MANUFACTURER	"Texas Instruments"
+#define CONFIG_G_DNL_VENDOR_NUM		0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM	0xd022
+#define CONFIG_USB_GADGET_DUALSPEED
+
 /* SATA */
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_CMD_SCSI
Signature · 1 line
2.7.0
#2 lore raw

PATCH 1/6 arm: am57xx: Enable USB gadget in AM57XX

Quoted 4 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

Enable dwc3, dwc3-omap and PHY for dwc3.
Also enable USB gadget.

Thanks and regards,
Lokesh

Quoted 32 lines
---
 include/configs/am57xx_evm.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
include/configs/am57xx_evm.h +14 -0
index 6308cab..9191d61 100644
@@ -77,6 +77,20 @@
 #define CONFIG_OMAP_USB_PHY
 #define CONFIG_OMAP_USB3PHY1_HOST
 
+/* USB GADGET */
+#define CONFIG_USB_DWC3_PHY_OMAP
+#define CONFIG_USB_DWC3_OMAP
+#define CONFIG_USB_DWC3
+#define CONFIG_USB_DWC3_GADGET
+
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_DOWNLOAD
+#define CONFIG_USB_GADGET_VBUS_DRAW	2
+#define CONFIG_G_DNL_MANUFACTURER	"Texas Instruments"
+#define CONFIG_G_DNL_VENDOR_NUM		0x0451
+#define CONFIG_G_DNL_PRODUCT_NUM	0xd022
+#define CONFIG_USB_GADGET_DUALSPEED
+
 /* SATA */
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_CMD_SCSI
#3 lore raw

PATCH 2/6 arm: am57xx: Enable Fastboot

In reply to Semen Protsenko

From: Sam Protsenko <[email protected]>

Enable fastboot by default for AM57XX EVM.

This is based on following patch modified accordingly:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

---
 include/configs/am57xx_evm.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
include/configs/am57xx_evm.h +11 -0
index 9191d61..9a740d4 100644
@@ -36,11 +36,22 @@
 
 #define CONFIG_SYS_OMAP_ABE_SYSCK
 
+#ifndef CONFIG_SPL_BUILD
 /* Define the default GPT table for eMMC */
 #define PARTS_DEFAULT \
 	"uuid_disk=${uuid_gpt_disk};" \
 	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+/* Fastboot */
+#define CONFIG_USB_FUNCTION_FASTBOOT
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
+#define CONFIG_FASTBOOT_BUF_SIZE	0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV	1
+#endif
+
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
Signature · 1 line
2.7.0
#4 lore raw

PATCH 2/6 arm: am57xx: Enable Fastboot

Quoted 6 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

Enable fastboot by default for AM57XX EVM.

This is based on following patch modified accordingly:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

Also mention that you are guarding for non SPL

Other than that:

Thanks and regards,
Lokesh

Quoted 34 lines
---
 include/configs/am57xx_evm.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
include/configs/am57xx_evm.h +11 -0
index 9191d61..9a740d4 100644
@@ -36,11 +36,22 @@
 
 #define CONFIG_SYS_OMAP_ABE_SYSCK
 
+#ifndef CONFIG_SPL_BUILD
 /* Define the default GPT table for eMMC */
 #define PARTS_DEFAULT \
 	"uuid_disk=${uuid_gpt_disk};" \
 	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
 
+/* Fastboot */
+#define CONFIG_USB_FUNCTION_FASTBOOT
+#define CONFIG_CMD_FASTBOOT
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
+#define CONFIG_FASTBOOT_BUF_SIZE	0x2F000000
+#define CONFIG_FASTBOOT_FLASH
+#define CONFIG_FASTBOOT_FLASH_MMC_DEV	1
+#endif
+
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
#5 lore raw

PATCH 2/6 arm: am57xx: Enable Fastboot

In reply to Semen Protsenko
Quoted 8 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

Enable fastboot by default for AM57XX EVM.

This is based on following patch modified accordingly:
http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=b2e04f92b5d91c708b6fd6b79d2266966ac51f4b

Since you're spending some time in here, can you please start converting some of the fastboot options over to Kconfig? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160308/d07636a7/attachment.sig>
#6 lore raw

PATCH 3/6 arm: am57xx: Define Android partition table

In reply to Semen Protsenko

From: Sam Protsenko <[email protected]>

"fastboot oem format" command reuses "gpt write" command, which in turn requires correct partitions defined in $partitions variable. This patch adds such definition of Android partitions for AM57XX EVM board.

By default $partitions variable contains Linux partition table. In order to prepare Android environment one can run next commands from U-Boot shell:

=> env set partitions $partitions_android
=> env save

After those operations one can go to fastboot mode and perform "fastboot oem format" to create Android partition table.

While at it, enable CONFIG_RANDOM_UUID to spare user from providing UUIDs for each partition manually.

---
 include/configs/am57xx_evm.h | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
include/configs/am57xx_evm.h +19 -1
index 9a740d4..d075d61 100644
@@ -39,8 +39,25 @@
 #ifndef CONFIG_SPL_BUILD
 /* Define the default GPT table for eMMC */
 #define PARTS_DEFAULT \
+	/* Linux partitions */ \
 	"uuid_disk=${uuid_gpt_disk};" \
-	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
+	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
+	/* Android partitions */ \
+	"partitions_android=" \
+	"uuid_disk=${uuid_gpt_disk};" \
+	"name=xloader,start=128K,size=128K,uuid=${uuid_gpt_xloader};" \
+	"name=bootloader,size=384K,uuid=${uuid_gpt_bootloader};" \
+	"name=environment,size=128K,uuid=${uuid_gpt_environment};" \
+	"name=misc,size=128K,uuid=${uuid_gpt_misc};" \
+	"name=efs,start=1280K,size=16M,uuid=${uuid_gpt_efs};" \
+	"name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \
+	"name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \
+	"name=boot,size=10M,uuid=${uuid_gpt_boot};" \
+	"name=system,size=768M,uuid=${uuid_gpt_system};" \
+	"name=cache,size=256M,uuid=${uuid_gpt_cache};" \
+	"name=ipu1,size=1M,uuid=${uuid_gpt_ipu1};" \
+	"name=ipu2,size=1M,uuid=${uuid_gpt_ipu2};" \
+	"name=userdata,size=-,uuid=${uuid_gpt_userdata}"
 
 /* Fastboot */
 #define CONFIG_USB_FUNCTION_FASTBOOT
@@ -57,6 +74,7 @@
 /* Enhance our eMMC support / experience. */
 #define CONFIG_CMD_GPT
 #define CONFIG_EFI_PARTITION
+#define CONFIG_RANDOM_UUID
 
 /* CPSW Ethernet */
 #define CONFIG_CMD_DHCP
Signature · 1 line
2.7.0
#7 lore raw

PATCH 3/6 arm: am57xx: Define Android partition table

Quoted 13 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

"fastboot oem format" command reuses "gpt write" command, which in turn requires correct partitions defined in $partitions variable. This patch adds such definition of Android partitions for AM57XX EVM board.

By default $partitions variable contains Linux partition table. In order to prepare Android environment one can run next commands from U-Boot shell:

=> env set partitions $partitions_android
=> env save

Quoted 7 lines

After those operations one can go to fastboot mode and perform "fastboot oem format" to create Android partition table.

While at it, enable CONFIG_RANDOM_UUID to spare user from providing UUIDs for each partition manually.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160308/ca42fb25/attachment.sig>
#8 lore raw

PATCH 4/6 arm: am57xx: Set serial# variable

In reply to Semen Protsenko

From: Sam Protsenko <[email protected]>

serial# variable is used to correctly display device ID in "fastboot devices".

---
 board/ti/am57xx/board.c | 1 +
 1 file changed, 1 insertion(+)
board/ti/am57xx/board.c +1 -0
index 042f9ab..751de39 100644
@@ -270,6 +270,7 @@ int board_late_init(void)
 	 * This is the POWERHOLD-in-Low behavior.
 	 */
 	palmas_i2c_write_u8(TPS65903X_CHIP_P1, 0xA0, 0x1);
+	omap_die_id_serial();
 	return 0;
 }
 
Signature · 1 line
2.7.0
#9 lore raw

PATCH 4/6 arm: am57xx: Set serial# variable

Quoted 6 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

serial# variable is used to correctly display device ID in "fastboot devices".

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160308/cf88f8c5/attachment.sig>
#10 lore raw

PATCH 5/6 arm: am57xx: Enable 8-bit eMMC access on AM57XX EVM

In reply to Semen Protsenko

From: Sam Protsenko <[email protected]>

Use 8-bit access instead of 4-bit to speed up eMMC flashing speed.

---
 include/configs/am57xx_evm.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/am57xx_evm.h +1 -0
index d075d61..1ab9498 100644
@@ -75,6 +75,7 @@
 #define CONFIG_CMD_GPT
 #define CONFIG_EFI_PARTITION
 #define CONFIG_RANDOM_UUID
+#define CONFIG_HSMMC2_8BIT
 
 /* CPSW Ethernet */
 #define CONFIG_CMD_DHCP
Signature · 1 line
2.7.0
#11 lore raw

PATCH 5/6 arm: am57xx: Enable 8-bit eMMC access on AM57XX EVM

Quoted 3 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

Use 8-bit access instead of 4-bit to speed up eMMC flashing speed.

Thanks and regards,
Lokesh

Quoted 19 lines
---
 include/configs/am57xx_evm.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/am57xx_evm.h +1 -0
index d075d61..1ab9498 100644
@@ -75,6 +75,7 @@
 #define CONFIG_CMD_GPT
 #define CONFIG_EFI_PARTITION
 #define CONFIG_RANDOM_UUID
+#define CONFIG_HSMMC2_8BIT
 
 /* CPSW Ethernet */
 #define CONFIG_CMD_DHCP
#12 lore raw

PATCH 5/6 arm: am57xx: Enable 8-bit eMMC access on AM57XX EVM

In reply to Semen Protsenko
Quoted 5 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

Use 8-bit access instead of 4-bit to speed up eMMC flashing speed.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160308/758a1f81/attachment.sig>
#13 lore raw

PATCH 6/6 arm: am57xx: Keep environment in eMMC

In reply to Semen Protsenko

From: Sam Protsenko <[email protected]>

Use eMMC (instead of SD card) to store U-Boot environment.

---
 include/configs/am57xx_evm.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
include/configs/am57xx_evm.h +7 -5
index 1ab9498..f467f46 100644
@@ -22,11 +22,13 @@
 
 #define CONFIG_NR_DRAM_BANKS		2
 
-#define CONFIG_ENV_SIZE			(64 << 10)
-#define CONFIG_ENV_IS_IN_FAT
-#define FAT_ENV_INTERFACE		"mmc"
-#define FAT_ENV_DEVICE_AND_PART		"0:1"
-#define FAT_ENV_FILE			"uboot.env"
+/* MMC ENV related defines */
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		1	/* SLOT2: eMMC(1) */
+#define CONFIG_ENV_SIZE			(128 << 10)
+#define CONFIG_ENV_OFFSET		0xE0000
+#define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 #define CONSOLEDEV			"ttyO2"
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE	/* Base EVM has UART0 */
Signature · 1 line
2.7.0
#14 lore raw

PATCH 6/6 arm: am57xx: Keep environment in eMMC

Quoted 3 lines · Semen Protsenko

From: Sam Protsenko <[email protected]>

Use eMMC (instead of SD card) to store U-Boot environment.

Any specific reason why you want this change?

Thanks and regards,
Lokesh

Quoted 30 lines
---
 include/configs/am57xx_evm.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
include/configs/am57xx_evm.h +7 -5
index 1ab9498..f467f46 100644
@@ -22,11 +22,13 @@
 
 #define CONFIG_NR_DRAM_BANKS		2
 
-#define CONFIG_ENV_SIZE			(64 << 10)
-#define CONFIG_ENV_IS_IN_FAT
-#define FAT_ENV_INTERFACE		"mmc"
-#define FAT_ENV_DEVICE_AND_PART		"0:1"
-#define FAT_ENV_FILE			"uboot.env"
+/* MMC ENV related defines */
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV		1	/* SLOT2: eMMC(1) */
+#define CONFIG_ENV_SIZE			(128 << 10)
+#define CONFIG_ENV_OFFSET		0xE0000
+#define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 #define CONSOLEDEV			"ttyO2"
 #define CONFIG_SYS_NS16550_COM1		UART1_BASE	/* Base EVM has UART0 */
#15 lore raw

PATCH 6/6 arm: am57xx: Keep environment in eMMC

Quoted 2 lines · Lokesh Vutla

Any specific reason why you want this change?

Yes, I'm thinking about use case when developer uses eMMC exclusively (no SD card). In that case the environment should be stored somewhere, and that should be eMMC. In other words, once eMMC support is fully available in U-Boot, we can think more about eMMC use-case, because developers usually prefer to work with eMMC. Also see how it's done in DRA7 config, for example. And in SD card use case we can still work with environment stored in eMMC. Seems like win-win to me.

#16 lore raw

PATCH 6/6 arm: am57xx: Keep environment in eMMC

Quoted 11 lines · Sam Protsenko
Quoted 2 lines · Lokesh Vutla

Any specific reason why you want this change?

Yes, I'm thinking about use case when developer uses eMMC exclusively (no SD card). In that case the environment should be stored somewhere, and that should be eMMC. In other words, once eMMC support is fully available in U-Boot, we can think more about eMMC use-case, because developers usually prefer to work with eMMC. Also see how it's done in DRA7 config, for example. And in SD card use case we can still work with environment stored in eMMC. Seems like win-win to me.

Except the DRA7 boards don't also support a community board like am57xx does, the Beagle x15. That's a big SD heavy use-case.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160309/a6564a2c/attachment.sig>
#17 lore raw

cover arm: am57xx: Add Fastboot support to AM57XX EVM

In reply to Semen Protsenko
Quoted 21 lines · Semen Protsenko

Hi All,

This patch series add Fastboot support to TexasInstruments AM57XX EVM board and improves eMMC support. The most of code was borrowed from DRA7 EVM (since this board is very similar to DRA7 EVM).

Next commands were tested:
- fastboot devices
- fastboot getvar
- fastboot oem format
- fastboot flash

Sam Protsenko (6):
arm: am57xx: Enable USB gadget in AM57XX
arm: am57xx: Enable Fastboot
arm: am57xx: Define Android partition table
arm: am57xx: Set serial# variable
arm: am57xx: Enable 8-bit eMMC access on AM57XX EVM
arm: am57xx: Keep environment in eMMC

Quoted 3 lines
 board/ti/am57xx/board.c      |  1 +
 include/configs/am57xx_evm.h | 58 +++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 53 insertions(+), 6 deletions(-)

I think this series shows that we really need someone to step up and spend time converting the environment options to Kconfig so that different applications of the same board can easily tweak things they need (ie save env on the eMMC that you're programming vs keep env as a FAT file on the SD card users are often using).

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160308/648dcd53/attachment.sig>
#18 lore raw

cover arm: am57xx: Add Fastboot support to AM57XX EVM

Quoted 6 lines · Tom Rini

I think this series shows that we really need someone to step up and spend time converting the environment options to Kconfig so that different applications of the same board can easily tweak things they need (ie save env on the eMMC that you're programming vs keep env as a FAT file on the SD card users are often using).

Right now I have some stuff going on I'm more concerned about. I can look into moving options (at least ones that we are using for TI platforms) to Kconfig, once I finished with current task. It seems like a right thing to do. But I'd really like current patches to be merged as is for now.

#19 lore raw

cover arm: am57xx: Add Fastboot support to AM57XX EVM

Quoted 8 lines · Sam Protsenko
Quoted 6 lines · Tom Rini

I think this series shows that we really need someone to step up and spend time converting the environment options to Kconfig so that different applications of the same board can easily tweak things they need (ie save env on the eMMC that you're programming vs keep env as a FAT file on the SD card users are often using).

Quoted 5 lines

Right now I have some stuff going on I'm more concerned about. I can look into moving options (at least ones that we are using for TI platforms) to Kconfig, once I finished with current task. It seems like a right thing to do. But I'd really like current patches to be merged as is for now.

No, we can't merge them as-is for now as moving the environment to eMMC by default breaks another of other use cases, so we need to move things to Kconfig here.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160309/8af17725/attachment.sig>