diff mbox series

[v3,05/12] of: overlays: dwc3-flattening: Add Qualcomm Arm32 overlays

Message ID 20250113-dwc3-refactor-v3-5-d1722075df7b@oss.qualcomm.com (mailing list archive)
State New
Headers show
Series usb: dwc3: qcom: Flatten dwc3 structure | expand

Commit Message

Bjorn Andersson Jan. 14, 2025, 5:11 a.m. UTC
Introduce the overlays necessary for migrating Qualcomm Arm32 boards
currently present in the upstream Linux kernel.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
---
 drivers/of/overlays/dwc3-flattening/Makefile       |  6 ++++
 .../of/overlays/dwc3-flattening/dwc3-flattening.c  | 42 ++++++++++++++++++++++
 .../of/overlays/dwc3-flattening/dwc3-flattening.h  | 13 +++++++
 .../overlays/dwc3-flattening/dwc3-qcom_ipq4018.dts | 36 +++++++++++++++++++
 .../dwc3-qcom_ipq4018_8dev_jalapeno.dts            | 38 ++++++++++++++++++++
 .../overlays/dwc3-flattening/dwc3-qcom_ipq4019.dts | 38 ++++++++++++++++++++
 .../overlays/dwc3-flattening/dwc3-qcom_ipq8064.dts | 40 +++++++++++++++++++++
 .../overlays/dwc3-flattening/dwc3-qcom_sdx55.dts   | 38 ++++++++++++++++++++
 .../overlays/dwc3-flattening/dwc3-qcom_sdx65.dts   | 38 ++++++++++++++++++++
 9 files changed, 289 insertions(+)
diff mbox series

Patch

diff --git a/drivers/of/overlays/dwc3-flattening/Makefile b/drivers/of/overlays/dwc3-flattening/Makefile
index 78ed59517887..248ddabd424e 100644
--- a/drivers/of/overlays/dwc3-flattening/Makefile
+++ b/drivers/of/overlays/dwc3-flattening/Makefile
@@ -2,3 +2,9 @@ 
 
 obj-$(CONFIG_OF_OVERLAYS_DWC3_FLATTENING) += dwc3-flattening-overlay.o
 dwc3-flattening-overlay-y += dwc3-flattening.o
+dwc3-flattening-overlay-y += dwc3-qcom_ipq4018.dtb.o
+dwc3-flattening-overlay-y += dwc3-qcom_ipq4018_8dev_jalapeno.dtb.o
+dwc3-flattening-overlay-y += dwc3-qcom_ipq4019.dtb.o
+dwc3-flattening-overlay-y += dwc3-qcom_ipq8064.dtb.o
+dwc3-flattening-overlay-y += dwc3-qcom_sdx55.dtb.o
+dwc3-flattening-overlay-y += dwc3-qcom_sdx65.dtb.o
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-flattening.c b/drivers/of/overlays/dwc3-flattening/dwc3-flattening.c
index fe8e42627fe3..0a3a31c5088b 100644
--- a/drivers/of/overlays/dwc3-flattening/dwc3-flattening.c
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-flattening.c
@@ -21,7 +21,49 @@  struct dwc3_overlay_data {
 	const char *migrate_match;
 };
 
