From 648fc94783dccabc5b5d142c1e3fff9851c9e403 Mon Sep 17 00:00:00 2001 From: Hong Guo Date: Thu, 22 Nov 2018 11:06:58 +0800 Subject: [PATCH] vrtc: vrtc time update for stick mem [2/2] 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 --- arch/arm/boot/dts/amlogic/mesontxl.dtsi | 8 ++++++++ arch/arm64/boot/dts/amlogic/mesontxl.dtsi | 8 ++++++++ drivers/amlogic/vrtc/aml_vrtc.c | 8 ++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/amlogic/mesontxl.dtsi b/arch/arm/boot/dts/amlogic/mesontxl.dtsi index 2316d57..12accae 100644 --- a/arch/arm/boot/dts/amlogic/mesontxl.dtsi +++ b/arch/arm/boot/dts/amlogic/mesontxl.dtsi @@ -388,6 +388,14 @@ 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>; diff --git a/arch/arm64/boot/dts/amlogic/mesontxl.dtsi b/arch/arm64/boot/dts/amlogic/mesontxl.dtsi index 43885b0..ffc50a27 100644 --- a/arch/arm64/boot/dts/amlogic/mesontxl.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesontxl.dtsi @@ -388,6 +388,14 @@ 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>; diff --git a/drivers/amlogic/vrtc/aml_vrtc.c b/drivers/amlogic/vrtc/aml_vrtc.c index 063cb4e..1f102f36 100644 --- a/drivers/amlogic/vrtc/aml_vrtc.c +++ b/drivers/amlogic/vrtc/aml_vrtc.c @@ -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); } -- 2.7.4