Skip to contentSkip to conversation

board: Add Kontron SMARC-sAL28 support

PATCH Superseded Michael Walle 2 participants 4 messages May 18, 2020 – May 20, 2020

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 board: Add Kontron SMARC-sAL28 support

Now that upstream supports this board add buildroot support for it, too.

This supports:
- upstream linux kernel, 5.7-rc6 for now. Once 5.7 is released and buildroot will switch to this kernel BR2_LINUX_KERNEL_CUSTOM_VERSION=y
can be removed. Since the support for this board and its SoC is still in active development, we want to follow the upstream kernel releases for now.
- building an image which can be installed to eMMC, SD card or USB thumb drive.
- upstream u-boot patches are pending, therefore no support for building a bootloader for now.

---
Changes since v1:
- added readme.txt
- changed from u-boot boot script to extlinux.conf booting
- enable eudev and added udev rules to properly name network interfaces
- removed CONFIG_FSL_ENETC_HW_TIMESTAMPING=y
- added CONFIG_NET_SCH_CBS, CONFIG_NET_SCH_ETF, CONFIG_NET_SCH_TAPRIO, CONFIG_FSL_ENETC_QOS and iproute2, as this it the main feature of this board
- added var2 device tree
- generate PARTUUID in post-build.sh to be able to use the resulting image on any block device which the board supports for booting
- (keep post-build.sh for consistency reasons)

 DEVELOPERS                                    |  2 +
 board/kontron/smarc-sal28/extlinux.conf       |  4 ++
 board/kontron/smarc-sal28/genimage.cfg        | 11 ++++
 board/kontron/smarc-sal28/linux.fragment      | 18 +++++
 board/kontron/smarc-sal28/post-build.sh       |  7 ++
 board/kontron/smarc-sal28/readme.txt          | 65 +++++++++++++++++++
 .../udev/rules.d/70-enetc-networking.rules    |  8 +++
 .../udev/rules.d/70-felix-networking.rules    |  6 ++
 configs/kontron_smarc_sal28_defconfig         | 23 +++++++
 9 files changed, 144 insertions(+)
 create mode 100644 board/kontron/smarc-sal28/extlinux.conf
 create mode 100644 board/kontron/smarc-sal28/genimage.cfg
 create mode 100644 board/kontron/smarc-sal28/linux.fragment
 create mode 100755 board/kontron/smarc-sal28/post-build.sh
 create mode 100644 board/kontron/smarc-sal28/readme.txt
 create mode 100644 board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules
 create mode 100644 board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules
 create mode 100644 configs/kontron_smarc_sal28_defconfig
DEVELOPERS +2 -0
index e427ab15d4..c3f4ce8133 100644
@@ -1837,6 +1837,8 @@ F:	package/jasper/
 F:	package/libstrophe/
 
 N:	Michael Walle <[email protected]>
+F:	board/kontron/smarc-sal28/
+F:	configs/kontron_smarc_sal28_defconfig
 F:	package/libavl/
 
 N:	Micha? ?yszczek <[email protected]>
board/kontron/smarc-sal28/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..37777ecd5c
@@ -0,0 +1,4 @@
+label buildroot
+  kernel /boot/Image
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait arm-smmu.disable_bypass=n
board/kontron/smarc-sal28/genimage.cfg new file +11 -0
new file mode 100644
index 0000000000..9ef37de757
@@ -0,0 +1,11 @@
+image sdcard-emmc.img {
+	hdimage {
+		gpt = true
+	}
+
+	partition rootfs {
+		offset = 2M
+		image = rootfs.ext4
+		partition-uuid = %PARTUUID%
+	}
+}
board/kontron/smarc-sal28/linux.fragment new file +18 -0
new file mode 100644
index 0000000000..00bbcc0923
@@ -0,0 +1,18 @@
+CONFIG_NET_DSA=m
+CONFIG_NET_DSA_TAG_OCELOT=m
+CONFIG_NET_DSA_MSCC_FELIX=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBS=m
+CONFIG_NET_SCH_ETF=m
+CONFIG_NET_SCH_TAPRIO=m
+CONFIG_CAN_FLEXCAN=m
+CONFIG_FSL_ENETC=y
+CONFIG_FSL_ENETC_VF=m
+CONFIG_FSL_ENETC_QOS=y
+CONFIG_MSCC_OCELOT_SWITCH=m
+CONFIG_PCIE_DW_PLAT_HOST=y
+CONFIG_GPIO_MPC8XXX=y
+CONFIG_SND_SOC_FSL_SAI=m
+CONFIG_SND_SOC_WM8904=m
+CONFIG_RTC_DRV_RV8803=y
+CONFIG_COMMON_CLK_FSL_SAI=y
board/kontron/smarc-sal28/post-build.sh new file +7 -0
new file mode 100755
index 0000000000..c0fa1c9435
@@ -0,0 +1,7 @@
+#!/bin/sh
+BOARD_DIR="$(dirname $0)"
+PARTUUID="$(uuidgen)"
+
+install -d "$TARGET_DIR/boot/extlinux/"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
board/kontron/smarc-sal28/readme.txt new file +65 -0

65 lines not on this page · raw message

