Skip to contentSkip to conversation

Add ZTE ZX296718 support

PATCH Superseded Jun Nie 2 participants 5 messages Sep 1, 2016 – Sep 5, 2016

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Jun Nie

author
#0 lore raw

v3 cover Add ZTE ZX296718 support

Changes in version3:
- Remove unecessary flag of gic in dts.

Changes in version2:
- Use more precise cpu and pmu compatible name in dts.
- fix minor coding style issue.

Jun Nie (3):
arm64: add ZTE ZX SoC family
arm64: dts: Add ZTE ZX296718 SoC dts and Makefile
arm64: defconfig: enable ZTE ZX related config

 Documentation/devicetree/bindings/arm/zte.txt |  24 +++
 arch/arm64/Kconfig.platforms                  |   5 +
 arch/arm64/boot/dts/Makefile                  |   1 +
 arch/arm64/boot/dts/zte/Makefile              |   5 +
 arch/arm64/boot/dts/zte/zx296718.dts          |  21 +++
 arch/arm64/boot/dts/zte/zx296718.dtsi         | 253 ++++++++++++++++++++++++++
 arch/arm64/configs/defconfig                  |   1 +
 7 files changed, 310 insertions(+)
 create mode 100644 arch/arm64/boot/dts/zte/Makefile
 create mode 100644 arch/arm64/boot/dts/zte/zx296718.dts
 create mode 100644 arch/arm64/boot/dts/zte/zx296718.dtsi
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v3 1/3 arm64: add ZTE ZX SoC family

This patch introduces ARCH_ZX to add the support of the ZTE ZX SoC family for the arm64 architecture.

---
 arch/arm64/Kconfig.platforms | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/Kconfig.platforms +5 -0
index be5d824..bc75fd2 100644
@@ -204,6 +204,11 @@ config ARCH_XGENE
 	help
 	  This enables support for AppliedMicro X-Gene SOC Family
 
+config ARCH_ZX
+	bool "ZTE ZX SoC Family"
+	help
+	  This enables support for ZTE ZX SoC Family
+
 config ARCH_ZYNQMP
 	bool "Xilinx ZynqMP Family"
 	help
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v3 2/3 arm64: dts: Add ZTE ZX296718 SoC dts and Makefile

In reply to Jun Nie

Add device tree support for ZX296718 SoC and evaluation board based on it. Also document new values.

---
 Documentation/devicetree/bindings/arm/zte.txt |  24 +++
 arch/arm64/boot/dts/Makefile                  |   1 +
 arch/arm64/boot/dts/zte/Makefile              |   5 +
 arch/arm64/boot/dts/zte/zx296718.dts          |  21 +++
 arch/arm64/boot/dts/zte/zx296718.dtsi         | 253 ++++++++++++++++++++++++++
 5 files changed, 304 insertions(+)
 create mode 100644 arch/arm64/boot/dts/zte/Makefile
 create mode 100644 arch/arm64/boot/dts/zte/zx296718.dts
 create mode 100644 arch/arm64/boot/dts/zte/zx296718.dtsi
Documentation/devicetree/bindings/arm/zte.txt +24 -0
index 3ff5c9e..b80790a 100644
@@ -13,3 +13,27 @@ Low power management required properties:
 
 Bus matrix required properties:
       - compatible = "zte,zx-bus-matrix"
+
+
+---------------------------------------
+-  ZX296718 SoC:
+    Required root node properties:
+      - compatible = "zte,zx296718"
+
+ZX296718 EVB board:
+      - "zte,zx296718-evb"
+
+System management required properties:
+      - compatible = "zte,zx296718-aon-sysctrl"
+      - compatible = "zte,zx296718-sysctrl"
+
+Example:
+aon_sysctrl: aon-sysctrl at 116000 {
+	compatible = "zte,zx296718-aon-sysctrl", "syscon";
+	reg = <0x116000 0x1000>;
+};
+
+sysctrl: sysctrl at 0x1463000 {
+	compatible = "zte,zx296718-sysctrl", "syscon";
+	reg = <0x1463000 0x1000>;
+};
arch/arm64/boot/dts/Makefile +1 -0
index 6e199c9..6684f97 100644
@@ -19,6 +19,7 @@ dts-dirs += socionext
 dts-dirs += sprd
 dts-dirs += xilinx
 dts-dirs += lg
