Skip to contentSkip to conversation

ARM: ts4800: add basic board support

PATCH New Patrick Keroulas 2 participants 6 messages Jul 15, 2016 – Jul 20, 2016

lore
Share & tools
lore
#0 lore raw

v7 cover ARM: ts4800: add basic board support

This patchset adds support for the TS-4800 SoM manufactured by Technologic Systems based on the Freescale i.MX515 SoC.

Changes v6->v7:
- moved package to boot/
Changes v5->v6:
- removed mbrboot source as it was published by Technologic System
- removed custom U-boot v2016.07 which is now the default version in BR
Changes v4->v5:
- remove the unnecessary section from mbrboot binary to fix build
with Linaro toolchain
- cleanup Makefile
- delete all the unnecessary defconfig options

Patrick Keroulas (2):
boot: add ts4800-mbrboot package
configs: add defconfig for TS-4800

 board/technologic/ts4800/genimage.cfg   | 37 +++++++++++++++++++++++++++++++++
 board/technologic/ts4800/linux.fragment |  3 +++
 board/technologic/ts4800/post-image.sh  | 22 ++++++++++++++++++++
 boot/Config.in                          |  1 +
 boot/ts4800-mbrboot/Config.in           |  7 +++++++
 boot/ts4800-mbrboot/ts4800-mbrboot.mk   | 20 ++++++++++++++++++
 configs/ts4800_defconfig                | 19 +++++++++++++++++
 7 files changed, 109 insertions(+)
 create mode 100644 board/technologic/ts4800/genimage.cfg
 create mode 100644 board/technologic/ts4800/linux.fragment
 create mode 100755 board/technologic/ts4800/post-image.sh
 create mode 100644 boot/ts4800-mbrboot/Config.in
 create mode 100644 boot/ts4800-mbrboot/ts4800-mbrboot.mk
 create mode 100644 configs/ts4800_defconfig
Signature · 1 line
1.9.1
#1 lore raw

PATCH v7 1/2 boot: add ts4800-mbrboot package

This MBR routine is based on TS' original bootloader. It is loaded by the bootrom stored in the companion FPGA, and chainloads an executable located at the beginning of the first non-fs (0xda) partition.

---
Changes v6->v7:
- moved package to boot/
Changes v5->v6:
- removed mbrboot source as it was published by Technologic System
Changes v4->v5:
- remove the unnecessary section from mbrboot binary to fix build
with Linaro toolchain
- cleanup Makefile

 boot/Config.in                        |  1 +
 boot/ts4800-mbrboot/Config.in         |  7 +++++++
 boot/ts4800-mbrboot/ts4800-mbrboot.mk | 20 ++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 boot/ts4800-mbrboot/Config.in
 create mode 100644 boot/ts4800-mbrboot/ts4800-mbrboot.mk
boot/Config.in +1 -0
index cd10cd8..677e5f0 100644
@@ -13,6 +13,7 @@ source "boot/lpc32xxcdl/Config.in"
 source "boot/mxs-bootlets/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
+source "boot/ts4800-mbrboot/Config.in"
 source "boot/uboot/Config.in"
 source "boot/xloader/Config.in"
 
boot/ts4800-mbrboot/Config.in new file +7 -0
new file mode 100644
index 0000000..b63e2fc
@@ -0,0 +1,7 @@
+config BR2_TARGET_TS4800_MBRBOOT
+	bool "ts4800-mbrboot"
+	depends on BR2_ARM_CPU_ARMV7A
+	help
+	  1st level bootloader for TS4800 board
+
+	  https://github.com/embeddedarm/ts4800-mbrboot
boot/ts4800-mbrboot/ts4800-mbrboot.mk new file +20 -0
new file mode 100644
index 0000000..91649d6
@@ -0,0 +1,20 @@
+################################################################################
+#
+# ts4800-mbrboot
+#
+################################################################################
+
+TS4800_MBRBOOT_VERSION = cf8f7072ed5a4a4e48fcb9841b2e31e519ec5dca
+TS4800_MBRBOOT_SITE = $(call github,embeddedarm,ts4800-mbrboot,$(TS4800_MBRBOOT_VERSION))
+TS4800_MBRBOOT_LICENSE = BSD-2c
+TS4800_MBRBOOT_LICENSE_FILES = LICENSE
+
+define TS4800_MBRBOOT_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define TS4800_MBRBOOT_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/mbrboot.bin $(BINARIES_DIR)/mbrboot.bin
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH v7 1/2 boot: add ts4800-mbrboot package

Hello,