board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules new file +8 -0
new file mode 100644
index 0000000000..8774bc5581
@@ -0,0 +1,8 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0", DRIVERS=="fsl_enetc", NAME="eno0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", NAME="eno1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.2", DRIVERS=="fsl_enetc", NAME="eno2"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.6", DRIVERS=="fsl_enetc", NAME="eno3"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.0", DRIVERS=="fsl_enetc_vf", NAME="eno0vf0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.1", DRIVERS=="fsl_enetc_vf", NAME="eno0vf1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.2", DRIVERS=="fsl_enetc_vf", NAME="eno1vf0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.3", DRIVERS=="fsl_enetc_vf", NAME="eno1vf1"
board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules new file +6 -0
new file mode 100644
index 0000000000..917c0244ab
@@ -0,0 +1,6 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p0", NAME="swp0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p1", NAME="swp1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p2", NAME="swp2"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p3", NAME="swp3"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p4", NAME="swp4"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p5", NAME="swp5"
configs/kontron_smarc_sal28_defconfig new file +23 -0
new file mode 100644
index 0000000000..8a7e650ccd
@@ -0,0 +1,23 @@
+BR2_aarch64=y
+BR2_cortex_a72=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_ROOTFS_OVERLAY="board/kontron/smarc-sal28/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/kontron/smarc-sal28/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="v5.7-rc6"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/kontron/smarc-sal28/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/fsl-ls1028a-kontron-sl28 freescale/fsl-ls1028a-kontron-sl28-var2 freescale/fsl-ls1028a-kontron-sl28-var3-ads2 freescale/fsl-ls1028a-kontron-sl28-var4 freescale/fsl-ls1028a-kontron-kbox-a-230-ls"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_IPROUTE2=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="128M"
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 board: Add Kontron SMARC-sAL28 support

Hi Michael,

Am Mo., 18. Mai 2020 um 23:01 Uhr schrieb Michael Walle <[email protected]>:

Quoted 14 lines

Now that upstream supports this board add buildroot support for it, too.

This supports:
- upstream linux kernel, 5.7-rc6 for now. Once 5.7 is released and buildroot will switch to this kernel BR2_LINUX_KERNEL_CUSTOM_VERSION=y
can be removed. Since the support for this board and its SoC is still in active development, we want to follow the upstream kernel releases for now.
- building an image which can be installed to eMMC, SD card or USB thumb drive.
- upstream u-boot patches are pending, therefore no support for building a bootloader for now.

Quoted 2 lines

---

Quoted 109 lines

Changes since v1:
- added readme.txt
- changed from u-boot boot script to extlinux.conf booting
- enable eudev and added udev rules to properly name network interfaces
- removed CONFIG_FSL_ENETC_HW_TIMESTAMPING=y
- added CONFIG_NET_SCH_CBS, CONFIG_NET_SCH_ETF, CONFIG_NET_SCH_TAPRIO, CONFIG_FSL_ENETC_QOS and iproute2, as this it the main feature of this board
- added var2 device tree
- generate PARTUUID in post-build.sh to be able to use the resulting image on any block device which the board supports for booting
- (keep post-build.sh for consistency reasons)

 DEVELOPERS                                    |  2 +
 board/kontron/smarc-sal28/extlinux.conf       |  4 ++
 board/kontron/smarc-sal28/genimage.cfg        | 11 ++++
 board/kontron/smarc-sal28/linux.fragment      | 18 +++++
 board/kontron/smarc-sal28/post-build.sh       |  7 ++
 board/kontron/smarc-sal28/readme.txt          | 65 +++++++++++++++++++
 .../udev/rules.d/70-enetc-networking.rules    |  8 +++
 .../udev/rules.d/70-felix-networking.rules    |  6 ++
 configs/kontron_smarc_sal28_defconfig         | 23 +++++++
 9 files changed, 144 insertions(+)
 create mode 100644 board/kontron/smarc-sal28/extlinux.conf
 create mode 100644 board/kontron/smarc-sal28/genimage.cfg
 create mode 100644 board/kontron/smarc-sal28/linux.fragment
 create mode 100755 board/kontron/smarc-sal28/post-build.sh
 create mode 100644 board/kontron/smarc-sal28/readme.txt
 create mode 100644
board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules
 create mode 100644
board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules
 create mode 100644 configs/kontron_smarc_sal28_defconfig
DEVELOPERS +2 -0
index e427ab15d4..c3f4ce8133 100644
@@ -1837,6 +1837,8 @@ F:        package/jasper/
 F:     package/libstrophe/
 
 N:     Michael Walle <[email protected]>
+F:     board/kontron/smarc-sal28/
+F:     configs/kontron_smarc_sal28_defconfig
 F:     package/libavl/
 
 N:     Micha? ?yszczek <[email protected]>
