Skip to contentSkip to conversation

ARM: ts4800: add basic board support

PATCH Superseded Patrick Keroulas 2 participants 8 messages Jun 9, 2016 – Jul 8, 2016

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 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.

Patrick Keroulas (2):
ts4800-mbrboot: new 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   | 23 ++++++++++
 configs/ts4800_defconfig                 | 30 +++++++++++++
 package/Config.in                        |  1 +
 package/ts4800-mbrboot/Config.in         |  5 +++
 package/ts4800-mbrboot/src/LICENSE       | 25 +++++++++++
 package/ts4800-mbrboot/src/Makefile      | 21 ++++++++++
 package/ts4800-mbrboot/src/mbrboot.c     | 72 ++++++++++++++++++++++++++++++++
 package/ts4800-mbrboot/src/mbrboot.ld    | 56 +++++++++++++++++++++++++
 package/ts4800-mbrboot/ts4800-mbrboot.mk | 22 ++++++++++
 11 files changed, 295 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
 create mode 100644 package/ts4800-mbrboot/Config.in
 create mode 100644 package/ts4800-mbrboot/src/LICENSE
 create mode 100644 package/ts4800-mbrboot/src/Makefile
 create mode 100644 package/ts4800-mbrboot/src/mbrboot.c
 create mode 100644 package/ts4800-mbrboot/src/mbrboot.ld
 create mode 100644 package/ts4800-mbrboot/ts4800-mbrboot.mk
Signature · 1 line
1.9.1
#1 lore raw

PATCH v4 1/2 ts4800-mbrboot: new 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.

---
 package/Config.in                        |  1 +
 package/ts4800-mbrboot/Config.in         |  5 +++
 package/ts4800-mbrboot/src/LICENSE       | 25 +++++++++++
 package/ts4800-mbrboot/src/Makefile      | 21 ++++++++++
 package/ts4800-mbrboot/src/mbrboot.c     | 72 ++++++++++++++++++++++++++++++++
 package/ts4800-mbrboot/src/mbrboot.ld    | 56 +++++++++++++++++++++++++
 package/ts4800-mbrboot/ts4800-mbrboot.mk | 22 ++++++++++
 7 files changed, 202 insertions(+)
 create mode 100644 package/ts4800-mbrboot/Config.in
 create mode 100644 package/ts4800-mbrboot/src/LICENSE
 create mode 100644 package/ts4800-mbrboot/src/Makefile
 create mode 100644 package/ts4800-mbrboot/src/mbrboot.c
 create mode 100644 package/ts4800-mbrboot/src/mbrboot.ld
 create mode 100644 package/ts4800-mbrboot/ts4800-mbrboot.mk
package/Config.in +1 -0
index 9d668bf..41b509e 100644
@@ -336,6 +336,7 @@ menu "Firmware"
 	source "package/linux-firmware/Config.in"
 	source "package/rpi-firmware/Config.in"
 	source "package/sunxi-boards/Config.in"
+	source "package/ts4800-mbrboot/Config.in"
 	source "package/ux500-firmware/Config.in"
 	source "package/wilc1000-firmware/Config.in"
 	source "package/zd1211-firmware/Config.in"
package/ts4800-mbrboot/Config.in new file +5 -0
new file mode 100644
index 0000000..556b0ec
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_TS4800_MBRBOOT
+	bool "ts4800-mbrboot"
+	depends on BR2_ARM_CPU_ARMV7A
+	help
+	  This package generate the ts4800 bootloader.
package/ts4800-mbrboot/src/LICENSE new file +25 -0
new file mode 100644
index 0000000..8fa1a84
@@ -0,0 +1,25 @@
+    Copyright (C) 2009, Technologic Systems Inc.
+    Copyright (C) 2016, Savoir-faire Linux Inc.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/ts4800-mbrboot/src/Makefile new file +21 -0
new file mode 100644
index 0000000..b583f9f
@@ -0,0 +1,21 @@
+COPTS=-march=armv7-a -marm -mno-thumb-interwork -Os -mno-apcs-frame -fomit-frame-pointer -ffunction-sections -fdata-sections
+
+.PHONY: all clean
+
+all: mbrboot.bin
+
+mbrboot.bin : mbrboot.elf
+	$(OBJCOPY) -S -O binary mbrboot.elf mbrboot.bin
+
+mbrboot.s : mbrboot.c
+	$(CC) -Wall $(COPTS) -S -c mbrboot.c
+
+mbrboot.o : mbrboot.c
+	$(CC) -Wall $(COPTS) -c mbrboot.c
+
+mbrboot.elf : mbrboot.o mbrboot.ld
+	$(CC) -Wl,--gc-sections -Wl,-static -o mbrboot.elf -nostdlib -Tmbrboot.ld -fno-pic mbrboot.o
+	size mbrboot.elf
+
+clean:
+	rm -f *.elf *.bin *.o
package/ts4800-mbrboot/src/mbrboot.c new file +72 -0

72 lines not on this page · raw message

package/ts4800-mbrboot/src/mbrboot.ld new file +56 -0

56 lines not on this page · raw message

package/ts4800-mbrboot/ts4800-mbrboot.mk new file +22 -0
new file mode 100644
index 0000000..706d191
@@ -0,0 +1,22 @@
+################################################################################
+#
+# ts4800-mbrboot
+#
+################################################################################
+
+TS4800_MBRBOOT_VERSION = 1.0
+TS4800_MBRBOOT_SITE = $(TOPDIR)/package/ts4800-mbrboot/src
+TS4800_MBRBOOT_SITE_METHOD = local
+TS4800_MBRBOOT_LICENSE = BSD-2c
+TS4800_MBRBOOT_LICENSE_FILES = LICENSE
+
+define TS4800_MBRBOOT_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
+		OBJCOPY="$(TARGET_OBJCOPY)" -C $(@D)
+endef
+
+define TS4800_MBRBOOT_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0644 $(@D)/mbrboot.bin $(BINARIES_DIR)/
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH v4 1/2 ts4800-mbrboot: new package

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Patrick" == Patrick Keroulas <[email protected]> writes:

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.

Is there no official upstream location for this so we don't need to carry it inside Buildroot? I know it is small, but still.

Quoted 6 lines
package/ts4800-mbrboot/ts4800-mbrboot.mk new file +0 -0
new file mode 100644
index 0000000..706d191

package/ts4800-mbrboot/ts4800-mbrboot.mk line 9

Quoted 9 lines
package/ts4800-mbrboot/ts4800-mbrboot.mk new file +9 -0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# ts4800-mbrboot
+#
+################################################################################
+
+TS4800_MBRBOOT_VERSION = 1.0
+TS4800_MBRBOOT_SITE = $(TOPDIR)/package/ts4800-mbrboot/src
+TS4800_MBRBOOT_SITE_METHOD = local

That's not really nice. If we have to include it inside buildroot then I would prefer to handle it like we do for E.G. makedevs.

package/ts4800-mbrboot/ts4800-mbrboot.mk line 15

Quoted 6 lines
package/ts4800-mbrboot/ts4800-mbrboot.mk new file +6 -0
+TS4800_MBRBOOT_LICENSE = BSD-2c
+TS4800_MBRBOOT_LICENSE_FILES = LICENSE
+
+define TS4800_MBRBOOT_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
+		OBJCOPY="$(TARGET_OBJCOPY)" -C $(@D)

please use $(TARGET_CONFIGURE_OPTS) instead.

package/ts4800-mbrboot/ts4800-mbrboot.mk line 19

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

We normally use install -D, so I would prefer to use that here as well.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH v4 1/2 ts4800-mbrboot: new package

In reply to Patrick Keroulas
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Patrick" == Patrick Keroulas <[email protected]> writes:

One more issue:

package/ts4800-mbrboot/src/Makefile line 18

