Skip to contentSkip to conversation

board: Add FriendlyARM Nanopi NEO Plus2 support

PATCH New Aussedat Louis 2 participants 2 messages Oct 17, 2019 – Oct 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: Add FriendlyARM Nanopi NEO Plus2 support

From: aussedatlo <[email protected]>

board with below features:
- U-Boot 2019.01
- Linux 5.0
- Default packages from buildroot

---
 .gitlab-ci.yml                                |  1 +
 DEVELOPERS                                    |  4 ++
 board/friendlyarm/nanopi-neo-plus2/boot.cmd   |  6 ++
 .../friendlyarm/nanopi-neo-plus2/genimage.cfg | 39 ++++++++++++
 .../nanopi-neo-plus2/linux-extras.config      | 10 +++
 board/friendlyarm/nanopi-neo-plus2/readme.txt | 37 +++++++++++
 ...3430-sdio.friendlyarm,nanopi-neo-plus2.txt | 53 ++++++++++++++++
 .../friendlyarm_nanopi_neo_plus2_defconfig    | 63 +++++++++++++++++++
 8 files changed, 213 insertions(+)
 create mode 100644 board/friendlyarm/nanopi-neo-plus2/boot.cmd
 create mode 100644 board/friendlyarm/nanopi-neo-plus2/genimage.cfg
 create mode 100644 board/friendlyarm/nanopi-neo-plus2/linux-extras.config
 create mode 100644 board/friendlyarm/nanopi-neo-plus2/readme.txt
 create mode 100644 board/friendlyarm/nanopi-neo-plus2/rootfs_overlay/lib/firmware/brcm/brcmfmac43430-sdio.friendlyarm,nanopi-neo-plus2.txt
 create mode 100644 configs/friendlyarm_nanopi_neo_plus2_defconfig
.gitlab-ci.yml +1 -0
index 59efd51340..3f584dfb0b 100644
@@ -185,6 +185,7 @@ freescale_t1040d4rdb_defconfig: { extends: .defconfig }
 freescale_t2080_qds_rdb_defconfig: { extends: .defconfig }
 friendlyarm_nanopi_a64_defconfig: { extends: .defconfig }
 friendlyarm_nanopi_neo2_defconfig: { extends: .defconfig }
+friendlyarm_nanopi_neo_plus2_defconfig: { extends: .defconfig }
 galileo_defconfig: { extends: .defconfig }
 grinn_chiliboard_defconfig: { extends: .defconfig }
 grinn_liteboard_defconfig: { extends: .defconfig }
DEVELOPERS +4 -0
index 9a24ca30ca..941462a077 100644
@@ -2512,3 +2512,7 @@ F:	package/qjson/
 F:	package/quazip/
 F:	package/shapelib/
 F:	package/tinc/
+
+N:  Aussedat Louis <[email protected]>
+F:	board/friendlyarm/nanopi-neo-plus2/
+F:	configs/friendlyarm_nanopi_neo_plus2_defconfig
board/friendlyarm/nanopi-neo-plus2/boot.cmd new file +6 -0
new file mode 100644
index 0000000000..227604a23d
@@ -0,0 +1,6 @@
+setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
+
+fatload mmc 0 $kernel_addr_r Image
+fatload mmc 0 $fdt_addr_r sun50i-h5-nanopi-neo-plus2.dtb
+
+booti $kernel_addr_r - $fdt_addr_r
board/friendlyarm/nanopi-neo-plus2/genimage.cfg new file +39 -0
new file mode 100644
index 0000000000..a4c2a7a894
@@ -0,0 +1,39 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"Image",
+			"sun50i-h5-nanopi-neo-plus2.dtb",
+			"boot.scr"
+		}
+	}
+	size = 64M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition spl {
+		in-partition-table = "no"
+		image = "sunxi-spl.bin"
+		offset = 8192
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot.itb"
+		offset = 40K
+		size = 1M # 1MB - 40K
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}
+}
board/friendlyarm/nanopi-neo-plus2/linux-extras.config new file +10 -0
new file mode 100644
index 0000000000..f73f582331
@@ -0,0 +1,10 @@
+# wireless core
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+CONFIG_MAC80211=y
+CONFIG_CFG80211_WEXT=y
+
+# wireless drivers
+CONFIG_WLAN=y
+CONFIG_WLAN_VENDOR_BROADCOM=y
+CONFIG_BRCMFMAC=m
\ No newline at end of file
board/friendlyarm/nanopi-neo-plus2/readme.txt new file +37 -0
new file mode 100644
index 0000000000..ae59952029
@@ -0,0 +1,37 @@
+Intro
+=====
+
+This default configuration will allow you to start experimenting with the
+buildroot environment for the Nanopi NEO Plus2. With the current configuration
+it will bring-up the board, and allow access through the serial console.
+
+Nanopi NEO2 link:
+http://nanopi.io/nanopi-neo-plus2.html
+
+Wiki link:
+http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO_Plus2
+
+This configuration uses U-Boot mainline and kernel mainline.
+
+How to build
+============
+
+    $ make friendlyarm_nanopi_neo_plus2_defconfig
+    $ make
+
+Note: you will need access to the internet to download the required
+sources.
+
+How to write the SD card
+========================
+
+Once the build process is finished you will have an image called "sdcard.img"
+in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+  $ sudo sync
+
+Insert the micro SDcard in your Nanopi NEO Plus2 and power it up. The console
+is on the serial line, 115200 8N1.
board/friendlyarm/nanopi-neo-plus2/rootfs_overlay/lib/firmware/brcm/brcmfmac43430-sdio.friendlyarm,nanopi-neo-plus2.txt new file +53 -0