board/kontron/smarc-sal28/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..37777ecd5c
@@ -0,0 +1,4 @@
+label buildroot
+  kernel /boot/Image
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait arm-smmu.disable_bypass=n
board/kontron/smarc-sal28/genimage.cfg new file +11 -0
new file mode 100644
index 0000000000..9ef37de757
@@ -0,0 +1,11 @@
+image sdcard-emmc.img {
+       hdimage {
+               gpt = true
+       }
+
+       partition rootfs {
+               offset = 2M
+               image = rootfs.ext4
+               partition-uuid = %PARTUUID%
+       }
+}
board/kontron/smarc-sal28/linux.fragment new file +18 -0
new file mode 100644
index 0000000000..00bbcc0923
@@ -0,0 +1,18 @@
+CONFIG_NET_DSA=m
+CONFIG_NET_DSA_TAG_OCELOT=m
+CONFIG_NET_DSA_MSCC_FELIX=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBS=m
+CONFIG_NET_SCH_ETF=m
+CONFIG_NET_SCH_TAPRIO=m
+CONFIG_CAN_FLEXCAN=m
+CONFIG_FSL_ENETC=y
+CONFIG_FSL_ENETC_VF=m
+CONFIG_FSL_ENETC_QOS=y
+CONFIG_MSCC_OCELOT_SWITCH=m
+CONFIG_PCIE_DW_PLAT_HOST=y
+CONFIG_GPIO_MPC8XXX=y
+CONFIG_SND_SOC_FSL_SAI=m
+CONFIG_SND_SOC_WM8904=m
+CONFIG_RTC_DRV_RV8803=y
+CONFIG_COMMON_CLK_FSL_SAI=y
board/kontron/smarc-sal28/post-build.sh new file +0 -0
new file mode 100755
index 0000000000..c0fa1c9435

board/kontron/smarc-sal28/post-build.sh line 3

Quoted 3 lines
board/kontron/smarc-sal28/post-build.sh new file +3 -0
@@ -0,0 +1,7 @@
+#!/bin/sh
+BOARD_DIR="$(dirname $0)"
+PARTUUID="$(uuidgen)"

To make sure not to take the native host tool set the full path to uuidgen:
$BUILD_HOST}/bin/uuidgen

Quoted 44 lines
board/kontron/smarc-sal28/post-build.sh new file +3 -0
+
+install -d "$TARGET_DIR/boot/extlinux/"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/extlinux.conf" >

"$TARGET_DIR/boot/extlinux/extlinux.conf"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"

board/kontron/smarc-sal28/readme.txt new file +29 -0
new file mode 100644
index 0000000000..c5b2ac9bb4
@@ -0,0 +1,65 @@
+Kontron SMARC-sAL28
+===================
+
+How to build it
+===============
+
+Configure Buildroot:
+
+  $ make kontron_smarc_sal28_defconfig
+
+Change settings to fit your needs (optional):
+
+  $ make menuconfig
+
+Compile everything and build the rootfs image:
+
+  $ make
+
+Copying the image to a storage device
+=====================================
+
+Buildroot builds an image which can be written to the internal eMMC
+storage, a SD card or an USB thumb drive. You can use the following
+command on your host:
+
+  $ sudo dd if=output/images/sdcard-emmc.img of=/dev/sdx bs=1M
+
+Where /dev/sdx is the corresponding block device of your SD card or USB
+thumb drive. To flash it on your internal eMMC use the following command

on

board/kontron/smarc-sal28/readme.txt line 36

Quoted 7 lines
board/kontron/smarc-sal28/readme.txt new file +7 -0
+the board:
+
+  # dd if=sdcard-emmc.img of=/dev/mmcblk1 bs=1M
+
+Be sure you have not booted from the internal eMMC in this case!
+
+Booting the the board

Small typo here ;-/

board/kontron/smarc-sal28/readme.txt line 45

Quoted 10 lines

+=====================

board/kontron/smarc-sal28/readme.txt new file +8 -0
+
+By default the bootloader will search for the first valid image, starting
+with the internal eMMC. Consult the vendor documentation on how to use the
+DIP switches to select specific boot devices. To use the bootloader
+environment set the boot_targets correspondingly. E.g.:
+
+  # setenv boot_targets usb0
+

Maybe a small hint about selecting the right fdt here?

Quoted 97 lines
board/kontron/smarc-sal28/readme.txt new file +3 -0
+To boot from an USB thumb drive.
+
+Connect your serial cable to SER1 and open your favorite terminal

emulation

board/kontron/smarc-sal28/readme.txt new file +13 -0
+program (baudrate 115200, 8n1). E.g.:
+
+  $ picocom -b 115200 /dev/ttyUSB0
+
+You will get a warning reported by fdisk when you examine the SD card.
+This is because the genimage.cfg file doesn't specify the SD card size
+(as people will naturally have different sized cards), so the
+secondary GPT header is placed after the rootfs rather than at the end
+of the disk where it is expected to be.
+
+You will see something like this at boot time:
+
+[    4.552797] GPT:Primary header thinks Alt. header is not at the end of

the disk.

+[    4.560237] GPT:266272 != 7864319
+[    4.563565] GPT:Alternate GPT header not at the end of the disk.
+[    4.569596] GPT:266272 != 7864319
+[    4.572925] GPT: Use GNU Parted to correct GPT errors.

diff --git a/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules new file mode 100644
index 0000000000..8774bc5581
--- /dev/null
+++
b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

board/kontron/smarc-sal28/readme.txt new file +1 -0
@@ -0,0 +1,8 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0",

DRIVERS=="fsl_enetc", NAME="eno0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", NAME="eno1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.2", DRIVERS=="fsl_enetc", NAME="eno2"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.6", DRIVERS=="fsl_enetc", NAME="eno3"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.0", DRIVERS=="fsl_enetc_vf", NAME="eno0vf0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.1", DRIVERS=="fsl_enetc_vf", NAME="eno0vf1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.2", DRIVERS=="fsl_enetc_vf", NAME="eno1vf0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.3", DRIVERS=="fsl_enetc_vf", NAME="eno1vf1"
diff --git a/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules new file mode 100644
index 0000000000..917c0244ab
--- /dev/null
+++
b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

