Skip to contentSkip to conversation

Texas Instruments am335x-evm support

PATCH New Lothar Felten 2 participants 2 messages Jul 14, 2016 – Jul 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Texas Instruments am335x-evm support

This patch adds a target config for the ti am335x-evm based on the am335x CPU. It also supports the beaglebone and beagleboneblack. By default SGX drivers and Qt5 are selected, demos for SGX and Qt5 are built.
Device tree blobs for am335x-evm, am335x-evmsk, am335x-bone, am335x-boneblack will be built and a sd card image is created with a post-image script. The kernel and driver versions match the ti-processor-sdk 02.00.00.00. Patches allow the use of old am335x evm revisions (1 bit sd card) and JTAG debugging.

Kernel JTAG patch:
By default the kernel will disable the JTAG clock, access via the JTAG port will not work after the kernel booted. The am335x-evm has a JTAG header fitted, this patch keeps the JTAG clock alive.

Uboot SD card patch:
Early AM335x-evm boards can only use 1 bit communication to the SD card, on newer board revisions this might be fixed.
Forcing 1 bit communication slows down the communication but will work regardless if the SD card is attached via 1 or 4 bits.
If the board has a working 4 bit SD card interface, this patch can be removed, this will speed up the access.

---
 board/ti/am335x-evm/genimage.cfg                   |  32 ++
 board/ti/am335x-evm/kernel.config                  | 621 +++++++++++++++++++++
 .../0004-keep-jtag-clock-alive-for-debugger.patch  |  10 +
 .../uboot/0001-mmc-force-1bit-bus-width.patch      |  29 +
 board/ti/am335x-evm/post-image.sh                  |  22 +
 board/ti/am335x-evm/readme.txt                     |  62 ++
 board/ti/am335x-evm/uEnv.txt                       |   3 +
 configs/am335x-evm_defconfig                       |  36 ++
 8 files changed, 815 insertions(+)
 create mode 100644 board/ti/am335x-evm/genimage.cfg
 create mode 100644 board/ti/am335x-evm/kernel.config
 create mode 100644 board/ti/am335x-evm/patches/linux/0004-keep-jtag-clock-alive-for-debugger.patch
 create mode 100644 board/ti/am335x-evm/patches/uboot/0001-mmc-force-1bit-bus-width.patch
 create mode 100755 board/ti/am335x-evm/post-image.sh
 create mode 100644 board/ti/am335x-evm/readme.txt
 create mode 100644 board/ti/am335x-evm/uEnv.txt
 create mode 100644 configs/am335x-evm_defconfig
board/ti/am335x-evm/genimage.cfg new file +32 -0
new file mode 100644
index 0000000..c9de722
@@ -0,0 +1,32 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"MLO",
+			"u-boot.img",
+			"zImage",
+			"uEnv.txt",
+			"am335x-evm.dtb",
+			"am335x-evmsk.dtb",
+			"am335x-bone.dtb",
+			"am335x-boneblack.dtb",
+		}
+	}
+	size = 16M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		partition-type = 0xC
+		bootable = "true"
+                image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext2"
+		size = 240M
+	}
+}
board/ti/am335x-evm/kernel.config new file +621 -0

621 lines not on this page · raw message

