From b86ace06d37bb2ef97dbd79723089f3b46e065a2 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 4 Aug 2025 15:57:10 -0600 Subject: rtc: Tighten some rtc driver dependencies The Marvell RTC rtc driver cannot build without access to some platform specific header files. Express that requirements in Kconfig as well. Signed-off-by: Tom Rini --- drivers/rtc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 79b879d68d1..ed903999f06 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -218,7 +218,7 @@ config RTC_PL031 config RTC_MV bool "Enable Marvell RTC driver" - depends on DM_RTC + depends on DM_RTC && ARCH_KIRKWOOD help Enable Marvell RTC driver. This driver supports the rtc that is present on some Marvell SoCs. -- cgit v1.2.3 From d7daa9274b1f7fad8f24c6020dc6225a1585de2f Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 4 Aug 2025 15:57:11 -0600 Subject: rtc: mc146818: Fix building on more architectures This driver makes calls to in8/out8(). On PowerPC these are separate and real calls but elsewhere they are able to simply be wrappers to inb/outb. Rework this logic to be able to build this driver on more platforms. Signed-off-by: Tom Rini --- drivers/rtc/mc146818.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/mc146818.c b/drivers/rtc/mc146818.c index c0d86c6d063..08bc528aeaf 100644 --- a/drivers/rtc/mc146818.c +++ b/drivers/rtc/mc146818.c @@ -11,9 +11,9 @@ #include #include #include - -#if defined(CONFIG_X86) || defined(CONFIG_TARGET_MALTA) #include + +#if !defined(CONFIG_PPC) #define in8(p) inb(p) #define out8(p, v) outb(v, p) #endif -- cgit v1.2.3 From 91122ea8f03b59b1fef7b9861734f6278ca4a123 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 4 Aug 2025 15:57:12 -0600 Subject: rtc: pl031: Correct function type of pl031_write_reg When calling writel we do not have a return value to check or pass along. This function should therefore be void and not return what writel gives us. Signed-off-by: Tom Rini --- drivers/rtc/pl031.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/pl031.c b/drivers/rtc/pl031.c index 855ee913416..6f189bc503e 100644 --- a/drivers/rtc/pl031.c +++ b/drivers/rtc/pl031.c @@ -39,11 +39,11 @@ static inline u32 pl031_read_reg(struct udevice *dev, int reg) return readl(pdata->base + reg); } -static inline u32 pl031_write_reg(struct udevice *dev, int reg, u32 value) +static inline void pl031_write_reg(struct udevice *dev, int reg, u32 value) { struct pl031_plat *pdata = dev_get_plat(dev); - return writel(value, pdata->base + reg); + writel(value, pdata->base + reg); } /* -- cgit v1.2.3 From e0f9a4fb576c3f4233393194161e48941823cbc3 Mon Sep 17 00:00:00 2001 From: Ben Hoelker Date: Mon, 18 Aug 2025 10:30:00 +1200 Subject: drivers: rtc: max313xx: Add delay after setting date The MAX31331 was not correctly updating the seconds when setting the time and would return the seconds previously set. Like the MAX31343, a delay needs to be added after setting the time. Wait one second after writing so that the date command shows the correct time. Reviewed-by: Chris Packham Reviewed-by: Bruce Adams Signed-off-by: Ben Hoelker --- drivers/rtc/max313xx.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/rtc') diff --git a/drivers/rtc/max313xx.c b/drivers/rtc/max313xx.c index 2cb3f245041..f0d38b10c97 100644 --- a/drivers/rtc/max313xx.c +++ b/drivers/rtc/max313xx.c @@ -308,6 +308,7 @@ static int max313xx_set_time(struct udevice *dev, const struct rtc_time *t) return ret; break; + case ID_MAX31331: case ID_MAX31343: /* Time is not updated for 1 second after writing */ /* Sleep here so the date command shows the new time */ -- cgit v1.2.3