All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base
@ 2017-09-04 10:41 Baruch Siach
  2017-09-04 11:35 ` Jan Kundrát
  2017-09-04 14:58 ` [Buildroot] [PATCH v2 " Jan Kundrát
  0 siblings, 2 replies; 10+ messages in thread
From: Baruch Siach @ 2017-09-04 10:41 UTC (permalink / raw)
  To: buildroot

Hi Jan,

On Mon, Sep 04, 2017 at 11:49:16AM +0200, Jan Kundr?t wrote:
> My goal was to rely on upstreamed features as much as possible, which
> means that some bits are only half-baked for now:
> 
> - Due to the DTS restructuring in upstream kernel, we require 4.11+. The
> latest LTS or CIP kernels do not know about the -Base model.
> 
> - Linux has no generic support for SFP cages (yet). It seems that this
> has hit the net-next tree in August 2017, but there's been no release
> (it's probably targettting 4.14). Also, the merge only included the
> required infrastructure; the mvneta driver conversion is not included.
> Patches which finalize this exist in Russel King's tree and also in
> random vendor trees.
> 
> - There's no access to the SPI flash in These versions of
> uboot/linux/dts.
> 
> - The U-Boot configuration looks pretty hacky; surely there must be a
> better way of overwriting the environment and getting rid of the generic
> setup with references to, e.g., EFI.

You can try using a boot script to override any default environment setting. 
See board/solidrun/mx6cubox/post-build.sh for example.

> Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>
> ---
>  board/solidrun/clearfog/genimage.cfg               | 16 ++++++++++++
>  board/solidrun/clearfog/linux.fragment             |  1 +
>  .../clearfog/patches/uboot-bootcmd-env.patch       | 19 ++++++++++++++
>  board/solidrun/clearfog/post-image.sh              | 14 ++++++++++
>  configs/clearfog_defconfig                         | 30 ++++++++++++++++++++++

Please add a readme.txt file that explains how to write the generated image to 
SD card, and how to set the DIP switches. See 
board/freescale/imx6sabre/readme.txt, as an example.

>  5 files changed, 80 insertions(+)
>  create mode 100644 board/solidrun/clearfog/genimage.cfg
>  create mode 100644 board/solidrun/clearfog/linux.fragment
>  create mode 100644 board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
>  create mode 100755 board/solidrun/clearfog/post-image.sh
>  create mode 100644 configs/clearfog_defconfig
> 
> diff --git a/board/solidrun/clearfog/genimage.cfg b/board/solidrun/clearfog/genimage.cfg
> new file mode 100644
> index 0000000..8963619
> --- /dev/null
> +++ b/board/solidrun/clearfog/genimage.cfg
> @@ -0,0 +1,16 @@
> +image sdcard.img {
> +	hdimage {
> +	}
> +
> +	partition u-boot {
> +		in-partition-table = "no"
> +		image = "u-boot-spl.kwb"
> +		offset = 512
> +	}
> +
> +	partition rootfs {
> +		partition-type = 0x83
> +		image = "rootfs.ext4"
> +		offset = 1M
> +	}
> +}
> diff --git a/board/solidrun/clearfog/linux.fragment b/board/solidrun/clearfog/linux.fragment
> new file mode 100644
> index 0000000..b7ed5b0
> --- /dev/null
> +++ b/board/solidrun/clearfog/linux.fragment
> @@ -0,0 +1 @@
> +CONFIG_SENSORS_MCP3021=y
> diff --git a/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch b/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
> new file mode 100644
> index 0000000..f1e5a7d
> --- /dev/null
> +++ b/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
> @@ -0,0 +1,19 @@
> +diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
> +index 5061f6c..7bdd883 100644
> +--- a/include/configs/clearfog.h
> ++++ b/include/configs/clearfog.h
> +@@ -171,9 +171,12 @@
> + #define CONFIG_EXTRA_ENV_SETTINGS \
> + 	RELOCATION_LIMITS_ENV_SETTINGS \
> + 	LOAD_ADDRESS_ENV_SETTINGS \
> +-	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
> ++	"fdtfile=armada-388-clearfog-base.dtb\0" \
> + 	"console=ttyS0,115200\0" \
> +-	BOOTENV
> ++	"bootargs=root=/dev/mmcblk0p1\0" \
> ++	"bootcmd=ext4load mmc 0:1 ${kernel_addr_r} boot/zImage;" \
> ++	" ext4load mmc 0:1 ${fdt_addr_r} boot/${fdtfile};" \
> ++	" bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
> + 
> + #endif /* CONFIG_SPL_BUILD */
> + 

With boot script this patch is not needed.

> diff --git a/board/solidrun/clearfog/post-image.sh b/board/solidrun/clearfog/post-image.sh
> new file mode 100755
> index 0000000..b4ac460
> --- /dev/null
> +++ b/board/solidrun/clearfog/post-image.sh
> @@ -0,0 +1,14 @@
> +#!/usr/bin/env bash
> +
> +BOARD_DIR="$(dirname $0)"
> +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}"

You can try the generic genimage.sh script. See configs/ci40_defconfig.

> diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
> new file mode 100644
> index 0000000..797c072
> --- /dev/null
> +++ b/configs/clearfog_defconfig
> @@ -0,0 +1,30 @@
> +BR2_arm=y
> +BR2_cortex_a9=y
> +BR2_ARM_ENABLE_NEON=y
> +BR2_ARM_ENABLE_VFP=y
> +BR2_ARM_FPU_NEON=y
> +BR2_TOOLCHAIN_EXTERNAL=y

Please use the internal toolchain for the basic defconfig.

> +BR2_TARGET_GENERIC_PASSWD_SHA512=y
> +BR2_INIT_SYSTEMD=y
> +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set

Basic defconfigs leave the defaults unchanged.

> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/solidrun/clearfog/post-image.sh"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12.10"
> +BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v7"
> +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/clearfog/linux.fragment"
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="armada-388-clearfog-base"
> +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
> +# BR2_TARGET_ROOTFS_TAR is not set
> +BR2_TARGET_UBOOT=y

Please set BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE to the version you tested.

> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_PATCH="board/solidrun/clearfog/patches/uboot-bootcmd-env.patch"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="clearfog"
> +# BR2_TARGET_UBOOT_FORMAT_BIN is not set
> +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
> +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-spl.kwb"
> +BR2_PACKAGE_HOST_GENIMAGE=y

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base
  2017-09-04 10:41 [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base Baruch Siach
@ 2017-09-04 11:35 ` Jan Kundrát
  2017-09-04 11:53   ` Baruch Siach
  2017-09-04 14:58 ` [Buildroot] [PATCH v2 " Jan Kundrát
  1 sibling, 1 reply; 10+ messages in thread
From: Jan Kundrát @ 2017-09-04 11:35 UTC (permalink / raw)
  To: buildroot

Hi Baruch,
thanks for a review, comments below.

> You can try using a boot script to override any default 
> environment setting. 
> See board/solidrun/mx6cubox/post-build.sh for example.

Ah, right. I looked into the bootscript feature in other defconfigs. I got 
confused on *how* the produced boot.scr gets actually used; some configs 
moved that to a fixed offset within the generated image via `genimage`, 
which looked quite ugly. Now I finally noticed that call to `install` :), 
OK, that's going to work. Thanks.

> Please add a readme.txt file that explains how to write the 
> generated image to 
> SD card, and how to set the DIP switches. See 
> board/freescale/imx6sabre/readme.txt, as an example.

Ack, will do.

>> diff --git a/board/solidrun/clearfog/post-image.sh 
>> b/board/solidrun/clearfog/post-image.sh
>> new file mode 100755
>> index 0000000..b4ac460
>> --- /dev/null
>> +++ b/board/solidrun/clearfog/post-image.sh ...
>
> You can try the generic genimage.sh script. See configs/ci40_defconfig.

Nice, thanks.

>> diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
>> new file mode 100644
>> index 0000000..797c072
>> --- /dev/null
>> +++ b/configs/clearfog_defconfig ...
>
> Please use the internal toolchain for the basic defconfig.

I can make that change, but I wonder what the rationale is. I see that it's 
probably not obvious from the attached config, but it is actually set to 
use the Linaro toolchain to save time during the build. Do you still want 
me to change this?

>> +BR2_TARGET_GENERIC_PASSWD_SHA512=y
>> +BR2_INIT_SYSTEMD=y
>> +# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
>
> Basic defconfigs leave the defaults unchanged.

OK, I'll make it so.

>> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/solidrun/clearfog/post-image.sh"
>> +BR2_LINUX_KERNEL=y
>> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12.10"
>> +BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v7" ...
>
> Please set BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE to the version you tested.

I created this file via `make menuconfig` followed by `make savedefconfig`. 
In there, I used the default version of U-Boot, the 2017.07. Should I 
really go and change this to hardcode a version which will eventually get 
obsolete in future? I'm not familiar with U-Boot's releases, just 
double-checking here.

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

* [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base
  2017-09-04 11:35 ` Jan Kundrát
@ 2017-09-04 11:53   ` Baruch Siach
  0 siblings, 0 replies; 10+ messages in thread
From: Baruch Siach @ 2017-09-04 11:53 UTC (permalink / raw)
  To: buildroot

Hi Jan,

On Mon, Sep 04, 2017 at 01:35:57PM +0200, Jan Kundr?t wrote:
> > > diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
> > > new file mode 100644
> > > index 0000000..797c072
> > > --- /dev/null
> > > +++ b/configs/clearfog_defconfig ...
> > 
> > Please use the internal toolchain for the basic defconfig.
> 
> I can make that change, but I wonder what the rationale is. I see that it's
> probably not obvious from the attached config, but it is actually set to use
> the Linaro toolchain to save time during the build. Do you still want me to
> change this?

All defconfigs use a Buildroot internal toolchain. These are sort of demo to 
the capabilities of Buildroot. Also, the internal toolcain generates smaller 
images since it uses uClibc.

> > > +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/solidrun/clearfog/post-image.sh"
> > > +BR2_LINUX_KERNEL=y
> > > +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> > > +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12.10"
> > > +BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v7" ...
> > 
> > Please set BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE to the version you tested.
> 
> I created this file via `make menuconfig` followed by `make savedefconfig`.
> In there, I used the default version of U-Boot, the 2017.07. Should I really
> go and change this to hardcode a version which will eventually get obsolete
> in future? I'm not familiar with U-Boot's releases, just double-checking
> here.

As long as you build the same sources you should get the same result, sans 
toolchain issues. The bootloader and the kernel are sensitive packages that 
frequently break between releases on any given target board. For that reason 
Buildroot defconfigs always set known working versions of both.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v2 1/1] New board: SolidRun ClearFog Base
  2017-09-04 10:41 [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base Baruch Siach
  2017-09-04 11:35 ` Jan Kundrát
@ 2017-09-04 14:58 ` Jan Kundrát
  2017-09-04 17:42   ` Baruch Siach
  1 sibling, 1 reply; 10+ messages in thread
From: Jan Kundrát @ 2017-09-04 14:58 UTC (permalink / raw)
  To: buildroot

My goal was to rely on upstreamed features as much as possible, which
means that some bits are only half-baked for now:

- Due to the DTS restructuring in upstream kernel, we require 4.11+. The
latest LTS or CIP kernels do not know about the -Base model.

- Linux has no generic support for SFP cages (yet). It seems that this
has hit the net-next tree in August 2017, but there's been no release
(it's probably targettting 4.14). Also, the merge only included the
required infrastructure; the mvneta driver conversion is not included.
Patches which finalize this exist in Russel King's tree and also in
random vendor trees.

- There's no access to the SPI flash in these versions of
uboot/linux/dts.

Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>

---
Changes v1 -> v2:
    - added a README
    - use boot.scr instead of patching uboot
    - use ithe internal toolchain
    - use the generic genimage.sh
    - use buildroot's defaults where possible
    - pin uboot version

Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>
---
 board/solidrun/clearfog/boot.scr.txt   |  5 +++
 board/solidrun/clearfog/genimage.cfg   | 16 +++++++++
 board/solidrun/clearfog/linux.fragment |  1 +
 board/solidrun/clearfog/post-build.sh  |  3 ++
 board/solidrun/clearfog/readme.txt     | 62 ++++++++++++++++++++++++++++++++++
 configs/clearfog_defconfig             | 31 +++++++++++++++++
 6 files changed, 118 insertions(+)
 create mode 100644 board/solidrun/clearfog/boot.scr.txt
 create mode 100644 board/solidrun/clearfog/genimage.cfg
 create mode 100644 board/solidrun/clearfog/linux.fragment
 create mode 100755 board/solidrun/clearfog/post-build.sh
 create mode 100644 board/solidrun/clearfog/readme.txt
 create mode 100644 configs/clearfog_defconfig

diff --git a/board/solidrun/clearfog/boot.scr.txt b/board/solidrun/clearfog/boot.scr.txt
new file mode 100644
index 0000000..a2332e3
--- /dev/null
+++ b/board/solidrun/clearfog/boot.scr.txt
@@ -0,0 +1,5 @@
+setenv fdtfile armada-388-clearfog-base.dtb
+setenv bootargs root=/dev/mmcblk0p1
+load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}/${fdtfile}
+load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}/zImage
+bootz ${kernel_addr_r} - ${fdt_addr_r}
diff --git a/board/solidrun/clearfog/genimage.cfg b/board/solidrun/clearfog/genimage.cfg
new file mode 100644
index 0000000..8963619
--- /dev/null
+++ b/board/solidrun/clearfog/genimage.cfg
@@ -0,0 +1,16 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-spl.kwb"
+		offset = 512
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		offset = 1M
+	}
+}
diff --git a/board/solidrun/clearfog/linux.fragment b/board/solidrun/clearfog/linux.fragment
new file mode 100644
index 0000000..b7ed5b0
--- /dev/null
+++ b/board/solidrun/clearfog/linux.fragment
@@ -0,0 +1 @@
+CONFIG_SENSORS_MCP3021=y
diff --git a/board/solidrun/clearfog/post-build.sh b/board/solidrun/clearfog/post-build.sh
new file mode 100755
index 0000000..ff22ebd
--- /dev/null
+++ b/board/solidrun/clearfog/post-build.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+install -m 0644 -D $BINARIES_DIR/boot.scr $TARGET_DIR/boot/boot.scr
diff --git a/board/solidrun/clearfog/readme.txt b/board/solidrun/clearfog/readme.txt
new file mode 100644
index 0000000..0962d49
--- /dev/null
+++ b/board/solidrun/clearfog/readme.txt
@@ -0,0 +1,62 @@
+**********************
+SolidRun Clearfog Base
+**********************
+
+This file documents Buildroot's support for the Clearfog Base by Solid Run.
+
+Vendor's documentation:
+https://wiki.solid-run.com/doku.php?id=products:a38x:documents
+
+Warning for eMMC variant of the MicroSoM
+========================================
+
+If you bought a MicroSoM version that includes an on-board eMMC flash, the
+built-in microSD card slot *WILL NOT WORK*. The Internet says that you have to
+upload the first bootloader via UART. This manual does not cover these steps;
+only MicroSoMs without the eMMC are supported.
+
+Build
+=====
+
+Start with the default Buildroot's configuration for Clearfog:
+
+  make clearfog_defconfig
+
+Build all components:
+
+  make
+
+The results of the build are available in ./output/images.
+
+Create a bootable SD card
+=========================
+
+To determine the device associated to the SD card have a look in the
+/proc/partitions file:
+
+  cat /proc/partitions
+
+Buildroot prepares a bootable "sdcard.img" image in the output/images/
+directory, ready to be dumped on a microSD card. Launch the following
+command as root:
+
+  dd if=./output/images/sdcard.img of=/dev/<your-microsd-device>
+
+*** WARNING! The script will destroy all the card content. Use with care! ***
+
+For details about the medium image layout, see the definition in
+board/solidrun/clearfog/genimage.cfg.
+
+Boot the Clearfog board
+=======================
+
+Here's how to boot the board:
+
+- Set up the DIP switches for microSD boot. The correct values are:
+  1: off, 2: off, 3: ON, 4: ON, 5: ON. In this scheme, switch #1" is closer to
+  the ethernet ports and #5 is closer to the microSD card, "ON" means towards
+  the SOM, and "off" means towards the SFP cage. Yes, it's different than what
+  the vendor says in the manual.
+- Connect to the board's console over the microUSB port.
+- Insert the SD card into the slot on the board (pins up).
+- Power up the board.
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
new file mode 100644
index 0000000..05df38c
--- /dev/null
+++ b/configs/clearfog_defconfig
@@ -0,0 +1,31 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/solidrun/clearfog/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/solidrun/clearfog/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12.10"
+BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v7"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/clearfog/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="armada-388-clearfog-base"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.07"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="clearfog"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-spl.kwb"
+BR2_TARGET_UBOOT_BOOT_SCRIPT=y
+BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="board/solidrun/clearfog/boot.scr.txt"
+BR2_PACKAGE_HOST_GENIMAGE=y
-- 
2.10.2

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

