This is a short guide for installing the OpenBSD latest snapshot on the Pine A64-LTS SoC board.
The official installation instructions are present here.
This guide assumes that this is the first ever SoC computer that the reader has ever seen in life and has no clue how to even connect to this device.
This guide is designed for a basic introduction to working with SoC boards, along with the components needed for connecting (via a serial console):
- Pine A64-LTS (along with a power supply)
- USB to TTL converter (cp2102)(needed for serial console access, also available on amazon)
- micro-sd card (+ card reader, to read the micro-sd card from laptop/desktop)
- Access to another (unix/linux) computer for writing to the micro-sd card (this guide uses a linux computer to install OpenBSD on the pine, so the tty/mmcblk devices will be reflecting the linux nomenclature).
- Download
minirootXX.img
for thearm64
machines (Pine A64 is an armv8/aarch64 machine). - Put the micro-sd card in the card reader and connect it to the laptop. Make sure the the partitions are unmounted.
- If this is the only mirco-sd card and in a dedicated card reader, it will most likely be found on
/dev/mmcblk0
- If this is the only mirco-sd card and in a dedicated card reader, it will most likely be found on
- Flash the
minirootXX.img
:dd if=minirootXX.img of=/dev/mmcblk0 bs=1M status=progress
- After flashing there will be BOOT partition of size 4MB i and a
ufs
partition of size 14MB. - Download
u-boot-aarch64-YYYY.MMpX.tgz
from https://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/ and extract the file.../share/u-boot/pine64-lts/u-boot-sunxi-with-spl.bin
- Flash the file
u-boot-sunxi-with-spl.bin
with the correct batch size and seek:dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
- The seek is to format the starting of the disk so that the machine can boot correctly.
NOTE: The download links are for amd64
, even though the machine is arm64
, as the package is actually an arm64
package. The amd64
links are used as they are updated and compiled more frequently.
- Download the file
dtb-X.YYpZ.tgz
from https://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/ and extract the file.../share/dtb/arm64/allwinner/sun50i-a64-pine64-lts.dtb
- Mount the BOOT partition of the micro-sd card and copy the
*.dtb
file into a folder calledallwinner
, and make a copy of ALL FILES in the boot partition (needed again in step 4, so this creates a backup):mkdir -p /tmp/tmpmnt mount /dev/mmcblk0p1 /tmp/tmpmnt mkdir -p /tmp/tmpmnt/allwinner cp sun50i-a64-pine64-lts.dtb /tmp/tmpmnt/allwinner cp -r /tmp/tmpmnt ~/ umount /tmp/tmpmnt
-
Insert the micro-sd card into the pine.
-
OpenBSD does not support HDMI I/O for the Pine A64 LTS so a serial console (the usb to ttl conenctor) is needed to connect to the board.
-
This is the UART connector for the pine, connect it to the RIGHT side pins, as shown in the picture (connecting to the left side can mess up voltages).
- THE TXD pin of the connector connects to the RXD pin of the board and the RXD connects to the TXD pin [RXD - receiver, TXD - transmitter].
- Remove the RXD pin of the board before booting. This means no data can be sent while booting. Connecting the wire during the boot phase can mess up voltages.
- Reconnect the RXD pin of the board after booting has finished.
-
Connect the usb to your machine and to access the console you can use two commands
cu
orscreen
-
I will be using
screen
as that comes default in most linux distributions -
The serial console attaches itself to
ttyUSB0
in most cases and can be connected viascreen /dev/ttyUSB0 115200
- Don't forget to hard-boot the machine after connecting the serial console so that you can begin the boot process
- Now that you have finished the installation on
sd0
, if you try to reboot the machine you will end up with the following errorDRAM: 0 MiB ### ERROR ### Please RESET the board ###
- The reason is that the installation removes the
u-boot.bin
and thesun50i-a64-pine64-lts.dtb
files from the BOOT partition - Remove the micro-sd card from the pine and connect it to your laptop (you can safely remove the card when the above error is showing)
- Now we need to copy all the files from step 2 back into the boot directory, while making sure that other vender
*.dtb
files are not present.- Anecdotal personal experience - having rpi
*dtb
files has made thebsd.mp
kernel hang while booting,bsd.sp
kernel still boots fine.
mkdir -p tmp/tmpmnt mount /dev/mmcblk0p1 /tmp/tmpmnt cp -r ~/tmpmnt/* /tmp/tmpmnt rm -f /tmp/tmpmnt/*.dtb umount /tmp/tmpmnt dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
- Anecdotal personal experience - having rpi