Skip to contentSkip to conversation

Enhance support for BeagleBone Black

PATCH New Justin Waters 3 participants 12 messages Jul 11, 2013 – Jul 30, 2013

lore
Share & tools
lore
#0 lore raw

v2 cover Enhance support for BeagleBone Black

There are a number of differences between the BeagleBone Black and other AM335x boards that require some modification of the default AM335x EVM configuration. In particular, it lacks NAND flash, has multiple MMC interfaces, and can store its environment in an unused eMMC partition.

The following patch set improves the out-of-box experience on the BeagleBone Black by making the AM335x EVM configuration more modular, and adding a few additional features.

Changes from v1:
* Reordered the patches
* Broke out the beagleboard target addition into a seperate patch so that it is independent of the other changes
* Reversed the NAND logic- rather than using a new token, NO_NAND, I simply define NAND in the configurations for the other boards.
* Fixed some bugs introduced by my mmcboot modifications

Justin Waters (6):
am335x_evm: Make NAND support modular
am335x_evm: Add command line editing
am335x_evm: Rework bootcmd to handle two MMC devs Add additional MLO images to .gitignore
am335x_evm: Add support for eMMC environment
am335x_evm: Add am335x_boneblack variant

 .gitignore                   |    2 +-
 boards.cfg                   |   17 +++----
 include/configs/am335x_evm.h |  101 ++++++++++++++++++++++++++----------------
 3 files changed, 72 insertions(+), 48 deletions(-)
Signature · 1 line
1.7.9.6
#1 lore raw

PATCH v2 1/6 am335x_evm: Make NAND support modular

Give the user the ability to disable NAND support by defining CONFIG_NO_NAND. This will allow custom hardware to easily support this configuration.

---
 boards.cfg                   |   16 +++++++-------
 include/configs/am335x_evm.h |   49 ++++++++++++++++++++++++++----------------
 2 files changed, 39 insertions(+), 26 deletions(-)
boards.cfg +8 -8
index c0c4282..c0cf446 100644
@@ -241,14 +241,14 @@ integratorcp_cm946es         arm         arm946es    integrator          armltd
 vexpress_ca15_tc2            arm         armv7       vexpress            armltd
 vexpress_ca5x2               arm         armv7       vexpress            armltd
 vexpress_ca9x4               arm         armv7       vexpress            armltd
-am335x_evm                   arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1
-am335x_evm_spiboot           arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,SPI_BOOT
-am335x_evm_uart1             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL2,CONS_INDEX=2
-am335x_evm_uart2             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL3,CONS_INDEX=3
-am335x_evm_uart3             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL4,CONS_INDEX=4
-am335x_evm_uart4             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL5,CONS_INDEX=5
-am335x_evm_uart5             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL6,CONS_INDEX=6
-am335x_evm_usbspl            arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,SPL_USBETH_SUPPORT
+am335x_evm                   arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NAND
+am335x_evm_spiboot           arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NAND,SPI_BOOT
+am335x_evm_uart1             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL2,CONS_INDEX=2,NAND
+am335x_evm_uart2             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL3,CONS_INDEX=3,NAND
+am335x_evm_uart3             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL4,CONS_INDEX=4,NAND
+am335x_evm_uart4             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL5,CONS_INDEX=5,NAND
+am335x_evm_uart5             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL6,CONS_INDEX=6,NAND
+am335x_evm_usbspl            arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NAND,SPL_USBETH_SUPPORT
 ti814x_evm                   arm         armv7       ti814x              ti             am33xx
 pcm051                       arm         armv7       pcm051              phytec         am33xx      pcm051
 sama5d3xek_mmc               arm         armv7       sama5d3xek          atmel          at91        sama5d3xek:SAMA5D3,SYS_USE_MMC
include/configs/am335x_evm.h +31 -18

130 lines not on this page · raw message

Signature · 1 line
1.7.9.6
#2 lore raw

PATCH v2 1/6 am335x_evm: Make NAND support modular

Am 2013-07-11 15:54, schrieb Justin Waters:

Quoted 3 lines

Give the user the ability to disable NAND support by defining CONFIG_NO_NAND. This will allow custom hardware to easily support this configuration.

If NAND is not enabled, we could also ifdef the SPI/MTD/CMD_FS configurations since they are not used on BeagleBone Black either. Maybe something for a follow-up patch rather than a new version of this patchset.

--
Stefan

#3 lore raw

PATCH v2 1/6 am335x_evm: Make NAND support modular

Stefan,

Quoted 9 lines · Stefan Agner

Am 2013-07-11 15:54, schrieb Justin Waters:

Quoted 3 lines

Give the user the ability to disable NAND support by defining CONFIG_NO_NAND. This will allow custom hardware to easily support this configuration.

If NAND is not enabled, we could also ifdef the SPI/MTD/CMD_FS configurations since they are not used on BeagleBone Black either. Maybe something for a follow-up patch rather than a new version of this patchset.

