Skip to contentSkip to conversation

Add nanopi_neo4 board support

PATCH New Marek Belisko 3 participants 8 messages Mar 30, 2020

lore
Share & tools
lore
#0 lore raw

v2 cover Add nanopi_neo4 board support

As nanopi_neo4 was dropped due to the fact that AFT 32 bit oolchain was not implemented. Recently such package was added so revert neo4 config drop + add AFT toolchain option. Also bump kernel to 5.4.

Marek Belisko (4):
Revert "configs/nanopi_neo4: remove defconfig"
nanpi_neo4_config: Enable
BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN option
nanopi_neo4_defconfig: Bump kernel to 5.4
nanopi_neo4_defconfig: Bump rootfs size to 70M

 board/friendlyarm/nanopi-neo4/extlinux.conf |  4 +++
 board/friendlyarm/nanopi-neo4/genimage.cfg  | 22 ++++++++++++
 board/friendlyarm/nanopi-neo4/post-build.sh |  9 +++++
 board/friendlyarm/nanopi-neo4/readme.txt    | 53 +++++++++++++++++++++++++++
 configs/nanopi_neo4_defconfig               | 56 +++++++++++++++++++++++++++++
 5 files changed, 144 insertions(+)
 create mode 100644 board/friendlyarm/nanopi-neo4/extlinux.conf
 create mode 100644 board/friendlyarm/nanopi-neo4/genimage.cfg
 create mode 100755 board/friendlyarm/nanopi-neo4/post-build.sh
 create mode 100644 board/friendlyarm/nanopi-neo4/readme.txt
 create mode 100644 configs/nanopi_neo4_defconfig
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/4 Revert "configs/nanopi_neo4: remove defconfig"

This reverts commit 8af7b11bd8a95bc41e4de46f727f3b0afde465a4.

neo4 config was removed due to the fact that 32 bit toolchain was missing for building AFT and was not added until some time.

Recently in commit d9959b647f2afd09e564bddfc3d21476f9a0f669 package was added to return back neo4 config and use this new option.

---
 board/friendlyarm/nanopi-neo4/extlinux.conf |  4 +++
 board/friendlyarm/nanopi-neo4/genimage.cfg  | 22 ++++++++++++
 board/friendlyarm/nanopi-neo4/post-build.sh |  9 +++++
 board/friendlyarm/nanopi-neo4/readme.txt    | 53 ++++++++++++++++++++++++++++
 configs/nanopi_neo4_defconfig               | 54 +++++++++++++++++++++++++++++
 5 files changed, 142 insertions(+)
 create mode 100644 board/friendlyarm/nanopi-neo4/extlinux.conf
 create mode 100644 board/friendlyarm/nanopi-neo4/genimage.cfg
 create mode 100755 board/friendlyarm/nanopi-neo4/post-build.sh
 create mode 100644 board/friendlyarm/nanopi-neo4/readme.txt
 create mode 100644 configs/nanopi_neo4_defconfig
board/friendlyarm/nanopi-neo4/extlinux.conf new file +4 -0
new file mode 100644
index 0000000..91eef67
@@ -0,0 +1,4 @@
+label NanoPi Neo4 linux
+  kernel /boot/Image
+  devicetree /boot/rk3399-nanopi-neo4.dtb
+  append earlycon=uart8250,mmio32,0xff1a0000 root=/dev/mmcblk1p1 rootwait
board/friendlyarm/nanopi-neo4/genimage.cfg new file +22 -0
new file mode 100644
index 0000000..b8c1cd5
@@ -0,0 +1,22 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot-tpl-spl-dtb {
+		in-partition-table = "no"
+		image = "u-boot-tpl-spl-dtb.img"
+		offset = 32K
+	}
+
+	partition u-boot-dtb {
+		in-partition-table = "no"
+		image = "u-boot.itb"
+		offset = 8M
+		size = 30M
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}
+}
board/friendlyarm/nanopi-neo4/post-build.sh new file +9 -0
new file mode 100755
index 0000000..e852ba6
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+MKIMAGE=$HOST_DIR/bin/mkimage
+BOARD_DIR="$(dirname $0)"
+
+$MKIMAGE -n rk3399 -T rksd -d $BINARIES_DIR/u-boot-tpl-dtb.bin $BINARIES_DIR/u-boot-tpl-dtb.img
+cat $BINARIES_DIR/u-boot-tpl-dtb.img $BINARIES_DIR/u-boot-spl-dtb.bin > $BINARIES_DIR/u-boot-tpl-spl-dtb.img
+
+install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
board/friendlyarm/nanopi-neo4/readme.txt new file +53 -0

