diff mbox series

[12/17] MIPS: loongson32: Convert RTC platform device to DT

Message ID 20230729134318.1694467-13-keguang.zhang@gmail.com (mailing list archive)
State New
Headers show
Series MIPS: loongson32: Convert all platform devices to DT | expand

Commit Message

Keguang Zhang July 29, 2023, 1:43 p.m. UTC
Add RTC device node for Loongson-1 boards,
and drop the legacy platform device and data accordingly.

Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
---
 arch/mips/boot/dts/loongson/loongson1b.dtsi   | 12 ++++++++++++
 arch/mips/boot/dts/loongson/loongson1c.dtsi   |  9 +++++++++
 arch/mips/boot/dts/loongson/lsgz_1b_dev.dts   |  4 ++++
 arch/mips/boot/dts/loongson/smartloong_1c.dts |  4 ++++
 arch/mips/loongson32/common/platform.c        |  6 ------
 arch/mips/loongson32/ls1b/board.c             |  1 -
 arch/mips/loongson32/ls1c/board.c             |  1 -
 7 files changed, 29 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/arch/mips/boot/dts/loongson/loongson1b.dtsi b/arch/mips/boot/dts/loongson/loongson1b.dtsi
index 7b4914c358df..935e559016d6 100644
--- a/arch/mips/boot/dts/loongson/loongson1b.dtsi
+++ b/arch/mips/boot/dts/loongson/loongson1b.dtsi
@@ -132,6 +132,18 @@  phy1: ethernet-phy@0 {
 	};
 };
 
+&apb {
+	rtc: rtc@1fe64000 {
+		compatible = "loongson,ls1b-rtc";
+		reg = <0x1fe64000 0x78>;
+
+		interrupt-parent = <&intc0>;
+		interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
+
+		status = "disabled";
+	};
+};
+
 &gpio0 {
 	ngpios = <31>;
 };
diff --git a/arch/mips/boot/dts/loongson/loongson1c.dtsi b/arch/mips/boot/dts/loongson/loongson1c.dtsi
index 7204b829c801..f68bef1f65d3 100644
--- a/arch/mips/boot/dts/loongson/loongson1c.dtsi
+++ b/arch/mips/boot/dts/loongson/loongson1c.dtsi
@@ -88,6 +88,15 @@  ohci0: usb@1fe28000 {
 	};
 };
 
+&apb {
+	rtc: rtc@1fe64000 {
+		compatible = "loongson,ls1c-rtc";
+		reg = <0x1fe64000 0x78>;
+
+		status = "disabled";
+	};
+};
+
 &gpio0 {
 	ngpios = <32>;
 };
diff --git a/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts b/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
index 71838f867f8c..d3988d789c0f 100644
--- a/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
+++ b/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
@@ -63,6 +63,10 @@  &ohci0 {
 	status = "okay";
 };
 
+&rtc {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
diff --git a/arch/mips/boot/dts/loongson/smartloong_1c.dts b/arch/mips/boot/dts/loongson/smartloong_1c.dts
index 3277770c33fe..1b7741dcb87f 100644
--- a/arch/mips/boot/dts/loongson/smartloong_1c.dts
+++ b/arch/mips/boot/dts/loongson/smartloong_1c.dts
@@ -59,6 +59,10 @@  &ohci0 {
 	status = "okay";
 };
 
+&rtc {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
diff --git a/arch/mips/loongson32/common/platform.c b/arch/mips/loongson32/common/platform.c
index 3b984c805eb0..7d0120fe9a5b 100644
--- a/arch/mips/loongson32/common/platform.c
+++ b/arch/mips/loongson32/common/platform.c
@@ -16,12 +16,6 @@ 
 #include <nand.h>
 #include <irq.h>
 
-/* Real Time Clock */
-struct platform_device ls1x_rtc_pdev = {
-	.name		= "ls1x-rtc",
-	.id		= -1,
-};
-
 /* Watchdog */
 static struct resource ls1x_wdt_resources[] = {
 	{
diff --git a/arch/mips/loongson32/ls1b/board.c b/arch/mips/loongson32/ls1b/board.c
index ecc405aa9016..59c70c7ffe1a 100644
--- a/arch/mips/loongson32/ls1b/board.c
+++ b/arch/mips/loongson32/ls1b/board.c
@@ -13,7 +13,6 @@ 
 #include <platform.h>
 
 static struct platform_device *ls1b_platform_devices[] __initdata = {
-	&ls1x_rtc_pdev,
 	&ls1x_wdt_pdev,
 };
 
diff --git a/arch/mips/loongson32/ls1c/board.c b/arch/mips/loongson32/ls1c/board.c
index 29bc467fd149..4c2d44f9f6f2 100644
--- a/arch/mips/loongson32/ls1c/board.c
+++ b/arch/mips/loongson32/ls1c/board.c
@@ -6,7 +6,6 @@ 
 #include <platform.h>
 
 static struct platform_device *ls1c_platform_devices[] __initdata = {
-	&ls1x_rtc_pdev,
 	&ls1x_wdt_pdev,
 };