* [PATCH 0/3] On-chip RTC support for ExynosAutov9 [not found] <CGME20250702051528epcas5p24abd15d8f554ea057bd6aac586644f4e@epcas5p2.samsung.com> @ 2025-07-02 5:24 ` Devang Tailor [not found] ` <CGME20250702051530epcas5p12b8c62aba9cc11dc8d13c65fb12b6c3c@epcas5p1.samsung.com> ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Devang Tailor @ 2025-07-02 5:24 UTC (permalink / raw) To: alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata Cc: Devang Tailor Enable on-chip RTC support. The on-chip RTC of this SoC is similar to the previous versions of Samsung SoC. So re-use the existing RTC driver with additional changes required for timer counter specific registers. Setting and getting hardware clock has been tested using 'hwclock' and 'date' utilities. Alarm interrupt has been checked with incrementing interrupt count via "cat /proc/interrupts | grep rtc" for 10sec wakeup time via "echo +10 > /sys/class/rtc/rtc0/wakealarm" Devang Tailor (3): dt-bindings: rtc: s3c-rtc: add compatible for exynosautov9 rtc: s3c: support for exynosautov9 on-chip RTC arm64: dts: exynosautov9: add RTC DT node .../devicetree/bindings/rtc/s3c-rtc.yaml | 1 + .../boot/dts/exynos/exynosautov9-sadk.dts | 4 +++ arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 10 +++++++ drivers/rtc/rtc-s3c.c | 26 +++++++++++++++++++ drivers/rtc/rtc-s3c.h | 4 +++ 5 files changed, 45 insertions(+) base-commit: bc6e0ba6c9bafa6241b05524b9829808056ac4ad -- 2.34.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <CGME20250702051530epcas5p12b8c62aba9cc11dc8d13c65fb12b6c3c@epcas5p1.samsung.com>]
* [PATCH 1/3] dt-bindings: rtc: s3c-rtc: add compatible for exynosautov9 [not found] ` <CGME20250702051530epcas5p12b8c62aba9cc11dc8d13c65fb12b6c3c@epcas5p1.samsung.com> @ 2025-07-02 5:24 ` Devang Tailor 2025-07-07 9:16 ` Krzysztof Kozlowski 0 siblings, 1 reply; 9+ messages in thread From: Devang Tailor @ 2025-07-02 5:24 UTC (permalink / raw) To: alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata Cc: Devang Tailor Add "samsung,exynosautov9-rtc" dedicated compatible for on-chip RTC found in ExynosAutov9 SoC. Signed-off-by: Devang Tailor <dev.tailor@samsung.com> --- Documentation/devicetree/bindings/rtc/s3c-rtc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml b/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml index bf4e11d6dffb..5daee2a5f866 100644 --- a/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml +++ b/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml @@ -13,6 +13,7 @@ properties: compatible: oneOf: - enum: + - samsung,exynosautov9-rtc - samsung,s3c2410-rtc - samsung,s3c2416-rtc - samsung,s3c2443-rtc -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] dt-bindings: rtc: s3c-rtc: add compatible for exynosautov9 2025-07-02 5:24 ` [PATCH 1/3] dt-bindings: rtc: s3c-rtc: add compatible for exynosautov9 Devang Tailor @ 2025-07-07 9:16 ` Krzysztof Kozlowski 0 siblings, 0 replies; 9+ messages in thread From: Krzysztof Kozlowski @ 2025-07-07 9:16 UTC (permalink / raw) To: Devang Tailor, alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata On 02/07/2025 07:24, Devang Tailor wrote: > Add "samsung,exynosautov9-rtc" dedicated compatible for > on-chip RTC found in ExynosAutov9 SoC. > > Signed-off-by: Devang Tailor <dev.tailor@samsung.com> > --- > Documentation/devicetree/bindings/rtc/s3c-rtc.yaml | 1 + Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <CGME20250702051532epcas5p381e97531e4df64f556e8aba86c5532d9@epcas5p3.samsung.com>]
* [PATCH 2/3] rtc: s3c: support for exynosautov9 on-chip RTC [not found] ` <CGME20250702051532epcas5p381e97531e4df64f556e8aba86c5532d9@epcas5p3.samsung.com> @ 2025-07-02 5:24 ` Devang Tailor 2025-07-07 9:23 ` Krzysztof Kozlowski 0 siblings, 1 reply; 9+ messages in thread From: Devang Tailor @ 2025-07-02 5:24 UTC (permalink / raw) To: alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata Cc: Devang Tailor The on-chip RTC of this SoC is almost similar to the previous versions of SoC. Hence re-use the existing driver with platform specific change to enable RTC. This has been tested with 'hwclock' & 'date' utilities Signed-off-by: Devang Tailor <dev.tailor@samsung.com> --- drivers/rtc/rtc-s3c.c | 26 ++++++++++++++++++++++++++ drivers/rtc/rtc-s3c.h | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 5dd575865adf..00686aa805f2 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -384,6 +384,23 @@ static void s3c6410_rtc_disable(struct s3c_rtc *info) writew(con, info->base + S3C2410_RTCCON); } +static void exynosautov9_rtc_disable(struct s3c_rtc *info) +{ + unsigned int con; + + con = readb(info->base + S3C2410_RTCCON); + con &= ~S3C2410_RTCCON_RTCEN; + writeb(con, info->base + S3C2410_RTCCON); + + con = readb(info->base + EXYNOSAUTOV9_TICCON0); + con &= ~EXYNOSAUTOV9_TICCON_TICEN; + writeb(con, info->base + EXYNOSAUTOV9_TICCON0); + + con = readb(info->base + EXYNOSAUTOV9_TICCON1); + con &= ~EXYNOSAUTOV9_TICCON_TICEN; + writeb(con, info->base + EXYNOSAUTOV9_TICCON1); +} + static void s3c_rtc_remove(struct platform_device *pdev) { struct s3c_rtc *info = platform_get_drvdata(pdev); @@ -574,6 +591,12 @@ static struct s3c_rtc_data const s3c6410_rtc_data = { .disable = s3c6410_rtc_disable, }; +static struct s3c_rtc_data const exynosautov9_rtc_data = { + .irq_handler = s3c6410_rtc_irq, + .enable = s3c24xx_rtc_enable, + .disable = exynosautov9_rtc_disable, +}; + static const __maybe_unused struct of_device_id s3c_rtc_dt_match[] = { { .compatible = "samsung,s3c2410-rtc", @@ -590,6 +613,9 @@ static const __maybe_unused struct of_device_id s3c_rtc_dt_match[] = { }, { .compatible = "samsung,exynos3250-rtc", .data = &s3c6410_rtc_data, + }, { + .compatible = "samsung,exynosautov9-rtc", + .data = &exynosautov9_rtc_data, }, { /* sentinel */ }, }; diff --git a/drivers/rtc/rtc-s3c.h b/drivers/rtc/rtc-s3c.h index 3552914aa611..ed57ebe06b41 100644 --- a/drivers/rtc/rtc-s3c.h +++ b/drivers/rtc/rtc-s3c.h @@ -14,6 +14,10 @@ #define S3C2410_INTP_ALM (1 << 1) #define S3C2410_INTP_TIC (1 << 0) +#define EXYNOSAUTOV9_TICCON0 S3C2410_RTCREG(0x38) +#define EXYNOSAUTOV9_TICCON1 S3C2410_RTCREG(0x3C) +#define EXYNOSAUTOV9_TICCON_TICEN (1 << 0) + #define S3C2410_RTCCON S3C2410_RTCREG(0x40) #define S3C2410_RTCCON_RTCEN (1 << 0) #define S3C2410_RTCCON_CNTSEL (1 << 2) -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] rtc: s3c: support for exynosautov9 on-chip RTC 2025-07-02 5:24 ` [PATCH 2/3] rtc: s3c: support for exynosautov9 on-chip RTC Devang Tailor @ 2025-07-07 9:23 ` Krzysztof Kozlowski 2025-07-08 5:03 ` Devang Tailor 0 siblings, 1 reply; 9+ messages in thread From: Krzysztof Kozlowski @ 2025-07-07 9:23 UTC (permalink / raw) To: Devang Tailor, alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata On 02/07/2025 07:24, Devang Tailor wrote: > The on-chip RTC of this SoC is almost similar to the previous > versions of SoC. Hence re-use the existing driver with platform specific > change to enable RTC. > > This has been tested with 'hwclock' & 'date' utilities > > Signed-off-by: Devang Tailor <dev.tailor@samsung.com> > --- > drivers/rtc/rtc-s3c.c | 26 ++++++++++++++++++++++++++ > drivers/rtc/rtc-s3c.h | 4 ++++ > 2 files changed, 30 insertions(+) > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c > index 5dd575865adf..00686aa805f2 100644 > --- a/drivers/rtc/rtc-s3c.c > +++ b/drivers/rtc/rtc-s3c.c > @@ -384,6 +384,23 @@ static void s3c6410_rtc_disable(struct s3c_rtc *info) > writew(con, info->base + S3C2410_RTCCON); > } > > +static void exynosautov9_rtc_disable(struct s3c_rtc *info) > +{ > + unsigned int con; > + > + con = readb(info->base + S3C2410_RTCCON); > + con &= ~S3C2410_RTCCON_RTCEN; > + writeb(con, info->base + S3C2410_RTCCON); > + > + con = readb(info->base + EXYNOSAUTOV9_TICCON0); > + con &= ~EXYNOSAUTOV9_TICCON_TICEN; > + writeb(con, info->base + EXYNOSAUTOV9_TICCON0); > + > + con = readb(info->base + EXYNOSAUTOV9_TICCON1); > + con &= ~EXYNOSAUTOV9_TICCON_TICEN; > + writeb(con, info->base + EXYNOSAUTOV9_TICCON1); You clear these bits during disable, but why aren't they set during enable? Why is this asymmetric? This should be clearly explained, but both commit msg and code is completely silent. > +} > + > static void s3c_rtc_remove(struct platform_device *pdev) > { > struct s3c_rtc *info = platform_get_drvdata(pdev); > @@ -574,6 +591,12 @@ static struct s3c_rtc_data const s3c6410_rtc_data = { > .disable = s3c6410_rtc_disable, > }; > > +static struct s3c_rtc_data const exynosautov9_rtc_data = { Please put const after static. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 2/3] rtc: s3c: support for exynosautov9 on-chip RTC 2025-07-07 9:23 ` Krzysztof Kozlowski @ 2025-07-08 5:03 ` Devang Tailor 0 siblings, 0 replies; 9+ messages in thread From: Devang Tailor @ 2025-07-08 5:03 UTC (permalink / raw) To: 'Krzysztof Kozlowski', alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata Hi Krzysztof, > -----Original Message----- > From: Krzysztof Kozlowski <krzk@kernel.org> > Sent: 07 July 2025 14:54 > To: Devang Tailor <dev.tailor@samsung.com>; > alexandre.belloni@bootlin.com; robh@kernel.org; krzk+dt@kernel.org; > conor+dt@kernel.org; alim.akhtar@samsung.com; linux-rtc@vger.kernel.org; > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; inux-arm- > kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org; > faraz.ata@samsung.com > Subject: Re: [PATCH 2/3] rtc: s3c: support for exynosautov9 on-chip RTC > > On 02/07/2025 07:24, Devang Tailor wrote: > > The on-chip RTC of this SoC is almost similar to the previous versions > > of SoC. Hence re-use the existing driver with platform specific change > > to enable RTC. > > > > This has been tested with 'hwclock' & 'date' utilities > > > > Signed-off-by: Devang Tailor <dev.tailor@samsung.com> > > --- > > drivers/rtc/rtc-s3c.c | 26 ++++++++++++++++++++++++++ > > drivers/rtc/rtc-s3c.h | 4 ++++ > > 2 files changed, 30 insertions(+) > > > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index > > 5dd575865adf..00686aa805f2 100644 > > --- a/drivers/rtc/rtc-s3c.c > > +++ b/drivers/rtc/rtc-s3c.c > > @@ -384,6 +384,23 @@ static void s3c6410_rtc_disable(struct s3c_rtc > *info) > > writew(con, info->base + S3C2410_RTCCON); } > > > > +static void exynosautov9_rtc_disable(struct s3c_rtc *info) { > > + unsigned int con; > > + > > + con = readb(info->base + S3C2410_RTCCON); > > + con &= ~S3C2410_RTCCON_RTCEN; > > + writeb(con, info->base + S3C2410_RTCCON); > > + > > + con = readb(info->base + EXYNOSAUTOV9_TICCON0); > > + con &= ~EXYNOSAUTOV9_TICCON_TICEN; > > + writeb(con, info->base + EXYNOSAUTOV9_TICCON0); > > + > > + con = readb(info->base + EXYNOSAUTOV9_TICCON1); > > + con &= ~EXYNOSAUTOV9_TICCON_TICEN; > > + writeb(con, info->base + EXYNOSAUTOV9_TICCON1); > > You clear these bits during disable, but why aren't they set during enable? > Why is this asymmetric? This should be clearly explained, but both commit > msg and code is completely silent. OK. I will correct in V2 patch > > > +} > > + > > static void s3c_rtc_remove(struct platform_device *pdev) { > > struct s3c_rtc *info = platform_get_drvdata(pdev); @@ -574,6 +591,12 > > @@ static struct s3c_rtc_data const s3c6410_rtc_data = { > > .disable = s3c6410_rtc_disable, > > }; > > > > +static struct s3c_rtc_data const exynosautov9_rtc_data = { > > Please put const after static. I tried to keep it similar to the existing format, I will correct it in V2 patch. > > > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <CGME20250702051533epcas5p28698c81b7ec141938f8808393c498cb7@epcas5p2.samsung.com>]
* [PATCH 3/3] arm64: dts: exynosautov9: add RTC DT node [not found] ` <CGME20250702051533epcas5p28698c81b7ec141938f8808393c498cb7@epcas5p2.samsung.com> @ 2025-07-02 5:24 ` Devang Tailor 2025-07-07 9:23 ` Krzysztof Kozlowski 0 siblings, 1 reply; 9+ messages in thread From: Devang Tailor @ 2025-07-02 5:24 UTC (permalink / raw) To: alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata Cc: Devang Tailor Add DT node for on-chip RTC for ExynosAutov9 Signed-off-by: Devang Tailor <dev.tailor@samsung.com> --- arch/arm64/boot/dts/exynos/exynosautov9-sadk.dts | 4 ++++ arch/arm64/boot/dts/exynos/exynosautov9.dtsi | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/exynosautov9-sadk.dts b/arch/arm64/boot/dts/exynos/exynosautov9-sadk.dts index de2c1de51a76..5f5167571f7a 100644 --- a/arch/arm64/boot/dts/exynos/exynosautov9-sadk.dts +++ b/arch/arm64/boot/dts/exynos/exynosautov9-sadk.dts @@ -106,6 +106,10 @@ &pwm { status = "okay"; }; +&rtc { + status = "okay"; +}; + &serial_0 { pinctrl-0 = <&uart0_bus_dual>; status = "okay"; diff --git a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi index 66628cb32776..e655212f6a6b 100644 --- a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi +++ b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi @@ -1633,6 +1633,16 @@ pwm: pwm@103f0000 { clock-names = "timers"; status = "disabled"; }; + + rtc: rtc@10540000 { + compatible = "samsung,exynosautov9-rtc"; + reg = <0x10540000 0x100>; + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&xtcxo>; + clock-names = "rtc"; + status = "disabled"; + }; }; }; -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] arm64: dts: exynosautov9: add RTC DT node 2025-07-02 5:24 ` [PATCH 3/3] arm64: dts: exynosautov9: add RTC DT node Devang Tailor @ 2025-07-07 9:23 ` Krzysztof Kozlowski 2025-07-08 5:00 ` Devang Tailor 0 siblings, 1 reply; 9+ messages in thread From: Krzysztof Kozlowski @ 2025-07-07 9:23 UTC (permalink / raw) To: Devang Tailor, alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata On 02/07/2025 07:24, Devang Tailor wrote: > --- a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi > +++ b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi > @@ -1633,6 +1633,16 @@ pwm: pwm@103f0000 { > clock-names = "timers"; > status = "disabled"; > }; > + > + rtc: rtc@10540000 { > + compatible = "samsung,exynosautov9-rtc"; > + reg = <0x10540000 0x100>; > + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, > + <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; Misaligned. Should match earlier '<'. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 3/3] arm64: dts: exynosautov9: add RTC DT node 2025-07-07 9:23 ` Krzysztof Kozlowski @ 2025-07-08 5:00 ` Devang Tailor 0 siblings, 0 replies; 9+ messages in thread From: Devang Tailor @ 2025-07-08 5:00 UTC (permalink / raw) To: 'Krzysztof Kozlowski', alexandre.belloni, robh, krzk+dt, conor+dt, alim.akhtar, linux-rtc, devicetree, linux-kernel, inux-arm-kernel, linux-samsung-soc, faraz.ata Hi Krzysztof, > -----Original Message----- > From: Krzysztof Kozlowski <krzk@kernel.org> > Sent: 07 July 2025 14:53 > To: Devang Tailor <dev.tailor@samsung.com>; > alexandre.belloni@bootlin.com; robh@kernel.org; krzk+dt@kernel.org; > conor+dt@kernel.org; alim.akhtar@samsung.com; linux-rtc@vger.kernel.org; > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; inux-arm- > kernel@lists.infradead.org; linux-samsung-soc@vger.kernel.org; > faraz.ata@samsung.com > Subject: Re: [PATCH 3/3] arm64: dts: exynosautov9: add RTC DT node > > On 02/07/2025 07:24, Devang Tailor wrote: > > --- a/arch/arm64/boot/dts/exynos/exynosautov9.dtsi > > +++ b/arch/arm64/boot/dts/exynos/exynosautov9.dtsi > > @@ -1633,6 +1633,16 @@ pwm: pwm@103f0000 { > > clock-names = "timers"; > > status = "disabled"; > > }; > > + > > + rtc: rtc@10540000 { > > + compatible = "samsung,exynosautov9-rtc"; > > + reg = <0x10540000 0x100>; > > + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, > > + <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; > > > Misaligned. Should match earlier '<'. Will update it to match last '<' 's alignment. > > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-07-08 6:08 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <CGME20250702051528epcas5p24abd15d8f554ea057bd6aac586644f4e@epcas5p2.samsung.com> 2025-07-02 5:24 ` [PATCH 0/3] On-chip RTC support for ExynosAutov9 Devang Tailor [not found] ` <CGME20250702051530epcas5p12b8c62aba9cc11dc8d13c65fb12b6c3c@epcas5p1.samsung.com> 2025-07-02 5:24 ` [PATCH 1/3] dt-bindings: rtc: s3c-rtc: add compatible for exynosautov9 Devang Tailor 2025-07-07 9:16 ` Krzysztof Kozlowski [not found] ` <CGME20250702051532epcas5p381e97531e4df64f556e8aba86c5532d9@epcas5p3.samsung.com> 2025-07-02 5:24 ` [PATCH 2/3] rtc: s3c: support for exynosautov9 on-chip RTC Devang Tailor 2025-07-07 9:23 ` Krzysztof Kozlowski 2025-07-08 5:03 ` Devang Tailor [not found] ` <CGME20250702051533epcas5p28698c81b7ec141938f8808393c498cb7@epcas5p2.samsung.com> 2025-07-02 5:24 ` [PATCH 3/3] arm64: dts: exynosautov9: add RTC DT node Devang Tailor 2025-07-07 9:23 ` Krzysztof Kozlowski 2025-07-08 5:00 ` Devang Tailor
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).