Skip to contentSkip to conversation

Add Spreadtrum Shark64 SoC support

PATCH In review [email protected] 2 participants 9 messages Sep 29, 2014

Subsystems (5)
lore
Share & tools
lore

[email protected]

author reviewer
#0 lore raw

cover Add Spreadtrum Shark64 SoC support

From: "chunyan.zhang" <[email protected]>

Spreadtrum is a rapid growing chip vendor providing smart phone total solutions.
Shark64 is nominated as a SoC infrastructure that supports 4G/3G/2G standards based on ARMv8 multiple core architecture.

This patchset adds shark64 supports in arm64 device tree and implements the basic earlycon serial driver.

chunyan.zhang (6):
Documentation: DT: Add bindings for Spreadtrum serial
arm64: Add DTS support for Spreadtrum's Shark64 SoC
arm64: dts/Makefile: Add support for Spreadtrum's Shark64 SoC.
arm64: Add support for Spreadtrum's Shark64 SoC in Kconfig and defconfig tty/serial: add Spreadtrum's serial earlycon
Documentation: Add entry for Spreadtrum's Shark64 SoC

 Documentation/devicetree/bindings/arm/sprd.txt     |    6 ++
 .../devicetree/bindings/serial/of-serial.txt       |    1 +
 arch/arm64/Kconfig                                 |    5 +
 arch/arm64/boot/dts/Makefile                       |    1 +
 arch/arm64/boot/dts/sprd_shark64.dts               |  110 ++++++++++++++++++++
 arch/arm64/configs/defconfig                       |    1 +
 drivers/tty/serial/Kconfig                         |   12 +++
 drivers/tty/serial/Makefile                        |    1 +
 drivers/tty/serial/serial_sprd_early.c             |   64 ++++++++++++
 9 files changed, 201 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/sprd.txt
 create mode 100644 arch/arm64/boot/dts/sprd_shark64.dts
 create mode 100644 drivers/tty/serial/serial_sprd_early.c
Signature · 1 line
1.7.9.5
author reviewer
#1 lore raw

PATCH 1/6 Documentation: DT: Add bindings for Spreadtrum serial

From: "chunyan.zhang" <[email protected]>

Adds the device-tree documentation for Spreadtrum's serial.

---
 .../devicetree/bindings/serial/of-serial.txt       |    1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/serial/of-serial.txt +1 -0
index 7705477..a0bb1d1 100644
@@ -14,6 +14,7 @@ Required properties:
 	- "altr,16550-FIFO32"
 	- "altr,16550-FIFO64"
 	- "altr,16550-FIFO128"
+	- "sprd,serial"
 	- "serial" if the port type is unknown.
 - reg : offset and length of the register set for the device.
 - interrupts : should contain uart interrupt.
Signature · 1 line
1.7.9.5
author reviewer
#2 lore raw

PATCH 2/6 arm64: Add DTS support for Spreadtrum's Shark64 SoC

In reply to [email protected]

From: "zhizhou.zhang" <[email protected]>

Adds the device tree support for Spreadtrum Shark64 SoC based on ARMv8 architecture.

---
 arch/arm64/boot/dts/sprd_shark64.dts |  110 ++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)
 create mode 100644 arch/arm64/boot/dts/sprd_shark64.dts
