RK3288下添加PCF8563 RTC支持

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/WXXGoodJob/article/details/88692949

SOC:RK3288

kernel:Linux4.4

1.  添加驱动支持

Device Drivers  --->

     [*] 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

猜你喜欢

转载自blog.csdn.net/WXXGoodJob/article/details/88692949
RTC