OpenBSD 7.2 on ODROID-C4 (eMMC)

Installing OpenBSD on the ODROID-C4 single board computer - small guide to not forget it again.

Hardware

The CPU is decent 4-core 1.9GHz ARM Cortex-A55 that doesn’t run hot and the stock heatsink is being quite sufficient.

4 gigabytes of DDR4 RAM.

xhci(4) ports work too so usb 3.0 hard drive performs well.

Network card is a proper dwge(4) gigabit ethernet that works too.

Caveats

HDMI framebuffer seems to not work at the moment with OpenBSD but that does not bother me much since I’m using this machine as a DHCP/DNS/Samba server.

MicroSD support is wobbly at best; it works as a boot device but doesn’t get initialized by OpenBSD kernel; since I’m using eMMC module I didn’t care as much but beware - if the uSD is the only root media you’ve got it might not be so easy.

There is no wireless card/chip onboard at all; use usb dongle if needed such as EDIMAX EW-7811UN v2 (works good with OpenBSD)

Tools needed

Files to download

Actual steps

Write a miniroot image onto microsd(N): dd if=miniroot72.img of=/dev/sdNc bs=1m

Write an install image onto flashdrive(M): dd if=install72.img of=/dev/sdMc bs=1m

Write a patched u-boot onto microsd:

dd if=u-boot.bin.sd.bin of=/dev/sdNc bs=512 skip=1 seek=1
dd if=u-boot.bin.sd.bin of=/dev/sdNc bs=1 count=444

We will need that u-boot file once more after installation so mount the boot partition of the USB flashdrive (!) and copy the file there:

mount /dev/sdMi /mnt/boot
cp u-boot.bin.sd.bin /mnt/boot/
umount /mnt/boot

UART console connector pinout:

_____UART____
|Pin 4 - GND|
|Pin 3 - RXD|
|Pin 2 - TXD|
|Pin 1 - VCC|
\___________|

Connect to the UART terminal: cu -l /dev/cuaU0 -s 115200

Board will boot from that microsd properly but won’t be able to use it afterwards; use preset usb flash drive to fetch the filesets or load them with network connected.

General OpenBSD installation proceeds; nothing tricky or unusual, but we will need to dump the patched u-boot onto eMMC after installation is finished once more; just don’t reboot afterwards, drop into shell, mount the boot partition from the usb flashdrive and use the u-boot file copied there beforehand to write onto eMMC with offsets same as before.

pic

dmesg

OpenBSD 7.2 (GENERIC.MP) #2: Thu Nov 24 23:53:03 MST 2022
    [email protected]:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 4103942144 (3913MB)
