Skip to contentSkip to conversation

boards: add FriendlyARM Nanopi NEO

PATCH New Yann E. MORIN 3 participants 6 messages Nov 3, 2016 – Nov 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boards: add FriendlyARM Nanopi NEO

The FriendlyARM Nanopi NEO is a 4x4cm? board with an Allwiner H3 SoC:
- quad-core Cortex-A7 @1.2GHz
- 256 or 512MiB of DDR
- uSDCard as only storage option
- 3x USB 2.0 host (one socket, two on expansion pin-holes)
- 1x USB 2.0 OTG (also used as power source)
- 10/100 etehrnet MAC
- GPIOs, SPI, I2c...

Support for the Nanopi NEO in U-Boot and Linux is very recent, so much so that we have to use an -rc tag for U-Boot and a special Linux tree.

As for Linux, I pushed a git tree on Github with a single tag that matches what is currently queued in the sunxi-next queued for 4.10, based on 4.9-rc3. All those commits are from Maxime's tree, the maintainer for most sunxi stuff.

This also means that we can't use the Linux headers from the kernel being built (which is what we usually do) because those report 4.9, while Buildroot currently knows only of 4.8 at best. So this is what we use.

Unfortunately, support for the ethernet MAC and the USB OTG are not yet upstream, but are being actively worked on.

The Nanopi NEO is very similar to the Orangepi PC, so I was able to scanvenge most of its configuration. ;-)

Thanks Maxime for your help on IRC! :-)

---
Notes:
- when support finally lands in upstream and there is a release,

    I'll update this defconfig as well;
  - this defconfig should also work for the Nanopi NEO AIR, which
    carries a WiFi+BT chip in lieue of an ethernet connector plus 8GiB
    of eMMC; totally untested by lack of the board so far, to come
    soonish I hope.
---
 board/nanopi-neo/boot.cmd      |  8 ++++++++
 board/nanopi-neo/genimage.cfg  | 34 +++++++++++++++++++++++++++++++++
 board/nanopi-neo/post-build.sh | 12 ++++++++++++
 board/nanopi-neo/post-image.sh | 15 +++++++++++++++
 board/nanopi-neo/readme.txt    | 43 ++++++++++++++++++++++++++++++++++++++++++
 configs/nanopi_neo_defconfig   | 42 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 154 insertions(+)
 create mode 100644 board/nanopi-neo/boot.cmd
 create mode 100644 board/nanopi-neo/genimage.cfg
 create mode 100755 board/nanopi-neo/post-build.sh
 create mode 100755 board/nanopi-neo/post-image.sh
 create mode 100644 board/nanopi-neo/readme.txt
 create mode 100644 configs/nanopi_neo_defconfig
board/nanopi-neo/boot.cmd new file +8 -0
new file mode 100644
index 0000000..7874057
@@ -0,0 +1,8 @@
+setenv fdt_high ffffffff
+
+setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
+
+fatload mmc 0 $kernel_addr_r zImage
+fatload mmc 0 $fdt_addr_r sun8i-h3-nanopi-neo.dtb
+
+bootz $kernel_addr_r - $fdt_addr_r
board/nanopi-neo/genimage.cfg new file +34 -0
new file mode 100644
index 0000000..ad43d31
@@ -0,0 +1,34 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"zImage",
+			"sun8i-h3-nanopi-neo.dtb",
+			"boot.scr"
+		}
+	}
+	size = 10M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot-sunxi-with-spl.bin"
+		offset = 8192
+		size = 1040384 # 1MB - 8192
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		size = 32M
+	}
+}
board/nanopi-neo/post-build.sh new file +12 -0
new file mode 100755
index 0000000..e6791e7
@@ -0,0 +1,12 @@
+#!/bin/sh
+# post-build.sh for Nanopi NEO, based on the Orange Pi PC
+# 2013, Carlo Caione <[email protected]>
+# 2016, "Yann E. MORIN" <[email protected]>
+
+BOARD_DIR="$( dirname "${0}" )"
+MKIMAGE="${HOST_DIR}/usr/bin/mkimage"
+BOOT_CMD="${BOARD_DIR}/boot.cmd"
+BOOT_CMD_H="${BINARIES_DIR}/boot.scr"
+
+# U-Boot script
+"${MKIMAGE}" -C none -A arm -T script -d "${BOOT_CMD}" "${BOOT_CMD_H}"
board/nanopi-neo/post-image.sh new file +15 -0
new file mode 100755
index 0000000..740386e
@@ -0,0 +1,15 @@
+#!/bin/sh
+# post-image.sh for Nanopi NEO, based on the Orange Pi PC
+
+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}"
board/nanopi-neo/readme.txt new file +43 -0

