> I'm close (using a pcf8523)
>
> root@beaglebone:~# uname -r
> 4.9.49-ti-r58
>
> root@beaglebone:~# dmesg | grep rtc
> [ 2.428569] omap_rtc 44e3e000.rtc: already running
> [ 2.429071] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
> [ 2.649410] rtc-pcf8523 2-0068: /aliases ID 0 not available
> [ 2.650843] rtc-pcf8523 2-0068: rtc core: registered rtc-pcf8523 as rtc1
> [ 2.693786] PM: bootloader does not support rtc-only!
> [ 2.694815] omap_rtc 44e3e000.rtc: setting system clock to
> 2017-09-11 20:09:40 UTC (1505160580)
>
>
https://github.com/RobertCNelson/bb.org-overlays/blob/rtc-hacks/src/arm/BB-I2C2-PCF8523-00A0.dts
>
> for some reason, it still gave rtc0 to omap...
one kinda crazy idea... we know am335x's are not battery backed up, so
what if we just specify "rtc1"
with pcf8523 plugged in:
root@beaglebone:~# dmesg | grep rtc
[ 1.982270] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[ 2.186787] rtc-pcf8523 2-0068: rtc core: registered rtc-pcf8523 as rtc1
[ 2.229775] PM: bootloader does not support rtc-only!
[ 2.231880] rtc-pcf8523 2-0068: setting system clock to 2017-09-11
21:22:26 UTC (1505164946)
with pcf8523 not plugged in:
root@beaglebone:~# dmesg | grep rtc
[ 2.163450] omap_rtc 44e3e000.rtc: already running
[ 2.163946] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
[ 2.399128] PM: bootloader does not support rtc-only!
[ 2.400752] hctosys: unable to open rtc device (rtc1)
This is what i'm thinking:
diff --git a/patches/defconfig b/patches/defconfig
index ef7b6cd..6904989 100644
--- a/patches/defconfig
+++ b/patches/defconfig
@@ -5306,9 +5306,9 @@ CONFIG_RTC_LIB=y
CONFIG_RTC_MC146818_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
-CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+CONFIG_RTC_HCTOSYS_DEVICE="rtc1"
CONFIG_RTC_SYSTOHC=y
-CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
+CONFIG_RTC_SYSTOHC_DEVICE="rtc1"
# CONFIG_RTC_DEBUG is not set
#
It doesn't really break anything un-less someone has got the rtc
working, we only support am335x devices in teh "bone" branch.. for the
x15 in v4.9.x-ti, i can change the rtc aliases properly..
another option
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 48ef93dc614c..64ef0b3cd412 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -39,6 +39,7 @@
mmc0 = &mmc1;
mmc1 = &mmc2;
mmc2 = &mmc3;
+ rtc1 = &rtc;
};
root@beaglebone:~# dmesg | grep rtc
[ 2.163901] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc1
[ 2.399093] PM: rtc0 not available
[ 2.400713] omap_rtc 44e3e000.rtc: setting system clock to
2000-01-01 00:00:00 UTC (946684800)
[ 3.957096] PM: rtc0 not available
[ 3.962392] PM: rtc0 not available
[ 3.970378] PM: rtc0 not available
[ 16.068076] PM: rtc0 not available
[ 16.165198] PM: rtc0 not available
root@beaglebone:~# dmesg | grep rtc
[ 1.981765] omap_rtc 44e3e000.rtc: already running
[ 1.982253] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc1
[ 2.190782] rtc-pcf8523 2-0068: rtc core: registered rtc-pcf8523 as rtc0
[ 2.233734] PM: bootloader does not support rtc-only!
[ 2.234745] omap_rtc 44e3e000.rtc: setting system clock to
2017-09-11 21:33:41 UTC (1505165621)