avail mem = 3900149760 (3719MB)
random: good seed from bootblocks
mainbus0 at root: Hardkernel ODROID-C4
psci0 at mainbus0: PSCI 1.0, SMCCC 1.1, SYSTEM_SUSPEND
cpu0 at mainbus0 mpidr 0: ARM Cortex-A55 r1p0
cpu0: 32KB 64b/line 4-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
cpu0: DP,RDM,Atomic,CRC32,SHA2,SHA1,AES+PMULL,LRCPC,DPB,ASID16,PAN+ATS1E1,LO,HPDS,HAFDBS
cpu1 at mainbus0 mpidr 1: ARM Cortex-A55 r1p0
cpu1: 32KB 64b/line 4-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu1: 512KB 64b/line 16-way L2 cache
cpu1: DP,RDM,Atomic,CRC32,SHA2,SHA1,AES+PMULL,LRCPC,DPB,ASID16,PAN+ATS1E1,LO,HPDS,HAFDBS
cpu2 at mainbus0 mpidr 2: ARM Cortex-A55 r1p0
cpu2: 32KB 64b/line 4-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu2: 512KB 64b/line 16-way L2 cache
cpu2: DP,RDM,Atomic,CRC32,SHA2,SHA1,AES+PMULL,LRCPC,DPB,ASID16,PAN+ATS1E1,LO,HPDS,HAFDBS
cpu3 at mainbus0 mpidr 3: ARM Cortex-A55 r1p0
cpu3: 32KB 64b/line 4-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu3: 512KB 64b/line 16-way L2 cache
cpu3: DP,RDM,Atomic,CRC32,SHA2,SHA1,AES+PMULL,LRCPC,DPB,ASID16,PAN+ATS1E1,LO,HPDS,HAFDBS
efi0 at mainbus0: UEFI 2.9
efi0: Das U-Boot rev 0x20230100
apm0 at mainbus0
amlsm0 at mainbus0: ver 2
pwmreg0 at mainbus0
"efuse" at mainbus0 not configured
"gpu-opp-table" at mainbus0 not configured
simplebus0 at mainbus0: "soc"
ampintc0 at simplebus0 nirq 256, ncpu 4 ipi: 0, 1, 2: "interrupt-controller"
dwge0 at simplebus0: rev 0x37, address 00:1e:06:48:9d:6c
rgephy0 at dwge0 phy 0: RTL8169S/8110S/8211 PHY, rev. 6
simplebus1 at simplebus0: "bus"
"hdmi-tx" at simplebus1 not configured
simplebus2 at simplebus1: "bus"
amlrng0 at simplebus2
simplebus3 at simplebus1: "bus"
amlpinctrl0 at simplebus3
amltemp0 at simplebus1
amltemp1 at simplebus1
amlusbphy0 at simplebus1
simplebus4 at simplebus1: "bus"
amlusbphy1 at simplebus1
simplebus5 at simplebus1: "bus"
syscon0 at simplebus5: "system-controller"
amlclock0 at syscon0
amlpwrc0 at syscon0
amlpciephy0 at simplebus1
"mdio-multiplexer" at simplebus1 not configured
simplebus6 at simplebus1: "bus"
"clock-controller" at simplebus6 not configured
"audio-controller" at simplebus6 not configured
"audio-controller" at simplebus6 not configured
"audio-controller" at simplebus6 not configured
"reset-controller" at simplebus6 not configured
"audio-controller" at simplebus6 not configured
"audio-controller" at simplebus6 not configured
simplebus7 at simplebus0: "bus"
syscon1 at simplebus7: "sys-ctrl"
amlpinctrl1 at syscon1
"clock-controller" at syscon1 not configured
syscon2 at simplebus7: "ao-secure"
"rtc" at simplebus7 not configured
amlpwm0 at simplebus7
amluart0 at simplebus7: console
"ir" at simplebus7 not configured
"adc" at simplebus7 not configured
"video-decoder" at simplebus0 not configured
"vpu" at simplebus0 not configured
simplebus8 at simplebus0: "bus"
amlreset0 at simplebus8
"interrupt-controller" at simplebus8 not configured
"watchdog" at simplebus8 not configured
"clock-measure" at simplebus8 not configured
amlmmc0 at simplebus0
sdmmc0 at amlmmc0: 4-bit, sd high-speed, sdr50, dma
amlmmc1 at simplebus0
sdmmc1 at amlmmc1: 8-bit, mmc high-speed, ddr52, hs200, dma
amldwusb0 at simplebus0: "usb"
"usb" at amldwusb0 not configured
xhci0 at amldwusb0, xHCI 1.10
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
"gpu" at simplebus0 not configured
agtimer0 at mainbus0: 24000 kHz
"xtal-clk" at mainbus0 not configured
"audio-controller-1" at mainbus0 not configured
"opp-table" at mainbus0 not configured
"emmc-pwrseq" at mainbus0 not configured
"regulator-tflash_vdd" at mainbus0 not configured
"gpio-regulator-tf_io" at mainbus0 not configured
"regulator-flash_1v8" at mainbus0 not configured
"regulator-main_12v" at mainbus0 not configured
"regulator-vcc_5v" at mainbus0 not configured
"regulator-vcc_1v8" at mainbus0 not configured
"regulator-vcc_3v3" at mainbus0 not configured
"regulator-usb_pwr_en" at mainbus0 not configured
"regulator-vddao_1v8" at mainbus0 not configured
"regulator-vddao_3v3" at mainbus0 not configured
"hdmi-connector" at mainbus0 not configured
"sound" at mainbus0 not configured
gpioleds0 at mainbus0: no LEDs
simplefb0 at mainbus0: 720x576, 32bpp
wsdisplay0 at simplefb0 mux 1
wsdisplay0: screen 0-5 added (std, vt100 emulation)
scsibus0 at sdmmc1: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0:  removable
sd0: 59000MB, 512 bytes/sector, 120832000 sectors
uhub1 at uhub0 port 1 configuration 1 interface 0 "VIA Labs, Inc. USB2.0 Hub" rev 2.10/90.33 addr 2
uhub2 at uhub0 port 3 configuration 1 interface 0 "VIA Labs, Inc. USB3.0 Hub" rev 3.10/90.33 addr 3
umass0 at uhub2 port 3 configuration 1 interface 0 "ULT-Best Best USB Device" rev 3.00/1.00 addr 4
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0:  serial.174c55aa000090000454
sd1: 953869MB, 512 bytes/sector, 1953525168 sectors
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (d9c20a8284a9197b.a) swap on sd0b dump on sd0b
WARNING: / was not properly unmounted
WARNING: CHECK AND RESET THE DATE!

https://www.mail-archive.com/[email protected]/msg02484.html https://wiki.odroid.com/odroid-c4/getting_started/os_installation_guide https://wiki.odroid.com/odroid-c4/hardware/hardware#board_layout https://www.openbsd.org/faq/faq4.html#Download