Skip to contentSkip to conversation

configs: Add ts4900 basic board support

PATCH New Mathieu Audat 3 participants 7 messages Sep 17, 2016 – Sep 22, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover configs: Add ts4900 basic board support

This serie of patches add the support for the TS-4900 SoM manufactured by Technologic Systems based on an i.MX6 SoC from Freescale.

Changes in v2:
- add a paragraph in the readme about the pre-flashed bootloader
- clean defconfig
- improve help text in ts4900-fpga package
- add a locally calculated sha256 for ts4900-fpga.bin
- ts4900-fpga version is now 0930 instead of 0326
- copy bitstream during target stage instead of image stage

Mathieu Audat (2):
ts4900-fpga: add ts4900-fpga package
configs: add defconfig for TS-4900

 board/technologic/ts4900/genimage.cfg  | 10 +++++++
 board/technologic/ts4900/post-image.sh | 20 ++++++++++++++
 board/technologic/ts4900/readme.txt    | 50 ++++++++++++++++++++++++++++++++++
 configs/ts4900_defconfig               | 19 +++++++++++++
 package/Config.in                      |  1 +
 package/ts4900-fpga/Config.in          | 11 ++++++++
 package/ts4900-fpga/ts4900-fpga.hash   |  5 ++++
 package/ts4900-fpga/ts4900-fpga.mk     | 21 ++++++++++++++
 8 files changed, 137 insertions(+)
 create mode 100644 board/technologic/ts4900/genimage.cfg
 create mode 100755 board/technologic/ts4900/post-image.sh
 create mode 100644 board/technologic/ts4900/readme.txt
 create mode 100644 configs/ts4900_defconfig
 create mode 100644 package/ts4900-fpga/Config.in
 create mode 100644 package/ts4900-fpga/ts4900-fpga.hash
 create mode 100644 package/ts4900-fpga/ts4900-fpga.mk
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/2 ts4900-fpga: add ts4900-fpga package

This package is responsible from downloading and deploying bitstream for TS-4900's FPGA. It implements clocks, UART MUX, and GPIOs. One of these GPIOs is used to enable the wifi module.

It is loaded by U-Boot during the boot sequence, the default U-boot script expects to find it in the /boot folder.

---
 package/Config.in                    |  1 +
 package/ts4900-fpga/Config.in        | 11 +++++++++++
 package/ts4900-fpga/ts4900-fpga.hash |  5 +++++
 package/ts4900-fpga/ts4900-fpga.mk   | 22 ++++++++++++++++++++++
 4 files changed, 39 insertions(+)
 create mode 100644 package/ts4900-fpga/Config.in
 create mode 100644 package/ts4900-fpga/ts4900-fpga.hash
 create mode 100644 package/ts4900-fpga/ts4900-fpga.mk
package/Config.in +1 -0
index 1e51a45..a20a84c 100644
@@ -334,6 +334,7 @@ menu "Firmware"
 	source "package/linux-firmware/Config.in"
 	source "package/rpi-firmware/Config.in"
 	source "package/sunxi-boards/Config.in"
+	source "package/ts4900-fpga/Config.in"
 	source "package/ux500-firmware/Config.in"
 	source "package/wilc1000-firmware/Config.in"
 	source "package/zd1211-firmware/Config.in"
