target/rk3568: use non rk808 rtc if exists

This commit is contained in:
Liangbin Lian 2024-04-08 12:19:18 +08:00
parent b307aec258
commit e2d212aef7
3 changed files with 11 additions and 1 deletions

View File

@ -16,10 +16,12 @@ boot() {
}
start() {
[ -e "/dev/rtc" ] && RTC_DEV=/dev/rtc
[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -s -u -f $RTC_DEV
}
stop() {
[ -e "/dev/rtc" ] && RTC_DEV=/dev/rtc
[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -w -u -f $RTC_DEV && \
logger -t sysfixtime "saved '$(date)' to $RTC_DEV"
}

View File

@ -0,0 +1,9 @@
#!/bin/sh /etc/rc.common
START=00
boot() {
if [ -e /sys/class/rtc/rtc1/device/modalias ]; then
grep -q 'rk808-rtc' /sys/class/rtc/rtc1/device/modalias || ln -s rtc1 /dev/rtc
fi
}

View File

@ -1,4 +1,3 @@
. /lib/functions.sh
preinit_set_gpio() {
# ref package/base-files/files/etc/init.d/gpio_switch