2023-08-09 03:13:26

by Jacky Huang

[permalink] [raw]
Subject: [RESEND PATCH v2 0/3] Add support for Nuvoton ma35d1 rtc controller

From: Jacky Huang <[email protected]>

This patch series adds the rtc driver for the nuvoton ma35d1 ARMv8 SoC.
It includes DT binding documentation, the ma35d1 rtc driver, and device
tree updates.

The ma35d1 rtc controller provides real-time and calendar messaging
capabilities. It supports programmable time tick and alarm match
interrupts. The time and calendar messages are expressed in BCD format.

This rtc driver has been tested on the ma35d1 som board with Linux 6.5-rc2.

v2:
- Updated nuvoton,ma35d1-rtc.yaml
- Modified patch title and fixed typo
- Added reference to rtc.yaml
- Used unevaluatedProperties instead of additionalProperties
- Modified rtc driver
- Used dev_err_probe()
- Removed ma35d1_rtc_remove()
- Made other minor fixes

Jacky Huang (3):
dt-bindings: rtc: Add Nuvoton ma35d1 rtc
arm64: dts: nuvoton: Add rtc for ma35d1
rtc: Add driver for Nuvoton ma35d1 rtc controller

.../bindings/rtc/nuvoton,ma35d1-rtc.yaml | 48 +++
.../boot/dts/nuvoton/ma35d1-iot-512m.dts | 4 +
.../boot/dts/nuvoton/ma35d1-som-256m.dts | 4 +
arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 8 +
drivers/rtc/Kconfig | 11 +
drivers/rtc/Makefile | 1 +
drivers/rtc/rtc-ma35d1.c | 355 ++++++++++++++++++
7 files changed, 431 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rtc/nuvoton,ma35d1-rtc.yaml
create mode 100644 drivers/rtc/rtc-ma35d1.c

--
2.34.1



2023-08-09 03:20:38

by Jacky Huang

[permalink] [raw]
Subject: [RESEND PATCH v2 1/3] dt-bindings: rtc: Add Nuvoton ma35d1 rtc

From: Jacky Huang <[email protected]>

Add documentation describing the Nuvoton ma35d1 rtc controller.

Signed-off-by: Jacky Huang <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
---
.../bindings/rtc/nuvoton,ma35d1-rtc.yaml | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rtc/nuvoton,ma35d1-rtc.yaml

diff --git a/Documentation/devicetree/bindings/rtc/nuvoton,ma35d1-rtc.yaml b/Documentation/devicetree/bindings/rtc/nuvoton,ma35d1-rtc.yaml
new file mode 100644
index 000000000000..5e4ade803eed
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/nuvoton,ma35d1-rtc.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nuvoton,ma35d1-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton MA35D1 Real Time Clock
+
+maintainers:
+ - Min-Jen Chen <[email protected]>
+
+allOf:
+ - $ref: rtc.yaml#
+
+properties:
+ compatible:
+ enum:
+ - nuvoton,ma35d1-rtc
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/nuvoton,ma35d1-clk.h>
+ rtc@40410000 {
+ compatible = "nuvoton,ma35d1-rtc";
+ reg = <0x40410000 0x200>;
+ interrupts = <GIC_SPI 5 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&clk RTC_GATE>;
+ };
+
+...
--
2.34.1


2023-08-09 03:42:40

by Jacky Huang

[permalink] [raw]
Subject: [RESEND PATCH v2 2/3] arm64: dts: nuvoton: Add rtc for ma35d1

From: Jacky Huang <[email protected]>

Add rtc controller support to the dtsi of ma35d1 SoC and
enable rtc on SOM and IoT boards.