board/kontron/smarc-sal28/readme.txt new file +1 -0
@@ -0,0 +1,6 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5",

DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p0", NAME="swp0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p1", NAME="swp1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p2", NAME="swp2" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p3", NAME="swp3" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p4", NAME="swp4" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p5", NAME="swp5"

configs/kontron_smarc_sal28_defconfig new file +15 -0
new file mode 100644
index 0000000000..8a7e650ccd
@@ -0,0 +1,23 @@
+BR2_aarch64=y
+BR2_cortex_a72=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_ROOTFS_OVERLAY="board/kontron/smarc-sal28/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/kontron/smarc-sal28/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="v5.7-rc6"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
 
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/kontron/smarc-sal28/linux.fragment"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/fsl-ls1028a-kontron-sl28

freescale/fsl-ls1028a-kontron-sl28-var2
freescale/fsl-ls1028a-kontron-sl28-var3-ads2
freescale/fsl-ls1028a-kontron-sl28-var4
freescale/fsl-ls1028a-kontron-kbox-a-230-ls"

configs/kontron_smarc_sal28_defconfig line 23

Quoted 8 lines
configs/kontron_smarc_sal28_defconfig new file +8 -0
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_IPROUTE2=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="128M"
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y

Maybe it make sense to add linuxptp for this board by default. Do you need a special default config in /etc/defaults for that?

Signature · 4 lines
Heiko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200519/1641d752/attachment-0001.html>
#2 lore raw

PATCH v2 1/1 board: Add Kontron SMARC-sAL28 support

Am 2020-05-19 10:36, schrieb Heiko Thiery:

Quoted 142 lines

Hi Michael,

Am Mo., 18. Mai 2020 um 23:01 Uhr schrieb Michael Walle <[email protected]>:

Quoted 17 lines

Now that upstream supports this board add buildroot support for it, too.

This supports:
- upstream linux kernel, 5.7-rc6 for now. Once 5.7 is released and buildroot will switch to this kernel BR2_LINUX_KERNEL_CUSTOM_VERSION=y
can be removed. Since the support for this board and its SoC is still in
active development, we want to follow the upstream kernel releases for
now.
- building an image which can be installed to eMMC, SD card or USB thumb drive.
- upstream u-boot patches are pending, therefore no support for building a bootloader for now.

Quoted 1 line
Quoted 29 lines

---
Changes since v1:
- added readme.txt
- changed from u-boot boot script to extlinux.conf booting
- enable eudev and added udev rules to properly name network interfaces
- removed CONFIG_FSL_ENETC_HW_TIMESTAMPING=y
- added CONFIG_NET_SCH_CBS, CONFIG_NET_SCH_ETF, CONFIG_NET_SCH_TAPRIO,
CONFIG_FSL_ENETC_QOS and iproute2, as this it the main feature of this
board
- added var2 device tree
- generate PARTUUID in post-build.sh to be able to use the resulting image
on any block device which the board supports for booting
- (keep post-build.sh for consistency reasons)

DEVELOPERS                                    |  2 +
board/kontron/smarc-sal28/extlinux.conf       |  4 ++
board/kontron/smarc-sal28/genimage.cfg        | 11 ++++
board/kontron/smarc-sal28/linux.fragment      | 18 +++++
board/kontron/smarc-sal28/post-build.sh       |  7 ++
board/kontron/smarc-sal28/readme.txt          | 65
+++++++++++++++++++
.../udev/rules.d/70-enetc-networking.rules    |  8 +++
.../udev/rules.d/70-felix-networking.rules    |  6 ++
configs/kontron_smarc_sal28_defconfig         | 23 +++++++
9 files changed, 144 insertions(+)
Quoted 7 lines

create mode 100644 board/kontron/smarc-sal28/extlinux.conf create mode 100644 board/kontron/smarc-sal28/genimage.cfg create mode 100644 board/kontron/smarc-sal28/linux.fragment create mode 100755 board/kontron/smarc-sal28/post-build.sh create mode 100644 board/kontron/smarc-sal28/readme.txt create mode 100644

board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 2 lines

create mode 100644

board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 75 lines

create mode 100644 configs/kontron_smarc_sal28_defconfig

DEVELOPERS +0 -0
index e427ab15d4..c3f4ce8133 100644
@@ -1837,6 +1837,8 @@ F:        package/jasper/

F: package/libstrophe/

N: Michael Walle <[email protected]>

DEVELOPERS +2 -0
+F:     board/kontron/smarc-sal28/
+F:     configs/kontron_smarc_sal28_defconfig

F: package/libavl/

N: Micha? ?yszczek <[email protected]>

board/kontron/smarc-sal28/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..37777ecd5c
@@ -0,0 +1,4 @@
+label buildroot
+  kernel /boot/Image
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait

arm-smmu.disable_bypass=n