I've applied, after doing some minor changes, see below.

Quoted 3 lines · Patrick Keroulas
 boot/Config.in                        |  1 +
 boot/ts4800-mbrboot/Config.in         |  7 +++++++
 boot/ts4800-mbrboot/ts4800-mbrboot.mk | 20 ++++++++++++++++++++

A hash file was missing, so I've added one.

boot/ts4800-mbrboot/ts4800-mbrboot.mk line 18

Quoted 3 lines
boot/ts4800-mbrboot/ts4800-mbrboot.mk new file +3 -0
+define TS4800_MBRBOOT_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/mbrboot.bin $(BINARIES_DIR)/mbrboot.bin
+endef

You're installing to $(BINARIES_DIR), not $(TARGET_DIR), so using INSTALL_TARGET_CMDS is not correct (it works, but it's not correct).

I've changed that to use INSTALL_IMAGES_CMDS (and therefore I've also added INSTALL_IMAGES = YES).

Thanks,

Thomas

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

PATCH v7 1/2 boot: add ts4800-mbrboot package

Thomas, Peter and Yann,

Thanks a lot for your time/effort.
Cheers.

--
Patrick Keroulas
Consultant en logiciel libre,
Savoir-faire Linux Inc.

7275 Saint-Urbain, bureau 200
Montr?al, Qu?bec H2R 2Y5
t?l: (514) 276-5468 ext. 167
fax: (514) 276-5465
_____________________

Quoted 30 lines · Thomas Petazzoni thomas.petazzoni at free-electrons.com

Hello,

I've applied, after doing some minor changes, see below.

Quoted 3 lines · Patrick Keroulas
 boot/Config.in                        |  1 +
 boot/ts4800-mbrboot/Config.in         |  7 +++++++
 boot/ts4800-mbrboot/ts4800-mbrboot.mk | 20 ++++++++++++++++++++

A hash file was missing, so I've added one.

boot/ts4800-mbrboot/ts4800-mbrboot.mk line 18

Quoted 3 lines
boot/ts4800-mbrboot/ts4800-mbrboot.mk new file +3 -0
+define TS4800_MBRBOOT_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/mbrboot.bin $(BINARIES_DIR)/mbrboot.bin
+endef

You're installing to $(BINARIES_DIR), not $(TARGET_DIR), so using INSTALL_TARGET_CMDS is not correct (it works, but it's not correct).

I've changed that to use INSTALL_IMAGES_CMDS (and therefore I've also added INSTALL_IMAGES = YES).

Thanks,

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

#4 lore raw

PATCH v7 2/2 configs: add defconfig for TS-4800

In reply to Patrick Keroulas

The TS-4800 is supported by mainline Linux as of 4.5 and by U-boot as of v2016-07.

The config requires the custom ts4800-mbrboot routine.

A post-image script is provided to generate an image that can be "dd" directly to an SD card.

More details on the board here:
http://wiki.embeddedarm.com/wiki/TS-4800

---
Changes v6->v7:
- moved package to boot/
Changes v5->v6:
- removed custom U-boot v2016.07 which is now the default version in BR
Changes v4->v5:
with Linaro toolchain
- delete all the unnecessary defconfig options

 board/technologic/ts4800/genimage.cfg   | 37 +++++++++++++++++++++++++++++++++
 board/technologic/ts4800/linux.fragment |  3 +++
 board/technologic/ts4800/post-image.sh  | 22 ++++++++++++++++++++
 configs/ts4800_defconfig                | 19 +++++++++++++++++
 4 files changed, 81 insertions(+)
 create mode 100644 board/technologic/ts4800/genimage.cfg
 create mode 100644 board/technologic/ts4800/linux.fragment
 create mode 100755 board/technologic/ts4800/post-image.sh
 create mode 100644 configs/ts4800_defconfig