43 lines not on this page · raw message

configs/nanopi_neo_defconfig new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 boards: add FriendlyARM Nanopi NEO

Hello,

Quoted 47 lines · Yann E. MORIN

The FriendlyARM Nanopi NEO is a 4x4cm? board with an Allwiner H3 SoC:
- quad-core Cortex-A7 @1.2GHz
- 256 or 512MiB of DDR
- uSDCard as only storage option
- 3x USB 2.0 host (one socket, two on expansion pin-holes)
- 1x USB 2.0 OTG (also used as power source)
- 10/100 etehrnet MAC
- GPIOs, SPI, I2c...

Support for the Nanopi NEO in U-Boot and Linux is very recent, so much so that we have to use an -rc tag for U-Boot and a special Linux tree.

As for Linux, I pushed a git tree on Github with a single tag that matches what is currently queued in the sunxi-next queued for 4.10, based on 4.9-rc3. All those commits are from Maxime's tree, the maintainer for most sunxi stuff.

This also means that we can't use the Linux headers from the kernel being built (which is what we usually do) because those report 4.9, while Buildroot currently knows only of 4.8 at best. So this is what we use.

Unfortunately, support for the ethernet MAC and the USB OTG are not yet upstream, but are being actively worked on.

The Nanopi NEO is very similar to the Orangepi PC, so I was able to scanvenge most of its configuration. ;-)

Thanks Maxime for your help on IRC! :-)

---
Notes:
- when support finally lands in upstream and there is a release,

    I'll update this defconfig as well;
  - this defconfig should also work for the Nanopi NEO AIR, which
    carries a WiFi+BT chip in lieue of an ethernet connector plus 8GiB
    of eMMC; totally untested by lack of the board so far, to come
    soonish I hope.
---
 board/nanopi-neo/boot.cmd      |  8 ++++++++
 board/nanopi-neo/genimage.cfg  | 34 +++++++++++++++++++++++++++++++++
 board/nanopi-neo/post-build.sh | 12 ++++++++++++
 board/nanopi-neo/post-image.sh | 15 +++++++++++++++
 board/nanopi-neo/readme.txt    | 43 ++++++++++++++++++++++++++++++++++++++++++
Quoted 8 lines
 configs/nanopi_neo_defconfig   | 42 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 154 insertions(+)
 create mode 100644 board/nanopi-neo/boot.cmd
 create mode 100644 board/nanopi-neo/genimage.cfg
 create mode 100755 board/nanopi-neo/post-build.sh
 create mode 100755 board/nanopi-neo/post-image.sh
 create mode 100644 board/nanopi-neo/readme.txt
 create mode 100644 configs/nanopi_neo_defconfig

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 boards: add FriendlyARM Nanopi NEO

In reply to Yann E. MORIN

Hi,

Quoted 11 lines · Yann E. MORIN

The FriendlyARM Nanopi NEO is a 4x4cm? board with an Allwiner H3 SoC:
- quad-core Cortex-A7 @1.2GHz
- 256 or 512MiB of DDR
- uSDCard as only storage option
- 3x USB 2.0 host (one socket, two on expansion pin-holes)
- 1x USB 2.0 OTG (also used as power source)
- 10/100 etehrnet MAC
- GPIOs, SPI, I2c...

Support for the Nanopi NEO in U-Boot and Linux is very recent, so much so that we have to use an -rc tag for U-Boot and a special Linux tree.