+static const struct dwc3_overlay_data dwc3_qcom_ipq4018_overlay = {
+	.fdt = __dtb_dwc3_qcom_ipq4018_begin,
+	.end = __dtb_dwc3_qcom_ipq4018_end,
+	.migrate_match = "qcom,dwc3",
+};
+
+static const struct dwc3_overlay_data dwc3_qcom_ipq4018_8dev_jalapeno_overlay = {
+	.fdt = __dtb_dwc3_qcom_ipq4018_8dev_jalapeno_begin,
+	.end = __dtb_dwc3_qcom_ipq4018_8dev_jalapeno_end,
+	.migrate_match = "qcom,dwc3",
+};
+
+static const struct dwc3_overlay_data dwc3_qcom_ipq4019_overlay = {
+	.fdt = __dtb_dwc3_qcom_ipq4019_begin,
+	.end = __dtb_dwc3_qcom_ipq4019_end,
+	.migrate_match = "qcom,dwc3",
+};
+
+static const struct dwc3_overlay_data dwc3_qcom_ipq8064_overlay = {
+	.fdt = __dtb_dwc3_qcom_ipq8064_begin,
+	.end = __dtb_dwc3_qcom_ipq8064_end,
+	.migrate_match = "qcom,dwc3",
+};
+
+static const struct dwc3_overlay_data dwc3_qcom_sdx55_overlay = {
+	.fdt = __dtb_dwc3_qcom_sdx55_begin,
+	.end = __dtb_dwc3_qcom_sdx55_end,
+	.migrate_match = "qcom,dwc3",
+};
+
+static const struct dwc3_overlay_data dwc3_qcom_sdx65_overlay = {
+	.fdt = __dtb_dwc3_qcom_sdx65_begin,
+	.end = __dtb_dwc3_qcom_sdx65_end,
+	.migrate_match = "qcom,dwc3",
+};
+
 static const struct of_device_id dwc3_flatten_of_match[] = {
+	{ .compatible = "8dev,jalapeno", .data = &dwc3_qcom_ipq4018_8dev_jalapeno_overlay },
+	{ .compatible = "qcom,ipq4018", .data = &dwc3_qcom_ipq4018_overlay },
+	{ .compatible = "qcom,ipq4019", .data = &dwc3_qcom_ipq4019_overlay },
+	{ .compatible = "qcom,ipq8064", .data = &dwc3_qcom_ipq8064_overlay },
+	{ .compatible = "qcom,sdx55", .data = &dwc3_qcom_sdx55_overlay },
+	{ .compatible = "qcom,sdx65", .data = &dwc3_qcom_sdx65_overlay },
 	{}
 };
 
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-flattening.h b/drivers/of/overlays/dwc3-flattening/dwc3-flattening.h
index 6147376d3c92..57d7dbc94980 100644
--- a/drivers/of/overlays/dwc3-flattening/dwc3-flattening.h
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-flattening.h
@@ -4,4 +4,17 @@ 
 
 #include <linux/kernel.h>
 
