ODROID-C1 was a $35 quad-core SBC from Hardkernel. ODROID-C1 support was introduced in NetBSD 7.0. It has been succeeded by the ODROID-C1+, which is supported by the same NetBSD kernel.

  1. Supported hardware
  2. TODO
  3. Installation (NetBSD 8.0 and later)
  4. Installation (NetBSD 7.0/7.1)
  5. HDMI
    1. Framebuffer console
    2. Video mode
    3. 16 or 24 bpp?
    4. Overscan compensation
  6. SYS_LED
  7. U-Boot Environment
  8. Automatically booting a backup kernel
  9. Documentation
  10. ODROID-C1 UART pins

Supported hardware

TODO

Installation (NetBSD 8.0 and later)

# dd if=bl1.bin.hardkernel of=armv7.img bs=1 count=442 conv=notrunc
# dd if=bl1.bin.hardkernel of=armv7.img bs=512 skip=1 seek=1 conv=notrunc
# dd if=u-boot.bin.odroidc1 of=armv7.img bs=512 seek=64 conv=notrunc

Installation (NetBSD 7.0/7.1)

# $TOOLDIR/bin/nbdisklabel -M evbarm -B le armv7.img
...
8 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   1359312    385024     4.2BSD      0     0     0  # (Cyl.    188 -    851*)
 b:    262144    122880       swap                     # (Cyl.     60 -    187)
 c:   1744336         0     unused      0     0        # (Cyl.      0 -    851*)
 d:   1744336         0     unused      0     0        # (Cyl.      0 -    851*)
 e:    114688      8192      MSDOS                     # (Cyl.      4 -     59)
# dd if=bl1.bin.hardkernel of=armv7.img bs=1 count=442 conv=notrunc
# dd if=bl1.bin.hardkernel of=armv7.img bs=512 skip=1 seek=1 conv=notrunc
# dd if=u-boot.bin of=armv7.img bs=512 seek=64 conv=notrunc
# $TOOLDIR/bin/armv7--netbsdelf-eabihf-fdisk -u armv7.img
...
Which partition do you want to change?: [none] 1
The data for partition 1 is:

sysid: [0..255 default: 169] 
start: [0..109cyl default: 63, 0cyl, 0MB] 385024
size: [0..85cyl default: 1359312, 85cyl, 664MB] 1359312
...
Which partition do you want to change?: [none] 
...
Should we write new partition table? [n] y
ODROIDC-UBOOT-CONFIG

setenv bootargs "root=ld0f awge0.mac-address=${ethaddr} console=fb"
setenv bootcmd "fatload mmc 0:1 0x21000000 netbsd.ub; bootm 0x21000000"
run bootcmd

# fdisk -u ld0
...
Which partition do you want to change?: [none] 1
The data for partition 1 is:
NetBSD (sysid 169)
    start 385024, size 1359312 (664 MB, Cyls 23/246/32-108/147/55)
        PBR is not bootable: All bytes are identical (0x00)
sysid: [0..255 default: 169]
start: [0..966cyl default: 385024, 24cyl, 188MB]
size: [0..942cyl default: 1359312, 85cyl, 664MB] $
...
Which partition do you want to change?: [none]
...
Should we write new partition table? [n] y
# resize_ffs -y /dev/rld0f
# reboot
# mount -u -o rw /dev/ld0f /
# cat > /etc/fstab << EOF
/dev/ld0f       /               ffs     rw      1 1
/dev/ld0e       /boot           msdos   rw      1 1
kernfs          /kern           kernfs  rw
ptyfs           /dev/pts        ptyfs   rw
procfs          /proc           procfs  rw
tmpfs           /var/shm        tmpfs   rw,-m1777,-sram%25
EOF
# reboot

HDMI

Framebuffer console

Simply add console=fb to the bootargs variable in boot.ini.

Video mode

HDMI video mode can be selected in U-Boot with the video command, e.g.:

odroidc#video dev open 1080P

To make this change permanent, add it to the bootcmd variable in boot.ini:

setenv bootcmd "video dev open 1080P; fatload mmc 0:1 0x21000000 netbsd.ub; bootm 0x21000000"

16 or 24 bpp?

ODROID-C1 defaults to 16bpp. If you want to try 24bpp, add fb.depth=24 to the kernel cmdline options in boot.ini. There are some issues with 24bpp mode and Xorg; see http://gnats.netbsd.org/49812.

Overscan compensation

If you have ODROID-C1 plugged into a TV, the edges of the screen may not be visible. You can scale down the framebuffer console with the hw.genfb0.scale sysctl, e.g.:

# sysctl -w hw.genfb0.scale=95

Setting scale to 100 disables scaling, any other value enables the scaler. Values between 10 and 100 are allowed.

To set this value at boot, you can add fb.scale=95 to the kernel cmdline options in boot.ini.

SYS_LED

The blue SYS_LED on the board is wired to GPIOAO_13. To control the LED from userland, set gpio=YES in rc.conf and add this to /etc/gpio.conf:

gpio4 13 set out sys_led

After rebooting, the LED state can be controlled with gpioctl(8).

# turn the light on
gpioctl gpio4 sys_led on

# turn the light off
gpioctl gpio4 sys_led off

# toggle the light state
gpioctl gpio4 sys_led toggle

U-Boot Environment

To read/write U-Boot environment variables from NetBSD, download and compile the following program: http://ftp.netbsd.org/pub/NetBSD/misc/jmcneill/odroidc1/uenv.c

Automatically booting a backup kernel

These instructions assume the kernels live on eMMC. Adjust devices accordingly for SD card setup.

To setup an ODROID-C1 to fall back to a recovery kernel in the event of a boot failure, install the recovery kernel as /boot/onetbsd.ub.

Create /boot/boot.ini as follows:

ODROIDC-UBOOT-CONFIG
setenv bootargs "root=ld0f awge0.mac-address=${ethaddr}"
fatload mmc 0:1 0x22000000 boot.scr
source 0x22000000

Create /boot/boot.txt:

# regenerate with:
#  mkubootimage -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/odroidc1 boot" boot.txt boot.scr

setenv rescue_kernel "onetbsd.ub"
setenv kernel "netbsd.ub"

if test ${boot_rescue} = false; then
  setenv boot_rescue true
  saveenv
  fatload mmc 0:1 0x21000000 ${kernel}
  mw.l c1109900 0f08ffff        # arm watchdog
  bootm 0x21000000
else
  fatload mmc 0:1 0x21000000 ${rescue_kernel}
  bootm 0x21000000
fi

Generate boot.scr from boot.txt:

mkubootimage -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/odroidc1 boot" /boot/boot.txt /boot/boot.scr

Install the uenv tool from above and add the following to root's crontab:

@reboot                                 /usr/local/sbin/uenv ld0 boot_rescue false

Documentation

Amlogic S805 datasheet: http://dn.odroid.com/S805/Datasheet/S805_Datasheet%20V0.8%2020150126.pdf

ODROID-C1 UART pins

From ODROID Forum:

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

3.3V LVTTL
Really looking forward to the future of this port! I'd love to build a fileserver with my C1 using NetBSD as the OS.
Comment by Bo terribly early Monday morning, March 9th, 2015

Hello, nice news (even if published almost 2 years ago :)) ) and information. I would like to ask you how complex could be the porting on the Odroid U3. Do you have some hints or links to find some information? Is there any work in progress? Many thanks in advance for your support.

Comment by Luca early Monday morning, August 22nd, 2016