* [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO
@ 2016-11-03 20:17 Yann E. MORIN
2016-11-03 20:43 ` Thomas Petazzoni
2016-11-03 21:02 ` Maxime Ripard
0 siblings, 2 replies; 6+ messages in thread
From: Yann E. MORIN @ 2016-11-03 20:17 UTC (permalink / raw)
To: buildroot
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! :-)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
---
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
diff --git a/board/nanopi-neo/boot.cmd b/board/nanopi-neo/boot.cmd
new file mode 100644
index 0000000..7874057
--- /dev/null
+++ b/board/nanopi-neo/boot.cmd
@@ -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
diff --git a/board/nanopi-neo/genimage.cfg b/board/nanopi-neo/genimage.cfg
new file mode 100644
index 0000000..ad43d31
--- /dev/null
+++ b/board/nanopi-neo/genimage.cfg
@@ -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
+ }
+}
diff --git a/board/nanopi-neo/post-build.sh b/board/nanopi-neo/post-build.sh
new file mode 100755
index 0000000..e6791e7
--- /dev/null
+++ b/board/nanopi-neo/post-build.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# post-build.sh for Nanopi NEO, based on the Orange Pi PC
+# 2013, Carlo Caione <carlo.caione@gmail.com>
+# 2016, "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+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}"
diff --git a/board/nanopi-neo/post-image.sh b/board/nanopi-neo/post-image.sh
new file mode 100755
index 0000000..740386e
--- /dev/null
+++ b/board/nanopi-neo/post-image.sh
@@ -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}"
diff --git a/board/nanopi-neo/readme.txt b/board/nanopi-neo/readme.txt
new file mode 100644
index 0000000..95fc628
--- /dev/null
+++ b/board/nanopi-neo/readme.txt
@@ -0,0 +1,43 @@
+Intro
+=====
+
+The instructions herein are valid for the FriendlyARM NanoPi NEO,
+both the 256MiB and 512MiB versions. They should also work the the
+NanoPi NEO Air, but this is untested so far.
+
+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 ethernet 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.
+
+Unfortunately, support for the ethernet MAC and the USB OTG are not
+yet upstream, but are being actively worked on.
+
+
+How to build
+============
+
+ $ make nanopi_neo_defconfig
+ $ make
+
+Note: you will need access to the internet to download the required
+sources.
+
+You will then obtain an image ready to be written to your micro SDcard:
+
+ $ dd if=output/images/sdcard.img of=/dev/sdX bs=1M
+
+Notes:
+ - replace 'sdX' with the actual device with your micro SDcard,
+ - you may need to be root to do that (use 'sudo').
+
+Insert the micro SDcard in your NanoPi NEO and power it up. The console
+is on the serial line, 115200 8N1.
diff --git a/configs/nanopi_neo_defconfig b/configs/nanopi_neo_defconfig
new file mode 100644
index 0000000..2f4ea37
--- /dev/null
+++ b/configs/nanopi_neo_defconfig
@@ -0,0 +1,42 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_ARM_FPU_VFPV4=y
+
+# Cannot use same headers as the kernel, because kernel is 4.9
+# and we only know 4.8 at best so far
+BR2_KERNEL_HEADERS_4_8=y
+
+BR2_TARGET_GENERIC_HOSTNAME="nanopi-neo"
+BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the NanoPi NEO"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/nanopi-neo/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/nanopi-neo/post-image.sh"
+
+# Use a special kernel tree until all support finally lands upstream
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/yann-morin-1998/linux"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="4.9-rc3-sunxi-next-2016-11-02"
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h3-nanopi-neo"
+
+# Use an -rc tag because the defconfig is very recent
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.11-rc3"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nanopi_neo"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
+
+# Build an sdcard image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_BLOCKS=32768
+BR2_TARGET_ROOTFS_EXT2_INODES=8192
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO
2016-11-03 20:17 [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO Yann E. MORIN
@ 2016-11-03 20:43 ` Thomas Petazzoni
2016-11-03 21:02 ` Maxime Ripard
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2016-11-03 20:43 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 3 Nov 2016 21:17:58 +0100, Yann E. MORIN wrote:
> 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! :-)
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
>
> ---
> 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
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO
2016-11-03 20:17 [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO Yann E. MORIN
2016-11-03 20:43 ` Thomas Petazzoni
@ 2016-11-03 21:02 ` Maxime Ripard
2016-11-03 21:09 ` Yann E. MORIN
1 sibling, 1 reply; 6+ messages in thread
From: Maxime Ripard @ 2016-11-03 21:02 UTC (permalink / raw)
To: buildroot
Hi,
On Thu, Nov 03, 2016 at 09:17:58PM +0100, Yann E. MORIN wrote:
> 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
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO
2016-11-03 21:02 ` Maxime Ripard
@ 2016-11-03 21:09 ` Yann E. MORIN
2016-11-03 21:49 ` Maxime Ripard
0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2016-11-03 21:09 UTC (permalink / raw)
To: buildroot
Maxime, All,
On 2016-11-03 22:02 +0100, Maxime Ripard spake thusly:
> On Thu, Nov 03, 2016 at 09:17:58PM +0100, Yann E. MORIN wrote:
> > 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.
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.
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO
2016-11-03 21:09 ` Yann E. MORIN
@ 2016-11-03 21:49 ` Maxime Ripard
2016-11-04 17:12 ` Yann E. MORIN
0 siblings, 1 reply; 6+ messages in thread
From: Maxime Ripard @ 2016-11-03 21:49 UTC (permalink / raw)
To: buildroot
On Thu, Nov 03, 2016 at 10:09:57PM +0100, Yann E. MORIN wrote:
> Maxime, All,
>
> On 2016-11-03 22:02 +0100, Maxime Ripard spake thusly:
> > On Thu, Nov 03, 2016 at 09:17:58PM +0100, Yann E. MORIN wrote:
> > > 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.
>
> 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
--
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO
2016-11-03 21:49 ` Maxime Ripard
@ 2016-11-04 17:12 ` Yann E. MORIN
0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2016-11-04 17:12 UTC (permalink / raw)
To: buildroot
Maxime, All,
On 2016-11-03 22:49 +0100, Maxime Ripard spake thusly:
> On Thu, Nov 03, 2016 at 10:09:57PM +0100, Yann E. MORIN wrote:
> > Maxime, All,
> >
> > On 2016-11-03 22:02 +0100, Maxime Ripard spake thusly:
> > > On Thu, Nov 03, 2016 at 09:17:58PM +0100, Yann E. MORIN wrote:
> > > > 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.
> >
> > 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.
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-04 17:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-03 20:17 [Buildroot] [PATCH] boards: add FriendlyARM Nanopi NEO Yann E. MORIN
2016-11-03 20:43 ` Thomas Petazzoni
2016-11-03 21:02 ` Maxime Ripard
2016-11-03 21:09 ` Yann E. MORIN
2016-11-03 21:49 ` Maxime Ripard
2016-11-04 17:12 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox