Skip to contentSkip to conversation

Add Unisoc's SC9863A support

PATCH Superseded Chunyan Zhang 2 participants 7 messages Dec 9, 2019 – Dec 23, 2019

Subsystems (2)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Chunyan Zhang

author reviewer
#0 lore raw

v4 cover Add Unisoc's SC9863A support

SC9863A has Octa-core ARM Cortex A55 application processor. Find more details about it on the website: http://www.unisoc.com/sc9863a

Changes from v3:
* Rebased on v5.5-rc1;
* Fix the cpu-map to put all cpus into the single cluster;
* Fixed a bindings error.

Changes from v2:
* Discard some dt-bindings patches which have been applied by Rob Herring.
* Added a new dt-binding file for sprd global-regs, also added a vendor directory for sprd.
* Moved sprd.yaml to the vendor directory.
* Addressed comments from Rob:
- fixed dtbs_check errors;
- move gic under to the bus node;
- removed msi-controller from gic, sinceSC9863A doesn't provide ITS;
- added specific compatible string for syscon nodes;
- cut down registers range of syscon nodes;
- removed unnecessary property "sprd,sc-id";
- added earlycon support in devicetree.

Changes from v1:
- Convert DT bindings to json-schema.

Chunyan Zhang (3):
dt-bindings: arm: sprd: add global registers bindings
dt-bindings: arm: move sprd board file to vendor directory
arm64: dts: Add Unisoc's SC9863A SoC support

 .../bindings/arm/sprd/global-regs.yaml        |  34 ++
 .../bindings/arm/{ => sprd}/sprd.yaml         |   2 +-
 arch/arm64/boot/dts/sprd/Makefile             |   3 +-
 arch/arm64/boot/dts/sprd/sc9863a.dtsi         | 523 ++++++++++++++++++
 arch/arm64/boot/dts/sprd/sharkl3.dtsi         | 148 +++++
 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts     |  39 ++
 6 files changed, 747 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/sprd/global-regs.yaml
 rename Documentation/devicetree/bindings/arm/{ => sprd}/sprd.yaml (92%)
 create mode 100644 arch/arm64/boot/dts/sprd/sc9863a.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sharkl3.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts
Signature · 1 line
2.20.1
author reviewer
#1 lore raw

PATCH v4 1/3 dt-bindings: arm: sprd: add global registers bindings

From: Chunyan Zhang <[email protected]>

The global registers would be used by different peripheral devices which we can see them as syscon clients which can use regmap interface that syscon driver provides.

---
 .../bindings/arm/sprd/global-regs.yaml        | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/sprd/global-regs.yaml
Documentation/devicetree/bindings/arm/sprd/global-regs.yaml new file +34 -0
new file mode 100644
index 000000000000..012207166116
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2019 Unisoc Inc.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/sprd/global-regs.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Unisoc Global Registers
+
+maintainers:
+  - Orson Zhai <[email protected]>
+  - Baolin Wang <[email protected]>
+  - Chunyan Zhang <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - sprd,sc9860-glbregs
+              - sprd,sc9863a-glbregs
+          - const: syscon
+
+  reg:
+    maxItems: 1
+
+examples:
+  - |
+    apb_regs: syscon@402e0000 {
+      compatible = "sprd,sc9863a-glbregs", "syscon";
+      reg = <0x402e0000 0x4000>;
+    };
+
+...
Signature · 1 line
2.20.1
author reviewer
#2 lore raw

PATCH v4 2/3 dt-bindings: arm: move sprd board file to vendor directory

In reply to Chunyan Zhang

From: Chunyan Zhang <[email protected]>

We've created a vendor directory for sprd, so move the board bindings to there.

---
 Documentation/devicetree/bindings/arm/{ => sprd}/sprd.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename Documentation/devicetree/bindings/arm/{ => sprd}/sprd.yaml (92%)
Documentation/devicetree/bindings/arm/sprd/sprd.yaml renamed from Documentation/devicetree/bindings/arm/sprd.yaml +1 -1
similarity index 92%
rename from Documentation/devicetree/bindings/arm/sprd.yaml
rename to Documentation/devicetree/bindings/arm/sprd/sprd.yaml
index c35fb845ccaa..0258a96bfbde 100644
@@ -2,7 +2,7 @@
 # Copyright 2019 Unisoc Inc.
 %YAML 1.2
 ---
-$id: http://devicetree.org/schemas/arm/sprd.yaml#
+$id: http://devicetree.org/schemas/arm/sprd/sprd.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Unisoc platforms device tree bindings
Signature · 1 line
2.20.1
author reviewer
#4 lore raw

PATCH v4 3/3 arm64: dts: Add Unisoc's SC9863A SoC support

In reply to Chunyan Zhang

From: Chunyan Zhang <[email protected]>

Add basic DT to support Unisoc's SC9863A, with this patch, the board sp9863a-1h10 can run into console.

