ODROID C2 RTC module under Arch Linux ARM

How to enable RTC Shield on Arch Linux ARM on ODROID C2

(Based on this Hardkernel wiki)

Install Device Tree Compiler:

# pacman -S dtc
resolving dependencies…
looking for conflicting packages…

Packages (1) dtc-1.4.2-1

Total Installed Size: 0.26 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [######################] 100%
(1/1) checking package integrity [######################] 100%
(1/1) loading package files [######################] 100%
(1/1) checking for file conflicts [######################] 100%
(1/1) checking available disk space [######################] 100%
:: Processing package changes…
(1/1) installing dtc [######################] 100%

Enable the RTC module in the DTB file:

# fdtput -t s /boot/dtbs/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status “okay”

Enable the RTC shield in the DTB file at every shutdown / reboot, create a file in /etc/systemd/system like rtc.service:

[Unit]
Description=Enable RTC Shield
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/fdtput -t s /boot/dtbs/meson64_odroidc2.dtb /i2c@c1108500/pcf8563@51 status “okay”

[Install]
WantedBy=shutdown.target

Enable the rtc service:

# systemctl enable rtc
Created symlink /etc/systemd/system/shutdown.target.wants/rtc.service -> /etc/systemd/system/rtc.service.

Load the kernel module at boot time:

# echo aml_i2c >> /etc/modules-load.d/aml_i2c.conf

reboot

Confirm RTC time after reboot:

# timedatectl
Local time: Mon 2016-11-14 14:13:37 AST
Universal time: Mon 2016-11-14 11:13:37 UTC
RTC time: Mon 2016-11-14 11:13:37
Time zone: Asia/Qatar (AST, +0300)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no