package/ts4900-fpga/Config.in new file +11 -0
new file mode 100644
index 0000000..8711718
@@ -0,0 +1,11 @@
+menuconfig BR2_PACKAGE_TS4900_FPGA
+	bool "ts4900-fpga"
+	help
+	  TS-4900's FPGA implements clocks, UART MUX, and GPIOs. One of these
+	  GPIOs is used to enable the wifi module.
+
+	  It is loaded by U-Boot during the boot sequence, the default U-boot
+	  script expects to find it in the /boot folder.
+
+	  http://wiki.embeddedarm.com/wiki/TS-4900#FPGA_Changelog
+
package/ts4900-fpga/ts4900-fpga.hash new file +5 -0
new file mode 100644
index 0000000..513d569
@@ -0,0 +1,5 @@
+# From ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/fpga/ts4900-fpga-20150930.bin.md5
+md5 bf93c03ef914cf008287c8cd60781cc8  ts4900-fpga-20150930.bin
+
+# Locally calculated
+sha256 242ac6a90bea9a95c937ea8952cdc9b02f543cea24a0359bed66a408a6dd8bf9 ts4900-fpga-20150930.bin
\ No newline at end of file
package/ts4900-fpga/ts4900-fpga.mk new file +22 -0
new file mode 100644
index 0000000..c2b5215
@@ -0,0 +1,22 @@
+################################################################################
+#
+# ts4900-fpga
+#
+################################################################################
+
+TS4900_FPGA_VERSION = 20150930
+TS4900_FPGA_SOURCE = ts4900-fpga-$(TS4900_FPGA_VERSION).bin
+TS4900_FPGA_SITE = ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4900-linux/fpga
+# No license file provided, Yocto recipe from the vendor claims MIT.
+# https://github.com/embeddedarm/meta-ts/blob/f31860f1204b64f765a5380d3b93a2cf18234f90/recipes-extras/ts4900-fpga/ts4900-fpga.bb#L6
+
+TS4900_FPGA_INSTALL_IMAGES = NO
+TS4900_FPGA_INSTALL_TARGET = YES
+TS4900_FPGA_EXTRACT_CMDS =
+
+define TS4900_FPGA_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/boot
+	$(INSTALL) -m 0644 $(DL_DIR)/$(TS4900_FPGA_SOURCE) $(TARGET_DIR)/boot/ts4900-fpga.bin
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 1/2 ts4900-fpga: add ts4900-fpga package

Hello,

Quoted 8 lines · Mathieu Audat

This package is responsible from downloading and deploying bitstream for TS-4900's FPGA. It implements clocks, UART MUX, and GPIOs. One of these GPIOs is used to enable the wifi module.

It is loaded by U-Boot during the boot sequence, the default U-boot script expects to find it in the /boot folder.

Quoted 9 lines
---
 package/Config.in                    |  1 +
 package/ts4900-fpga/Config.in        | 11 +++++++++++
 package/ts4900-fpga/ts4900-fpga.hash |  5 +++++
 package/ts4900-fpga/ts4900-fpga.mk   | 22 ++++++++++++++++++++++
 4 files changed, 39 insertions(+)
 create mode 100644 package/ts4900-fpga/Config.in
 create mode 100644 package/ts4900-fpga/ts4900-fpga.hash
 create mode 100644 package/ts4900-fpga/ts4900-fpga.mk

Applied to master with the following changes:

