January 15, 2023
NetBSD on the Orange Pi - recent release (NetBSD 9.3)
Apart from Allwinner chips, there are ports to the Rockchip 3399 (and others) as well as the BBB,
even the original Beaglebone White. The name "evbarm" was coined during work on the first ARM based
board, but is somewhat out of date now that there are many other ports.
What flavor
Immediately I am confronted with a series of perplexing choices.
Which of these do I want to download for my OrangePi with the Allwinner H3?
- armv6hf
- armv7hf
- armv7hfeb
- aarch64
I can eliminate aarch64 (that would be for my H5 allwinner boards).
The explanation for the rest follows shortly below on the main "evbarm" page.
"hf" stands for "Hard Float"
The armv6hf is for a machine with an ARMv6-A (such as the original raspberry pi).
The armv7hf is for an ARMv7-A machine (most recent and common 32 bit ARM boards).
The armv7hfeb is the above, but with hardware running in big endian (not for me).
Find armv7.img
I will also need a board specific U-boot that is 2018.05 or later.
Something I do not have. But we will ignore this for now.
They say that armv7.img is "a complete NetBSD operating system image).
It can be found in
It is about 318M in size. Curiously they also offer an ISO image for the
entire armv7hf release, I'm not entirely sure what a person would do with that.
Now for U-Boot
So I need a recent vintage U-Boot specific to the Allwinner H3.
They give instructions using pkgsrc, but these assume you already have NetBSD
running on some system. In my case I do not (this is the classic bootstrapping
dilemna). They also say (for which I am grateful) that you can extract the image
from u-boot-*.tgz in an existing NetBSD binary package set.
I go to this link:
And indeed there is a long list of u-boot-*.tgz options here.
The board I want to work with is an "orange pi pc plus".
Considerable care is required here, along with knowledge of the confusing and misleading
naming scheme used by Orange Pi.
- "orangepi-pc" which indeed has the Allwinner H3, but no emmc.
- "orangepi-pc plus 2e" has the Allwinner H3, 16G of emmc and gigabit ethernet.
- "orangepi 2" has the H3, but no emmc.
- "nanopi neo" has the H3, no emmc, and 512M of ram.
- Avoid (for this round) the "orangepi pc2" which has the H5 chip.
It seems odd that the "pc2" is in here with the 32 bit stuff, but then when you consider
now confusing all these product names are, it isn't really a surprise at all.
I download al of the above.
Of these choices, I feel most tempted to try using the plain old "orange pi pc" first.
-rw-r--r-- 1 tom tom 237206 Jan 15 16:52 u-boot-orangepi-pc-2018.11.tgz
This contains two files:
share/u-boot/orangepi-pc/installboot.plist
share/u-boot/orangepi-pc/u-boot-sunxi-with-spl.bin
I extract these, and delete the installboot.plist file.
Also, in preparation for the next step:
gunzip armv7.img
This turns out to be a tidy 1.2G and will be no problem to fit onto my 16G card.
Make the SD card
I drag out my USB flash card reader and grab this 16G micro SD card that has been laying on my desk for months.
make sdcard
dd if=u-boot-sunxi-with-spl.bin of=/dev/sdg bs=1k seek=8 conv=sync
412+1 records in
413+0 records out
422912 bytes (423 kB, 413 KiB) copied, 0.0919318 s, 4.6 MB/s
dd if=armv7.img of=/dev/sdg bs=1M conv=sync
1164+1 records in
1165+0 records out
1221591040 bytes (1.2 GB, 1.1 GiB) copied, 61.7214 s, 19.8 MB/s
sync
Here I am using this little Makefile:
# 1-15-2023
#
# Make a bootable NetBSD SD card for my OrangePi PC 2
CARD=/dev/sdg
sdcard:
dd if=u-boot-sunxi-with-spl.bin of=$(CARD) bs=1k seek=8 conv=sync
dd if=armv7.img of=$(CARD) bs=1M conv=sync
sync
Why use a Makefile? Why not? It let's me take a close look at the commands
before running them and gives me a record of what I did for next time.
And there always seems to be a next time.
Try the "Orange Pi PC" image.
I have my Orange Pi PC plus sitting right here. I disconnect power, plug in the freshly minted
SD card, plug power back in and it boots from emmc. Not what I hoped for or expected.
But I try it again a second time (see below) and it works!
Try the "Orange Pi PC 2e" image.
This works! It boots up once, does something to expand the "disk" to fill the 16G flash card,
then reboots itself to use the new partition scheme (or something of the sort).
It now gives me a login prompt and I can log in with no password.
I scan back through the boot messages to glean some information
There is something nasty in the boot messages:
[ 1.0000060] emac0 at simplebus1: EMAC
[ 1.0000060] emac0: Ethernet address 02:81:b3:9c:e0:c9
[ 1.0000060] emac0: interrupting on GIC irq 114
[ 1.0000060] emac0: no PHY found!
This is probably because the U-boot I selected is expecting a orangepi-plus2e, which has gigabit
ethernet and uses an external PHY. I need things to be configured to use the internal PHY.
Remember that the NetBSD image is entirely generic. Odds are that the U-boot image that gets
installed ahead of it contains the "device tree" information for the plus2e.
Try the "Orange Pi PC" image again.
It works! I just stuck the SD card in on a whim after trying the "2e".
No telling what was wrong the first time. Maybe the SD slot is erratic.
Who knows, but I am sitting at a boot prompt.
I had dug out the one actual Orange Pi PC I have in my drawer and was getting ready
to give it a try, but stuck the flash card into the PC plus for "one last try".
See the next page for more about how NetBSD on the Orange Pi works out..
Feedback? Questions?
Drop me a line!
Tom's Computer Info / [email protected]