Quoted 3 lines
package/ts4800-mbrboot/src/Makefile new file +3 -0
+mbrboot.elf : mbrboot.o mbrboot.ld
+	$(CC) -Wl,--gc-sections -Wl,-static -o mbrboot.elf -nostdlib -Tmbrboot.ld -fno-pic mbrboot.o
+	size mbrboot.elf

With at least our current Linaro external toolchain, this ends up with a 2.4G big file.

It reminds me of a similar problem in the Linux kernel from some years ago:

commit 1e621a8e3752367d4aae78a8ab00a18fb2793f34

Author: Lennert Buytenhek <[email protected]>
Date:   Fri Oct 12 14:38:54 2007 +0100

[ARM] 4600/1: fix kernel build failure with build-id-supporting binutils

Newer versions of binutils support --build-id, which adds an ELF note section called ".note.gnu.build-id" to the output. On the ARM kernel build, because there is no explicit mention of this section in the shipped ld script, this section is placed at vaddr 0x00000000 (whereas the normal kernel text/data typically starts at vaddr 0xc0008000), causing the output of objcopy (Image) to produce a 3G+ file.

This patch makes objcopy strip the .note.gnu.build-id section from the Image file along with all other note sections, which fixes the build.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1e621a8e3752367d4aae78a8ab00a18fb2793f34

And indeed, passing -R .note.gnu.build-id to objcopy fixes it - So that might be worth including.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH v4 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.

u-boot-imx had to be patched and selected as a custom U-Boot until this fork is merged into mainline U-Boot.

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

---
 board/technologic/ts4800/genimage.cfg   | 37 +++++++++++++++++++++++++++++++++
 board/technologic/ts4800/linux.fragment |  3 +++
 board/technologic/ts4800/post-image.sh  | 23 ++++++++++++++++++++
 configs/ts4800_defconfig                | 30 ++++++++++++++++++++++++++
 4 files changed, 93 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..4e47095
@@ -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 = 8M
+        }
+
+        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 +23 -0
new file mode 100755
index 0000000..03b909f
@@ -0,0 +1,23 @@
+#!/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
+
+${HOST_DIR}/usr/bin/genimage \
+        --config ${GENIMAGE_CFG} \
+        --rootpath ${TARGET_DIR} \
+        --tmppath ${GENIMAGE_TMP} \
+        --inputpath $IDIR \
+        --outputpath $IDIR
+
+ret=${?}
+rm -rf ${GENIMAGE_TMP}
+exit ${ret}
+
configs/ts4800_defconfig new file +30 -0
new file mode 100644
index 0000000..ec1778a
@@ -0,0 +1,30 @@
+BR2_arm=y
+BR2_cortex_a8=y
+BR2_ARM_FPU_NEON=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
+BR2_BINUTILS_VERSION_2_24_X=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
+# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/technologic/ts4800/post-image.sh"
+BR2_LINUX_KERNEL=y
+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_PACKAGE_FBTERM=y
+BR2_PACKAGE_TS4800_MBRBOOT=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.denx.de/u-boot-imx.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="d2ba7a6adcef6e6f8c4418c7b0caf9d7ab98a6d4"
+BR2_TARGET_UBOOT_BOARDNAME="ts4800"
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_SQUASHFS=y
Signature · 1 line
1.9.1
#5 lore raw

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

Quoted 40 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Patrick" == Patrick Keroulas <[email protected]> writes:

The TS-4800 is supported by mainline Linux as of 4.5. u-boot-imx had to be patched and selected as a custom U-Boot until this fork is merged into mainline U-Boot.

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

---
 board/technologic/ts4800/genimage.cfg   | 37 +++++++++++++++++++++++++++++++++
 board/technologic/ts4800/linux.fragment |  3 +++
 board/technologic/ts4800/post-image.sh  | 23 ++++++++++++++++++++
 configs/ts4800_defconfig                | 30 ++++++++++++++++++++++++++
 4 files changed, 93 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 +9 -0