board/kontron/smarc-sal28/genimage.cfg new file +11 -0
new file mode 100644
index 0000000000..9ef37de757
@@ -0,0 +1,11 @@
+image sdcard-emmc.img {
+       hdimage {
+               gpt = true
+       }
+
+       partition rootfs {
+               offset = 2M
+               image = rootfs.ext4
+               partition-uuid = %PARTUUID%
+       }
+}
board/kontron/smarc-sal28/linux.fragment new file +18 -0
new file mode 100644
index 0000000000..00bbcc0923
@@ -0,0 +1,18 @@
+CONFIG_NET_DSA=m
+CONFIG_NET_DSA_TAG_OCELOT=m
+CONFIG_NET_DSA_MSCC_FELIX=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBS=m
+CONFIG_NET_SCH_ETF=m
+CONFIG_NET_SCH_TAPRIO=m
+CONFIG_CAN_FLEXCAN=m
+CONFIG_FSL_ENETC=y
+CONFIG_FSL_ENETC_VF=m
+CONFIG_FSL_ENETC_QOS=y
+CONFIG_MSCC_OCELOT_SWITCH=m
+CONFIG_PCIE_DW_PLAT_HOST=y
+CONFIG_GPIO_MPC8XXX=y
+CONFIG_SND_SOC_FSL_SAI=m
+CONFIG_SND_SOC_WM8904=m
+CONFIG_RTC_DRV_RV8803=y
+CONFIG_COMMON_CLK_FSL_SAI=y
board/kontron/smarc-sal28/post-build.sh new file +0 -1
new file mode 100755
index 0000000000..c0fa1c9435
--- /dev/null
Quoted 8 lines

board/kontron/smarc-sal28/post-build.sh line 3

Quoted 5 lines

+++ b/board/kontron/smarc-sal28/post-build.sh

board/kontron/smarc-sal28/post-build.sh new file +3 -0
@@ -0,0 +1,7 @@
+#!/bin/sh
+BOARD_DIR="$(dirname $0)"
+PARTUUID="$(uuidgen)"

To make sure not to take the native host tool set the full path to
uuidgen: $BUILD_HOST}/bin/uuidgen

yep.

Quoted 55 lines
Quoted 45 lines
board/kontron/smarc-sal28/post-build.sh new file +3 -0
+
+install -d "$TARGET_DIR/boot/extlinux/"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/extlinux.conf" >

"$TARGET_DIR/boot/extlinux/extlinux.conf"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"

board/kontron/smarc-sal28/readme.txt new file +28 -0
new file mode 100644
index 0000000000..c5b2ac9bb4
@@ -0,0 +1,65 @@
+Kontron SMARC-sAL28
+===================
+
+How to build it
+===============
+
+Configure Buildroot:
+
+  $ make kontron_smarc_sal28_defconfig
+
+Change settings to fit your needs (optional):
+
+  $ make menuconfig
+
+Compile everything and build the rootfs image:
+
+  $ make
+
+Copying the image to a storage device
+=====================================
+
+Buildroot builds an image which can be written to the internal eMMC
+storage, a SD card or an USB thumb drive. You can use the following
+command on your host:
+
+  $ sudo dd if=output/images/sdcard-emmc.img of=/dev/sdx bs=1M
+
+Where /dev/sdx is the corresponding block device of your SD card or

USB
+thumb drive. To flash it on your internal eMMC use the following command on

board/kontron/smarc-sal28/readme.txt line 36

Quoted 7 lines
board/kontron/smarc-sal28/readme.txt new file +7 -0
+the board:
+
+  # dd if=sdcard-emmc.img of=/dev/mmcblk1 bs=1M
+
+Be sure you have not booted from the internal eMMC in this case!
+
+Booting the the board

Small typo here ;-/

Quoted 13 lines

board/kontron/smarc-sal28/readme.txt line 45

Quoted 11 lines

+=====================

board/kontron/smarc-sal28/readme.txt new file +2 -0
+
+By default the bootloader will search for the first valid image,

starting
+with the internal eMMC. Consult the vendor documentation on how to use the

board/kontron/smarc-sal28/readme.txt new file +5 -0
+DIP switches to select specific boot devices. To use the bootloader
+environment set the boot_targets correspondingly. E.g.:
+
+  # setenv boot_targets usb0
+

Maybe a small hint about selecting the right fdt here?

Will add that.

Quoted 103 lines
Quoted 22 lines
board/kontron/smarc-sal28/readme.txt new file +3 -0
+To boot from an USB thumb drive.
+
+Connect your serial cable to SER1 and open your favorite terminal

emulation

board/kontron/smarc-sal28/readme.txt new file +5 -0
+program (baudrate 115200, 8n1). E.g.:
+
+  $ picocom -b 115200 /dev/ttyUSB0
+
+You will get a warning reported by fdisk when you examine the SD

card.
+This is because the genimage.cfg file doesn't specify the SD card size

board/kontron/smarc-sal28/readme.txt new file +2 -0
+(as people will naturally have different sized cards), so the
+secondary GPT header is placed after the rootfs rather than at the

end

board/kontron/smarc-sal28/readme.txt new file +5 -0
+of the disk where it is expected to be.
+
+You will see something like this at boot time:
+
+[    4.552797] GPT:Primary header thinks Alt. header is not at the

end of the disk.

Quoted 6 lines
+[    4.560237] GPT:266272 != 7864319
+[    4.563565] GPT:Alternate GPT header not at the end of the disk.
+[    4.569596] GPT:266272 != 7864319
+[    4.572925] GPT: Use GNU Parted to correct GPT errors.

