Allwinner: H6: Add RTC workaround

This commit is contained in:
Jernej Skrabec 2019-08-25 15:44:27 +02:00
parent 48b85f763e
commit 6270d8fe08

View File

@ -0,0 +1,41 @@
From 7c8b4644df51ba7ecd68a6898bcb041ab669ddf9 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@siol.net>
Date: Sun, 25 Aug 2019 00:02:06 +0200
Subject: [PATCH] RTC workaround
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
---
drivers/rtc/rtc-sun6i.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index 4603a91c11be..d8a0817b96f4 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -33,6 +33,7 @@
#define SUN6I_LOSC_CTRL 0x0000
#define SUN6I_LOSC_CTRL_KEY (0x16aa << 16)
#define SUN6I_LOSC_CTRL_AUTO_SWT_BYPASS BIT(15)
+#define SUN6I_LOSC_CTRL_AUTO_SWT_EN BIT(14)
#define SUN6I_LOSC_CTRL_ALM_DHMS_ACC BIT(9)
#define SUN6I_LOSC_CTRL_RTC_HMS_ACC BIT(8)
#define SUN6I_LOSC_CTRL_RTC_YMD_ACC BIT(7)
@@ -253,6 +254,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node,
/* Switch to the external, more precise, oscillator */
reg |= SUN6I_LOSC_CTRL_EXT_OSC;
+ reg |= SUN6I_LOSC_CTRL_AUTO_SWT_EN;
if (rtc->data->has_losc_en)
reg |= SUN6I_LOSC_CTRL_EXT_LOSC_EN;
writel(reg, rtc->base + SUN6I_LOSC_CTRL);
@@ -370,7 +372,6 @@ static const struct sun6i_rtc_clk_data sun50i_h6_rtc_data = {
.has_out_clk = 1,
.export_iosc = 1,
.has_losc_en = 1,
- .has_auto_swt = 1,
};
static void __init sun50i_h6_rtc_clk_init(struct device_node *node)
--
2.23.0