new file mode 100644
index 0000000..4e47095
@@ -0,0 +1,37 @@
+image boot.vfat {
+        vfat {
+                files = {
+                        "zImage",
+                        "imx51-ts4800.dtb"
+                }
+        }
+        size = 8M
+}

board/technologic/ts4800/genimage.cfg line 19

Quoted 10 lines
board/technologic/ts4800/genimage.cfg new file +10 -0
+
+image sdcard.img {
+        hdimage {
+        }
+
+        partition mbrboot {
+                in-partition-table = "no"
+                image = "mbrboot.bin"
+                offset = 0
+        }

Does genimage really handle this correctly (E.G. doesn't overwrite the bootloader when it writes the MBR)? I know that we at least postprocess the genimage output for odroid2 where a similar boot logic is used (board/hardkernel/odroidc2/post-image.sh)

board/technologic/ts4800/genimage.cfg line 24

Quoted 5 lines
board/technologic/ts4800/genimage.cfg new file +5 -0
+
+        partition uboot {
+                partition-type = 0xda
+                image = "u-boot.bin"
+                size = 8M

Any particular reason why this is so big?

board/technologic/ts4800/genimage.cfg line 35

Quoted 11 lines
board/technologic/ts4800/genimage.cfg new file +11 -0
+${HOST_DIR}/usr/bin/genimage \
+        --config ${GENIMAGE_CFG} \
+        --rootpath ${TARGET_DIR} \
+        --tmppath ${GENIMAGE_TMP} \
+        --inputpath $IDIR \
+        --outputpath $IDIR
+
+ret=${?}
+rm -rf ${GENIMAGE_TMP}
+exit ${ret}
+

Empty trailing line. Other post-image scripts don't explicitly cleanup the tmppath afterwards (instead do it before calling genimage). Any specific reason to do it differently here?

configs/ts4800_defconfig line 3

Quoted 9 lines
configs/ts4800_defconfig new file +3 -0
new file mode 100644
index 0000000..ec1778a
@@ -0,0 +1,30 @@
+BR2_arm=y
+BR2_cortex_a8=y
+BR2_ARM_FPU_NEON=y

Why? That is normally not a good choice for compatibility reasons.

configs/ts4800_defconfig line 4

Quoted 1 line
configs/ts4800_defconfig new file +1 -0
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y

Why not 4.6?

configs/ts4800_defconfig line 5

Quoted 1 line
configs/ts4800_defconfig new file +1 -0
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y

Our basic defconfigs should be minimal. Why do you want to enable locale support?

configs/ts4800_defconfig line 6

Quoted 1 line
configs/ts4800_defconfig new file +1 -0
+BR2_BINUTILS_VERSION_2_24_X=y

Why? Is this because of the objcopy issue? If so, that would be fixed by the -R .note.gnu.build-id option.

configs/ts4800_defconfig line 7

Quoted 1 line
configs/ts4800_defconfig new file +1 -0
+BR2_TOOLCHAIN_BUILDROOT_CXX=y

Same as for locale.

configs/ts4800_defconfig line 8

Quoted 1 line
configs/ts4800_defconfig new file +1 -0
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y

Any specific reason (E.G. firmware loading or what not) for wanting mdev?

configs/ts4800_defconfig line 10

Quoted 2 lines
configs/ts4800_defconfig new file +2 -0
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y

Are the kernel defaults not ok?

configs/ts4800_defconfig line 17

Quoted 7 lines
configs/ts4800_defconfig new file +7 -0
+# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/technologic/ts4800/post-image.sh"
+BR2_LINUX_KERNEL=y
+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"

You forgot to lock it to 4.5

configs/ts4800_defconfig line 19

Quoted 2 lines
configs/ts4800_defconfig new file +2 -0
+BR2_PACKAGE_BUSYBOX_WATCHDOG=y
+BR2_PACKAGE_FBTERM=y

Are these _REALLY_ needed for anything?

configs/ts4800_defconfig line 29

Quoted 10 lines
configs/ts4800_defconfig new file +10 -0
+BR2_PACKAGE_TS4800_MBRBOOT=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.denx.de/u-boot-imx.git"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="d2ba7a6adcef6e6f8c4418c7b0caf9d7ab98a6d4"
+BR2_TARGET_UBOOT_BOARDNAME="ts4800"
+BR2_PACKAGE_HOST_GENIMAGE=y

You create a fat filesystem with genimage, so you also need:

BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_MTOOLS=y

configs/ts4800_defconfig line 30

Quoted 1 line
configs/ts4800_defconfig new file +1 -0
+BR2_PACKAGE_HOST_SQUASHFS=y

Why? You don't seem to use it anywhere?

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

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

Hello Peter,

Thank you for the review. I've followed every suggestion except two:

Quoted 19 lines · Peter Korsgaard peter at korsgaard.com
Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Patrick" == Patrick Keroulas <[email protected]> writes:

+++ b/board/technologic/ts4800/genimage.cfg

board/technologic/ts4800/genimage.cfg new file +16 -0
@@ -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"
Quoted 8 lines

board/technologic/ts4800/genimage.cfg line 19

Quoted 3 lines
board/technologic/ts4800/genimage.cfg new file +3 -0
+ image = "mbrboot.bin"
+ offset = 0
+ }

Does genimage really handle this correctly (E.G. doesn't overwrite the bootloader when it writes the MBR)? I know that we at least postprocess the genimage output for odroid2 where a similar boot logic is used (board/hardkernel/odroidc2/post-image.sh)

mbrboot.bin size is 238B and genimage writes the partition table @ offset=446 and the bootloader partition @offset=512. So, nothing should be overwritten. The output image was fully tested on target.

Quoted 4 lines

configs/ts4800_defconfig line 19

Quoted 2 lines
configs/ts4800_defconfig new file +2 -0
+BR2_PACKAGE_BUSYBOX_WATCHDOG=y
+BR2_PACKAGE_FBTERM=y

Are these _REALLY_ needed for anything?

The tested base board has a touchscreen, but FBTERM is not absolutely necessary for ts-4800 module and will be removed.
However, the watchdog is needed because it is enabled by u-boot and the associated driver is part of the kernel config.

Thank you,

Patrick

#7 lore raw

v4 cover ARM: ts4800: add basic board support

In reply to Patrick Keroulas

Hi all,

v3 included 2 patches that were integrated in u-boot-imx recently. In v4, this fork is selected as a custom U-boot until it's merge into mainline U-boot and the patches were removed from board/technologic/ts4800/.

Thanks,

Patrick

Quoted 32 lines · Patrick Keroulas patrick.keroulas at savoirfairelinux.com

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

Patrick Keroulas (2):
ts4800-mbrboot: new 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 | 23 ++++++++++ configs/ts4800_defconfig | 30 +++++++++++++
package/Config.in | 1 +
package/ts4800-mbrboot/Config.in | 5 +++ package/ts4800-mbrboot/src/LICENSE | 25 +++++++++++ package/ts4800-mbrboot/src/Makefile | 21 ++++++++++ package/ts4800-mbrboot/src/mbrboot.c | 72 ++++++++++++++++++++++++++++++++ package/ts4800-mbrboot/src/mbrboot.ld | 56 +++++++++++++++++++++++++ package/ts4800-mbrboot/ts4800-mbrboot.mk | 22 ++++++++++

11 files changed, 295 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
create mode 100644 package/ts4800-mbrboot/Config.in create mode 100644 package/ts4800-mbrboot/src/LICENSE create mode 100644 package/ts4800-mbrboot/src/Makefile create mode 100644 package/ts4800-mbrboot/src/mbrboot.c create mode 100644 package/ts4800-mbrboot/src/mbrboot.ld create mode 100644 package/ts4800-mbrboot/ts4800-mbrboot.mk

--
1.9.1