53 lines not on this page · raw message

configs/nanopi_neo4_defconfig new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/4 Revert "configs/nanopi_neo4: remove defconfig"

Quoted 7 lines · On Mon, 30 Mar 2020 19:22:58 +0200 Marek Belisko…

This reverts commit 8af7b11bd8a95bc41e4de46f727f3b0afde465a4.

neo4 config was removed due to the fact that 32 bit toolchain was missing for building AFT and was not added until some time.

Recently in commit d9959b647f2afd09e564bddfc3d21476f9a0f669 package was added to return back neo4 config and use this new option.

Your Signed-off-by is missing. However, I think a revert is the bad approach, indeed this commit by itself is still broken, it needs the second patch in your series to work correctly.

So could you instead simply resubmit a new neo4 defconfig ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 1/4 Revert "configs/nanopi_neo4: remove defconfig"

Quoted 13 lines · Thomas Petazzoni
Quoted 7 lines · On Mon, 30 Mar 2020 19:22:58 +0200 Marek Belisko…

This reverts commit 8af7b11bd8a95bc41e4de46f727f3b0afde465a4.

neo4 config was removed due to the fact that 32 bit toolchain was missing for building AFT and was not added until some time.

Recently in commit d9959b647f2afd09e564bddfc3d21476f9a0f669 package was added to return back neo4 config and use this new option.

Quoted 5 lines

Your Signed-off-by is missing. However, I think a revert is the bad approach, indeed this commit by itself is still broken, it needs the second patch in your series to work correctly.

So could you instead simply resubmit a new neo4 defconfig ?

You mean squash all other commits to one and post as initial commit in:d1cd9cdf269488d6adeb0cc6d2250cf6ffe1b3ed
Thanks.

Quoted 8 lines

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

marek

#4 lore raw

PATCH v2 1/4 Revert "configs/nanopi_neo4: remove defconfig"

Quoted 3 lines · On Mon, 30 Mar 2020 21:34:29 +0200 Belisko Marek <[email protected]>…
Quoted 1 line

So could you instead simply resubmit a new neo4 defconfig ?

You mean squash all other commits to one and post as initial commit in:d1cd9cdf269488d6adeb0cc6d2250cf6ffe1b3ed

Yes, please. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH v2 2/4 nanpi_neo4_config: Enable BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN option

In reply to Marek Belisko

With this option enabled AFT to neo4 will be build without issues. For more details see commit: 8af7b11bd8a95bc41e4de46f727f3b0afde465a4 and d9959b647f2afd09e564bddfc3d21476f9a0f669

---
 configs/nanopi_neo4_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/nanopi_neo4_defconfig +1 -0
index 0e58aea..2bffe66 100644
@@ -11,6 +11,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v2.0"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3399"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN=y
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
 
 # Bootloader
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 3/4 nanopi_neo4_defconfig: Bump kernel to 5.4

In reply to Marek Belisko
---
 configs/nanopi_neo4_defconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
configs/nanopi_neo4_defconfig +3 -3
index 2bffe66..f68b5e2 100644
@@ -2,8 +2,8 @@
 BR2_aarch64=y
 BR2_cortex_a72_a53=y
 
-# Linux headers same as kernel, a 5.2 series
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_2=y
+# Linux headers same as kernel, a 5.4 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y
 
 # Firmware
 BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
@@ -34,7 +34,7 @@ BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl-dtb.bin tpl/u-boot-tpl-dtb.bin"
 # Kernel
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.2"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.4.18"
 BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3399-nanopi-neo4"
Signature · 1 line
2.7.4
#7 lore raw

PATCH v2 4/4 nanopi_neo4_defconfig: Bump rootfs size to 70M

In reply to Marek Belisko

When bumped kernel to 5.4 rootfs increase a bit and it doesn't fit to default 60M. Increase size to 70M.

---
 configs/nanopi_neo4_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/nanopi_neo4_defconfig +1 -0
index f68b5e2..8cc9bb4 100644
@@ -46,6 +46,7 @@ BR2_TARGET_GENERIC_HOSTNAME="NanoPi Neo4"
 BR2_TARGET_GENERIC_ISSUE="Welcome to NanoPi Neo4!"
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="70M"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.7.4