+dts-dirs += zte
 
 subdir-y	:= $(dts-dirs)
 
arch/arm64/boot/dts/zte/Makefile new file +5 -0
new file mode 100644
index 0000000..a99640b
@@ -0,0 +1,5 @@
+dtb-$(CONFIG_ARCH_ZX) += zx296718.dtb
+
+always		:= $(dtb-y)
+subdir-y	:= $(dts-dirs)
+clean-files	:= *.dtb
arch/arm64/boot/dts/zte/zx296718.dts new file +21 -0
new file mode 100644
index 0000000..046cee3
@@ -0,0 +1,21 @@
+/*
+ * ZTE Ltd. zx296718 Plaform
+ *
+ */
+/dts-v1/;
+#include "zx296718.dtsi"
+
+/ {
+	model = "ZTE zx296718 evaluation board";
+	compatible = "zte,zx296718-evb", "zte,zx296718";
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0x40000000 0x40000000>;
+	};
+
+};
arch/arm64/boot/dts/zte/zx296718.dtsi new file +253 -0

253 lines not on this page · raw message

Signature · 1 line
1.9.1
#3 lore raw

PATCH v3 2/3 arm64: dts: Add ZTE ZX296718 SoC dts and Makefile

Quoted 34 lines · Jun Nie

Add device tree support for ZX296718 SoC and evaluation board based on it. Also document new values.

---
 Documentation/devicetree/bindings/arm/zte.txt |  24 +++
 arch/arm64/boot/dts/Makefile                  |   1 +
 arch/arm64/boot/dts/zte/Makefile              |   5 +
 arch/arm64/boot/dts/zte/zx296718.dts          |  21 +++
 arch/arm64/boot/dts/zte/zx296718.dtsi         | 253 ++++++++++++++++++++++++++
 5 files changed, 304 insertions(+)
 create mode 100644 arch/arm64/boot/dts/zte/Makefile
 create mode 100644 arch/arm64/boot/dts/zte/zx296718.dts
 create mode 100644 arch/arm64/boot/dts/zte/zx296718.dtsi
Documentation/devicetree/bindings/arm/zte.txt +11 -0
index 3ff5c9e..b80790a 100644
@@ -13,3 +13,27 @@ Low power management required properties:
 
 Bus matrix required properties:
       - compatible = "zte,zx-bus-matrix"
+
+
+---------------------------------------
+-  ZX296718 SoC:
+    Required root node properties:
+      - compatible = "zte,zx296718"
+
+ZX296718 EVB board:
+      - "zte,zx296718-evb"
+
+System management required properties:

Documentation/devicetree/bindings/arm/zte.txt Low power management required properties: · line 36

Quoted 10 lines
Documentation/devicetree/bindings/arm/zte.txt +10 -0
+      - compatible = "zte,zx296718-aon-sysctrl"
+      - compatible = "zte,zx296718-sysctrl"
+
+Example:
+aon_sysctrl: aon-sysctrl at 116000 {
+	compatible = "zte,zx296718-aon-sysctrl", "syscon";
+	reg = <0x116000 0x1000>;
+};
+
+sysctrl: sysctrl at 0x1463000 {

The '0x' in unit-address of node name should be dropped.

Quoted 32 lines
Documentation/devicetree/bindings/arm/zte.txt +3 -0
+	compatible = "zte,zx296718-sysctrl", "syscon";
+	reg = <0x1463000 0x1000>;
+};
arch/arm64/boot/dts/Makefile +1 -0
index 6e199c9..6684f97 100644
@@ -19,6 +19,7 @@ dts-dirs += socionext
 dts-dirs += sprd
 dts-dirs += xilinx
 dts-dirs += lg
+dts-dirs += zte
 
 subdir-y	:= $(dts-dirs)
 
arch/arm64/boot/dts/zte/Makefile new file +5 -0
new file mode 100644
index 0000000..a99640b
@@ -0,0 +1,5 @@
+dtb-$(CONFIG_ARCH_ZX) += zx296718.dtb
+
+always		:= $(dtb-y)
+subdir-y	:= $(dts-dirs)
+clean-files	:= *.dtb
arch/arm64/boot/dts/zte/zx296718.dts new file +0 -0
new file mode 100644
index 0000000..046cee3

