SOC:RK3288
kernel:Linux4.4
1.添加驱动支持
Device Drivers--->
【RK3288|RK3288下添加PCF8563 RTC支持】[*] Real Time Clock--->
[*]Set system time from RTC on startup and resume(自动同步时间)
<*>Philips PCF8563/Epson RTC8564(CONFIG_RTC_DRV_PCF8563)
2.添加设备树
参考文档:Documentation/devicetree/bindings/rtc/pcf8563.txt
arch/arm/boot/dts/rk3288-firefly.dtsi:
......
rtc_pcf8563: rtc-pcf8563 {
clocks = <&pcf8563>;
};
sdio_pwrseq: sdio-pwrseq {
compatible = "mmc-pwrseq-simple";
//clocks = <&hym8563>;
clock-names = "ext_clock";
pinctrl-names = "default";
pinctrl-0 = <&wifi_enable_h>;
/*
* On the module itself this is one of these (depending
* on the actual card populated):
* - SDIO_RESET_L_WL_REG_ON
* - PDN (power down when low)
*/
reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
};
......&i2c0 {
pcf8563: pcf8563@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
#clock-cells = <0>;
};
};
......
3. 测试
3.1 date 设置时间:date 月日时分年.秒
3.2 同步时间到RTC(把系统时间写到RTC芯片):hwclock -w
3.3 同步时间到系统(把RTC芯片时间写到系统时间):hwclock -s
推荐阅读
- 开发文档|【资源共享】RK3288 使用POWER键开机
- rk3288 7.1 usb触摸上下左右反
- Android 8.1拦截Activity
- rk3288 apk通过jni控制gpio,实现人体感应自动开关门禁