board/ti/am335x-evm/patches/linux/0004-keep-jtag-clock-alive-for-debugger.patch new file +10 -0
new file mode 100644
index 0000000..0192e64
@@ -0,0 +1,10 @@
+--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c	2016-01-08 21:16:11.000000000 +0100
++++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c	2016-03-10 10:47:15.209992555 +0100
+@@ -208,6 +208,7 @@
+ 	.name		= "debugss",
+ 	.class		= &am33xx_debugss_hwmod_class,
+ 	.clkdm_name	= "l3_aon_clkdm",
++	.flags		= (HWMOD_INIT_NO_IDLE|HWMOD_INIT_NO_RESET), /* keep debugSS clock alive for JTAG */
+ 	.main_clk	= "trace_clk_div_ck",
+ 	.prcm		= {
+ 		.omap4	= {
board/ti/am335x-evm/patches/uboot/0001-mmc-force-1bit-bus-width.patch new file +29 -0
new file mode 100644
index 0000000..ecaabaa
@@ -0,0 +1,29 @@
+diff -Naur a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
+--- a/drivers/mmc/mmc.c	2016-05-16 16:40:32.000000000 +0200
++++ b/drivers/mmc/mmc.c	2016-07-11 13:23:13.235880737 +0200
+@@ -1351,25 +1351,6 @@
+ 	mmc->card_caps &= mmc->cfg->host_caps;
+ 
+ 	if (IS_SD(mmc)) {
+-		if (mmc->card_caps & MMC_MODE_4BIT) {
+-			cmd.cmdidx = MMC_CMD_APP_CMD;
+-			cmd.resp_type = MMC_RSP_R1;
+-			cmd.cmdarg = mmc->rca << 16;
+-
+-			err = mmc_send_cmd(mmc, &cmd, NULL);
+-			if (err)
+-				return err;
+-
+-			cmd.cmdidx = SD_CMD_APP_SET_BUS_WIDTH;
+-			cmd.resp_type = MMC_RSP_R1;
+-			cmd.cmdarg = 2;
+-			err = mmc_send_cmd(mmc, &cmd, NULL);
+-			if (err)
+-				return err;
+-
+-			mmc_set_bus_width(mmc, 4);
+-		}
+-
+ 		if (mmc->card_caps & MMC_MODE_HS)
+ 			mmc->tran_speed = 50000000;
+ 		else
board/ti/am335x-evm/post-image.sh new file +22 -0
new file mode 100755
index 0000000..6b16f40
@@ -0,0 +1,22 @@
+#!/bin/sh
+# post-image.sh for ti am335x-evm
+# based on post-image from beagleboard
+# 2014, Marcin Jabrzyk <[email protected]>
+# 2016, Lothar Felten <[email protected]>
+
+BOARD_DIR="$(dirname $0)"
+
+# copy the uEnv.txt to the output/images directory
+cp board/ti/am335x-evm/uEnv.txt $BINARIES_DIR/uEnv.txt
+
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+    --rootpath "${TARGET_DIR}" \
+    --tmppath "${GENIMAGE_TMP}" \
+    --inputpath "${BINARIES_DIR}" \
+    --outputpath "${BINARIES_DIR}" \
+    --config "${GENIMAGE_CFG}"
board/ti/am335x-evm/readme.txt new file +62 -0

62 lines not on this page · raw message

board/ti/am335x-evm/uEnv.txt new file +3 -0
new file mode 100644
index 0000000..e09fff5
@@ -0,0 +1,3 @@
+bootpart=0:1
+bootdir=
+uenvcmd=run loadimage;run loadramdisk;run findfdt;run loadfdt;run ramboot
configs/am335x-evm_defconfig new file +36 -0
new file mode 100644
index 0000000..a5c0edf
@@ -0,0 +1,36 @@
+BR2_arm=y
+BR2_cortex_a8=y
+BR2_KERNEL_HEADERS_4_1=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_ENABLE_LOCALE_PURGE=y
+BR2_ENABLE_LOCALE_WHITELIST="C en_US"
+BR2_TARGET_GENERIC_HOSTNAME="TI am335x-evm"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am335x-evm/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.ti.com/processor-sdk/processor-sdk-linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="52c4aa7cdb93d61f8008f380135beaf7b8fa6593"
+BR2_LINUX_KERNEL_PATCH="board/ti/am335x-evm/patches/linux/"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/ti/am335x-evm/kernel.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-evm am335x-bone am335x-boneblack am335x-evmsk"
+BR2_PACKAGE_FBV=y
+BR2_PACKAGE_QT5=y
+BR2_PACKAGE_QT5BASE_LICENSE_APPROVED=y
+BR2_PACKAGE_QT5BASE_EXAMPLES=y
+BR2_PACKAGE_QT5BASE_EGLFS=y
+BR2_PACKAGE_QT5QUICKCONTROLS=y
+BR2_PACKAGE_TI_SGX_DEMOS=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_PATCH="board/ti/am335x-evm/patches/uboot"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_evm"
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="MLO"
+BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 Texas Instruments am335x-evm support

Hello,

The commit title should be:

configs: new defconfig for TI am335x-evm

or something similar.

board/ti/am335x-evm/kernel.config

Quoted 5 lines
board/ti/am335x-evm/kernel.config new file +0 -0
new file mode 100644
index 0000000..39b1bd3

This kernel configuration is very very verbose. Could you instead use the omap2plus_defconfig from the kernel?

board/ti/am335x-evm/patches/linux/0004-keep-jtag-clock-alive-for-debugger.patch

Quoted 1 line
board/ti/am335x-evm/patches/linux/0004-keep-jtag-clock-alive-for-debugger.patch +0 -0

Why 0004 ?

Also, all patches should have a description + Signed-off-by.

board/ti/am335x-evm/patches/uboot/0001-mmc-force-1bit-bus-width.patch

Quoted 20 lines

new file mode 100644
index 0000000..0192e64

board/ti/am335x-evm/patches/linux/0004-keep-jtag-clock-alive-for-debugger.patch new file +10 -0
@@ -0,0 +1,10 @@
+--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c	2016-01-08 21:16:11.000000000 +0100
++++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c	2016-03-10 10:47:15.209992555 +0100
+@@ -208,6 +208,7 @@
+ 	.name		= "debugss",
+ 	.class		= &am33xx_debugss_hwmod_class,
+ 	.clkdm_name	= "l3_aon_clkdm",
++	.flags		= (HWMOD_INIT_NO_IDLE|HWMOD_INIT_NO_RESET), /* keep debugSS clock alive for JTAG */
+ 	.main_clk	= "trace_clk_div_ck",
+ 	.prcm		= {
+ 		.omap4	= {
board/ti/am335x-evm/patches/uboot/0001-mmc-force-1bit-bus-width.patch new file +0 -0
new file mode 100644
index 0000000..ecaabaa

Ditto: missing description + Signed-off-by.

Quoted 104 lines
board/ti/am335x-evm/patches/uboot/0001-mmc-force-1bit-bus-width.patch new file +29 -0
@@ -0,0 +1,29 @@
+diff -Naur a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
+--- a/drivers/mmc/mmc.c	2016-05-16 16:40:32.000000000 +0200
++++ b/drivers/mmc/mmc.c	2016-07-11 13:23:13.235880737 +0200
+@@ -1351,25 +1351,6 @@
+ 	mmc->card_caps &= mmc->cfg->host_caps;
+ 
+ 	if (IS_SD(mmc)) {
+-		if (mmc->card_caps & MMC_MODE_4BIT) {
+-			cmd.cmdidx = MMC_CMD_APP_CMD;
+-			cmd.resp_type = MMC_RSP_R1;
+-			cmd.cmdarg = mmc->rca << 16;
+-
+-			err = mmc_send_cmd(mmc, &cmd, NULL);
+-			if (err)
+-				return err;
+-
+-			cmd.cmdidx = SD_CMD_APP_SET_BUS_WIDTH;
+-			cmd.resp_type = MMC_RSP_R1;
+-			cmd.cmdarg = 2;
+-			err = mmc_send_cmd(mmc, &cmd, NULL);
+-			if (err)
+-				return err;
+-
+-			mmc_set_bus_width(mmc, 4);
+-		}
+-
+ 		if (mmc->card_caps & MMC_MODE_HS)
+ 			mmc->tran_speed = 50000000;
+ 		else
board/ti/am335x-evm/post-image.sh new file +22 -0
new file mode 100755
index 0000000..6b16f40
@@ -0,0 +1,22 @@
+#!/bin/sh
+# post-image.sh for ti am335x-evm
+# based on post-image from beagleboard
+# 2014, Marcin Jabrzyk <[email protected]>
+# 2016, Lothar Felten <[email protected]>
+
+BOARD_DIR="$(dirname $0)"
+
+# copy the uEnv.txt to the output/images directory
+cp board/ti/am335x-evm/uEnv.txt $BINARIES_DIR/uEnv.txt
+
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+    --rootpath "${TARGET_DIR}" \
+    --tmppath "${GENIMAGE_TMP}" \
+    --inputpath "${BINARIES_DIR}" \
+    --outputpath "${BINARIES_DIR}" \
+    --config "${GENIMAGE_CFG}"
board/ti/am335x-evm/readme.txt new file +40 -0
new file mode 100644
index 0000000..f25c8ea
@@ -0,0 +1,62 @@
+Texas Instuments AM335x Evaluation Module (TMDXEVM3358)
+
+Description
+===========
+
+This configuration will build a complete image for the AM335x-EVM, including
+SGX530 graphics acceleation support (only included in the 3354/8/9) and Qt5.
+
+The configuration is based on the ti-processor-sdk-02.00.00.00.
+
+Device tree blobs for the evm-sk, and beaglebone variants are built too.
+
+
+How to build it
+===============
+
+Select the default configuration for the am335x-evm target:
+$ make am335x-evm_defconfig
+
+Optional: modify the configuration:
+$ make menuconfig
+
+Build:
+$ make
+
+
+Result of the build
+===================
+output/images/
+??? am335x-boneblack.dtb
+??? am335x-bone.dtb
+??? am335x-evm.dtb
+??? am335x-evmsk.dtb
+??? boot.vfat
+??? MLO
+??? rootfs.ext2
+??? rootfs.tar
+??? sdcard.img
+??? u-boot.img
+??? uEnv.txt

board/ti/am335x-evm/readme.txt line 50

Quoted 10 lines
board/ti/am335x-evm/readme.txt new file +10 -0
+??? zImage
+
+To copy the image file to the sdcard use dd:
+dd if=output/images/sdcard.img of=/dev/XXX
+
+
+Tested hardware
+===============
+am335x-evm (rev. 1.1A):
+/usr/bin/sha512sum

Testing sha512sum doesn't seem like a very useful test.

Quoted 27 lines
board/ti/am335x-evm/readme.txt new file +12 -0
+/usr/lib/qt/examples/opengl/hellowindow/hellowindow 
+/usr/bin/OGLES2MagicLantern
+
+beagleboneblack (rev. A5A): 
+/usr/bin/sha512sum
+/usr/lib/qt/examples/opengl/hellowindow/hellowindow 
+/usr/bin/OGLES2MagicLantern
+
+beaglebone (rev. A6):
+/usr/bin/sha512sum
+
+2016, Lothar Felten <[email protected]>
board/ti/am335x-evm/uEnv.txt new file +3 -0
new file mode 100644
index 0000000..e09fff5
@@ -0,0 +1,3 @@
+bootpart=0:1
+bootdir=
+uenvcmd=run loadimage;run loadramdisk;run findfdt;run loadfdt;run ramboot
configs/am335x-evm_defconfig new file +0 -0
new file mode 100644
index 0000000..a5c0edf

configs/am335x-evm_defconfig line 5

Quoted 5 lines
configs/am335x-evm_defconfig new file +5 -0
@@ -0,0 +1,36 @@
+BR2_arm=y
+BR2_cortex_a8=y
+BR2_KERNEL_HEADERS_4_1=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y

Why normally want a minimal default toolchain, i.e uClibc and no C++.

configs/am335x-evm_defconfig line 7

Quoted 2 lines
configs/am335x-evm_defconfig new file +2 -0
+BR2_ENABLE_LOCALE_PURGE=y
+BR2_ENABLE_LOCALE_WHITELIST="C en_US"

Leave the default for this.

configs/am335x-evm_defconfig line 9

Quoted 2 lines
configs/am335x-evm_defconfig new file +2 -0
+BR2_TARGET_GENERIC_HOSTNAME="TI am335x-evm"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y

Ditto.

configs/am335x-evm_defconfig line 16

Quoted 7 lines
configs/am335x-evm_defconfig new file +7 -0
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am335x-evm/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.ti.com/processor-sdk/processor-sdk-linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="52c4aa7cdb93d61f8008f380135beaf7b8fa6593"
+BR2_LINUX_KERNEL_PATCH="board/ti/am335x-evm/patches/linux/"

You could use BR2_GLOBAL_PATCH_DIR instead, to group the Linux and U-Boot patches.

configs/am335x-evm_defconfig line 27

Quoted 11 lines
configs/am335x-evm_defconfig new file +11 -0
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/ti/am335x-evm/kernel.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="am335x-evm am335x-bone am335x-boneblack am335x-evmsk"
+BR2_PACKAGE_FBV=y
+BR2_PACKAGE_QT5=y
+BR2_PACKAGE_QT5BASE_LICENSE_APPROVED=y
+BR2_PACKAGE_QT5BASE_EXAMPLES=y
+BR2_PACKAGE_QT5BASE_EGLFS=y
+BR2_PACKAGE_QT5QUICKCONTROLS=y
+BR2_PACKAGE_TI_SGX_DEMOS=y

We want our defconfigs to be minimal ones, i.e without any special package enabled.

configs/am335x-evm_defconfig line 30

Quoted 3 lines
configs/am335x-evm_defconfig new file +3 -0
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y

Please indicate a specific version of U-Boot (use the "Custom version") possibility.

configs/am335x-evm_defconfig line 36

Quoted 6 lines
configs/am335x-evm_defconfig new file +6 -0
+BR2_TARGET_UBOOT_PATCH="board/ti/am335x-evm/patches/uboot"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am335x_evm"
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="MLO"
+BR2_PACKAGE_HOST_GENIMAGE=y

You also need:

BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_MTOOLS=y

because your genimage configuration is building a FAT partition.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com