arch/arm64/boot/dts/zte/zx296718.dts line 10

Quoted 10 lines
arch/arm64/boot/dts/zte/zx296718.dts new file +10 -0
@@ -0,0 +1,21 @@
+/*
+ * ZTE Ltd. zx296718 Plaform
+ *
+ */
+/dts-v1/;
+#include "zx296718.dtsi"
+
+/ {
+	model = "ZTE zx296718 evaluation board";
+	compatible = "zte,zx296718-evb", "zte,zx296718";

The board DTS file should generally be named after the compatible string, i.e. zx296718-evb.dts

Quoted 83 lines
arch/arm64/boot/dts/zte/zx296718.dts new file +11 -0
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0x40000000 0x40000000>;
+	};
+
+};
arch/arm64/boot/dts/zte/zx296718.dtsi new file +66 -0
new file mode 100644
index 0000000..5345a28
@@ -0,0 +1,253 @@
+/*
+ * DTS File for ZTE ZX296718 Plaform
+ *
+ * Copyright (c) 2016 ZTE Semiconductor Co., Ltd.
+ */
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	compatible = "zte,zx296718";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	cpus {
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		cpu-map {
+			cluster0 {
+				core0 {
+					cpu = <&cpu0>;
+				};
+				core1 {
+					cpu = <&cpu1>;
+				};
+				core2 {
+					cpu = <&cpu2>;
+				};
+				core3 {
+					cpu = <&cpu3>;
+				};
+			};
+		};
+
+		cpu0: cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53","arm,armv8";
+			reg = <0x0 0x0>;
+			enable-method = "psci";
+		};
+
+		cpu1: cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53","arm,armv8";
+			reg = <0x0 0x1>;
+			enable-method = "psci";
+		};
+
+		cpu2: cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53","arm,armv8";
+			reg = <0x0 0x2>;
+			enable-method = "psci";
+		};
+
+		cpu3: cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a53","arm,armv8";
+			reg = <0x0 0x3>;
+			enable-method = "psci";
+		};

arch/arm64/boot/dts/zte/zx296718.dtsi line 76