diff --git

a/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 1 line

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 5 lines

new file mode 100644
index 0000000000..8774bc5581
--- /dev/null
+++

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 10 lines
board/kontron/smarc-sal28/readme.txt new file +1 -0
@@ -0,0 +1,8 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0",

DRIVERS=="fsl_enetc", NAME="eno0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", NAME="eno1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.2", DRIVERS=="fsl_enetc", NAME="eno2"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.6", DRIVERS=="fsl_enetc", NAME="eno3"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.0",

Quoted 9 lines

DRIVERS=="fsl_enetc_vf", NAME="eno0vf0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.1", DRIVERS=="fsl_enetc_vf", NAME="eno0vf1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.2", DRIVERS=="fsl_enetc_vf", NAME="eno1vf0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.3", DRIVERS=="fsl_enetc_vf", NAME="eno1vf1"
diff --git

a/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 1 line

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 5 lines

new file mode 100644
index 0000000000..917c0244ab
--- /dev/null
+++

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 21 lines
board/kontron/smarc-sal28/readme.txt new file +1 -0
@@ -0,0 +1,6 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5",

DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p0", NAME="swp0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p1", NAME="swp1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p2", NAME="swp2" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p3", NAME="swp3" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p4", NAME="swp4" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p5", NAME="swp5"

configs/kontron_smarc_sal28_defconfig new file +0 -0
new file mode 100644
index 0000000000..8a7e650ccd

configs/kontron_smarc_sal28_defconfig line 5

Quoted 5 lines
configs/kontron_smarc_sal28_defconfig new file +5 -0
@@ -0,0 +1,23 @@
+BR2_aarch64=y
+BR2_cortex_a72=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_ROOTFS_OVERLAY="board/kontron/smarc-sal28/rootfs_overlay"

+BR2_ROOTFS_POST_BUILD_SCRIPT="board/kontron/smarc-sal28/post-build.sh"

configs/kontron_smarc_sal28_defconfig line 12

Quoted 7 lines
configs/kontron_smarc_sal28_defconfig new file +6 -0
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="v5.7-rc6"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y

+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/kontron/smarc-sal28/linux.fragment"

configs/kontron_smarc_sal28_defconfig line 14

Quoted 2 lines
configs/kontron_smarc_sal28_defconfig new file +1 -0
+BR2_LINUX_KERNEL_DTS_SUPPORT=y

+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/fsl-ls1028a-kontron-sl28

Quoted 15 lines

configs/kontron_smarc_sal28_defconfig line 23

Quoted 12 lines

freescale/fsl-ls1028a-kontron-sl28-var2
freescale/fsl-ls1028a-kontron-sl28-var3-ads2
freescale/fsl-ls1028a-kontron-sl28-var4
freescale/fsl-ls1028a-kontron-kbox-a-230-ls"

configs/kontron_smarc_sal28_defconfig new file +8 -0
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_IPROUTE2=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="128M"
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y

Maybe it make sense to add linuxptp for this board by default. Do you need a special default config in /etc/defaults for that?

Does that even work? Because there is an [eth0] section in /etc/linuxptp.cfg. IMHO it would be better to use the "-i" argument instead of having the interface hardcoded in linuxptp.cfg.

-michael

#3 lore raw

PATCH v2 1/1 board: Add Kontron SMARC-sAL28 support

Hi

Am Di., 19. Mai 2020 um 23:14 Uhr schrieb Michael Walle <[email protected]>:

Quoted 345 lines

Am 2020-05-19 10:36, schrieb Heiko Thiery:

Quoted 142 lines

Hi Michael,

Am Mo., 18. Mai 2020 um 23:01 Uhr schrieb Michael Walle <[email protected]>:

Quoted 17 lines

Now that upstream supports this board add buildroot support for it, too.

This supports:
- upstream linux kernel, 5.7-rc6 for now. Once 5.7 is released and buildroot will switch to this kernel BR2_LINUX_KERNEL_CUSTOM_VERSION=y
can be removed. Since the support for this board and its SoC is still in
active development, we want to follow the upstream kernel releases for
now.
- building an image which can be installed to eMMC, SD card or USB thumb drive.
- upstream u-boot patches are pending, therefore no support for building a bootloader for now.

Quoted 1 line
Quoted 29 lines

---
Changes since v1:
- added readme.txt
- changed from u-boot boot script to extlinux.conf booting
- enable eudev and added udev rules to properly name network interfaces
- removed CONFIG_FSL_ENETC_HW_TIMESTAMPING=y
- added CONFIG_NET_SCH_CBS, CONFIG_NET_SCH_ETF, CONFIG_NET_SCH_TAPRIO,
CONFIG_FSL_ENETC_QOS and iproute2, as this it the main feature of this
board
- added var2 device tree
- generate PARTUUID in post-build.sh to be able to use the resulting image
on any block device which the board supports for booting
- (keep post-build.sh for consistency reasons)