53 lines not on this page · raw message

configs/friendlyarm_nanopi_neo_plus2_defconfig new file +63 -0

63 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 board: Add FriendlyARM Nanopi NEO Plus2 support

Hi Aussedat,

Quoted 1 line · Aussedat Louis

From: aussedatlo <[email protected]>

Please set your name correctly with `git config --global user.name="Aussedat
Louis"`.

I've fixed that and applied to master, thanks.

This is a pretty good patch for a first contribution! Still, there are a few
extensions I'd like to ask, if you have the time for it.

Quoted 4 lines

board with below features:
- U-Boot 2019.01
- Linux 5.0

These are old versions, and the kernel is EOL. Could you update to the latest
of each (and of course test if it actually still works on the board)?

It would also be nice to do the same for the other friendlyarm boards.

Quoted 3 lines

- Default packages from buildroot

[snip]

Quoted 34 lines
board/friendlyarm/nanopi-neo-plus2/genimage.cfg new file +28 -0
new file mode 100644
index 0000000000..a4c2a7a894
@@ -0,0 +1,39 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"Image",
+			"sun50i-h5-nanopi-neo-plus2.dtb",
+			"boot.scr"
+		}
+	}
+	size = 64M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition spl {
+		in-partition-table = "no"
+		image = "sunxi-spl.bin"
+		offset = 8192
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot.itb"
+		offset = 40K
+		size = 1M # 1MB - 40K
+	}
+

board/friendlyarm/nanopi-neo-plus2/genimage.cfg line 38

Quoted 10 lines
board/friendlyarm/nanopi-neo-plus2/genimage.cfg new file +10 -0
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}

For booting from eMMC, U-Boot seems to evolve towards having the kernel inside
the rootfs in /boot, with an extlinux.conf instead of uEnv.txt to define boot parameters. See for example orangepi-lite2. It would be nice to do the same for the friendlyarm boards.

Quoted 8 lines
board/friendlyarm/nanopi-neo-plus2/genimage.cfg new file +1 -0
+}
board/friendlyarm/nanopi-neo-plus2/linux-extras.config new file +1 -0
new file mode 100644
index 0000000000..f73f582331
@@ -0,0 +1,10 @@
+# wireless core

board/friendlyarm/nanopi-neo-plus2/linux-extras.config line 10

Quoted 10 lines
board/friendlyarm/nanopi-neo-plus2/linux-extras.config new file +9 -0
+CONFIG_WIRELESS=y
+CONFIG_CFG80211=y
+CONFIG_MAC80211=y
+CONFIG_CFG80211_WEXT=y
+
+# wireless drivers
+CONFIG_WLAN=y
+CONFIG_WLAN_VENDOR_BROADCOM=y
+CONFIG_BRCMFMAC=m
\ No newline at end of file

I've added a newline here.

[snip]

Regards,
Arnout