All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v7 0/2] ARM: ts4800: add basic board support
@ 2016-07-15 19:23 Patrick Keroulas
  2016-07-15 19:23 ` [Buildroot] [PATCH v7 1/2] boot: add ts4800-mbrboot package Patrick Keroulas
  2016-07-15 19:23 ` [Buildroot] [PATCH v7 2/2] configs: add defconfig for TS-4800 Patrick Keroulas
  0 siblings, 2 replies; 6+ messages in thread
From: Patrick Keroulas @ 2016-07-15 19:23 UTC (permalink / raw)
  To: buildroot

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

-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v7 1/2] boot: add ts4800-mbrboot package
  2016-07-15 19:23 [Buildroot] [PATCH v7 0/2] ARM: ts4800: add basic board support Patrick Keroulas
@ 2016-07-15 19:23 ` Patrick Keroulas
  2016-07-15 21:19   ` Thomas Petazzoni
  2016-07-15 19:23 ` [Buildroot] [PATCH v7 2/2] configs: add defconfig for TS-4800 Patrick Keroulas
  1 sibling, 1 reply; 6+ messages in thread
From: Patrick Keroulas @ 2016-07-15 19:23 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
---
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

diff --git a/boot/Config.in b/boot/Config.in
index cd10cd8..677e5f0 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -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"
 
diff --git a/boot/ts4800-mbrboot/Config.in b/boot/ts4800-mbrboot/Config.in
new file mode 100644
index 0000000..b63e2fc
--- /dev/null
+++ b/boot/ts4800-mbrboot/Config.in
@@ -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
diff --git a/boot/ts4800-mbrboot/ts4800-mbrboot.mk b/boot/ts4800-mbrboot/ts4800-mbrboot.mk
new file mode 100644
index 0000000..91649d6
--- /dev/null
+++ b/boot/ts4800-mbrboot/ts4800-mbrboot.mk
@@ -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))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v7 2/2] configs: add defconfig for TS-4800
  2016-07-15 19:23 [Buildroot] [PATCH v7 0/2] ARM: ts4800: add basic board support Patrick Keroulas
  2016-07-15 19:23 ` [Buildroot] [PATCH v7 1/2] boot: add ts4800-mbrboot package Patrick Keroulas
@ 2016-07-15 19:23 ` Patrick Keroulas
  2016-07-15 21:26   ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Patrick Keroulas @ 2016-07-15 19:23 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
---
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

diff --git a/board/technologic/ts4800/genimage.cfg b/board/technologic/ts4800/genimage.cfg
new file mode 100644
index 0000000..2070cc5
--- /dev/null
+++ b/board/technologic/ts4800/genimage.cfg
@@ -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
+        }
+}
diff --git a/board/technologic/ts4800/linux.fragment b/board/technologic/ts4800/linux.fragment
new file mode 100644
index 0000000..0451c86
--- /dev/null
+++ b/board/technologic/ts4800/linux.fragment
@@ -0,0 +1,3 @@
+CONFIG_TOUCHSCREEN_TS4800=y
+CONFIG_TS4800_WATCHDOG=y
+CONFIG_TS4800_IRQ=y
diff --git a/board/technologic/ts4800/post-image.sh b/board/technologic/ts4800/post-image.sh
new file mode 100755
index 0000000..bbfea28
--- /dev/null
+++ b/board/technologic/ts4800/post-image.sh
@@ -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 $?
diff --git a/configs/ts4800_defconfig b/configs/ts4800_defconfig
new file mode 100644
index 0000000..0dd3e84
--- /dev/null
+++ b/configs/ts4800_defconfig
@@ -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
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v7 1/2] boot: add ts4800-mbrboot package
  2016-07-15 19:23 ` [Buildroot] [PATCH v7 1/2] boot: add ts4800-mbrboot package Patrick Keroulas
@ 2016-07-15 21:19   ` Thomas Petazzoni
  2016-07-20 13:18     ` Patrick Keroulas
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-07-15 21:19 UTC (permalink / raw)
  To: buildroot

Hello,

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

On Fri, 15 Jul 2016 15:23:07 -0400, Patrick Keroulas wrote:

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


> +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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v7 2/2] configs: add defconfig for TS-4800
  2016-07-15 19:23 ` [Buildroot] [PATCH v7 2/2] configs: add defconfig for TS-4800 Patrick Keroulas
@ 2016-07-15 21:26   ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2016-07-15 21:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 15 Jul 2016 15:23:08 -0400, Patrick Keroulas wrote:
> 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
> 
> Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
> Signed-off-by: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>

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.

> diff --git a/board/technologic/ts4800/post-image.sh b/board/technologic/ts4800/post-image.sh
> new file mode 100755
> index 0000000..bbfea28
> --- /dev/null
> +++ b/board/technologic/ts4800/post-image.sh
> @@ -0,0 +1,22 @@
> +#!/bin/bash
> +#
> +# Copyright (C) 2015 Savoir-faire Linux
> +# Post image generation script.
> +
> +IDIR="$1"

Not needed.

> +
> +BOARD_DIR="board/technologic/ts4800"

Use:

BOARD_DIR="$(dirname $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.

> +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}

> +        --outputpath $IDIR

ditto.

> +
> +exit $?
> diff --git a/configs/ts4800_defconfig b/configs/ts4800_defconfig
> new file mode 100644
> index 0000000..0dd3e84
> --- /dev/null
> +++ b/configs/ts4800_defconfig
> @@ -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

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

> +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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v7 1/2] boot: add ts4800-mbrboot package
  2016-07-15 21:19   ` Thomas Petazzoni
@ 2016-07-20 13:18     ` Patrick Keroulas
  0 siblings, 0 replies; 6+ messages in thread
From: Patrick Keroulas @ 2016-07-20 13:18 UTC (permalink / raw)
  To: buildroot

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
_____________________

----- On Jul 15, 2016, at 5:19 PM, Thomas Petazzoni thomas.petazzoni at free-electrons.com wrote:

> Hello,
> 
> I've applied, after doing some minor changes, see below.
> 
> On Fri, 15 Jul 2016 15:23:07 -0400, Patrick Keroulas wrote:
> 
>>  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.
> 
> 
>> +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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-20 13:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 19:23 [Buildroot] [PATCH v7 0/2] ARM: ts4800: add basic board support Patrick Keroulas
2016-07-15 19:23 ` [Buildroot] [PATCH v7 1/2] boot: add ts4800-mbrboot package Patrick Keroulas
2016-07-15 21:19   ` Thomas Petazzoni
2016-07-20 13:18     ` Patrick Keroulas
2016-07-15 19:23 ` [Buildroot] [PATCH v7 2/2] configs: add defconfig for TS-4800 Patrick Keroulas
2016-07-15 21:26   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.