DEVELOPERS                                    |  2 +
board/kontron/smarc-sal28/extlinux.conf       |  4 ++
board/kontron/smarc-sal28/genimage.cfg        | 11 ++++
board/kontron/smarc-sal28/linux.fragment      | 18 +++++
board/kontron/smarc-sal28/post-build.sh       |  7 ++
board/kontron/smarc-sal28/readme.txt          | 65
+++++++++++++++++++
.../udev/rules.d/70-enetc-networking.rules    |  8 +++
.../udev/rules.d/70-felix-networking.rules    |  6 ++
configs/kontron_smarc_sal28_defconfig         | 23 +++++++
9 files changed, 144 insertions(+)
Quoted 7 lines

create mode 100644 board/kontron/smarc-sal28/extlinux.conf create mode 100644 board/kontron/smarc-sal28/genimage.cfg create mode 100644 board/kontron/smarc-sal28/linux.fragment create mode 100755 board/kontron/smarc-sal28/post-build.sh create mode 100644 board/kontron/smarc-sal28/readme.txt create mode 100644

board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 2 lines

create mode 100644

board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 75 lines

create mode 100644 configs/kontron_smarc_sal28_defconfig

DEVELOPERS +0 -0
index e427ab15d4..c3f4ce8133 100644
@@ -1837,6 +1837,8 @@ F:        package/jasper/

F: package/libstrophe/

N: Michael Walle <[email protected]>

DEVELOPERS +2 -0
+F:     board/kontron/smarc-sal28/
+F:     configs/kontron_smarc_sal28_defconfig

F: package/libavl/

N: Micha? ?yszczek <[email protected]>

board/kontron/smarc-sal28/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..37777ecd5c
@@ -0,0 +1,4 @@
+label buildroot
+  kernel /boot/Image
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait

arm-smmu.disable_bypass=n

board/kontron/smarc-sal28/genimage.cfg new file +11 -0
new file mode 100644
index 0000000000..9ef37de757
@@ -0,0 +1,11 @@
+image sdcard-emmc.img {
+       hdimage {
+               gpt = true
+       }
+
+       partition rootfs {
+               offset = 2M
+               image = rootfs.ext4
+               partition-uuid = %PARTUUID%
+       }
+}
board/kontron/smarc-sal28/linux.fragment new file +18 -0
new file mode 100644
index 0000000000..00bbcc0923
@@ -0,0 +1,18 @@
+CONFIG_NET_DSA=m
+CONFIG_NET_DSA_TAG_OCELOT=m
+CONFIG_NET_DSA_MSCC_FELIX=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBS=m
+CONFIG_NET_SCH_ETF=m
+CONFIG_NET_SCH_TAPRIO=m
+CONFIG_CAN_FLEXCAN=m
+CONFIG_FSL_ENETC=y
+CONFIG_FSL_ENETC_VF=m
+CONFIG_FSL_ENETC_QOS=y
+CONFIG_MSCC_OCELOT_SWITCH=m
+CONFIG_PCIE_DW_PLAT_HOST=y
+CONFIG_GPIO_MPC8XXX=y
+CONFIG_SND_SOC_FSL_SAI=m
+CONFIG_SND_SOC_WM8904=m
+CONFIG_RTC_DRV_RV8803=y
+CONFIG_COMMON_CLK_FSL_SAI=y
board/kontron/smarc-sal28/post-build.sh new file +0 -1
new file mode 100755
index 0000000000..c0fa1c9435
--- /dev/null
Quoted 8 lines

board/kontron/smarc-sal28/post-build.sh line 3

Quoted 5 lines

+++ b/board/kontron/smarc-sal28/post-build.sh

board/kontron/smarc-sal28/post-build.sh new file +3 -0
@@ -0,0 +1,7 @@
+#!/bin/sh
+BOARD_DIR="$(dirname $0)"
+PARTUUID="$(uuidgen)"

To make sure not to take the native host tool set the full path to
uuidgen: $BUILD_HOST}/bin/uuidgen

yep.

Quoted 55 lines
Quoted 45 lines
board/kontron/smarc-sal28/post-build.sh new file +3 -0
+
+install -d "$TARGET_DIR/boot/extlinux/"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/extlinux.conf" >

"$TARGET_DIR/boot/extlinux/extlinux.conf"
+sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"

board/kontron/smarc-sal28/readme.txt new file +28 -0
new file mode 100644
index 0000000000..c5b2ac9bb4
@@ -0,0 +1,65 @@
+Kontron SMARC-sAL28
+===================
+
+How to build it
+===============
+
+Configure Buildroot:
+
+  $ make kontron_smarc_sal28_defconfig
+
+Change settings to fit your needs (optional):
+
+  $ make menuconfig
+
+Compile everything and build the rootfs image:
+
+  $ make
+
+Copying the image to a storage device
+=====================================
+
+Buildroot builds an image which can be written to the internal eMMC
+storage, a SD card or an USB thumb drive. You can use the following
+command on your host:
+
+  $ sudo dd if=output/images/sdcard-emmc.img of=/dev/sdx bs=1M
+
+Where /dev/sdx is the corresponding block device of your SD card or

USB
+thumb drive. To flash it on your internal eMMC use the following command on

board/kontron/smarc-sal28/readme.txt line 36

Quoted 7 lines
board/kontron/smarc-sal28/readme.txt new file +7 -0
+the board:
+
+  # dd if=sdcard-emmc.img of=/dev/mmcblk1 bs=1M
+
+Be sure you have not booted from the internal eMMC in this case!
+
+Booting the the board

Small typo here ;-/

Quoted 13 lines

board/kontron/smarc-sal28/readme.txt line 45

