linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Add Spreadtrum Shark64 SoC support
@ 2014-09-29 12:04 zhang.lyra
  2014-09-29 12:04 ` [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial zhang.lyra
                   ` (6 more replies)
  0 siblings, 7 replies; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 12:04 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>

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

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial
  2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
@ 2014-09-29 12:04 ` zhang.lyra
  2014-09-29 13:39   ` Arnd Bergmann
  2014-10-01 11:21   ` Mark Rutland
  2014-09-29 12:04 ` [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC zhang.lyra
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 12:04 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>

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

Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
---
 .../devicetree/bindings/serial/of-serial.txt       |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt
index 7705477..a0bb1d1 100644
--- a/Documentation/devicetree/bindings/serial/of-serial.txt
+++ b/Documentation/devicetree/bindings/serial/of-serial.txt
@@ -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.
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
  2014-09-29 12:04 ` [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial zhang.lyra
@ 2014-09-29 12:04 ` zhang.lyra
  2014-09-29 13:47   ` Arnd Bergmann
  2014-10-01 11:23   ` Mark Rutland
  2014-09-29 12:04 ` [PATCH 3/6] arm64: dts/Makefile: Add " zhang.lyra
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 12:04 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "zhizhou.zhang" <zhizhou.zhang@spreadtrum.com>

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

Signed-off-by: zhizhou.zhang <zhizhou.zhang@spreadtrum.com>
Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
---
 arch/arm64/boot/dts/sprd_shark64.dts |  110 ++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)
 create mode 100644 arch/arm64/boot/dts/sprd_shark64.dts

diff --git a/arch/arm64/boot/dts/sprd_shark64.dts b/arch/arm64/boot/dts/sprd_shark64.dts
new file mode 100644
index 0000000..537cd6d
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd_shark64.dts
@@ -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@0 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x0>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu@1 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x1>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu@2 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x2>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu@3 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x3>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0 0x80000000 0 0x20000000>;
+	};
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+	};
+
+	gic: interrupt-controller@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@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@70000000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70000000 0 0x100>;
+		interrupts = <0 2 0xf04>;
+	};
+
+	uart1: uart@70100000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70100000 0 0x100>;
+		interrupts = <0 3 0xf04>;
+	};
+};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 3/6] arm64: dts/Makefile: Add support for Spreadtrum's Shark64 SoC.
  2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
  2014-09-29 12:04 ` [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial zhang.lyra
  2014-09-29 12:04 ` [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC zhang.lyra
@ 2014-09-29 12:04 ` zhang.lyra
  2014-09-29 14:47   ` Mark Brown
  2014-09-29 12:04 ` [PATCH 4/6] arm64: Add support for Spreadtrum's Shark64 SoC in Kconfig and defconfig zhang.lyra
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 12:04 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "zhizhou.zhang" <zhizhou.zhang@spreadtrum.com>

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

Signed-off-by: zhizhou.zhang <zhizhou.zhang@spreadtrum.com>
Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
---
 arch/arm64/boot/dts/Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index c52bdb0..7fdb9df 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -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)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 4/6] arm64: Add support for Spreadtrum's Shark64 SoC in Kconfig and defconfig
  2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
                   ` (2 preceding siblings ...)
  2014-09-29 12:04 ` [PATCH 3/6] arm64: dts/Makefile: Add " zhang.lyra
