Setting up the RTC on an ODROID C2 running Arch Linux

The Hardkernel wiki page for the ODROID C2 RTC shield is mostly specific to Ubuntu and Android. Here’s a quick update if you’re using Arch Linux ARM.

  1. Install community/dtc to get fdtput.
sudo pacman -S dtc
  1. Enable the RTC shield in the device tree. NOTE that this should all be on one line as one command.
sudo fdtput -t s /boot/dtbs/meson64_odroidc2.dtb \
    /i2c@c1108500/pcf8563@51 status "okay"
  1. Load the Amlogic i2c kernel module. This should detect the RTC shield on the i2c pins, load the rtc_pcf8563 kernel module for the RTC chip, and create /dev files for rtc, rtc0, and i2c-*.
sudo modprobe aml_i2c
  1. Check the date and time. The RTC will probably be set to some date in 2033 by default.
timedatectl status
  1. Set the RTC to the system time, and verify the settings.
sudo hwclock -w
timedatectl status
  1. Load the Amlogic i2c module at boot.
echo aml_i2c | sudo tee -a /etc/modules-load.d/odroid-c2.conf