---
 arch/arm64/boot/dts/sprd/Makefile         |   3 +-
 arch/arm64/boot/dts/sprd/sc9863a.dtsi     | 523 ++++++++++++++++++++++
 arch/arm64/boot/dts/sprd/sharkl3.dtsi     | 148 ++++++
 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts |  39 ++
 4 files changed, 712 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/sprd/sc9863a.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sharkl3.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts
arch/arm64/boot/dts/sprd/Makefile +2 -1
index 2bdc23804f40..f4f1f5148cc2 100644
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_SPRD) += sc9836-openphone.dtb \
-			sp9860g-1h10.dtb
+			sp9860g-1h10.dtb	\
+			sp9863a-1h10.dtb
arch/arm64/boot/dts/sprd/sc9863a.dtsi new file +523 -0

523 lines not on this page · raw message

arch/arm64/boot/dts/sprd/sharkl3.dtsi new file +148 -0

148 lines not on this page · raw message

arch/arm64/boot/dts/sprd/sp9863a-1h10.dts new file +39 -0
new file mode 100644
index 000000000000..5c32c1596337
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Unisoc SP9863A-1h10 boards DTS file
+ *
+ * Copyright (C) 2019, Unisoc Inc.
+ */
+
+/dts-v1/;
+
+#include "sc9863a.dtsi"
+
+/ {
+	model = "Spreadtrum SP9863A-1H10 Board";
+
+	compatible = "sprd,sp9863a-1h10", "sprd,sc9863a";
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0x0 0x80000000 0x0 0x80000000>;
+	};
+
+	chosen {
+		stdout-path = "serial1:115200n8";
+		bootargs = "earlycon";
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
Signature · 1 line
2.20.1
maintainer
#5 lore raw

Re: [PATCH v4 3/3] arm64: dts: Add Unisoc's SC9863A SoC support

Quoted 38 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

Add basic DT to support Unisoc's SC9863A, with this patch, the board sp9863a-1h10 can run into console.

---
 arch/arm64/boot/dts/sprd/Makefile         |   3 +-
 arch/arm64/boot/dts/sprd/sc9863a.dtsi     | 523 ++++++++++++++++++++++
 arch/arm64/boot/dts/sprd/sharkl3.dtsi     | 148 ++++++
 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts |  39 ++
 4 files changed, 712 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/sprd/sc9863a.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sharkl3.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts
arch/arm64/boot/dts/sprd/sharkl3.dtsi new file +15 -0
new file mode 100644
index 000000000000..3b5a94560481
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Unisoc Sharkl3 platform DTS file
+ *
+ * Copyright (C) 2019, Unisoc Inc.
+ */
+
+/ {
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	soc: soc {
+		compatible = "simple-bus";
+		#address-cells = <2>;

arch/arm64/boot/dts/sprd/sharkl3.dtsi line 25

Quoted 10 lines
arch/arm64/boot/dts/sprd/sharkl3.dtsi new file +10 -0
+		#size-cells = <2>;
+		ranges;
+
+		ap_ahb_regs: syscon@20e00000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x20e00000 0 0x4000>;
+		};
+
+		pub_ctrl_regs: syscon@300e0000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";

Having a bunch of the same compatible doesn't look right. I assume by the label names each of these are a different set of registers. The compatible should be specific enough the OS can match to a driver that knows the register details.

Doesn't look like you use all these, so maybe drop until you do and/or figure out if you can use common bindings for some of these.

Quoted 171 lines
arch/arm64/boot/dts/sprd/sharkl3.dtsi new file +123 -0
+			reg = <0 0x300e0000 0 0x4000>;
+		};
+
+		pub_wrap_regs: syscon@300f0000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x300f0000 0 0x1000>;
+		};
+
+		pmu_regs: syscon@402b0000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x402b0000 0 0x4000>;
+		};
+
+		aon_apb_regs: syscon@402e0000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x402e0000 0 0x4000>;
+		};
+
+		anlg_phy_g1_regs: syscon@40350000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x40350000 0 0x3000>;
+		};
+
+		anlg_phy_g2_regs: syscon@40353000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x40353000 0 0x3000>;
+		};
+
+		anlg_phy_g4_regs: syscon@40359000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x40359000 0 0x3000>;
+		};
+
+		anlg_phy_g5_regs: syscon@4035c000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x4035c000 0 0x3000>;
+		};
+
+		anlg_phy_g7_regs: syscon@40363000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x40363000 0 0x3000>;
+		};
+
+		anlg_wrap_wcn_regs: syscon@40366000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x40366000 0 0x3000>;
+		};
+
+		mm_ahb_regs: syscon@60800000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x60800000 0 0x1000>;
+		};
+
+		mm_vsp_ahb_regs: syscon@62000000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x62000000 0 0x1000>;
+		};
+
+		ap_apb_regs: syscon@71300000 {
+			compatible = "sprd,sc9863a-glbregs", "syscon";
+			reg = <0 0x71300000 0 0x4000>;
+		};
+
+		apb@70000000 {
+			compatible = "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0x0 0x70000000 0x10000000>;
+
+			uart0: serial@0 {
+				compatible = "sprd,sc9863a-uart",
+					     "sprd,sc9836-uart";
+				reg = <0x0 0x100>;
+				interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&ext_26m>;
+				status = "disabled";
+			};
+
+			uart1: serial@100000 {
+				compatible = "sprd,sc9863a-uart",
+					     "sprd,sc9836-uart";
+				reg = <0x100000 0x100>;
+				interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&ext_26m>;
+				status = "disabled";
+			};
+
+			uart2: serial@200000 {
+				compatible = "sprd,sc9863a-uart",
+					     "sprd,sc9836-uart";
+				reg = <0x200000 0x100>;
+				interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&ext_26m>;
+				status = "disabled";
+			};
+
+			uart3: serial@300000 {
+				compatible = "sprd,sc9863a-uart",
+					     "sprd,sc9836-uart";
+				reg = <0x300000 0x100>;
+				interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&ext_26m>;
+				status = "disabled";
+			};
+
+			uart4: serial@400000 {
+				compatible = "sprd,sc9863a-uart",
+					     "sprd,sc9836-uart";
+				reg = <0x400000 0x100>;
+				interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&ext_26m>;
+				status = "disabled";
+			};
+		};
+	};
+
+	ext_26m: ext-26m {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <26000000>;
+		clock-output-names = "ext-26m";
+	};
+};
arch/arm64/boot/dts/sprd/sp9863a-1h10.dts new file +39 -0
new file mode 100644
index 000000000000..5c32c1596337
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Unisoc SP9863A-1h10 boards DTS file
+ *
+ * Copyright (C) 2019, Unisoc Inc.
+ */
+
+/dts-v1/;
+
+#include "sc9863a.dtsi"
+
+/ {
+	model = "Spreadtrum SP9863A-1H10 Board";
+
+	compatible = "sprd,sp9863a-1h10", "sprd,sc9863a";
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0x0 0x80000000 0x0 0x80000000>;
+	};
+
+	chosen {
+		stdout-path = "serial1:115200n8";
+		bootargs = "earlycon";
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	status = "okay";
+};
Signature · 1 line
2.20.1
maintainer Acked-by on v4 2/3
#3 lore raw