I'm not sure why you need that custom tree, the DT is in 4.9 already.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20161103/b2ab29cc/attachment.asc>
#3 lore raw

PATCH 1/1 boards: add FriendlyARM Nanopi NEO

Maxime, All,

On 2016-11-03 22:02 +0100, Maxime Ripard spake thusly:

Quoted 10 lines · Yann E. MORIN
Quoted 9 lines

The FriendlyARM Nanopi NEO is a 4x4cm? board with an Allwiner H3 SoC:
- quad-core Cortex-A7 @1.2GHz
- 256 or 512MiB of DDR
- uSDCard as only storage option
- 3x USB 2.0 host (one socket, two on expansion pin-holes)
- 1x USB 2.0 OTG (also used as power source)
- 10/100 etehrnet MAC
- GPIOs, SPI, I2c...

Quoted 4 lines
Quoted 2 lines

Support for the Nanopi NEO in U-Boot and Linux is very recent, so much so that we have to use an -rc tag for U-Boot and a special Linux tree.

I'm not sure why you need that custom tree, the DT is in 4.9 already.

Yup. But with 4.9-rc3, I had mmc corruption. With your tree and sunxi-next, I don't have those. Not sure what hapenned...

I can re-check to be sure.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 boards: add FriendlyARM Nanopi NEO

Quoted 16 lines · Yann E. MORIN

Maxime, All,

On 2016-11-03 22:02 +0100, Maxime Ripard spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 11 lines

The FriendlyARM Nanopi NEO is a 4x4cm? board with an Allwiner H3 SoC:
- quad-core Cortex-A7 @1.2GHz
- 256 or 512MiB of DDR
- uSDCard as only storage option
- 3x USB 2.0 host (one socket, two on expansion pin-holes)
- 1x USB 2.0 OTG (also used as power source)
- 10/100 etehrnet MAC
- GPIOs, SPI, I2c...

Support for the Nanopi NEO in U-Boot and Linux is very recent, so much so that we have to use an -rc tag for U-Boot and a special Linux tree.

Quoted 6 lines
Quoted 1 line

I'm not sure why you need that custom tree, the DT is in 4.9 already.

Yup. But with 4.9-rc3, I had mmc corruption. With your tree and sunxi-next, I don't have those. Not sure what hapenned...

I can re-check to be sure.

I don't think we have any fix in there for the H3 and the MMC. If something is missing in 4.9, then it should be reported :)

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20161103/b907ce8e/attachment.asc>
#5 lore raw

PATCH 1/1 boards: add FriendlyARM Nanopi NEO

Maxime, All,

On 2016-11-03 22:49 +0100, Maxime Ripard spake thusly:

Quoted 19 lines · Yann E. MORIN
Quoted 18 lines

Maxime, All,

On 2016-11-03 22:02 +0100, Maxime Ripard spake thusly:

Quoted 14 lines · Yann E. MORIN
Quoted 11 lines

The FriendlyARM Nanopi NEO is a 4x4cm? board with an Allwiner H3 SoC:
- quad-core Cortex-A7 @1.2GHz
- 256 or 512MiB of DDR
- uSDCard as only storage option
- 3x USB 2.0 host (one socket, two on expansion pin-holes)
- 1x USB 2.0 OTG (also used as power source)
- 10/100 etehrnet MAC
- GPIOs, SPI, I2c...

Support for the Nanopi NEO in U-Boot and Linux is very recent, so much so that we have to use an -rc tag for U-Boot and a special Linux tree.

I'm not sure why you need that custom tree, the DT is in 4.9 already.

Quoted 7 lines
Quoted 4 lines

Yup. But with 4.9-rc3, I had mmc corruption. With your tree and sunxi-next, I don't have those. Not sure what hapenned...

I can re-check to be sure.

I don't think we have any fix in there for the H3 and the MMC. If something is missing in 4.9, then it should be reported :)

So, I re-tried with 4.9-rc3, and it does indeed work correctly now. Probably me borking my setup previously.

I'll send an update to that defconfig to use plain 4.9-rc3.

Thanks for the feedback! :-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'