* [Buildroot] [PATCH v2 1/1] New board: SolidRun ClearFog Base
  2017-09-04 14:58 ` [Buildroot] [PATCH v2 " Jan Kundrát
@ 2017-09-04 17:42   ` Baruch Siach
  2017-09-04 20:30     ` Jan Kundrát
  2017-09-04 20:30     ` [Buildroot] [PATCH v3 " Jan Kundrát
  0 siblings, 2 replies; 10+ messages in thread
From: Baruch Siach @ 2017-09-04 17:42 UTC (permalink / raw)
  To: buildroot

Hi Jan,

On Mon, Sep 04, 2017 at 04:58:10PM +0200, Jan Kundr?t wrote:
> My goal was to rely on upstreamed features as much as possible, which
> means that some bits are only half-baked for now:
> 
> - Due to the DTS restructuring in upstream kernel, we require 4.11+. The
> latest LTS or CIP kernels do not know about the -Base model.
> 
> - Linux has no generic support for SFP cages (yet). It seems that this
> has hit the net-next tree in August 2017, but there's been no release
> (it's probably targettting 4.14). Also, the merge only included the
> required infrastructure; the mvneta driver conversion is not included.
> Patches which finalize this exist in Russel King's tree and also in
> random vendor trees.
> 
> - There's no access to the SPI flash in these versions of
> uboot/linux/dts.

This information belongs (also) in the readme.txt file, I believe.

> Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>

[...]

> diff --git a/board/solidrun/clearfog/readme.txt b/board/solidrun/clearfog/readme.txt
> new file mode 100644
> index 0000000..0962d49
> --- /dev/null
> +++ b/board/solidrun/clearfog/readme.txt
> @@ -0,0 +1,62 @@
> +**********************
> +SolidRun Clearfog Base
> +**********************
> +
> +This file documents Buildroot's support for the Clearfog Base by Solid Run.
> +
> +Vendor's documentation:
> +https://wiki.solid-run.com/doku.php?id=products:a38x:documents
> +
> +Warning for eMMC variant of the MicroSoM
> +========================================
> +
> +If you bought a MicroSoM version that includes an on-board eMMC flash, the
> +built-in microSD card slot *WILL NOT WORK*. The Internet says that you have to
> +upload the first bootloader via UART. This manual does not cover these steps;
> +only MicroSoMs without the eMMC are supported.

As far as I know all eMMC SOMs are pre-loaded with a bootloader. But you are 
right that this README doesn't cover these.

[...]

> +Boot the Clearfog board
> +=======================
> +
> +Here's how to boot the board:
> +
> +- Set up the DIP switches for microSD boot. The correct values are:
> +  1: off, 2: off, 3: ON, 4: ON, 5: ON. In this scheme, switch #1" is closer to
> +  the ethernet ports and #5 is closer to the microSD card, "ON" means towards
> +  the SOM, and "off" means towards the SFP cage. Yes, it's different than what
> +  the vendor says in the manual.

These DIP switches settings looks exactly the same as in the wiki page[1]. 
Note the comment below the diagram.

[1] https://wiki.solid-run.com/doku.php?id=products:a38x:clearfog#bootdevice_dipswitch

> +- Connect to the board's console over the microUSB port.
> +- Insert the SD card into the slot on the board (pins up).
> +- Power up the board.

[...]

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v2 1/1] New board: SolidRun ClearFog Base
  2017-09-04 17:42   ` Baruch Siach
@ 2017-09-04 20:30     ` Jan Kundrát
  2017-09-04 20:30     ` [Buildroot] [PATCH v3 " Jan Kundrát
  1 sibling, 0 replies; 10+ messages in thread
From: Jan Kundrát @ 2017-09-04 20:30 UTC (permalink / raw)
  To: buildroot

> This information belongs (also) in the readme.txt file, I believe.

Right, I've added this in v3.

> As far as I know all eMMC SOMs are pre-loaded with a 
> bootloader. But you are 
> right that this README doesn't cover these.

I didn't know that. In fact, I specifically ordered the no-eMMC version 
based on the information on the web in order to make my life easier. 
Thanks. I'll leave the comment as-is for now though.

> These DIP switches settings looks exactly the same as in the wiki page[1]. 
> Note the comment below the diagram.

You're right. However, the PDF manual on the web [1] mentions 11000 on page 
10.

[1] 
https://wiki.solid-run.com/lib/exe/fetch.php?media=a38x:carrierboard:docs:sr-a38x-clearfog_base-manual-rev1.1.pdf

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

* [Buildroot] [PATCH v3 1/1] New board: SolidRun ClearFog Base
  2017-09-04 17:42   ` Baruch Siach
  2017-09-04 20:30     ` Jan Kundrát
@ 2017-09-04 20:30     ` Jan Kundrát
  2018-04-01 10:54       ` Arnout Vandecappelle
  1 sibling, 1 reply; 10+ messages in thread
From: Jan Kundrát @ 2017-09-04 20:30 UTC (permalink / raw)
  To: buildroot

My goal was to rely on upstreamed features as much as possible, which
means that some bits are only half-baked for now:

- Due to the DTS restructuring in upstream kernel, we require 4.11+. The
latest LTS or CIP kernels do not know about the -Base model.

- Linux has no generic support for SFP cages (yet). It seems that this
has hit the net-next tree in August 2017, but there's been no release
(it's probably targettting 4.14). Also, the merge only included the
required infrastructure; the mvneta driver conversion is not included.
Patches which finalize this exist in Russel King's tree and also in
random vendor trees.

- There's no access to the SPI flash in these versions of
uboot/linux/dts.

Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>

---
Changes v2 -> v3:
    - added the SPI flash info into the README
    - toned-down the language for boot DIP switches

Changes v1 -> v2:
    - added a README
    - use boot.scr instead of patching uboot
    - use ithe internal toolchain
    - use the generic genimage.sh
    - use buildroot's defaults where possible
    - pin uboot version
---
 board/solidrun/clearfog/boot.scr.txt   |  5 +++
 board/solidrun/clearfog/genimage.cfg   | 16 +++++++++
 board/solidrun/clearfog/linux.fragment |  1 +
 board/solidrun/clearfog/post-build.sh  |  3 ++
 board/solidrun/clearfog/readme.txt     | 66 ++++++++++++++++++++++++++++++++++
 configs/clearfog_defconfig             | 31 ++++++++++++++++
 6 files changed, 122 insertions(+)
 create mode 100644 board/solidrun/clearfog/boot.scr.txt
 create mode 100644 board/solidrun/clearfog/genimage.cfg
 create mode 100644 board/solidrun/clearfog/linux.fragment
 create mode 100755 board/solidrun/clearfog/post-build.sh
 create mode 100644 board/solidrun/clearfog/readme.txt
 create mode 100644 configs/clearfog_defconfig

diff --git a/board/solidrun/clearfog/boot.scr.txt b/board/solidrun/clearfog/boot.scr.txt
new file mode 100644
index 0000000..a2332e3
--- /dev/null
+++ b/board/solidrun/clearfog/boot.scr.txt
@@ -0,0 +1,5 @@
+setenv fdtfile armada-388-clearfog-base.dtb
+setenv bootargs root=/dev/mmcblk0p1
+load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}/${fdtfile}
+load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}/zImage
+bootz ${kernel_addr_r} - ${fdt_addr_r}
diff --git a/board/solidrun/clearfog/genimage.cfg b/board/solidrun/clearfog/genimage.cfg
new file mode 100644
index 0000000..8963619
--- /dev/null
+++ b/board/solidrun/clearfog/genimage.cfg
@@ -0,0 +1,16 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-spl.kwb"
+		offset = 512
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		offset = 1M
+	}
+}
diff --git a/board/solidrun/clearfog/linux.fragment b/board/solidrun/clearfog/linux.fragment
new file mode 100644
index 0000000..b7ed5b0
--- /dev/null
+++ b/board/solidrun/clearfog/linux.fragment
@@ -0,0 +1 @@
+CONFIG_SENSORS_MCP3021=y
diff --git a/board/solidrun/clearfog/post-build.sh b/board/solidrun/clearfog/post-build.sh
new file mode 100755
index 0000000..ff22ebd
--- /dev/null
+++ b/board/solidrun/clearfog/post-build.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+install -m 0644 -D $BINARIES_DIR/boot.scr $TARGET_DIR/boot/boot.scr
diff --git a/board/solidrun/clearfog/readme.txt b/board/solidrun/clearfog/readme.txt
new file mode 100644
index 0000000..203d964
--- /dev/null
+++ b/board/solidrun/clearfog/readme.txt
@@ -0,0 +1,66 @@
+**********************
+SolidRun Clearfog Base
+**********************
+
+This file documents Buildroot's support for the Clearfog Base by Solid Run.
+
+Vendor's documentation:
+https://wiki.solid-run.com/doku.php?id=products:a38x:documents
+
+Warning for eMMC variant of the MicroSoM
+========================================
+
+If you bought a MicroSoM version that includes an on-board eMMC flash, the
+built-in microSD card slot *WILL NOT WORK*. The Internet says that you have to
+upload the first bootloader via UART. This manual does not cover these steps;
+only MicroSoMs without the eMMC are supported.
+
+Limitations
+===========
+
+There's no access to the SPI flash in this combination of kernel/uboot/dts.
+
+Build
+=====
+
+Start with the default Buildroot's configuration for Clearfog:
+
+  make clearfog_defconfig
+
+Build all components:
+
+  make
+
+The results of the build are available in ./output/images.
+
+Create a bootable SD card
+=========================
+
+To determine the device associated to the SD card have a look in the
+/proc/partitions file:
+
+  cat /proc/partitions
+
+Buildroot prepares a bootable "sdcard.img" image in the output/images/
+directory, ready to be dumped on a microSD card. Launch the following
+command as root:
+
+  dd if=./output/images/sdcard.img of=/dev/<your-microsd-device>
+
+*** WARNING! The script will destroy all the card content. Use with care! ***
+
+For details about the medium image layout, see the definition in
+board/solidrun/clearfog/genimage.cfg.
+
+Boot the Clearfog board
+=======================
+
+Here's how to boot the board:
+
+- Set up the DIP switches for microSD boot. The correct values are:
+  1: off, 2: off, 3: ON, 4: ON, 5: ON. In this scheme, switch #1" is closer to
+  the ethernet ports and #5 is closer to the microSD card, "ON" means towards
+  the SOM, and "off" means towards the SFP cage.
+- Connect to the board's console over the microUSB port.
+- Insert the SD card into the slot on the board (pins up).
+- Power up the board.
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
new file mode 100644
index 0000000..05df38c
--- /dev/null
+++ b/configs/clearfog_defconfig
@@ -0,0 +1,31 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/solidrun/clearfog/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/solidrun/clearfog/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12.10"
+BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v7"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/clearfog/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="armada-388-clearfog-base"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.07"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="clearfog"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-spl.kwb"
+BR2_TARGET_UBOOT_BOOT_SCRIPT=y
+BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="board/solidrun/clearfog/boot.scr.txt"
+BR2_PACKAGE_HOST_GENIMAGE=y
-- 
2.10.2

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

* [Buildroot] [PATCH v3 1/1] New board: SolidRun ClearFog Base
  2017-09-04 20:30     ` [Buildroot] [PATCH v3 " Jan Kundrát
@ 2018-04-01 10:54       ` Arnout Vandecappelle
  0 siblings, 0 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2018-04-01 10:54 UTC (permalink / raw)
  To: buildroot



On 04-09-17 22:30, Jan Kundr?t wrote:
> My goal was to rely on upstreamed features as much as possible, which
> means that some bits are only half-baked for now:
> 
> - Due to the DTS restructuring in upstream kernel, we require 4.11+. The
> latest LTS or CIP kernels do not know about the -Base model.

 Latest is better :-)

> 
> - Linux has no generic support for SFP cages (yet). It seems that this
> has hit the net-next tree in August 2017, but there's been no release
> (it's probably targettting 4.14). Also, the merge only included the
> required infrastructure; the mvneta driver conversion is not included.
> Patches which finalize this exist in Russel King's tree and also in
> random vendor trees.
> 
> - There's no access to the SPI flash in these versions of
> uboot/linux/dts.

 All these limitations really are no problem.

 I committed to master, but with a bunch of fixes:

     - rename to solidrun_clearfog_defconfig;
     - specify kernel headers version (default is now 4.15);
     - remove ext2 fs size override, the 4 extra MB are not needed;
     - U-Boot needs dtc and openssl;
     - add comments to defconfig;
     - update .gitlab-ci.yml;
     - mention in readme.txt that SFP support is missing;
     - add Jan to DEVELOPERS.

 If you would update to a more recent kernel, please remember to update the
readme.txt as well if some of the limitations are removed.

 Regards,
 Arnout

> 
> Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>[snip]


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

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

* [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base
@ 2017-09-04  9:49 Jan Kundrát
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Kundrát @ 2017-09-04  9:49 UTC (permalink / raw)
  To: buildroot

My goal was to rely on upstreamed features as much as possible, which
means that some bits are only half-baked for now:

- Due to the DTS restructuring in upstream kernel, we require 4.11+. The
latest LTS or CIP kernels do not know about the -Base model.

- Linux has no generic support for SFP cages (yet). It seems that this
has hit the net-next tree in August 2017, but there's been no release
(it's probably targettting 4.14). Also, the merge only included the
required infrastructure; the mvneta driver conversion is not included.
Patches which finalize this exist in Russel King's tree and also in
random vendor trees.

- There's no access to the SPI flash in These versions of
uboot/linux/dts.

- The U-Boot configuration looks pretty hacky; surely there must be a
better way of overwriting the environment and getting rid of the generic
setup with references to, e.g., EFI.

Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>
---
 board/solidrun/clearfog/genimage.cfg               | 16 ++++++++++++
 board/solidrun/clearfog/linux.fragment             |  1 +
 .../clearfog/patches/uboot-bootcmd-env.patch       | 19 ++++++++++++++
 board/solidrun/clearfog/post-image.sh              | 14 ++++++++++
 configs/clearfog_defconfig                         | 30 ++++++++++++++++++++++
 5 files changed, 80 insertions(+)
 create mode 100644 board/solidrun/clearfog/genimage.cfg
 create mode 100644 board/solidrun/clearfog/linux.fragment
 create mode 100644 board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
 create mode 100755 board/solidrun/clearfog/post-image.sh
 create mode 100644 configs/clearfog_defconfig

diff --git a/board/solidrun/clearfog/genimage.cfg b/board/solidrun/clearfog/genimage.cfg
new file mode 100644
index 0000000..8963619
--- /dev/null
+++ b/board/solidrun/clearfog/genimage.cfg
@@ -0,0 +1,16 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-spl.kwb"
+		offset = 512
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		offset = 1M
+	}
+}
diff --git a/board/solidrun/clearfog/linux.fragment b/board/solidrun/clearfog/linux.fragment
new file mode 100644
index 0000000..b7ed5b0
--- /dev/null
+++ b/board/solidrun/clearfog/linux.fragment
@@ -0,0 +1 @@
+CONFIG_SENSORS_MCP3021=y
diff --git a/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch b/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
new file mode 100644
index 0000000..f1e5a7d
--- /dev/null
+++ b/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
@@ -0,0 +1,19 @@
+diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
+index 5061f6c..7bdd883 100644
+--- a/include/configs/clearfog.h
++++ b/include/configs/clearfog.h
+@@ -171,9 +171,12 @@
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+ 	RELOCATION_LIMITS_ENV_SETTINGS \
+ 	LOAD_ADDRESS_ENV_SETTINGS \
+-	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
++	"fdtfile=armada-388-clearfog-base.dtb\0" \
+ 	"console=ttyS0,115200\0" \
+-	BOOTENV
++	"bootargs=root=/dev/mmcblk0p1\0" \
++	"bootcmd=ext4load mmc 0:1 ${kernel_addr_r} boot/zImage;" \
++	" ext4load mmc 0:1 ${fdt_addr_r} boot/${fdtfile};" \
++	" bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
+ 
+ #endif /* CONFIG_SPL_BUILD */
+ 
diff --git a/board/solidrun/clearfog/post-image.sh b/board/solidrun/clearfog/post-image.sh
new file mode 100755
index 0000000..b4ac460
--- /dev/null
+++ b/board/solidrun/clearfog/post-image.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+BOARD_DIR="$(dirname $0)"
+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}"
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
new file mode 100644
index 0000000..797c072
--- /dev/null
+++ b/configs/clearfog_defconfig
@@ -0,0 +1,30 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TARGET_GENERIC_PASSWD_SHA512=y
+BR2_INIT_SYSTEMD=y
+# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/solidrun/clearfog/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12.10"
+BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v7"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/clearfog/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="armada-388-clearfog-base"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_PATCH="board/solidrun/clearfog/patches/uboot-bootcmd-env.patch"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="clearfog"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-spl.kwb"
+BR2_PACKAGE_HOST_GENIMAGE=y
-- 
2.10.2

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

* [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base
@ 2017-09-04  9:42 Jan Kundrát
  0 siblings, 0 replies; 10+ messages in thread
From: Jan Kundrát @ 2017-09-04  9:42 UTC (permalink / raw)
  To: buildroot

My goal was to rely on upstreamed features as much as possible, which
means that some bits are only half-baked for now:

- Due to the DTS restructuring in upstream kernel, we require 4.11+. The
latest LTS or CIP kernels do not know about the -Base model.

- Linux has no generic support for SFP cages (yet). It seems that this
has hit the net-next tree in August 2017, but there's been no release
(it's probably targettting 4.14). Also, the merge only included the
required infrastructure; the mvneta driver conversion is not included.
Patches which finalize this exist in Russel King's tree and also in
random vendor trees.

- There's no access to the SPI flash in These versions of
uboot/linux/dts.

- The U-Boot configuration looks pretty hacky; surely there must be a
better way of overwriting the environment and getting rid of the generic
setup with references to, e.g., EFI.

Signed-off-by: Jan Kundr?t <jan.kundrat@cesnet.cz>
---
 board/solidrun/clearfog/genimage.cfg               | 16 ++++++++++++
 board/solidrun/clearfog/linux.fragment             |  1 +
 .../clearfog/patches/uboot-bootcmd-env.patch       | 19 ++++++++++++++
 board/solidrun/clearfog/post-image.sh              | 14 ++++++++++
 configs/clearfog_defconfig                         | 30 ++++++++++++++++++++++
 5 files changed, 80 insertions(+)
 create mode 100644 board/solidrun/clearfog/genimage.cfg
 create mode 100644 board/solidrun/clearfog/linux.fragment
 create mode 100644 board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
 create mode 100755 board/solidrun/clearfog/post-image.sh
 create mode 100644 configs/clearfog_defconfig

diff --git a/board/solidrun/clearfog/genimage.cfg b/board/solidrun/clearfog/genimage.cfg
new file mode 100644
index 0000000..8963619
--- /dev/null
+++ b/board/solidrun/clearfog/genimage.cfg
@@ -0,0 +1,16 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-spl.kwb"
+		offset = 512
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		offset = 1M
+	}
+}
diff --git a/board/solidrun/clearfog/linux.fragment b/board/solidrun/clearfog/linux.fragment
new file mode 100644
index 0000000..b7ed5b0
--- /dev/null
+++ b/board/solidrun/clearfog/linux.fragment
@@ -0,0 +1 @@
+CONFIG_SENSORS_MCP3021=y
diff --git a/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch b/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
new file mode 100644
index 0000000..f1e5a7d
--- /dev/null
+++ b/board/solidrun/clearfog/patches/uboot-bootcmd-env.patch
@@ -0,0 +1,19 @@
+diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
+index 5061f6c..7bdd883 100644
+--- a/include/configs/clearfog.h
++++ b/include/configs/clearfog.h
+@@ -171,9 +171,12 @@
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+ 	RELOCATION_LIMITS_ENV_SETTINGS \
+ 	LOAD_ADDRESS_ENV_SETTINGS \
+-	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
++	"fdtfile=armada-388-clearfog-base.dtb\0" \
+ 	"console=ttyS0,115200\0" \
+-	BOOTENV
++	"bootargs=root=/dev/mmcblk0p1\0" \
++	"bootcmd=ext4load mmc 0:1 ${kernel_addr_r} boot/zImage;" \
++	" ext4load mmc 0:1 ${fdt_addr_r} boot/${fdtfile};" \
++	" bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
+ 
+ #endif /* CONFIG_SPL_BUILD */
+ 
diff --git a/board/solidrun/clearfog/post-image.sh b/board/solidrun/clearfog/post-image.sh
new file mode 100755
index 0000000..b4ac460
--- /dev/null
+++ b/board/solidrun/clearfog/post-image.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+BOARD_DIR="$(dirname $0)"
+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}"
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
new file mode 100644
index 0000000..797c072
--- /dev/null
+++ b/configs/clearfog_defconfig
@@ -0,0 +1,30 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_ARM_ENABLE_VFP=y
+BR2_ARM_FPU_NEON=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TARGET_GENERIC_PASSWD_SHA512=y
+BR2_INIT_SYSTEMD=y
+# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/solidrun/clearfog/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.12.10"
+BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v7"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/solidrun/clearfog/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="armada-388-clearfog-base"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="64M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_PATCH="board/solidrun/clearfog/patches/uboot-bootcmd-env.patch"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="clearfog"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-spl.kwb"
+BR2_PACKAGE_HOST_GENIMAGE=y
-- 
2.10.2

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

end of thread, other threads:[~2018-04-01 10:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-04 10:41 [Buildroot] [PATCH 1/1] New board: SolidRun ClearFog Base Baruch Siach
2017-09-04 11:35 ` Jan Kundrát
2017-09-04 11:53   ` Baruch Siach
2017-09-04 14:58 ` [Buildroot] [PATCH v2 " Jan Kundrát
2017-09-04 17:42   ` Baruch Siach
2017-09-04 20:30     ` Jan Kundrát
2017-09-04 20:30     ` [Buildroot] [PATCH v3 " Jan Kundrát
2018-04-01 10:54       ` Arnout Vandecappelle
  -- strict thread matches above, loose matches on Subject: below --
2017-09-04  9:49 [Buildroot] [PATCH " Jan Kundrát
2017-09-04  9:42 Jan Kundrát

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.