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-12-keguang.zhang@gmail.com>
Date:   Sat, 29 Jul 2023 21:43:12 +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 11/17] MIPS: loongson32: Convert USB host platform device to DT

Add USB host device nodes for Loongson-1 boards,
and drop the legacy platform devices and data accordingly.

Signed-off-by: Keguang Zhang <keguang.zhang@...il.com>
---
 arch/mips/boot/dts/loongson/loongson1b.dtsi   | 20 +++++++++++++
 arch/mips/boot/dts/loongson/loongson1c.dtsi   | 20 +++++++++++++
 arch/mips/boot/dts/loongson/lsgz_1b_dev.dts   |  8 +++++
 arch/mips/boot/dts/loongson/smartloong_1c.dts |  8 +++++
 arch/mips/loongson32/common/platform.c        | 29 -------------------
 arch/mips/loongson32/ls1b/board.c             |  1 -
 6 files changed, 56 insertions(+), 30 deletions(-)

diff --git a/arch/mips/boot/dts/loongson/loongson1b.dtsi b/arch/mips/boot/dts/loongson/loongson1b.dtsi
index 7010d3f3511b..7b4914c358df 100644
--- a/arch/mips/boot/dts/loongson/loongson1b.dtsi
+++ b/arch/mips/boot/dts/loongson/loongson1b.dtsi
@@ -82,6 +82,26 @@ clkc: clock-controller@...78030 {
 };
 
 &ahb {
+	ehci0: usb@...00000 {
+		compatible = "generic-ehci";
+		reg = <0x1fe00000 0x100>;
+
+		interrupt-parent = <&intc1>;
+		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+
+		status = "disabled";
+	};
+
+	ohci0: usb@...08000 {
+		compatible = "generic-ohci";
+		reg = <0x1fe08000 0x100>;
+
+		interrupt-parent = <&intc1>;
+		interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
+
+		status = "disabled";
+	};
+
 	gmac1: ethernet@...20000 {
 		compatible = "snps,dwmac-3.70a";
 		reg = <0x1fe20000 0x10000>;
diff --git a/arch/mips/boot/dts/loongson/loongson1c.dtsi b/arch/mips/boot/dts/loongson/loongson1c.dtsi
index a5bc2c5093ca..7204b829c801 100644
--- a/arch/mips/boot/dts/loongson/loongson1c.dtsi
+++ b/arch/mips/boot/dts/loongson/loongson1c.dtsi
@@ -66,6 +66,26 @@ gpio3: gpio@...010cc {
 
 		ngpios = <32>;
 	};
+
+	ehci0: usb@...20000 {
+		compatible = "generic-ehci";
+		reg = <0x1fe20000 0x100>;
+
+		interrupt-parent = <&intc1>;
+		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+
+		status = "disabled";
+	};
+
+	ohci0: usb@...28000 {
+		compatible = "generic-ohci";
+		reg = <0x1fe28000 0x100>;
+
+		interrupt-parent = <&intc1>;
+		interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
+
+		status = "disabled";
+	};
 };
 
 &gpio0 {
diff --git a/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts b/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
index 8ee76ecdafbb..71838f867f8c 100644
--- a/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
+++ b/arch/mips/boot/dts/loongson/lsgz_1b_dev.dts
@@ -55,6 +55,14 @@ &gmac1 {
 	status = "okay";
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ohci0 {
+	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 96387cc814ca..3277770c33fe 100644
--- a/arch/mips/boot/dts/loongson/smartloong_1c.dts
+++ b/arch/mips/boot/dts/loongson/smartloong_1c.dts
@@ -51,6 +51,14 @@ &gmac0 {
 	status = "okay";
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
diff --git a/arch/mips/loongson32/common/platform.c b/arch/mips/loongson32/common/platform.c
index 37302bcfb9ab..3b984c805eb0 100644
--- a/arch/mips/loongson32/common/platform.c
+++ b/arch/mips/loongson32/common/platform.c
@@ -16,35 +16,6 @@
 #include <nand.h>
 #include <irq.h>
 
-/* USB EHCI */
-static u64 ls1x_ehci_dmamask = DMA_BIT_MASK(32);
-
-static struct resource ls1x_ehci_resources[] = {
-	[0] = {
-		.start	= LS1X_EHCI_BASE,
-		.end	= LS1X_EHCI_BASE + SZ_32K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= LS1X_EHCI_IRQ,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct usb_ehci_pdata ls1x_ehci_pdata = {
-};
-
-struct platform_device ls1x_ehci_pdev = {
-	.name		= "ehci-platform",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(ls1x_ehci_resources),
-	.resource	= ls1x_ehci_resources,
-	.dev		= {
-		.dma_mask = &ls1x_ehci_dmamask,
-		.platform_data = &ls1x_ehci_pdata,
-	},
-};
-
 /* Real Time Clock */
 struct platform_device ls1x_rtc_pdev = {
 	.name		= "ls1x-rtc",
diff --git a/arch/mips/loongson32/ls1b/board.c b/arch/mips/loongson32/ls1b/board.c
index 4cad019d655f..ecc405aa9016 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_ehci_pdev,
 	&ls1x_rtc_pdev,
 	&ls1x_wdt_pdev,
 };
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