[Thomas:
- Use "config" instead of "menuconfig" since there's a single option and no sub-options.
- Add BR2_arm dependency, since it's only used on a specific i.MX6 platform.
- Implement TS4900_FPGA_EXTRACT_CMDS that copy the file to the package build directory $(@D)
- Change the install command to copy from $(@D) instead of from $(DL_DIR)
- Change the install command to remove the 'mkdir -p $(TARGET_DIR)/boot' and instead just use the -D option of the install program that creates the destination directory if it doesn't exist.]

Thanks!

Thomas

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

PATCH v2 2/2 configs: add defconfig for TS-4900

In reply to Mathieu Audat

The TS-4900 uses a custom Linux 4.X from Technologic Systems:
https://github.com/embeddedarm/linux-3.10.17-imx6/tree/imx_4.1.15_1.0.0_ga
Indeed, it is not supported by mainline Linux but this work is ongoing.

This patch is inspired by a previous work for the TS-4800. A post image script is provided to generate an image that can be directly written to an SD card. It also adds an fpga wifi module.

---
 board/technologic/ts4900/genimage.cfg  | 10 +++++++
 board/technologic/ts4900/post-image.sh | 20 ++++++++++++++
 board/technologic/ts4900/readme.txt    | 50 ++++++++++++++++++++++++++++++++++
 configs/ts4900_defconfig               | 19 +++++++++++++
 4 files changed, 99 insertions(+)
 create mode 100644 board/technologic/ts4900/genimage.cfg
 create mode 100755 board/technologic/ts4900/post-image.sh
 create mode 100644 board/technologic/ts4900/readme.txt
 create mode 100644 configs/ts4900_defconfig
board/technologic/ts4900/genimage.cfg new file +10 -0
new file mode 100644
index 0000000..7e580eb
@@ -0,0 +1,10 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext2"
+		size = 256M
+	}
+}
board/technologic/ts4900/post-image.sh new file +20 -0
new file mode 100755
index 0000000..3ce6bc1
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright (C) 2015-2016 Savoir-Faire Linux
+# Post image generation script.
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG=$BOARD_DIR/genimage.cfg
+GENIMAGE_TMP=$BUILD_DIR/.genimage_tmp
+
+rm -rf $GENIMAGE_TMP
+
+${HOST_DIR}/usr/bin/genimage \
+        --config ${GENIMAGE_CFG} \
+        --rootpath $TARGET_DIR \
+        --tmppath $GENIMAGE_TMP \
+        --inputpath $BINARIES_DIR \
+        --outputpath $BINARIES_DIR
+
+exit $?
+
board/technologic/ts4900/readme.txt new file +50 -0

50 lines not on this page · raw message

configs/ts4900_defconfig new file +19 -0
new file mode 100644
index 0000000..7f1c0cd
@@ -0,0 +1,19 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_KERNEL_HEADERS_AS_KERNEL=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="$(TOPDIR)/board/technologic/ts4900/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/embeddedarm/linux-3.10.17-imx6.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="70d1e85a22879e27cc9e36384438d5a9793e44b0"
+BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
+BR2_LINUX_KERNEL_UIMAGE=y
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x10008000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-ts4900"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_PACKAGE_TS4900_FPGA=y
+BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 1 line
1.9.1
#4 lore raw

PATCH v2 2/2 configs: add defconfig for TS-4900

Hello,

Quoted 9 lines · Mathieu Audat

The TS-4900 uses a custom Linux 4.X from Technologic Systems:
https://github.com/embeddedarm/linux-3.10.17-imx6/tree/imx_4.1.15_1.0.0_ga
Indeed, it is not supported by mainline Linux but this work is ongoing.

This patch is inspired by a previous work for the TS-4800. A post image script is provided to generate an image that can be directly written to an SD card. It also adds an fpga wifi module.

Thanks for this contribution, I've applied your patch, after doing some tweaks. See below.

Quoted 15 lines
board/technologic/ts4900/post-image.sh new file +9 -0
new file mode 100755
index 0000000..3ce6bc1
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright (C) 2015-2016 Savoir-Faire Linux
+# Post image generation script.
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_CFG=$BOARD_DIR/genimage.cfg
+GENIMAGE_TMP=$BUILD_DIR/.genimage_tmp
+

board/technologic/ts4900/post-image.sh line 19

Quoted 10 lines
board/technologic/ts4900/post-image.sh new file +10 -0
+rm -rf $GENIMAGE_TMP
+
+${HOST_DIR}/usr/bin/genimage \
+        --config ${GENIMAGE_CFG} \
+        --rootpath $TARGET_DIR \
+        --tmppath $GENIMAGE_TMP \
+        --inputpath $BINARIES_DIR \
+        --outputpath $BINARIES_DIR
+
+exit $?

This exit $? is not needed, so I removed it.

board/technologic/ts4900/post-image.sh

Quoted 4 lines
board/technologic/ts4900/post-image.sh new file +4 -0
+The bootloader comes pre-flashed on the board on an SPI flash. Since updating
+the bootloader is risky and not trivial, it is not included in the Buildroot
+defconfig. Refer to http://wiki.embeddedarm.com/wiki/TS-4900#U-Boot for details
+on which U-Boot config to use and how to flash it.