Re: [PATCH v4 2/3] dt-bindings: arm: move sprd board file to vendor directory

In reply to Chunyan Zhang
Quoted 11 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

We've created a vendor directory for sprd, so move the board bindings to there.

---
 Documentation/devicetree/bindings/arm/{ => sprd}/sprd.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename Documentation/devicetree/bindings/arm/{ => sprd}/sprd.yaml (92%)
author reviewer
#6 lore raw

Re: [PATCH v4 3/3] arm64: dts: Add Unisoc's SC9863A SoC support

In reply to Rob Herring
Quoted 56 lines · Rob Herring
Quoted 38 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

Add basic DT to support Unisoc's SC9863A, with this patch, the board sp9863a-1h10 can run into console.

---
 arch/arm64/boot/dts/sprd/Makefile         |   3 +-
 arch/arm64/boot/dts/sprd/sc9863a.dtsi     | 523 ++++++++++++++++++++++
 arch/arm64/boot/dts/sprd/sharkl3.dtsi     | 148 ++++++
 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts |  39 ++
 4 files changed, 712 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/sprd/sc9863a.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sharkl3.dtsi
 create mode 100644 arch/arm64/boot/dts/sprd/sp9863a-1h10.dts
arch/arm64/boot/dts/sprd/sharkl3.dtsi new file +15 -0
new file mode 100644
index 000000000000..3b5a94560481
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Unisoc Sharkl3 platform DTS file
+ *
+ * Copyright (C) 2019, Unisoc Inc.
+ */
+
+/ {
+     interrupt-parent = <&gic>;
+     #address-cells = <2>;
+     #size-cells = <2>;
+
+     soc: soc {
+             compatible = "simple-bus";
+             #address-cells = <2>;

arch/arm64/boot/dts/sprd/sharkl3.dtsi line 25

Quoted 10 lines
arch/arm64/boot/dts/sprd/sharkl3.dtsi new file +10 -0
+             #size-cells = <2>;
+             ranges;
+
+             ap_ahb_regs: syscon@20e00000 {
+                     compatible = "sprd,sc9863a-glbregs", "syscon";
+                     reg = <0 0x20e00000 0 0x4000>;
+             };
+
+             pub_ctrl_regs: syscon@300e0000 {
+                     compatible = "sprd,sc9863a-glbregs", "syscon";

Having a bunch of the same compatible doesn't look right. I assume by the label names each of these are a different set of registers. The compatible should be specific enough the OS can match to a driver that knows the register details.

Quoted 1 line

Doesn't look like you use all these, so maybe drop until you do and/or

Ok, I'll drop them in this patchset, and add back when adding clock nodes which need these syscon nodes.
Let's discuss if these syscons can have the same compatible string then.

Thanks,
Chunyan