@ 2014-09-29 12:04 ` zhang.lyra
  2014-09-29 12:04 ` [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon zhang.lyra
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 12:04 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "zhizhou.zhang" <zhizhou.zhang@spreadtrum.com>

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

Signed-off-by: zhizhou.zhang <zhizhou.zhang@spreadtrum.com>
Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
---
 arch/arm64/Kconfig           |    5 +++++
 arch/arm64/configs/defconfig |    1 +
 2 files changed, 6 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index fd4e81a..c8f36ad 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -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"
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index d92ef3c..86bb5e9 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -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
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon
  2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
                   ` (3 preceding siblings ...)
  2014-09-29 12:04 ` [PATCH 4/6] arm64: Add support for Spreadtrum's Shark64 SoC in Kconfig and defconfig zhang.lyra
@ 2014-09-29 12:04 ` zhang.lyra
  2014-09-29 13:36   ` Arnd Bergmann
  2014-09-29 14:53   ` Mark Brown
  2014-09-29 12:04 ` [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC zhang.lyra
  2014-09-29 14:08 ` [PATCH 0/6] Add Spreadtrum Shark64 SoC support Arnd Bergmann
  6 siblings, 2 replies; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 12:04 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>

Adds earlycon support for the Spreadtrum's serial.

Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
---
 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

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64..ede16e6 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -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
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 0080cc3..3ea9edc 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -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
diff --git a/drivers/tty/serial/serial_sprd_early.c b/drivers/tty/serial/serial_sprd_early.c
new file mode 100644
index 0000000..059e109
--- /dev/null
+++ b/drivers/tty/serial/serial_sprd_early.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 Spreadtrum Communications Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+#include <linux/of.h>
+
+/*offset*/
+#define ARM_UART_TXD	0x0000
+#define ARM_UART_RXD	0x0004
+#define ARM_UART_STS0	0x0008
+#define ARM_UART_STS1	0x000C
+#define ARM_UART_IEN	0x0010
+#define ARM_UART_ICLR	0x0014
+#define ARM_UART_CTL0	0x0018
+#define ARM_UART_CTL1	0x001C
+#define ARM_UART_CTL2	0x0020
+#define ARM_UART_CLKD0	0x0024
+#define ARM_UART_CLKD1	0x0028
+#define ARM_UART_STS2	0x002C
+
+/*line status */
+#define UART_LSR_TX_OVER	(0x1<<15)
+
+static void serial_sprd_putc(struct uart_port *port, int c)
+{
+	while (!(readl(port->membase + ARM_UART_STS0) & UART_LSR_TX_OVER))
+		;
+	writeb(c, port->membase + ARM_UART_TXD);
+}
+
+static void serial_sprd_early_write(struct console *con, const char *s,
+				    unsigned n)
+{
+	struct earlycon_device *dev = con->data;
+
+	uart_console_write(&dev->port, s, n, serial_sprd_putc);
+}
+
+static int __init serial_sprd_early_console_setup(
+				struct earlycon_device *device,
+				const char *opt)
+{
+	if (!device->port.membase)
+		return -ENODEV;
+
+	device->con->write = serial_sprd_early_write;
+	return 0;
+}
+EARLYCON_DECLARE(serial_sprd, serial_sprd_early_console_setup);
+OF_EARLYCON_DECLARE(serial_sprd, "sprd,serial",
+		    serial_sprd_early_console_setup);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC
  2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
                   ` (4 preceding siblings ...)
  2014-09-29 12:04 ` [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon zhang.lyra
@ 2014-09-29 12:04 ` zhang.lyra
  2014-09-29 13:30   ` Arnd Bergmann
  2014-09-29 13:59   ` Arnd Bergmann
  2014-09-29 14:08 ` [PATCH 0/6] Add Spreadtrum Shark64 SoC support Arnd Bergmann
  6 siblings, 2 replies; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 12:04 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>

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

Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
---
 Documentation/devicetree/bindings/arm/sprd.txt |    6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/sprd.txt

diff --git a/Documentation/devicetree/bindings/arm/sprd.txt b/Documentation/devicetree/bindings/arm/sprd.txt
new file mode 100644
index 0000000..b6dc143
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/sprd.txt
@@ -0,0 +1,6 @@
+Spreadtrum Platforms Device Tree Bindings
+----------------------------------------------------
+
+Shark64 Board
+Required root node properties:
+        - compatible = "sprd,shark64";
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC
  2014-09-29 12:04 ` [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC zhang.lyra
@ 2014-09-29 13:30   ` Arnd Bergmann
  2014-09-29 13:59   ` Arnd Bergmann
  1 sibling, 0 replies; 27+ messages in thread
From: Arnd Bergmann @ 2014-09-29 13:30 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: zhang.lyra, catalin.marinas, gregkh, ijc+devicetree, jslaby,
	galak, broonie, mark.rutland, m-karicheri2, pawel.moll, artagnon,
	rrichter, robh+dt, will.deacon, orsonzhai, geng.ren,
	zhizhou.zhang, devicetree, linux-kernel

On Monday 29 September 2014 20:04:53 zhang.lyra@gmail.com wrote:
> diff --git a/Documentation/devicetree/bindings/arm/sprd.txt b/Documentation/devicetree/bindings/arm/sprd.txt
> new file mode 100644
> index 0000000..b6dc143
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/sprd.txt
> @@ -0,0 +1,6 @@
> +Spreadtrum Platforms Device Tree Bindings
> +----------------------------------------------------
> +
> +Shark64 Board
> +Required root node properties:
> +        - compatible = "sprd,shark64";
> 

Is Shark a board or an SOC? The subject line of the patch and the contents
seem to disagree here.

It's generally better to have the exact SoC product numbers in here, e.g.
"sprd,sc1234", in case we have to apply fixups based on the SoC. You should
also have a board specific string in addition to the SoC-specific one.

	Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon
  2014-09-29 12:04 ` [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon zhang.lyra
@ 2014-09-29 13:36   ` Arnd Bergmann
  2014-10-01 13:55     ` Rob Herring
  2014-09-29 14:53   ` Mark Brown
  1 sibling, 1 reply; 27+ messages in thread
From: Arnd Bergmann @ 2014-09-29 13:36 UTC (permalink / raw)
  To: zhang.lyra
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

On Monday 29 September 2014 20:04:52 zhang.lyra@gmail.com wrote:
> From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>
> 
> Adds earlycon support for the Spreadtrum's serial.
> 
> Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
> ---
>  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
> 
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 26cec64..ede16e6 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -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

I assume you will later want to have a proper device driver for
this hardware, so it would be better to make the Kconfig symbol
and the file name what you are going to use in the long run, but
for now only have the earlycon support included.


> +static int __init serial_sprd_early_console_setup(
> +				struct earlycon_device *device,
> +				const char *opt)
> +{
> +	if (!device->port.membase)
> +		return -ENODEV;
> +
> +	device->con->write = serial_sprd_early_write;
> +	return 0;
> +}
> +EARLYCON_DECLARE(serial_sprd, serial_sprd_early_console_setup);
> +OF_EARLYCON_DECLARE(serial_sprd, "sprd,serial",
> +		    serial_sprd_early_console_setup);
> 

I think you should drop the EARLYCON_DECLARE() line, using
OF_EARLYCON_DECLARE should be enough.

	Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial
  2014-09-29 12:04 ` [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial zhang.lyra
@ 2014-09-29 13:39   ` Arnd Bergmann
  2014-10-01 11:21   ` Mark Rutland
  1 sibling, 0 replies; 27+ messages in thread
From: Arnd Bergmann @ 2014-09-29 13:39 UTC (permalink / raw)
  To: zhang.lyra
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

On Monday 29 September 2014 20:04:48 zhang.lyra@gmail.com wrote:
> diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt
> index 7705477..a0bb1d1 100644
> --- a/Documentation/devicetree/bindings/serial/of-serial.txt
> +++ b/Documentation/devicetree/bindings/serial/of-serial.txt
> @@ -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.
> 

This file is really only for 8250 compatible UART implementations, please
add a new file with a proper binding for your serial port. It would be
nice if you could rename this file to 8250.txt to avoid confusing the
next person.

Please also add the "sprd" prefix to
Documentation/devicetree/bindings/vendor-prefixes.txt

	Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-09-29 12:04 ` [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC zhang.lyra
@ 2014-09-29 13:47   ` Arnd Bergmann
  2014-10-01 11:17     ` Catalin Marinas
  2014-10-15  3:17     ` Lyra Zhang
  2014-10-01 11:23   ` Mark Rutland
  1 sibling, 2 replies; 27+ messages in thread
From: Arnd Bergmann @ 2014-09-29 13:47 UTC (permalink / raw)
  To: zhang.lyra
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

On Monday 29 September 2014 20:04:49 zhang.lyra@gmail.com wrote:
> +
> +/memreserve/ 0x80000000 0x00010000;

Maybe add a comment explaining why it is reserved?

> +	chosen {
> +		bootargs = "earlycon=serial_sprd,0x70000000";
> +      };

Just remove this for now, the command line should really be set by the
boot loader, not hardcoded in the dts file.

IIRC, the earlycon=... syntax is not recommended on DT based systems,
better use the "stdout-path" syntax instead.

> +	cpus {
> +		#address-cells = <2>;
> +		#size-cells = <0>;
> +
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x0>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};

New platforms should avoid using "spin-table" method. Please
change the boot loader to implement PSCI if you can.

> +	memory@80000000 {
> +		device_type = "memory";
> +		reg = <0 0x80000000 0 0x20000000>;
> +	};
> +
> +	aliases {
> +		serial0 = &uart0;
> +		serial1 = &uart1;
> +	};

These two belong into a board-specific file. I'd suggest renaming this
file to sprd_shark64.dtsi (or whatever the SoC is called) and adding a
.dts file that includes this and sets the aliases and memory node
according to what the particular board has.

> +	intc:interrupt-controller@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>;
> +	};

This interrupt controller does not have a binding, so please add at least
a documentation for the binding as well. The name should probably be more
specific that this. Also, explain why you have an interrupt controller
that has four memory regions but only one interrupt sink but no interrupt
source.

I assume this is a nested interrupt controller to which some internal
peripherals are connected?

> +	uart0: uart@70000000 {
> +		compatible = "sprd,serial";
> +		reg = <0 0x70000000 0 0x100>;
> +		interrupts = <0 2 0xf04>;
> +	};
> +
> +	uart1: uart@70100000 {
> +		compatible = "sprd,serial";
> +		reg = <0 0x70100000 0 0x100>;
> +		interrupts = <0 3 0xf04>;
> +	};

Please rename these to serial@70000000. Like the interrupt controller,
it would be good to have a more specific compatible string.
You may want to add a status="disabled" property in both these
nodes, and override them from the board.dts file for the ports that
are actually available.

	Arnd


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC
  2014-09-29 12:04 ` [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC zhang.lyra
  2014-09-29 13:30   ` Arnd Bergmann
@ 2014-09-29 13:59   ` Arnd Bergmann
  2014-09-30 10:08     ` Lyra Zhang
  1 sibling, 1 reply; 27+ messages in thread
From: Arnd Bergmann @ 2014-09-29 13:59 UTC (permalink / raw)
  To: zhang.lyra
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

On Monday 29 September 2014 20:04:53 zhang.lyra@gmail.com wrote:
> From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>
> 
> Adds a devicetree binding documentation for Spreadtrum's Shark64 SoC.
> 
> Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>

One more thing: The email addresses look wrong, please use the form in
which you normally write the names, such as

Signed-off-by: Zhang Chunyan <chunyan.zhang@spreadtrum.com>

You can set the user name that git will add using the
'git config --global user.name ...'.

Also, I notice that the email from which the patch is sent does not
match the last 'Signed-off-by' line. If Chunyan and Lyra are both
your names, better pick one that you use for both the email and the
signoff. If you are Lyra and are posting a patch from Chunyan, please
add your own line below hers, like

Signed-off-by: Zhang Chunyan <chunyan.zhang@spreadtrum.com>
Signed-off-by: Zhang Lyra <zhang.lyra@gmail.com>

so that you include everybody who was involved in sending the
patch, but have your own list last.

	Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/6] Add Spreadtrum Shark64 SoC support
  2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
                   ` (5 preceding siblings ...)
  2014-09-29 12:04 ` [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC zhang.lyra
@ 2014-09-29 14:08 ` Arnd Bergmann
  6 siblings, 0 replies; 27+ messages in thread
From: Arnd Bergmann @ 2014-09-29 14:08 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: zhang.lyra, catalin.marinas, gregkh, ijc+devicetree, jslaby,
	galak, broonie, mark.rutland, m-karicheri2, pawel.moll, artagnon,
	rrichter, robh+dt, will.deacon, orsonzhai, geng.ren,
	zhizhou.zhang, devicetree, linux-kernel

On Monday 29 September 2014 20:04:47 zhang.lyra@gmail.com wrote:
> From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>
> 
> 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.

Hi Lyra and/or Chunyan,

Thanks for your submission, it's great to see another company join the
upstream submission process.

Your patches look good overall, but I have replied with a few comments
on the details that need to be worked out.

	Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/6] arm64: dts/Makefile: Add support for Spreadtrum's Shark64 SoC.
  2014-09-29 12:04 ` [PATCH 3/6] arm64: dts/Makefile: Add " zhang.lyra
@ 2014-09-29 14:47   ` Mark Brown
  2014-09-30  9:51     ` Lyra Zhang
  0 siblings, 1 reply; 27+ messages in thread
From: Mark Brown @ 2014-09-29 14:47 UTC (permalink / raw)
  To: zhang.lyra
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

On Mon, Sep 29, 2014 at 08:04:50PM +0800, zhang.lyra@gmail.com wrote:

>  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

It's better to keep lists in Makefiles and Kconfig sorted
alphanumerically, that way there's less chance of conflicts when
applying patches or merging different branches.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon
  2014-09-29 12:04 ` [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon zhang.lyra
  2014-09-29 13:36   ` Arnd Bergmann
@ 2014-09-29 14:53   ` Mark Brown
  1 sibling, 0 replies; 27+ messages in thread
From: Mark Brown @ 2014-09-29 14:53 UTC (permalink / raw)
  To: zhang.lyra
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

On Mon, Sep 29, 2014 at 08:04:52PM +0800, zhang.lyra@gmail.com wrote:

> +config SERIAL_EARLYCON_SPRD
> +	bool "Early console using SPRD serial"
> +	depends on ARM64

This code doesn't appear to be ARM64 specific so adding an ||
COMPILE_TEST will allow better build time coverage for people doing
generic work on the subsystem.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/6] arm64: dts/Makefile: Add support for Spreadtrum's Shark64 SoC.
  2014-09-29 14:47   ` Mark Brown
@ 2014-09-30  9:51     ` Lyra Zhang
  0 siblings, 0 replies; 27+ messages in thread
From: Lyra Zhang @ 2014-09-30  9:51 UTC (permalink / raw)
  To: Mark Brown
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, Kumar Gala,
	mark.rutland, m-karicheri2, pawel.moll, Ramkumar Ramachandra,
	rrichter, robh+dt, will.deacon, Orson Zhai, geng.ren,
	zhizhou.zhang, devicetree, linux-kernel, linux-arm-kernel

Hi, Mark

[use plain text pattern to send again]

2014-09-29 22:47 GMT+08:00 Mark Brown <broonie@kernel.org>:
> On Mon, Sep 29, 2014 at 08:04:50PM +0800, zhang.lyra@gmail.com wrote:
>
>>  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
>
> It's better to keep lists in Makefiles and Kconfig sorted
> alphanumerically, that way there's less chance of conflicts when
> applying patches or merging different branches.

Thank you very much for your review and explain why this way is
better. I'll address this change in V2.

Best regards,
Chunyan

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC
  2014-09-29 13:59   ` Arnd Bergmann
@ 2014-09-30 10:08     ` Lyra Zhang
  0 siblings, 0 replies; 27+ messages in thread
From: Lyra Zhang @ 2014-09-30 10:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, Kumar Gala,
	Mark Brown, mark.rutland, m-karicheri2, pawel.moll,
	Ramkumar Ramachandra, rrichter, robh+dt, will.deacon, Orson Zhai,
	geng.ren, zhizhou.zhang, devicetree, linux-arm-kernel,
	linux-kernel, chunyan.zhang

Hi, Arnd

[use plain text pattern to send again]

Thank you very much for your review in detail so carefully. I'll
address these changes which you mentioned in this patch set in V2, but
the days from tomorrow to 10.7 are Chinese holidays, I'm going to send
PATCHv2 a few days later.

I'm also sorry that make you confused about my name, I'll solve this
problem in the next submit.

Thanks,
Chunyan

2014-09-29 21:59 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> On Monday 29 September 2014 20:04:53 zhang.lyra@gmail.com wrote:
>> From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>
>>
>> Adds a devicetree binding documentation for Spreadtrum's Shark64 SoC.
>>
>> Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
>
> One more thing: The email addresses look wrong, please use the form in
> which you normally write the names, such as
>
> Signed-off-by: Zhang Chunyan <chunyan.zhang@spreadtrum.com>
>
> You can set the user name that git will add using the
> 'git config --global user.name ...'.
>
> Also, I notice that the email from which the patch is sent does not
> match the last 'Signed-off-by' line. If Chunyan and Lyra are both
> your names, better pick one that you use for both the email and the
> signoff. If you are Lyra and are posting a patch from Chunyan, please
> add your own line below hers, like
>
> Signed-off-by: Zhang Chunyan <chunyan.zhang@spreadtrum.com>
> Signed-off-by: Zhang Lyra <zhang.lyra@gmail.com>
>
> so that you include everybody who was involved in sending the
> patch, but have your own list last.
>
>         Arnd

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-09-29 13:47   ` Arnd Bergmann
@ 2014-10-01 11:17     ` Catalin Marinas
  2014-10-15  3:17     ` Lyra Zhang
  1 sibling, 0 replies; 27+ messages in thread
From: Catalin Marinas @ 2014-10-01 11:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: zhang.lyra, gregkh, ijc+devicetree, jslaby, galak, broonie,
	Mark Rutland, m-karicheri2, Pawel Moll, artagnon, rrichter,
	robh+dt, Will Deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

On Mon, Sep 29, 2014 at 02:47:47PM +0100, Arnd Bergmann wrote:
> On Monday 29 September 2014 20:04:49 zhang.lyra@gmail.com wrote:
> > +	cpus {
> > +		#address-cells = <2>;
> > +		#size-cells = <0>;
> > +
> > +		cpu@0 {
> > +			device_type = "cpu";
> > +			compatible = "arm,armv8";
> > +			reg = <0x0 0x0>;
> > +			enable-method = "spin-table";
> > +			cpu-release-addr = <0x0 0x8000fff8>;
> > +		};
> 
> New platforms should avoid using "spin-table" method. Please
> change the boot loader to implement PSCI if you can.

As usual, I strongly recommend PSCI here if the CPU supports EL3. It
would solve the cpuidle kernel support as well with the generic cpuidle
driver and the PSCI back-end.

-- 
Catalin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial
  2014-09-29 12:04 ` [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial zhang.lyra
  2014-09-29 13:39   ` Arnd Bergmann
@ 2014-10-01 11:21   ` Mark Rutland
  2014-10-02 15:08     ` Orson Zhai
  1 sibling, 1 reply; 27+ messages in thread
From: Mark Rutland @ 2014-10-01 11:21 UTC (permalink / raw)
  To: zhang.lyra
  Cc: Catalin Marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	m-karicheri2, Pawel Moll, artagnon, rrichter, robh+dt,
	Will Deacon, orsonzhai, geng.ren, zhizhou.zhang, devicetree,
	linux-arm-kernel, linux-kernel, chunyan.zhang

On Mon, Sep 29, 2014 at 01:04:48PM +0100, zhang.lyra@gmail.com wrote:
> From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>
> 
> Adds the device-tree documentation for Spreadtrum's serial.
> 
> Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
> ---
>  .../devicetree/bindings/serial/of-serial.txt       |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt
> index 7705477..a0bb1d1 100644
> --- a/Documentation/devicetree/bindings/serial/of-serial.txt
> +++ b/Documentation/devicetree/bindings/serial/of-serial.txt
> @@ -14,6 +14,7 @@ Required properties:
>  	- "altr,16550-FIFO32"
>  	- "altr,16550-FIFO64"
>  	- "altr,16550-FIFO128"
> +	- "sprd,serial"

Is there not a more specific name? I'd imagine you might build a
different uart in future.

I didn't spot "sprd" in vendor-prefixes.txt in mainline. Is there a
patch adding that?

Mark.

>  	- "serial" if the port type is unknown.
>  - reg : offset and length of the register set for the device.
>  - interrupts : should contain uart interrupt.
> -- 
> 1.7.9.5
> 
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-09-29 12:04 ` [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC zhang.lyra
  2014-09-29 13:47   ` Arnd Bergmann
@ 2014-10-01 11:23   ` Mark Rutland
  1 sibling, 0 replies; 27+ messages in thread
From: Mark Rutland @ 2014-10-01 11:23 UTC (permalink / raw)
  To: zhang.lyra
  Cc: Catalin Marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	m-karicheri2, Pawel Moll, artagnon, rrichter, robh+dt,
	Will Deacon, orsonzhai, geng.ren, zhizhou.zhang, devicetree,
	linux-arm-kernel, linux-kernel, chunyan.zhang

On Mon, Sep 29, 2014 at 01:04:49PM +0100, zhang.lyra@gmail.com wrote:
> From: "zhizhou.zhang" <zhizhou.zhang@spreadtrum.com>
> 
> Adds the device tree support for Spreadtrum Shark64 SoC based on ARMv8 architecture.
> 
> Signed-off-by: zhizhou.zhang <zhizhou.zhang@spreadtrum.com>
> Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
> ---
>  arch/arm64/boot/dts/sprd_shark64.dts |  110 ++++++++++++++++++++++++++++++++++
>  1 file changed, 110 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/sprd_shark64.dts
> 
> diff --git a/arch/arm64/boot/dts/sprd_shark64.dts b/arch/arm64/boot/dts/sprd_shark64.dts
> new file mode 100644
> index 0000000..537cd6d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/sprd_shark64.dts
> @@ -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;

What is this protecting?

Please add a comment.

> +
> +/ {
> +	model = "shark64 Board";
> +	compatible = "sprd,shark64";

This feels like it would make more sense as an SoC dtsi to be included
by various boards (which can override the model and compatible).

> +	interrupt-parent = <&gic>;
> +	#address-cells = <2>;
> +	#size-cells = <2>;
> +
> +	chosen {
> +		bootargs = "earlycon=serial_sprd,0x70000000";

Can we not use stdout-path for this?

> +      };
> +
> +	cpus {
> +		#address-cells = <2>;
> +		#size-cells = <0>;
> +
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";

Can we have the particular CPU name, please?

> +			reg = <0x0 0x0>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;

No PSCI?

What are you using for your bootloader/firmware?

If you must use spin-table, please give each CPU a unique release
address.

> +		};
> +		cpu@1 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x1>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};
> +		cpu@2 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x2>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};
> +		cpu@3 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x3>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};
> +	};
> +
> +	memory@80000000 {
> +		device_type = "memory";
> +		reg = <0 0x80000000 0 0x20000000>;
> +	};
> +
> +	aliases {
> +		serial0 = &uart0;
> +		serial1 = &uart1;
> +	};

Could you move this up above chosen, please?

> +
> +	gic: interrupt-controller@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>;

No GICH or GICV?

Which exception level do your CPUs boot in?

I would strongly recommend booting at EL2. That gives the kernel more
flexibility to perform fixups (e.g. zeroing CNTVOFF), and requires less
work in your bootloader.

> +	};
> +
> +	intc:interrupt-controller@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>;
> +	};

This binding doesn't exist in mainline, and isn't added by this series.
I'm especially confused by the #interrupt-cells = <0>.

What exactly is this, and how do you intend to use it?

> +
> +	timer {
> +		compatible = "arm,armv8-timer";
> +		interrupts = <1 13 0xff01>,
> +			     <1 14 0xff01>,
> +			     <1 11 0xff01>,
> +			     <1 10 0xff01>;
> +		clock-frequency = <26000000>;

Please have your FW or bootloader program CNTFRQ_EL1 on each CPU, and
get rid of the clock-frequency property here.

> +	};
> +
> +	uart0: uart@70000000 {
> +		compatible = "sprd,serial";
> +		reg = <0 0x70000000 0 0x100>;
> +		interrupts = <0 2 0xf04>;
> +	};

No clocks/dmas/etc necessary?

Mark.

> +
> +	uart1: uart@70100000 {
> +		compatible = "sprd,serial";
> +		reg = <0 0x70100000 0 0x100>;
> +		interrupts = <0 3 0xf04>;
> +	};
> +};
> -- 
> 1.7.9.5
> 
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon
  2014-09-29 13:36   ` Arnd Bergmann
@ 2014-10-01 13:55     ` Rob Herring
  0 siblings, 0 replies; 27+ messages in thread
From: Rob Herring @ 2014-10-01 13:55 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: zhang.lyra, Catalin Marinas, Greg Kroah-Hartman, Ian Campbell,
	Jiri Slaby, Kumar Gala, Mark Brown, Mark Rutland,
	Murali Karicheri, Pawel Moll, artagnon, Robert Richter,
	Rob Herring, Will Deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

On Mon, Sep 29, 2014 at 8:36 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 29 September 2014 20:04:52 zhang.lyra@gmail.com wrote:
>> From: "chunyan.zhang" <chunyan.zhang@spreadtrum.com>
>>
>> Adds earlycon support for the Spreadtrum's serial.
>>
>> Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
>> ---
>>  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
>>
>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>> index 26cec64..ede16e6 100644
>> --- a/drivers/tty/serial/Kconfig
>> +++ b/drivers/tty/serial/Kconfig
>> @@ -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
>
> I assume you will later want to have a proper device driver for
> this hardware, so it would be better to make the Kconfig symbol
> and the file name what you are going to use in the long run, but
> for now only have the earlycon support included.
>
>
>> +static int __init serial_sprd_early_console_setup(
>> +                             struct earlycon_device *device,
>> +                             const char *opt)
>> +{
>> +     if (!device->port.membase)
>> +             return -ENODEV;
>> +
>> +     device->con->write = serial_sprd_early_write;
>> +     return 0;
>> +}
>> +EARLYCON_DECLARE(serial_sprd, serial_sprd_early_console_setup);
>> +OF_EARLYCON_DECLARE(serial_sprd, "sprd,serial",
>> +                 serial_sprd_early_console_setup);
>>
>
> I think you should drop the EARLYCON_DECLARE() line, using
> OF_EARLYCON_DECLARE should be enough.

No, I've been telling people to put both in. The reason is you may
have a bootloader or boot files (e.g PXELINUX) that only allows
changing changing the command line or you want to override/extend the
command line in the kernel.

I'm thinking the declaration should be combined into one to do both
since I'm getting tired of making this comment.

Rob

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial
  2014-10-01 11:21   ` Mark Rutland
@ 2014-10-02 15:08     ` Orson Zhai
  0 siblings, 0 replies; 27+ messages in thread
From: Orson Zhai @ 2014-10-02 15:08 UTC (permalink / raw)
  To: Mark Rutland, zhang.lyra
  Cc: Catalin Marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	m-karicheri2, Pawel Moll, artagnon, rrichter, robh+dt,
	Will Deacon, geng.ren, zhizhou.zhang, devicetree,
	linux-arm-kernel, linux-kernel, chunyan.zhang


On 2014年10月01日 19:21, Mark Rutland wrote:
>> diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt
>> >index 7705477..a0bb1d1 100644
>> >--- a/Documentation/devicetree/bindings/serial/of-serial.txt
>> >+++ b/Documentation/devicetree/bindings/serial/of-serial.txt
>> >@@ -14,6 +14,7 @@ Required properties:
>> >  	- "altr,16550-FIFO32"
>> >  	- "altr,16550-FIFO64"
>> >  	- "altr,16550-FIFO128"
>> >+	- "sprd,serial"
> Is there not a more specific name? I'd imagine you might build a
> different uart in future.
AFAIK, sprd's uart is re-used the same ip core in ARM 32bit chip.
so it is neither 16550 or pl011 compatible.
>
> I didn't spot "sprd" in vendor-prefixes.txt in mainline. Is there a
> patch adding that?
sorry for missing it. we'll add it at patch V2.
thanks for reviewing! :)
>
> Mark.
>


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-09-29 13:47   ` Arnd Bergmann
  2014-10-01 11:17     ` Catalin Marinas
@ 2014-10-15  3:17     ` Lyra Zhang
  2014-10-20 19:00       ` Arnd Bergmann
  1 sibling, 1 reply; 27+ messages in thread
From: Lyra Zhang @ 2014-10-15  3:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, Kumar Gala,
	Mark Brown, mark.rutland, m-karicheri2, pawel.moll,
	Ramkumar Ramachandra, rrichter, robh+dt, will.deacon, Orson Zhai,
	geng.ren, zhizhou.zhang, devicetree, linux-arm-kernel,
	linux-kernel, chunyan.zhang

Hi, Arnd

2014-09-29 21:47 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> On Monday 29 September 2014 20:04:49 zhang.lyra@gmail.com wrote:
>> +
>> +/memreserve/ 0x80000000 0x00010000;
>
> Maybe add a comment explaining why it is reserved?
>
>> +     chosen {
>> +             bootargs = "earlycon=serial_sprd,0x70000000";
>> +      };
>
> Just remove this for now, the command line should really be set by the
> boot loader, not hardcoded in the dts file.
>
> IIRC, the earlycon=... syntax is not recommended on DT based systems,
> better use the "stdout-path" syntax instead.
>

I have tried to use  "stdout-path" instead of "bootargs= "earlycon=
..." like below :

/ {
     ...

     chosen {
             stdout-path = "/serial@70000000";
      };

     uart0: serial@70000000 {
             status="okay";
     };
      ...
};

But then there is nothing output information on serial console.(I have
been testing in Fast Model)


I saw the below code in init/main.c

/* Check for early params. */
static int __init do_early_param(char *param, char *val, const char *unused)
{
const struct obs_kernel_param *p;

for (p = __setup_start; p < __setup_end; p++) {
if ((p->early && parameq(param, p->str)) ||
   (strcmp(param, "console") == 0 &&
    strcmp(p->str, "earlycon") == 0)
) {
if (p->setup_func(val) != 0)
pr_warn("Malformed early option '%s'\n", param);
}
}
/* We accept everything at this stage. */
return 0;
}

And I saw a patch from Grant Likely, he had a comment in it :
"If the devicetree specifies a serial port as a stdout device, then the
kernel can use it as the default console if nothing else was selected on
the command line. For any serial port that uses the uart_add_one_port()
feature, the uart_add_one_port() has all the information needed to
automatically enable the console device, which is what this patch does."

So, I guess that the reason why I can't see any output information on
console after using "stdout-path" instead of "earlycon" is that I
haven't a driver of Spreadtrum's serial, and dose not use  the
uart_add_one_port() feature.

I don't know is correct what I guess.

Could you give me some suggestions to solve this problem?

Thanks,
Chunyan

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-10-15  3:17     ` Lyra Zhang
@ 2014-10-20 19:00       ` Arnd Bergmann
  2014-10-21  1:28         ` Lyra Zhang
  0 siblings, 1 reply; 27+ messages in thread
From: Arnd Bergmann @ 2014-10-20 19:00 UTC (permalink / raw)
  To: Lyra Zhang
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, Kumar Gala,
	Mark Brown, mark.rutland, m-karicheri2, pawel.moll,
	Ramkumar Ramachandra, rrichter, robh+dt, will.deacon, Orson Zhai,
	geng.ren, zhizhou.zhang, devicetree, linux-arm-kernel,
	linux-kernel, chunyan.zhang

On Wednesday 15 October 2014 11:17:07 Lyra Zhang wrote:
> Hi, Arnd

Hi Lyra,

Sorry for the late reply, I've been away travelling and am just
now catching up on email. Have you found a solution or do
you still need help with this?

	Arnd

> 2014-09-29 21:47 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> > On Monday 29 September 2014 20:04:49 zhang.lyra@gmail.com wrote:
> >> +
> >> +/memreserve/ 0x80000000 0x00010000;
> >
> > Maybe add a comment explaining why it is reserved?
> >
> >> +     chosen {
> >> +             bootargs = "earlycon=serial_sprd,0x70000000";
> >> +      };
> >
> > Just remove this for now, the command line should really be set by the
> > boot loader, not hardcoded in the dts file.
> >
> > IIRC, the earlycon=... syntax is not recommended on DT based systems,
> > better use the "stdout-path" syntax instead.
> >
> 
> I have tried to use  "stdout-path" instead of "bootargs= "earlycon=
> ..." like below :
> 
> / {
>      ...
> 
>      chosen {
>              stdout-path = "/serial@70000000";
>       };
> 
>      uart0: serial@70000000 {
>              status="okay";
>      };
>       ...
> };
> 
> But then there is nothing output information on serial console.(I have
> been testing in Fast Model)
> 
> 
> I saw the below code in init/main.c
> 
> /* Check for early params. */
> static int __init do_early_param(char *param, char *val, const char *unused)
> {
> const struct obs_kernel_param *p;
> 
> for (p = __setup_start; p < __setup_end; p++) {
> if ((p->early && parameq(param, p->str)) ||
>    (strcmp(param, "console") == 0 &&
>     strcmp(p->str, "earlycon") == 0)
> ) {
> if (p->setup_func(val) != 0)
> pr_warn("Malformed early option '%s'\n", param);
> }
> }
> /* We accept everything at this stage. */
> return 0;
> }
> 
> And I saw a patch from Grant Likely, he had a comment in it :
> "If the devicetree specifies a serial port as a stdout device, then the
> kernel can use it as the default console if nothing else was selected on
> the command line. For any serial port that uses the uart_add_one_port()
> feature, the uart_add_one_port() has all the information needed to
> automatically enable the console device, which is what this patch does."
> 
> So, I guess that the reason why I can't see any output information on
> console after using "stdout-path" instead of "earlycon" is that I
> haven't a driver of Spreadtrum's serial, and dose not use  the
> uart_add_one_port() feature.
> 
> I don't know is correct what I guess.
> 
> Could you give me some suggestions to solve this problem?
> 


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-10-20 19:00       ` Arnd Bergmann
@ 2014-10-21  1:28         ` Lyra Zhang
  0 siblings, 0 replies; 27+ messages in thread
From: Lyra Zhang @ 2014-10-21  1:28 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Catalin Marinas, gregkh, ijc+devicetree, jslaby, Kumar Gala,
	Mark Brown, Mark Rutland, m-karicheri2, Pawel Moll,
	Ramkumar Ramachandra, rrichter, robh+dt, Will Deacon, Orson Zhai,
	geng.ren, zhizhou.zhang, devicetree, linux-arm-kernel,
	linux-kernel, chunyan.zhang

Hi, Arnd

This problem have been solved, and was submitted in v2.
Thanks for your answer to the question(which Orson asked for me) about
this on Freenode.

Best regards,
Lyra

2014-10-21 3:00 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> On Wednesday 15 October 2014 11:17:07 Lyra Zhang wrote:
>> Hi, Arnd
>
> Hi Lyra,
>
> Sorry for the late reply, I've been away travelling and am just
> now catching up on email. Have you found a solution or do
> you still need help with this?
>
>         Arnd
>
>> 2014-09-29 21:47 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
>> > On Monday 29 September 2014 20:04:49 zhang.lyra@gmail.com wrote:
>> >> +
>> >> +/memreserve/ 0x80000000 0x00010000;
>> >
>> > Maybe add a comment explaining why it is reserved?
>> >
>> >> +     chosen {
>> >> +             bootargs = "earlycon=serial_sprd,0x70000000";
>> >> +      };
>> >
>> > Just remove this for now, the command line should really be set by the
>> > boot loader, not hardcoded in the dts file.
>> >
>> > IIRC, the earlycon=... syntax is not recommended on DT based systems,
>> > better use the "stdout-path" syntax instead.
>> >
>>
>> I have tried to use  "stdout-path" instead of "bootargs= "earlycon=
>> ..." like below :
>>
>> / {
>>      ...
>>
>>      chosen {
>>              stdout-path = "/serial@70000000";
>>       };
>>
>>      uart0: serial@70000000 {
>>              status="okay";
>>      };
>>       ...
>> };
>>
>> But then there is nothing output information on serial console.(I have
>> been testing in Fast Model)
>>
>>
>> I saw the below code in init/main.c
>>
>> /* Check for early params. */
>> static int __init do_early_param(char *param, char *val, const char *unused)
>> {
>> const struct obs_kernel_param *p;
>>
>> for (p = __setup_start; p < __setup_end; p++) {
>> if ((p->early && parameq(param, p->str)) ||
>>    (strcmp(param, "console") == 0 &&
>>     strcmp(p->str, "earlycon") == 0)
>> ) {
>> if (p->setup_func(val) != 0)
>> pr_warn("Malformed early option '%s'\n", param);
>> }
>> }
>> /* We accept everything at this stage. */
>> return 0;
>> }
>>
>> And I saw a patch from Grant Likely, he had a comment in it :
>> "If the devicetree specifies a serial port as a stdout device, then the
>> kernel can use it as the default console if nothing else was selected on
>> the command line. For any serial port that uses the uart_add_one_port()
>> feature, the uart_add_one_port() has all the information needed to
>> automatically enable the console device, which is what this patch does."
>>
>> So, I guess that the reason why I can't see any output information on
>> console after using "stdout-path" instead of "earlycon" is that I
>> haven't a driver of Spreadtrum's serial, and dose not use  the
>> uart_add_one_port() feature.
>>
>> I don't know is correct what I guess.
>>
>> Could you give me some suggestions to solve this problem?
>>
>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-09-29 11:48 ` [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC zhang.lyra
@ 2014-09-29 14:55   ` Andreas Färber
  0 siblings, 0 replies; 27+ messages in thread
From: Andreas Färber @ 2014-09-29 14:55 UTC (permalink / raw)
  To: zhang.lyra
  Cc: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang,
	devicetree, linux-kernel, linux-arm-kernel

Hi,

Am 29.09.2014 um 13:48 schrieb zhang.lyra@gmail.com:
> From: "zhizhou.zhang" <zhizhou.zhang@spreadtrum.com>
> 
> Adds the device tree support for Spreadtrum Shark64 SoC based on ARMv8 architecture.
> 
> Signed-off-by: zhizhou.zhang <zhizhou.zhang@spreadtrum.com>
> Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
> ---
>  arch/arm64/boot/dts/sprd_shark64.dts |  110 ++++++++++++++++++++++++++++++++++
>  1 file changed, 110 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/sprd_shark64.dts
> 
> diff --git a/arch/arm64/boot/dts/sprd_shark64.dts b/arch/arm64/boot/dts/sprd_shark64.dts
> new file mode 100644
> index 0000000..537cd6d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/sprd_shark64.dts
> @@ -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";

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.

> +	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

> +
> +	cpus {
> +		#address-cells = <2>;
> +		#size-cells = <0>;
> +
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x0>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};
> +		cpu@1 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x1>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};
> +		cpu@2 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x2>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};
> +		cpu@3 {
> +			device_type = "cpu";
> +			compatible = "arm,armv8";
> +			reg = <0x0 0x3>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x8000fff8>;
> +		};
> +	};
> +
> +	memory@80000000 {
> +		device_type = "memory";
> +		reg = <0 0x80000000 0 0x20000000>;
> +	};
> +
> +	aliases {
> +		serial0 = &uart0;
> +		serial1 = &uart1;
> +	};
> +
> +	gic: interrupt-controller@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@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@70000000 {
> +		compatible = "sprd,serial";
> +		reg = <0 0x70000000 0 0x100>;
> +		interrupts = <0 2 0xf04>;
> +	};
> +
> +	uart1: uart@70100000 {
> +		compatible = "sprd,serial";
> +		reg = <0 0x70100000 0 0x100>;
> +		interrupts = <0 3 0xf04>;
> +	};
> +};

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC
  2014-09-29 11:48 zhang.lyra