I don't really like the fact that Buildroot doesn't rebuild the entire system. Why is it "risky" to update the bootloader? It's an i.MX6 processor, so you have imx-usb-loader to recover the board whatever happens. I believe Buildroot defconfigs should rebuild all the software components that runs on the board.

configs/ts4900_defconfig line 5

Quoted 11 lines
configs/ts4900_defconfig new file +5 -0
new file mode 100644
index 0000000..7f1c0cd
@@ -0,0 +1,19 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_KERNEL_HEADERS_AS_KERNEL=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y

I don't know how you generate this defconfig, but this combination of options is wrong, and causes kconfig to complain:

thomas at skate:~/projets/buildroot (master)$ make ts4900_defconfig /home/thomas/projets/buildroot/configs/ts4900_defconfig:4:warning: override: BR2_KERNEL_HEADERS_AS_KERNEL changes choice state

Only the last of those three options was needed to make things work.

configs/ts4900_defconfig line 6

Quoted 1 line
configs/ts4900_defconfig new file +1 -0
+BR2_ROOTFS_POST_IMAGE_SCRIPT="$(TOPDIR)/board/technologic/ts4900/post-image.sh"

$(TOPDIR) not needed, the top-level Buildroot source directory is always the location from which paths are interpreted.

configs/ts4900_defconfig line 19

Quoted 13 lines
configs/ts4900_defconfig new file +13 -0
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/embeddedarm/linux-3.10.17-imx6.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="70d1e85a22879e27cc9e36384438d5a9793e44b0"
+BR2_LINUX_KERNEL_DEFCONFIG="imx_v7"
+BR2_LINUX_KERNEL_UIMAGE=y
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x10008000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-ts4900"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_PACKAGE_TS4900_FPGA=y
+BR2_PACKAGE_HOST_GENIMAGE=y

I've applied with those minor tweaks.

Thanks!

Thomas

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

PATCH v2 2/2 configs: add defconfig for TS-4900

Quoted 10 lines · Thomas Petazzoni
Quoted 4 lines

+The bootloader comes pre-flashed on the board on an SPI flash. Since updating

board/technologic/ts4900/readme.txt line 50

Quoted 3 lines
board/technologic/ts4900/readme.txt new file +3 -0
+the bootloader is risky and not trivial, it is not included in the Buildroot
+defconfig. Refer to http://wiki.embeddedarm.com/wiki/TS-4900#U-Boot for details
+on which U-Boot config to use and how to flash it.

I don't really like the fact that Buildroot doesn't rebuild the entire system. Why is it "risky" to update the bootloader? It's an i.MX6 processor, so you have imx-usb-loader to recover the board whatever happens. I believe Buildroot defconfigs should rebuild all the software components that runs on the board.

As discussed in v1 of this patch, the problem is that this is a defconfig for a
module. Several hardware revisions of this module exist with different DDR chips, which require a different U-Boot config. So we'd need several buildroot defconfigs for the different module revisions. And it's not easy to distinguish between them.

In addition, recovery through USB requires a specific baseboard that sets the
boot mode pins in a way that you actually boot from USB. Not everybody necessary has this baseboard.

For these reasons, I agreed with Mathieu that it was OK to skip the bootloader.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH v2 2/2 configs: add defconfig for TS-4900

Hello,

Quoted 11 lines · Arnout Vandecappelle

As discussed in v1 of this patch, the problem is that this is a defconfig for a
module. Several hardware revisions of this module exist with different DDR chips, which require a different U-Boot config. So we'd need several buildroot defconfigs for the different module revisions. And it's not easy to distinguish between them.

In addition, recovery through USB requires a specific baseboard that sets the
boot mode pins in a way that you actually boot from USB. Not everybody necessary has this baseboard.

For these reasons, I agreed with Mathieu that it was OK to skip the bootloader.

OK, fine with me. Thanks for the explanation!

Thomas

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