+extern u8 __dtb_dwc3_qcom_ipq4018_begin[];
+extern u8 __dtb_dwc3_qcom_ipq4018_end[];
+extern u8 __dtb_dwc3_qcom_ipq4018_8dev_jalapeno_begin[];
+extern u8 __dtb_dwc3_qcom_ipq4018_8dev_jalapeno_end[];
+extern u8 __dtb_dwc3_qcom_ipq4019_begin[];
+extern u8 __dtb_dwc3_qcom_ipq4019_end[];
+extern u8 __dtb_dwc3_qcom_ipq8064_begin[];
+extern u8 __dtb_dwc3_qcom_ipq8064_end[];
+extern u8 __dtb_dwc3_qcom_sdx55_begin[];
+extern u8 __dtb_dwc3_qcom_sdx55_end[];
+extern u8 __dtb_dwc3_qcom_sdx65_begin[];
+extern u8 __dtb_dwc3_qcom_sdx65_end[];
+
 #endif
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4018.dts b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4018.dts
new file mode 100644
index 000000000000..1bd86a1852ba
--- /dev/null
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4018.dts
@@ -0,0 +1,36 @@ 
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	fragment@0 {
+		target-path = "/soc/usb@8af8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq4019-dwc3", "qcom,snps-dwc3";
+			reg = <0x08a00000 0xf8100>;
+			phys = <&usb3_hs_phy>;
+			phy-names = "usb2-phy";
+		};
+	};
+
+	fragment@1 {
+		target-path = "/soc/usb@60f8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq4019-dwc3", "qcom,snps-dwc3";
+			reg = <0x06000000 0xf8100>;
+			phys = <&usb2_hs_phy>;
+			phy-names = "usb2-phy";
+		};
+	};
+};
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4018_8dev_jalapeno.dts b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4018_8dev_jalapeno.dts
new file mode 100644
index 000000000000..bdc76b73c1fe
--- /dev/null
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4018_8dev_jalapeno.dts
@@ -0,0 +1,38 @@ 
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	fragment@0 {
+		target-path = "/soc/usb@8af8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq4019-dwc3", "qcom,snps-dwc3";
+			reg = <0x08a00000 0xf8100>;
+			phys = <&usb3_hs_phy>,
+			       <&usb3_ss_phy>;
+			phy-names = "usb2-phy",
+				    "usb3-phy";
+		};
+	};
+
+	fragment@1 {
+		target-path = "/soc/usb@60f8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq4019-dwc3", "qcom,snps-dwc3";
+			reg = <0x06000000 0xf8100>;
+			phys = <&usb2_hs_phy>;
+			phy-names = "usb2-phy";
+		};
+	};
+};
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4019.dts b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4019.dts
new file mode 100644
index 000000000000..bdc76b73c1fe
--- /dev/null
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq4019.dts
@@ -0,0 +1,38 @@ 
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	fragment@0 {
+		target-path = "/soc/usb@8af8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq4019-dwc3", "qcom,snps-dwc3";
+			reg = <0x08a00000 0xf8100>;
+			phys = <&usb3_hs_phy>,
+			       <&usb3_ss_phy>;
+			phy-names = "usb2-phy",
+				    "usb3-phy";
+		};
+	};
+
+	fragment@1 {
+		target-path = "/soc/usb@60f8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq4019-dwc3", "qcom,snps-dwc3";
+			reg = <0x06000000 0xf8100>;
+			phys = <&usb2_hs_phy>;
+			phy-names = "usb2-phy";
+		};
+	};
+};
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq8064.dts b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq8064.dts
new file mode 100644
index 000000000000..8e29a17472c6
--- /dev/null
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_ipq8064.dts
@@ -0,0 +1,40 @@ 
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	fragment@0 {
+		target-path = "/soc/usb@100f8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq8064-dwc3", "qcom,snps-dwc3";
+			reg = <0x10000000 0x14d00>;
+			phys = <&hs_phy_0>,
+			       <&ss_phy_0>;
+			phy-names = "usb2-phy",
+				    "usb3-phy";
+		};
+	};
+
+	fragment@1 {
+		target-path = "/soc/usb@110f8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,ipq8064-dwc3", "qcom,snps-dwc3";
+			reg = <0x11000000 0x14d00>;
+			phys = <&hs_phy_1>,
+			       <&ss_phy_1>;
+			phy-names = "usb2-phy",
+				    "usb3-phy";
+		};
+	};
+};
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-qcom_sdx55.dts b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_sdx55.dts
new file mode 100644
index 000000000000..9ebb5d42f355
--- /dev/null
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_sdx55.dts
@@ -0,0 +1,38 @@ 
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	fragment@0 {
+		target-path = "/soc/usb@a6f8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,sdx55-dwc3", "qcom,snps-dwc3";
+			reg = <0x0a600000 0xd100>;
+			interrupts-extended = <&intc GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
+					      <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+					      <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 10 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 11 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 51 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "dwc_usb3",
+					  "pwr_event",
+					  "hs_phy_irq",
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq",
+					  "ss_phy_irq";
+			iommus = <&apps_smmu 0x1a0 0x0>;
+			phys = <&usb_hsphy>,
+			       <&usb_qmpphy>;
+			phy-names = "usb2-phy",
+				    "usb3-phy";
+		};
+	};
+};
diff --git a/drivers/of/overlays/dwc3-flattening/dwc3-qcom_sdx65.dts b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_sdx65.dts
new file mode 100644
index 000000000000..239caec1f80d
--- /dev/null
+++ b/drivers/of/overlays/dwc3-flattening/dwc3-qcom_sdx65.dts
@@ -0,0 +1,38 @@ 
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+	fragment@0 {
+		target-path = "/soc/usb@a6f8800";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		__overlay__ {
+			compatible = "qcom,sdx65-dwc3", "qcom,snps-dwc3";
+			reg = <0x0a600000 0xd100>;
+			interrupts-extended = <&intc GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
+					      <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+					      <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 19 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 18 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 76 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "dwc_usb3",
+					  "pwr_event",
+					  "hs_phy_irq",
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq",
+					  "ss_phy_irq";
+			iommus = <&apps_smmu 0x1a0 0x0>;
+			phys = <&usb_hsphy>,
+			       <&usb_qmpphy>;
+			phy-names = "usb2-phy",
+				    "usb3-phy";
+		};
+	};
+};