@ 2014-09-29 11:48 ` zhang.lyra
  2014-09-29 14:55   ` Andreas Färber
  0 siblings, 1 reply; 27+ messages in thread
From: zhang.lyra @ 2014-09-29 11:48 UTC (permalink / raw)
  To: catalin.marinas, gregkh, ijc+devicetree, jslaby, galak, broonie,
	mark.rutland, m-karicheri2, pawel.moll, artagnon, rrichter,
	robh+dt, will.deacon, orsonzhai, geng.ren, zhizhou.zhang
  Cc: devicetree, linux-arm-kernel, linux-kernel, chunyan.zhang

From: "zhizhou.zhang" <zhizhou.zhang@spreadtrum.com>

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

Signed-off-by: zhizhou.zhang <zhizhou.zhang@spreadtrum.com>
Signed-off-by: chunyan.zhang <chunyan.zhang@spreadtrum.com>
---
 arch/arm64/boot/dts/sprd_shark64.dts |  110 ++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)
 create mode 100644 arch/arm64/boot/dts/sprd_shark64.dts

diff --git a/arch/arm64/boot/dts/sprd_shark64.dts b/arch/arm64/boot/dts/sprd_shark64.dts
new file mode 100644
index 0000000..537cd6d
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd_shark64.dts
@@ -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@0 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x0>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu@1 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x1>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu@2 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x2>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu@3 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x3>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+	};
+
+	memory@80000000 {
+		device_type = "memory";
+		reg = <0 0x80000000 0 0x20000000>;
+	};
+
+	aliases {
+		serial0 = &uart0;
+		serial1 = &uart1;
+	};
+
+	gic: interrupt-controller@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@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@70000000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70000000 0 0x100>;
+		interrupts = <0 2 0xf04>;
+	};
+
+	uart1: uart@70100000 {
+		compatible = "sprd,serial";
+		reg = <0 0x70100000 0 0x100>;
+		interrupts = <0 3 0xf04>;
+	};
+};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2014-10-21  1:28 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-29 12:04 [PATCH 0/6] Add Spreadtrum Shark64 SoC support zhang.lyra
2014-09-29 12:04 ` [PATCH 1/6] Documentation: DT: Add bindings for Spreadtrum serial zhang.lyra
2014-09-29 13:39   ` Arnd Bergmann
2014-10-01 11:21   ` Mark Rutland
2014-10-02 15:08     ` Orson Zhai
2014-09-29 12:04 ` [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC zhang.lyra
2014-09-29 13:47   ` Arnd Bergmann
2014-10-01 11:17     ` Catalin Marinas
2014-10-15  3:17     ` Lyra Zhang
2014-10-20 19:00       ` Arnd Bergmann
2014-10-21  1:28         ` Lyra Zhang
2014-10-01 11:23   ` Mark Rutland
2014-09-29 12:04 ` [PATCH 3/6] arm64: dts/Makefile: Add " zhang.lyra
2014-09-29 14:47   ` Mark Brown
2014-09-30  9:51     ` Lyra Zhang
2014-09-29 12:04 ` [PATCH 4/6] arm64: Add support for Spreadtrum's Shark64 SoC in Kconfig and defconfig zhang.lyra
2014-09-29 12:04 ` [PATCH 5/6] tty/serial: Add Spreadtrum's serial earlycon zhang.lyra
2014-09-29 13:36   ` Arnd Bergmann
2014-10-01 13:55     ` Rob Herring
2014-09-29 14:53   ` Mark Brown
2014-09-29 12:04 ` [PATCH 6/6] Documentation: Add entry for Spreadtrum's Shark64 SoC zhang.lyra
2014-09-29 13:30   ` Arnd Bergmann
2014-09-29 13:59   ` Arnd Bergmann
2014-09-30 10:08     ` Lyra Zhang
2014-09-29 14:08 ` [PATCH 0/6] Add Spreadtrum Shark64 SoC support Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2014-09-29 11:48 zhang.lyra
2014-09-29 11:48 ` [PATCH 2/6] arm64: Add DTS support for Spreadtrum's Shark64 SoC zhang.lyra
2014-09-29 14:55   ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).