lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230729134318.1694467-13-keguang.zhang@gmail.com>
Date:   Sat, 29 Jul 2023 21:43:13 +0800
From:   Keguang Zhang <keguang.zhang@...il.com>
To:     linux-mips@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Keguang Zhang <keguang.zhang@...il.com>
Subject: [PATCH 12/17] MIPS: loongson32: Convert RTC platform device to DT

Add RTC device node for Loongson-1 boards,
and drop the legacy platform device and data accordingly.

Signed-off-by: Keguang Zhang <keguang.zhang@...il.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 --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@...64000 {
+		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@...28000 {
 	};
 };
 
+&apb {
+	rtc: rtc@...64000 {
+		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,
 };
 
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