Agreed on all accounts. I focused on the NAND mostly because the logic was gumming up the environment storage, and I needed it out of the way for the eMMC boot. It was an added bonus that it decreases the image size and cleans up the initialization. The others were more innocuous, so I skipped them for the time being.

-Justin

#4 lore raw

PATCH v2 2/6 am335x_evm: Add command line editing

In reply to Justin Waters

Many modern U-Boot ports enable command line editing and a history buffer. The am335x_evm configuration is fairly comprehensive as it is, so a few extra kb should not be noticable, and it adds a very convenient feature.

---
 include/configs/am335x_evm.h |    3 +++
 1 file changed, 3 insertions(+)
include/configs/am335x_evm.h +3 -0
index c53bc21..ea68b57 100644
@@ -37,6 +37,9 @@
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMD_BOOTZ
 #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_STACKSIZE		(128 * 1024)
+#define CONFIG_AUTO_COMPLETE
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 
Signature · 1 line
1.7.9.6
#5 lore raw

PATCH v2 3/6 am335x_evm: Rework bootcmd to handle two MMC devs

In reply to Justin Waters

The BeagleBone Black can boot from either the MMC card or eMMC chip on board. We should try both interfaces.

This modification also allows a graceful fallback if a device exists but boot images are not present on it.

Changes for v2:

* Fix boot partition - it should always show up as mmcblk0p2
* Fix missing FDT load

---
 include/configs/am335x_evm.h |   42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)
include/configs/am335x_evm.h +22 -20
index ea68b57..0df0e7a 100644
@@ -128,9 +128,23 @@
 	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
 	"loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
 	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-	"mmcboot=echo Booting from mmc ...; " \
-		"run mmcargs; " \
-		"bootm ${loadaddr} - ${fdtaddr}\0" \
+	"mmcboot=mmc dev ${mmcdev}; " \
+		"if mmc rescan; then " \
+			"echo SD/MMC found on device ${mmcdev};" \
+			"if run loadbootenv; then " \
+				"echo Loaded environment from ${bootenv};" \
+				"run importbootenv;" \
+			"fi;" \
+			"if test -n $uenvcmd; then " \
+				"echo Running uenvcmd ...;" \
+				"run uenvcmd;" \
+			"fi;" \
+			"if run loaduimage; then " \
+				"run loadfdt;" \
+				"run mmcargs; " \
+				"bootm ${loadaddr} - ${fdtaddr};" \
+			"fi;" \
+		"fi;\0" \
 	"spiboot=echo Booting from spi ...; " \
 		"run spiargs; " \
 		"sf probe ${spibusno}:0; " \
@@ -162,23 +176,11 @@
 
 #define CONFIG_BOOTCOMMAND \
 	"run findfdt; " \
-	"mmc dev ${mmcdev}; if mmc rescan; then " \
-		"echo SD/MMC found on device ${mmcdev};" \
-		"if run loadbootenv; then " \
-			"echo Loaded environment from ${bootenv};" \
-			"run importbootenv;" \
-		"fi;" \
-		"if test -n $uenvcmd; then " \
-			"echo Running uenvcmd ...;" \
-			"run uenvcmd;" \
-		"fi;" \
-		"if run loaduimage; then " \
-			"run loadfdt;" \
-			"run mmcboot;" \
-		"fi;" \
-	"else " \
-		"run nandboot;" \
-	"fi;" \
+	"run mmcboot;" \
+	"setenv mmcdev 1; " \
+	"setenv bootpart 1:2; " \
+	"run mmcboot;" \
+	"run nandboot;"
 
 /* Clock Defines */
 #define V_OSCK				24000000  /* Clock output from T2 */
Signature · 1 line
1.7.9.6
#6 lore raw

PATCH v2 4/6 Add additional MLO images to .gitignore

In reply to Justin Waters

This rule catches images such as MLO.byteswap

---
 .gitignore |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.gitignore +1 -1
index 771b860..d1282e7 100644
@@ -24,7 +24,7 @@
 # Top-level generic files
 #
 
-/MLO
+/MLO*
 /SPL
 /System.map
 /u-boot
Signature · 1 line
1.7.9.6
#7 lore raw

PATCH v2 5/6 am335x_evm: Add support for eMMC environment

In reply to Justin Waters

Some boards, such as the BeagleBone Black, have an eMMC chip intstead of NAND. We can use the eMMC boot partition to store the environment, since it isn't used for anything else. This allows us to have a configurable environment on those boards.

---
 include/configs/am335x_evm.h |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/configs/am335x_evm.h +6 -1
index 0df0e7a..e3f75cd 100644
@@ -486,7 +486,12 @@
 # define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
 # define CONFIG_ENV_OFFSET		(892 << 10) /* 892 KiB in */
 # define CONFIG_ENV_SECT_SIZE		(4 << 10) /* 4 KB sectors */