Signed-off-by: Jacky Huang <[email protected]>
---
arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts | 4 ++++
arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts | 4 ++++
arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 8 ++++++++
3 files changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts b/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
index b89e2be6abae..b3be4331abcf 100644
--- a/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
+++ b/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
@@ -54,3 +54,7 @@ &clk {
"integer",
"integer";
};
+
+&rtc {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts b/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
index a1ebddecb7f8..9858788a589c 100644
--- a/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
+++ b/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
@@ -54,3 +54,7 @@ &clk {
"integer",
"integer";
};
+
+&rtc {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi b/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi
index 781cdae566a0..394395bfd3ae 100644
--- a/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi
@@ -95,6 +95,14 @@ clk: clock-controller@40460200 {
clocks = <&clk_hxt>;
};

+ rtc: rtc@40410000 {
+ compatible = "nuvoton,ma35d1-rtc";
+ reg = <0x0 0x40410000 0x0 0x200>;
+ interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk RTC_GATE>;
+ status = "disabled";
+ };
+
uart0: serial@40700000 {
compatible = "nuvoton,ma35d1-uart";
reg = <0x0 0x40700000 0x0 0x100>;
--
2.34.1


2023-08-12 10:05:09

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [RESEND PATCH v2 0/3] Add support for Nuvoton ma35d1 rtc controller

On Wed, Aug 9, 2023, at 03:15, Jacky Huang wrote:
> From: Jacky Huang <[email protected]>
>
> This patch series adds the rtc driver for the nuvoton ma35d1 ARMv8 SoC.
> It includes DT binding documentation, the ma35d1 rtc driver, and device
> tree updates.
>
> The ma35d1 rtc controller provides real-time and calendar messaging
> capabilities. It supports programmable time tick and alarm match
> interrupts. The time and calendar messages are expressed in BCD format.
>
> This rtc driver has been tested on the ma35d1 som board with Linux 6.5-rc2.

Hi Jacky,

I see you added [email protected] to Cc for all three patches, which
has put them into the patchwork tracker.

Now that the platoform support is merged, I do not pick up patches
for other subsystems through the soc tree, so please drop the Cc
here.

You can post the the dts change along with the driver, but the
correct process is that the subsystem maintainer(s) pick up the
DT binding and the driver once the review is complete, and then
you send the dts changes to [email protected]. Depending on the
platform, there may be a lot of conflicting dts changes, so this
way you can aggregate any patches for these files before sending
them to the soc tree for inclusion, while I then merge them
with all the dts changes for other platforms and any global
cleanup.

Arnd

2023-08-13 00:57:19

by Jacky Huang

[permalink] [raw]
Subject: Re: [RESEND PATCH v2 0/3] Add support for Nuvoton ma35d1 rtc controller


On 2023/8/12 下午 04:53, Arnd Bergmann wrote:
> On Wed, Aug 9, 2023, at 03:15, Jacky Huang wrote:
>> From: Jacky Huang <[email protected]>
>>
>> This patch series adds the rtc driver for the nuvoton ma35d1 ARMv8 SoC.
>> It includes DT binding documentation, the ma35d1 rtc driver, and device
>> tree updates.
>>
>> The ma35d1 rtc controller provides real-time and calendar messaging
>> capabilities. It supports programmable time tick and alarm match
>> interrupts. The time and calendar messages are expressed in BCD format.
>>
>> This rtc driver has been tested on the ma35d1 som board with Linux 6.5-rc2.
> Hi Jacky,
>
> I see you added [email protected] to Cc for all three patches, which
> has put them into the patchwork tracker.
>
> Now that the platoform support is merged, I do not pick up patches
> for other subsystems through the soc tree, so please drop the Cc
> here.
>
> You can post the the dts change along with the driver, but the
> correct process is that the subsystem maintainer(s) pick up the
> DT binding and the driver once the review is complete, and then
> you send the dts changes to [email protected]. Depending on the
> platform, there may be a lot of conflicting dts changes, so this
> way you can aggregate any patches for these files before sending
> them to the soc tree for inclusion, while I then merge them
> with all the dts changes for other platforms and any global
> cleanup.
>
> Arnd


Dear Arnd,


Thank you for the detailed explanation. I now understand how to proceed.

I will remove Cc: [email protected] from here. I apologize for any
inconvenience

this patch series may have caused you and appreciate your assistance.


Best Regards,

Jacky Huang