vrtc: vrtc time update for stick mem [2/2]
authorHong Guo <hong.guo@amlogic.com>
Thu, 22 Nov 2018 03:06:58 +0000 (11:06 +0800)
committerHong Guo <hong.guo@amlogic.com>
Thu, 22 Nov 2018 08:41:48 +0000 (00:41 -0800)
PD#174867

Problem:
vrtc time update for stick mem.

Solution:
vrtc time update for stick mem.

Verify:
g12a txl.

Change-Id: I65074422569370b253882a4e66fb771da10ccdbf
Signed-off-by: Hong Guo <hong.guo@amlogic.com>
arch/arm/boot/dts/amlogic/mesontxl.dtsi
arch/arm64/boot/dts/amlogic/mesontxl.dtsi
drivers/amlogic/vrtc/aml_vrtc.c

index 2316d57..12accae 100644 (file)
                sys_poweroff = <0x84000008>;
        };
 
+       rtc {
+               compatible = "amlogic, aml_vrtc";
+               alarm_reg_addr = <0xc81000a8>;
+               timer_e_addr = <0xc1109988>;
+               init_date = "2018/01/01";
+               status = "okay";
+       };
+
        soc {
                compatible = "simple-bus";
                #address-cells = <1>;
index 43885b0..ffc50a2 100644 (file)
                sys_poweroff = <0x84000008>;
        };
 
+       rtc {
+               compatible = "amlogic, aml_vrtc";
+               alarm_reg_addr = <0xc81000a8>;
+               timer_e_addr = <0xc1109988>;
+               init_date = "2018/01/01";
+               status = "okay";
+       };
+
        soc {
                compatible = "simple-bus";
                #address-cells = <2>;
index 063cb4e..1f102f3 100644 (file)
@@ -188,8 +188,12 @@ static int aml_vrtc_probe(struct platform_device *pdev)
        if (!ret) {
                pr_debug("init_date: %s\n", str);
                if (!scpi_get_vrtc(&vrtc_val)) {
-                       vrtc_init_date = vrtc_val;
-                       pr_debug("get vrtc: %us\n", vrtc_init_date);
+                       if (!vrtc_val)
+                               parse_init_date(str);
+                       else {
+                               vrtc_init_date = vrtc_val;
+                               pr_debug("get vrtc: %us\n", vrtc_init_date);
+                       }
                } else
                        parse_init_date(str);
        }