board/technologic/ts4800/genimage.cfg new file +37 -0
new file mode 100644
index 0000000..2070cc5
@@ -0,0 +1,37 @@
+image boot.vfat {
+        vfat {
+                files = {
+                        "zImage",
+                        "imx51-ts4800.dtb"
+                }
+        }
+        size = 8M
+}
+
+image sdcard.img {
+        hdimage {
+        }
+
+        partition mbrboot {
+                in-partition-table = "no"
+                image = "mbrboot.bin"
+                offset = 0
+        }
+
+        partition uboot {
+                partition-type = 0xda
+                image = "u-boot.bin"
+                size = 256k
+        }
+
+        partition kernel {
+                partition-type = 0xC
+                image = "boot.vfat"
+        }
+
+        partition rootfs {
+                partition-type = 0x83
+                image = "rootfs.ext4"
+                size = 256M
+        }
+}
board/technologic/ts4800/linux.fragment new file +3 -0
new file mode 100644
index 0000000..0451c86
@@ -0,0 +1,3 @@
+CONFIG_TOUCHSCREEN_TS4800=y
+CONFIG_TS4800_WATCHDOG=y
+CONFIG_TS4800_IRQ=y
board/technologic/ts4800/post-image.sh new file +22 -0
new file mode 100755
index 0000000..bbfea28
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright (C) 2015 Savoir-faire Linux
+# Post image generation script.
+
+IDIR="$1"
+
+BOARD_DIR="board/technologic/ts4800"
+GENIMAGE_CFG_DEFAULT="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_CFG=${GENIMAGE_CFG_DEFAULT}
+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 $IDIR \
+        --outputpath $IDIR
+
+exit $?
configs/ts4800_defconfig new file +19 -0
new file mode 100644
index 0000000..0dd3e84
@@ -0,0 +1,19 @@
+BR2_arm=y
+BR2_cortex_a8=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/technologic/ts4800/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.6.3"
+BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(TOPDIR)/board/technologic/ts4800/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx51-ts4800"
+BR2_PACKAGE_BUSYBOX_WATCHDOG=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_TS4800_MBRBOOT=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="ts4800"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
1.9.1
#5 lore raw

PATCH v7 2/2 configs: add defconfig for TS-4800

Hello,

Quoted 5 lines · Patrick Keroulas

The TS-4800 is supported by mainline Linux as of 4.5 and by U-boot as of v2016-07.

The config requires the custom ts4800-mbrboot routine.

Quoted 8 lines

A post-image script is provided to generate an image that can be "dd" directly to an SD card.

More details on the board here:
http://wiki.embeddedarm.com/wiki/TS-4800

I was about to apply this patch, but there's one big thing missing: a readme.txt file. We have one for each defconfig we support, to tell the user how to use the defconfig from Buildroot: how to flash it and how to boot the board with it.

Also, a few more comments below.

board/technologic/ts4800/post-image.sh line 6

Quoted 12 lines
board/technologic/ts4800/post-image.sh new file +6 -0
new file mode 100755
index 0000000..bbfea28
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright (C) 2015 Savoir-faire Linux
+# Post image generation script.
+
+IDIR="$1"

Not needed.

board/technologic/ts4800/post-image.sh line 8

Quoted 2 lines
board/technologic/ts4800/post-image.sh new file +2 -0
+
+BOARD_DIR="board/technologic/ts4800"

Use:

BOARD_DIR="$(dirname $0)"

board/technologic/ts4800/post-image.sh line 10

Quoted 2 lines
board/technologic/ts4800/post-image.sh new file +2 -0
+GENIMAGE_CFG_DEFAULT="${BOARD_DIR}/genimage.cfg"
+GENIMAGE_CFG=${GENIMAGE_CFG_DEFAULT}

Why do you have two variables here? Just define GENIMAGE_CFG and that's enough.

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

Quoted 9 lines
board/technologic/ts4800/post-image.sh new file +9 -0
+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 $IDIR \

replace $IDIR by ${BINARIES_DIR}

board/technologic/ts4800/post-image.sh line 20

Quoted 1 line
board/technologic/ts4800/post-image.sh new file +1 -0
+        --outputpath $IDIR

ditto.

configs/ts4800_defconfig line 2

Quoted 10 lines
board/technologic/ts4800/post-image.sh new file +2 -0
+
+exit $?
configs/ts4800_defconfig new file +2 -0
new file mode 100644
index 0000000..0dd3e84
@@ -0,0 +1,19 @@
+BR2_arm=y
+BR2_cortex_a8=y

Please make it explicit with kernel headers are being used:

BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_6=y

configs/ts4800_defconfig line 8

Quoted 6 lines
configs/ts4800_defconfig new file +6 -0
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/technologic/ts4800/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.6.3"
+BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(TOPDIR)/board/technologic/ts4800/linux.fragment"

$(TOPDIR)/ not needed.

configs/ts4800_defconfig line 16

Quoted 8 lines
configs/ts4800_defconfig new file +8 -0
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx51-ts4800"
+BR2_PACKAGE_BUSYBOX_WATCHDOG=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_TS4800_MBRBOOT=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="ts4800"

Please specify the exact U-Boot version being used:

+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.07"

Thanks!

Thomas

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