arch/arm64/boot/dts/sprd_shark64.dts new file +110 -0
new file mode 100644
index 0000000..537cd6d
@@ -0,0 +1,110 @@
+/*
+ * dts file for Spreadtrum(sprd) Shark64 SOC
+ *
+ * Copyright (C) 2014,  Spreadtrum Communications Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x80000000 0x00010000;
+
+/ {
+	model = "shark64 Board";
+	compatible = "sprd,shark64";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	chosen {
+		bootargs = "earlycon=serial_sprd,0x70000000";
+      };
+
+	cpus {
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x0>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x1>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x2>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x3>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0 0x80000000 0 0x20000000>;
+	};
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+	};
+
+	gic: interrupt-controller at 12001000 {
+		compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0 0x12001000 0 0x1000>,
+		      <0 0x12002000 0 0x1000>;
+	};
+
+	intc:interrupt-controller at 71400000 {
+		compatible = "sprd,intc";
+		#interrupt-cells = <0>;
+		interrupt-controller;
+		reg =	<0 0x71400000 0 0x1000>,
+			<0 0x71500000 0 0x1000>,
+			<0 0x71600000 0 0x1000>,
+			<0 0x71700000 0 0x1000>;
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <1 13 0xff01>,
+			     <1 14 0xff01>,
+			     <1 11 0xff01>,
+			     <1 10 0xff01>;
+		clock-frequency = <26000000>;
+	};
+
+	uart0: uart at 70000000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70000000 0 0x100>;
+		interrupts = <0 2 0xf04>;
+	};
+
+	uart1: uart at 70100000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70100000 0 0x100>;
+		interrupts = <0 3 0xf04>;
+	};
+};
Signature · 1 line
1.7.9.5
#3 lore raw

Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC

Hi,

Am 29.09.2014 um 13:48 schrieb zhang.lyra at gmail.com:

Quoted 24 lines

From: "zhizhou.zhang" <[email protected]>

Adds the device tree support for Spreadtrum Shark64 SoC based on ARMv8 architecture.

---
 arch/arm64/boot/dts/sprd_shark64.dts |  110 ++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)
 create mode 100644 arch/arm64/boot/dts/sprd_shark64.dts
arch/arm64/boot/dts/sprd_shark64.dts new file +7 -0
new file mode 100644
index 0000000..537cd6d
@@ -0,0 +1,110 @@
+/*
+ * dts file for Spreadtrum(sprd) Shark64 SOC
+ *
+ * Copyright (C) 2014,  Spreadtrum Communications Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as

arch/arm64/boot/dts/sprd_shark64.dts line 17

Quoted 10 lines
arch/arm64/boot/dts/sprd_shark64.dts new file +10 -0
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x80000000 0x00010000;
+
+/ {
+	model = "shark64 Board";

The commit message says SoC but here it says Board. Usually the SoC goes into a .dtsi file that can then be reused for multiple boards (.dts). Even if you only have one board for now, this distinction makes sense.

You can use status = "disabled"; to prepare nodes in the .dtsi and then override the ones used via status = "okay"; in the .dts file. UARTs are a typical example where you will see this pattern used.

arch/arm64/boot/dts/sprd_shark64.dts line 25

Quoted 8 lines
arch/arm64/boot/dts/sprd_shark64.dts new file +8 -0
+	compatible = "sprd,shark64";
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	chosen {
+		bootargs = "earlycon=serial_sprd,0x70000000";
+      };

Some spaces snuck into this line. ;)

Cheers,
Andreas

Quoted 85 lines
arch/arm64/boot/dts/sprd_shark64.dts new file +85 -0
+
+	cpus {
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x0>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x1>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 2 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x2>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 3 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x3>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0 0x80000000 0 0x20000000>;
+	};
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+	};
+
+	gic: interrupt-controller at 12001000 {
+		compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0 0x12001000 0 0x1000>,
+		      <0 0x12002000 0 0x1000>;
+	};
+
+	intc:interrupt-controller at 71400000 {
+		compatible = "sprd,intc";
+		#interrupt-cells = <0>;
+		interrupt-controller;
+		reg =	<0 0x71400000 0 0x1000>,
+			<0 0x71500000 0 0x1000>,
+			<0 0x71600000 0 0x1000>,
+			<0 0x71700000 0 0x1000>;
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <1 13 0xff01>,
+			     <1 14 0xff01>,
+			     <1 11 0xff01>,
+			     <1 10 0xff01>;
+		clock-frequency = <26000000>;
+	};
+
+	uart0: uart at 70000000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70000000 0 0x100>;
+		interrupts = <0 2 0xf04>;
+	};
+
+	uart1: uart at 70100000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70100000 0 0x100>;
+		interrupts = <0 3 0xf04>;
+	};
+};
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer; HRB 16746 AG N?rnberg
author reviewer
#4 lore raw

PATCH 3/6 arm64: dts/Makefile: Add support for Spreadtrum's Shark64 SoC.

In reply to [email protected]

From: "zhizhou.zhang" <[email protected]>

Adds build support for Spreadtrum's Shark64 SoC in arm64 dts Makefile.

---
 arch/arm64/boot/dts/Makefile |    1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/Makefile +1 -0
index c52bdb0..7fdb9df 100644
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
 dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
+dtb-$(CONFIG_ARCH_SHARK64) += sprd_shark64.dtb
 
 targets += dtbs
 targets += $(dtb-y)
Signature · 1 line
1.7.9.5
#5 lore raw

Re: [PATCH 3/6] arm64: dts/Makefile: Add support for Spreadtrum's Shark64 SoC.

Hi,

Am 29.09.2014 um 13:48 schrieb zhang.lyra at gmail.com:

Quoted 15 lines

From: "zhizhou.zhang" <[email protected]>

Adds build support for Spreadtrum's Shark64 SoC in arm64 dts Makefile.

---
 arch/arm64/boot/dts/Makefile |    1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/Makefile +0 -0
index c52bdb0..7fdb9df 100644

arch/arm64/boot/dts/Makefile line 6

Quoted 6 lines
arch/arm64/boot/dts/Makefile +1 -0
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
 dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
+dtb-$(CONFIG_ARCH_SHARK64) += sprd_shark64.dtb
 
 targets += dtbs
 targets += $(dtb-y)

This patch seems so trivial that you could just squash it into 2/6 (adding the .dts file).

Also, it looks to me as if the ordering is alphabetical, so SHARK should probably go somewhere before VEXPRESS, not after XGENE.

Regards,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer; HRB 16746 AG N?rnberg
author reviewer
#6 lore raw

PATCH 4/6 arm64: Add support for Spreadtrum's Shark64 SoC in Kconfig and defconfig

In reply to [email protected]

From: "zhizhou.zhang" <[email protected]>

Adds support for Spreadtrum's Shark64 SoC in the arm64 Kconfig and defconfig files.

---
 arch/arm64/Kconfig           |    5 +++++
 arch/arm64/configs/defconfig |    1 +
 2 files changed, 6 insertions(+)
arch/arm64/Kconfig +5 -0
index fd4e81a..c8f36ad 100644
@@ -149,6 +149,11 @@ config ARCH_XGENE
 	help
 	  This enables support for AppliedMicro X-Gene SOC Family
 
+config ARCH_SHARK64
+	bool "Spreadtrum 64-bit SOC (ARMv8 platform)"
+	help
+	Support for 64 bits Spreadtrum based systems.
+
 endmenu
 
 menu "Bus support"
arch/arm64/configs/defconfig +1 -0
index d92ef3c..86bb5e9 100644
@@ -34,6 +34,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_IOSCHED_DEADLINE is not set
 CONFIG_ARCH_VEXPRESS=y
 CONFIG_ARCH_XGENE=y
+CONFIG_ARCH_SHARK64=y
 CONFIG_SMP=y
 CONFIG_PREEMPT=y
 CONFIG_KSM=y
Signature · 1 line
1.7.9.5
author reviewer
#7 lore raw

PATCH 5/6 tty/serial: Add Spreadtrum's serial earlycon

In reply to [email protected]

From: "chunyan.zhang" <[email protected]>

Adds earlycon support for the Spreadtrum's serial.

---
 drivers/tty/serial/Kconfig             |   12 ++++++
 drivers/tty/serial/Makefile            |    1 +
 drivers/tty/serial/serial_sprd_early.c |   64 ++++++++++++++++++++++++++++++++
 3 files changed, 77 insertions(+)
 create mode 100644 drivers/tty/serial/serial_sprd_early.c
drivers/tty/serial/Kconfig +12 -0
index 26cec64..ede16e6 100644
@@ -85,6 +85,18 @@ config SERIAL_EARLYCON_ARM_SEMIHOST
 	  with "earlycon=smh" on the kernel command line. The console is
 	  enabled when early_param is processed.
 
+config SERIAL_EARLYCON_SPRD
+	bool "Early console using SPRD serial"
+	depends on ARM64
+	select SERIAL_CORE
+	select SERIAL_CORE_CONSOLE
+	select SERIAL_EARLYCON
+	help
+	  Support for early debug console using SPRD serial. This enables
+	  the console before standard serial driver is probed. This is enabled
+	  with "earlycon=serial_sprd" on the kernel command line. The console is
+	  enabled when early_param is processed.
+
 config SERIAL_SB1250_DUART
 	tristate "BCM1xxx on-chip DUART serial support"
 	depends on SIBYTE_SB1xxx_SOC=y
drivers/tty/serial/Makefile +1 -0
index 0080cc3..3ea9edc 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_21285) += 21285.o
 
 obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
 obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o
+obj-$(CONFIG_SERIAL_EARLYCON_SPRD) += serial_sprd_early.o
 
 # These Sparc drivers have to appear before others such as 8250
 # which share ttySx minor node space.  Otherwise console device
drivers/tty/serial/serial_sprd_early.c new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author reviewer
#8 lore raw

PATCH 6/6 Documentation: Add entry for Spreadtrum's Shark64 SoC

In reply to [email protected]

From: "chunyan.zhang" <[email protected]>

Adds a devicetree binding documentation for Spreadtrum's Shark64 SoC.

---
 Documentation/devicetree/bindings/arm/sprd.txt |    6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/sprd.txt
Documentation/devicetree/bindings/arm/sprd.txt new file +6 -0
new file mode 100644
index 0000000..b6dc143
@@ -0,0 +1,6 @@
+Spreadtrum Platforms Device Tree Bindings
+----------------------------------------------------
+
+Shark64 Board
+Required root node properties:
+        - compatible = "sprd,shark64";
Signature · 1 line
1.7.9.5