Quoted 11 lines

+=====================

board/kontron/smarc-sal28/readme.txt new file +2 -0
+
+By default the bootloader will search for the first valid image,

starting
+with the internal eMMC. Consult the vendor documentation on how to use the

board/kontron/smarc-sal28/readme.txt new file +5 -0
+DIP switches to select specific boot devices. To use the bootloader
+environment set the boot_targets correspondingly. E.g.:
+
+  # setenv boot_targets usb0
+

Maybe a small hint about selecting the right fdt here?

Will add that.

Quoted 103 lines
Quoted 22 lines
board/kontron/smarc-sal28/readme.txt new file +3 -0
+To boot from an USB thumb drive.
+
+Connect your serial cable to SER1 and open your favorite terminal

emulation

board/kontron/smarc-sal28/readme.txt new file +5 -0
+program (baudrate 115200, 8n1). E.g.:
+
+  $ picocom -b 115200 /dev/ttyUSB0
+
+You will get a warning reported by fdisk when you examine the SD

card.
+This is because the genimage.cfg file doesn't specify the SD card size

board/kontron/smarc-sal28/readme.txt new file +2 -0
+(as people will naturally have different sized cards), so the
+secondary GPT header is placed after the rootfs rather than at the

end

board/kontron/smarc-sal28/readme.txt new file +5 -0
+of the disk where it is expected to be.
+
+You will see something like this at boot time:
+
+[    4.552797] GPT:Primary header thinks Alt. header is not at the

end of the disk.

Quoted 6 lines
+[    4.560237] GPT:266272 != 7864319
+[    4.563565] GPT:Alternate GPT header not at the end of the disk.
+[    4.569596] GPT:266272 != 7864319
+[    4.572925] GPT: Use GNU Parted to correct GPT errors.

diff --git

a/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 1 line

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 5 lines

new file mode 100644
index 0000000000..8774bc5581
--- /dev/null
+++

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-enetc-networking.rules

Quoted 10 lines
board/kontron/smarc-sal28/readme.txt new file +1 -0
@@ -0,0 +1,8 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0",

DRIVERS=="fsl_enetc", NAME="eno0"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", NAME="eno1"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.2", DRIVERS=="fsl_enetc", NAME="eno2"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.6", DRIVERS=="fsl_enetc", NAME="eno3"
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.0",

Quoted 9 lines

DRIVERS=="fsl_enetc_vf", NAME="eno0vf0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.1", DRIVERS=="fsl_enetc_vf", NAME="eno0vf1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.2", DRIVERS=="fsl_enetc_vf", NAME="eno1vf0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.3", DRIVERS=="fsl_enetc_vf", NAME="eno1vf1"
diff --git

a/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 1 line

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 5 lines

new file mode 100644
index 0000000000..917c0244ab
--- /dev/null
+++

b/board/kontron/smarc-sal28/rootfs_overlay/etc/udev/rules.d/70-felix-networking.rules

Quoted 21 lines
board/kontron/smarc-sal28/readme.txt new file +1 -0
@@ -0,0 +1,6 @@
+ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5",

DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p0", NAME="swp0" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p1", NAME="swp1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p2", NAME="swp2" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p3", NAME="swp3" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p4", NAME="swp4" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p5", NAME="swp5"

configs/kontron_smarc_sal28_defconfig new file +0 -0
new file mode 100644
index 0000000000..8a7e650ccd

configs/kontron_smarc_sal28_defconfig line 5

Quoted 5 lines
configs/kontron_smarc_sal28_defconfig new file +5 -0
@@ -0,0 +1,23 @@
+BR2_aarch64=y
+BR2_cortex_a72=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_ROOTFS_OVERLAY="board/kontron/smarc-sal28/rootfs_overlay"

+BR2_ROOTFS_POST_BUILD_SCRIPT="board/kontron/smarc-sal28/post-build.sh"

configs/kontron_smarc_sal28_defconfig line 12

Quoted 7 lines
configs/kontron_smarc_sal28_defconfig new file +6 -0
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="v5.7-rc6"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y

+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/kontron/smarc-sal28/linux.fragment"

configs/kontron_smarc_sal28_defconfig line 14

Quoted 2 lines
configs/kontron_smarc_sal28_defconfig new file +1 -0
+BR2_LINUX_KERNEL_DTS_SUPPORT=y

+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/fsl-ls1028a-kontron-sl28

Quoted 15 lines

configs/kontron_smarc_sal28_defconfig line 23

Quoted 12 lines

freescale/fsl-ls1028a-kontron-sl28-var2
freescale/fsl-ls1028a-kontron-sl28-var3-ads2
freescale/fsl-ls1028a-kontron-sl28-var4
freescale/fsl-ls1028a-kontron-kbox-a-230-ls"

configs/kontron_smarc_sal28_defconfig new file +8 -0
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_IPROUTE2=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="128M"
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y

Maybe it make sense to add linuxptp for this board by default. Do you need a special default config in /etc/defaults for that?

Quoted 4 lines

Does that even work? Because there is an [eth0] section in /etc/linuxptp.cfg. IMHO it would be better to use the "-i" argument instead of having the interface hardcoded in linuxptp.cfg.

hmm .. your're right. This leads to an error when the interface does not exists. I will prepare a patch for that.

Quoted 1 line

-michael