-#endif /* SPI support */
+#elif defined(CONFIG_EMMC_BOOT)
+# undef CONFIG_ENV_IS_NOWHERE
+# define CONFIG_ENV_IS_IN_MMC
+# define CONFIG_SYS_MMC_ENV_DEV		1
+# define CONFIG_SYS_MMC_ENV_PART	2
+#endif
 
 /* Unsupported features */
 #undef CONFIG_USE_IRQ
Signature · 1 line
1.7.9.6
#8 lore raw

PATCH v2 6/6 am335x_evm: Add am335x_boneblack variant

In reply to Justin Waters

The BeagleBone Black differs from the other AM335x boards in a few significant ways, so it makes sense to create a custom configuration for it. In particular, it uses eMMC instead of NAND flash.

---
 boards.cfg |    1 +
 1 file changed, 1 insertion(+)
boards.cfg +1 -0
index c0cf446..461f69b 100644
@@ -249,6 +249,7 @@ am335x_evm_uart3             arm         armv7       am335x              ti
 am335x_evm_uart4             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL5,CONS_INDEX=5,NAND
 am335x_evm_uart5             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL6,CONS_INDEX=6,NAND
 am335x_evm_usbspl            arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NAND,SPL_USBETH_SUPPORT
+am335x_boneblack             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,EMMC_BOOT
 ti814x_evm                   arm         armv7       ti814x              ti             am33xx
 pcm051                       arm         armv7       pcm051              phytec         am33xx      pcm051
 sama5d3xek_mmc               arm         armv7       sama5d3xek          atmel          at91        sama5d3xek:SAMA5D3,SYS_USE_MMC
Signature · 1 line
1.7.9.6
#9 lore raw

PATCH v2 6/6 am335x_evm: Add am335x_boneblack variant

Quoted 14 lines · Justin Waters

The BeagleBone Black differs from the other AM335x boards in a few significant ways, so it makes sense to create a custom configuration for it. In particular, it uses eMMC instead of NAND flash.

---
 boards.cfg |    1 +
 1 file changed, 1 insertion(+)
boards.cfg +0 -0
index c0cf446..461f69b 100644

boards.cfg am335x_evm_uart3 arm armv7 am335x ti · line 255

Quoted 7 lines
boards.cfg +1 -0
@@ -249,6 +249,7 @@ am335x_evm_uart3             arm         armv7       am335x              ti
 am335x_evm_uart4             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL5,CONS_INDEX=5,NAND
 am335x_evm_uart5             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL6,CONS_INDEX=6,NAND
 am335x_evm_usbspl            arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,NAND,SPL_USBETH_SUPPORT
+am335x_boneblack             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL1,CONS_INDEX=1,EMMC_BOOT
 ti814x_evm                   arm         armv7       ti814x              ti             am33xx
 pcm051                       arm         armv7       pcm051              phytec         am33xx      pcm051
 sama5d3xek_mmc               arm         armv7       sama5d3xek          atmel          at91        sama5d3xek:SAMA5D3,SYS_USE_MMC

One minor nit, do we have room for SPL_USBETH_SUPPORT since you turned off NAND? I bet you do, and the default sysboot pins will try USB too.

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

v2 cover Enhance support for BeagleBone Black

In reply to Justin Waters

Hi,

Am 2013-07-11 15:54, schrieb Justin Waters:

Quoted 7 lines

Justin Waters (6):
am335x_evm: Make NAND support modular
am335x_evm: Add command line editing
am335x_evm: Rework bootcmd to handle two MMC devs Add additional MLO images to .gitignore
am335x_evm: Add support for eMMC environment
am335x_evm: Add am335x_boneblack variant

Applied your patches on v2013.07-rc3 and compiled the beaglebone target. Works fine on my BeagleBone Black.

--
Stefan

#11 lore raw

v2 cover Enhance support for BeagleBone Black

In reply to Justin Waters
Quoted 26 lines · Justin Waters

There are a number of differences between the BeagleBone Black and other AM335x boards that require some modification of the default AM335x EVM configuration. In particular, it lacks NAND flash, has multiple MMC interfaces, and can store its environment in an unused eMMC partition.

The following patch set improves the out-of-box experience on the BeagleBone Black by making the AM335x EVM configuration more modular, and adding a few additional features.

Changes from v1:
* Reordered the patches
* Broke out the beagleboard target addition into a seperate patch so that it is independent of the other changes
* Reversed the NAND logic- rather than using a new token, NO_NAND, I simply define NAND in the configurations for the other boards.
* Fixed some bugs introduced by my mmcboot modifications

Justin Waters (6):
am335x_evm: Make NAND support modular
am335x_evm: Add command line editing
am335x_evm: Rework bootcmd to handle two MMC devs Add additional MLO images to .gitignore
am335x_evm: Add support for eMMC environment
am335x_evm: Add am335x_boneblack variant

Quoted 4 lines
 .gitignore                   |    2 +-
 boards.cfg                   |   17 +++----
 include/configs/am335x_evm.h |  101 ++++++++++++++++++++++++++----------------
 3 files changed, 72 insertions(+), 48 deletions(-)

Applied to u-boot-ti/master, thanks!

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