OpenBSD/arm64 on the NanoPi NEO2
Frederic Cambus November 13, 2018 [OpenBSD] [ARM]I bought the NanoPi NEO2 solely for it's form-factor, and I haven't been disappointed. It's a cute little board (40*40mm), which is to the best of my knowledge the smallest possible device one can run OpenBSD on.
The CPU is a quad-core ARM Cortex-A53 which is quite capable, a GENERIC.MP kernel build taking 15 minutes. On the downside, the board only has 512MB of RAM.
An USB to TTL serial cable is required to connect to the board and perform installation. The system doesn't have a supported miniroot so the preparation steps detailed in the INSTALL.arm64 file have to be performed to get a working installation image.
The following packages need to be installed:
pkg_add dtb u-boot-aarch64
After writing the miniroot image to an SD card, the correct DTB should be copied:
mount /dev/sdXi /mnt
mkdir /mnt/allwinner
cp /usr/local/share/dtb/arm64/allwinner/sun50i-h5-nanopi-neo2.dtb /mnt/allwinner
umount /mnt
Lastly, the correct U-Boot image should be written:
dd if=/usr/local/share/u-boot/nanopi_neo2/u-boot-sunxi-with-spl.bin of=/dev/sdXc bs=1024 seek=8
After performing the installation process, the DTB should be copied again to the SD card before attempting to boot the system.
Here is the output of running file on executables:
ELF 64-bit LSB shared object, AArch64, version 1
And this is the result of the md5 -t benchmark:
MD5 time trial. Processing 10000 10000-byte blocks...
Digest = 52e5f9c9e6f656f3e1800dfa5579d089
Time = 1.070000 seconds
Speed = 93457943.925234 bytes/second
For the record, LibreSSL speed benchmark results are available here.
System message buffer (dmesg output):
OpenBSD 6.4-current (GENERIC.MP) #262: Mon Nov 12 01:54:10 MST 2018
deraadt@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem = 407707648 (388MB)
avail mem = 367030272 (350MB)
mainbus0 at root: FriendlyARM NanoPi NEO 2
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x0
sxiccmu0 at mainbus0
psci0 at mainbus0: PSCI 0.2
simplebus0 at mainbus0: "soc"
syscon0 at simplebus0: "syscon"
sxiccmu1 at simplebus0
sxipio0 at simplebus0: 94 pins
ampintc0 at simplebus0 nirq 224, ncpu 4 ipi: 0, 1: "interrupt-controller"
sxiccmu2 at simplebus0
sxipio1 at simplebus0: 12 pins
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ehci1 at simplebus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
dwxe0 at simplebus0: address 02:01:f7:f9:2f:67
rgephy0 at dwxe0 phy 7: RTL8169S/8110S/8211 PHY, rev. 5
com0 at simplebus0: ns16550, no working fifo
com0: console
sxirtc0 at simplebus0
gpio0 at sxipio0: 32 pins
gpio1 at sxipio0: 32 pins
gpio2 at sxipio0: 32 pins
gpio3 at sxipio0: 32 pins
gpio4 at sxipio0: 32 pins
gpio5 at sxipio0: 32 pins
gpio6 at sxipio0: 32 pins
gpio7 at sxipio1: 32 pins
agtimer0 at mainbus0: tick rate 24000 KHz
cpu1 at mainbus0 mpidr 1: ARM Cortex-A53 r0p4
cpu1: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu1: 512KB 64b/line 16-way L2 cache
cpu2 at mainbus0 mpidr 2: ARM Cortex-A53 r0p4
cpu2: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu2: 512KB 64b/line 16-way L2 cache
cpu3 at mainbus0 mpidr 3: ARM Cortex-A53 r0p4
cpu3: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu3: 512KB 64b/line 16-way L2 cache
scsibus0 at sdmmc0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SD/MMC, SC64G, 0080> SCSI2 0/direct removable
sd0: 60906MB, 512 bytes/sector, 124735488 sectors
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root on sd0a (1fbfe51d132e41c0.a) swap on sd0b dump on sd0b