Quoted 10 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +10 -0
+	};
+
+	soc {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "simple-bus";
+		interrupt-parent = <&gic>;
+		ranges;
+
+		osc12m: osc12m_clk {

Hyphen rather than underscore should be used in node name.

Quoted 15 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +15 -0
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <12000000>;
+			clock-output-names = "osc12m";
+		};
+
+		osc24m: osc24m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <24000000>;
+			clock-output-names = "osc24m";
+		};
+
+		osc25m: osc25m_clk {
+			compatible = "fixed-clock";

arch/arm64/boot/dts/zte/zx296718.dtsi line 101

Quoted 10 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +10 -0
+			#clock-cells = <0>;
+			clock-frequency = <25000000>;
+			clock-output-names = "osc25m";
+		};
+
+		clk24k: clk-24k {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <24000>;
+			clock-output-names = "zte:rtcclk";

The "zte:" in the name makes it special. Is it on purpose?

Quoted 110 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +110 -0
+		};
+
+		osc32k: osc32k_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <32000>;
+			clock-output-names = "osc32k";
+		};
+
+		osc60m: osc60m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <60000000>;
+			clock-output-names = "osc60m";
+		};
+
+		osc99m: osc99m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <99000000>;
+			clock-output-names = "osc99m";
+		};
+
+		osc125m: osc125m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <125000000>;
+			clock-output-names = "osc125m";
+		};
+
+		osc198m: osc198m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <198000000>;
+			clock-output-names = "osc198m";
+		};
+
+		pll_vga: pll_1073m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <1073000000>;
+			clock-output-names = "pll_vga";
+		};
+
+		pll_ddr: pll_932m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <932000000>;
+			clock-output-names = "pll_ddr";
+		};
+
+		pll_mac: pll_1000m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <1000000000>;
+			clock-output-names = "pll_mac";
+		};
+
+		pll_mm0: pll_1188m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <1188000000>;
+			clock-output-names = "pll_mm0";
+		};
+
+		pll_mm1: pll_1296m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <1296000000>;
+			clock-output-names = "pll_mm1";
+		};
+
+		pll_audio: pll_884m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <884000000>;
+			clock-output-names = "pll_audio";
+		};
+
+		pll_hsic: pll_960m_clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <960000000>;
+			clock-output-names = "pll_hsic";
+		};
+
+		gic: interrupt-controller at 2a00000 {
+			compatible = "arm,gic-v3";
+			#interrupt-cells = <3>;
+			#address-cells = <0>;
+			#redistributor-regions = <6>;
+			redistributor-stride = <0x0 0x40000>;
+			interrupt-controller;
+			reg = <0x02a00000 0x10000>,
+			      <0x02b00000 0x20000>,
+			      <0x02b20000 0x20000>,
+			      <0x02b40000 0x20000>,
+			      <0x02b60000 0x20000>,
+			      <0x02b80000 0x20000>,
+			      <0x02ba0000 0x20000>;
+			interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
+		timer {
+			compatible = "arm,armv8-timer";
+			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
+				     <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
+				     <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
+				     <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+		};

arch/arm64/boot/dts/zte/zx296718.dtsi line 221

Quoted 10 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +10 -0
+
+		pmu {
+			compatible = "arm,cortex-a53-pmu";
+			interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
+		psci {
+			compatible = "arm,psci-1.0";
+			method = "smc";
+		};

I'm not quite sure about the rationale behind it, but I see that most of DTS files put things like fixed clocks, armv8-timer, pmu, psci such node which do not have a bus unit-address directly under root instead of 'soc' node.

arch/arm64/boot/dts/zte/zx296718.dtsi line 228

Quoted 7 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +7 -0
+
+		aon_sysctrl: aon-sysctrl at 116000 {
+			compatible = "zte,zx296718-aon-sysctrl", "syscon";
+			reg = <0x116000 0x1000>;
+		};
+
+		sysctrl: sysctrl at 0x1463000 {

Drop the '0x' in unit-address of node name.

arch/arm64/boot/dts/zte/zx296718.dtsi line 233

Quoted 5 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +5 -0
+			compatible = "zte,zx296718-sysctrl", "syscon";
+			reg = <0x1463000 0x1000>;
+		};
+
+		uart0: uart at 11f000 {

We generally sort the node under 'simple-bus' in order of unit-address.

arch/arm64/boot/dts/zte/zx296718.dtsi line 240

Quoted 7 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +7 -0
+			compatible = "arm,pl011", "arm,primecell";
+			arm,primecell-periphid = <0x001feffe>;
+			reg = <0x11f000 0x1000>;
+			interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&osc24m>;
+			clock-names = "apb_pclk";
+		};

For devices that have pin-out on board, we generally disable it by default in <soc>.dtsi with:

	status = "disabled";

In <board>.dts, we enable the device if it's available on the board with:

	status = "okay";

And, we need to code pinctrl properties or any other board level configuration for the device in <board>.dts anyway. This will help users easily get which devices with pin-out are available for given board design.

arch/arm64/boot/dts/zte/zx296718.dtsi line 242

Quoted 2 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +2 -0
+
+		dma: dma-controller at 01460000 {

Drop the leading zero in unit-address.

Shawn

Quoted 19 lines
arch/arm64/boot/dts/zte/zx296718.dtsi new file +11 -0
+			compatible = "zte,zx296702-dma";
+			reg = <0x01460000 0x1000>;
+			interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&osc24m>;
+			clock-names = "dmaclk";
+			#dma-cells = <1>;
+			dma-channels = <32>;
+			dma-requests = <32>;
+		};
+	};
+};
Signature · 7 lines
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#4 lore raw

PATCH v3 3/3 arm64: defconfig: enable ZTE ZX related config

In reply to Jun Nie

This patch enables the configuration for the ZTE ZX family.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index eadf485..2bd5c88 100644
@@ -57,6 +57,7 @@ CONFIG_ARCH_UNIPHIER=y
 CONFIG_ARCH_VEXPRESS=y
 CONFIG_ARCH_VULCAN=y
 CONFIG_ARCH_XGENE=y
+CONFIG_ARCH_ZX=y
 CONFIG_ARCH_ZYNQMP=y
 CONFIG_PCI=y
 CONFIG_PCI_MSI=y
Signature · 1 line
1.9.1