Discussion:
[PATCH v2 0/5] Add Spreadtrum Sharkl Platform support
Chunyan Zhang
2014-10-17 09:54:20 UTC
Permalink
Spreadtrum is a rapid growing chip vendor providing smart phone total solutions.

Sharkl Platform is nominated as a SoC infrastructure that supports 4G/3G/2G
standards based on ARMv8 multiple core architecture.Now we have only one
SoC(Sharkl3) based on this Platform in developing.

This patchset adds Sharkl support in arm64 device tree and implements the
basic earlycon serial driver.

This patchset also has patches which address "sprd" prefix and DT compatible
strings for nodes which appear un-documented.

This version code was tesed on Fast Mode successfully.

Changes from v1:
* Addressed review comments:
- Added "sprd" prefix to vendor-prefixes.txt
- Created serial/sprd-serial.txt and remove the properties for serial-sprd
from of-serial.txt to it.
- Renamed of-serial.txt to 8250.txt according to Arnd's review comments
- Splited and revised .dts for Sharkl Platform
- Changed to PSCI method for cpu power management
- Revised Kconfig Makefile to match the alphabetical ordering
- Renamed serial-sprd-earlycon.c to serial-sprd.c

Chunyan Zhang (3):
Documentation: DT: Renamed of-serial.txt to 8250.txt
Documentation: DT: Add bindings for Spreadtrum Sharkl Platform
tty/serial: Add earlycon support for Spreadtrum serial driver

Zhizhou Zhang (2):
arm64: dts: Add support for Spreadtrum Sharkl3 SoC in dts and Makefile.
arm64: Add support for Spreadtrum's Sharkl Platform in Kconfig and defconfig

Documentation/devicetree/bindings/arm/sprd.txt | 11 ++++
Documentation/devicetree/bindings/serial/8250.txt | 50 ++++++++++++++
.../devicetree/bindings/serial/of-serial.txt | 50 --------------
.../devicetree/bindings/serial/sprd-serial.txt | 6 ++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
arch/arm64/Kconfig | 6 ++
arch/arm64/boot/dts/Makefile | 1 +
arch/arm64/boot/dts/sprd-sharkl.dtsi | 33 ++++++++++
arch/arm64/boot/dts/sprd-sharkl3-fpga.dts | 41 ++++++++++++
arch/arm64/boot/dts/sprd-sharkl3.dtsi | 69 ++++++++++++++++++++
arch/arm64/configs/defconfig | 1 +
drivers/tty/serial/Kconfig | 24 +++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/sprd-serial.c | 64 ++++++++++++++++++
14 files changed, 308 insertions(+), 50 deletions(-)
create mode 100644 Documentation/devicetree/bindings/arm/sprd.txt
create mode 100644 Documentation/devicetree/bindings/serial/8250.txt
delete mode 100644 Documentation/devicetree/bindings/serial/of-serial.txt
create mode 100644 Documentation/devicetree/bindings/serial/sprd-serial.txt
create mode 100644 arch/arm64/boot/dts/sprd-sharkl.dtsi
create mode 100644 arch/arm64/boot/dts/sprd-sharkl3-fpga.dts
create mode 100644 arch/arm64/boot/dts/sprd-sharkl3.dtsi
create mode 100644 drivers/tty/serial/sprd-serial.c
--
1.7.9.5
Chunyan Zhang
2014-10-17 09:54:22 UTC
Permalink
Adds Spreadtrum's prefix "sprd" to vendor-prefixes file.
Adds the devicetree binding documentation for Spreadtrum's serial
and Sharkl3 SoC based on the Sharkl Platform which is the 64-bit
SoC Platform of Spreadtrum.

Signed-off-by: Chunyan Zhang <***@spreadtrum.com>
---
Documentation/devicetree/bindings/arm/sprd.txt | 11 +++++++++++
.../devicetree/bindings/serial/sprd-serial.txt | 6 ++++++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
3 files changed, 18 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/sprd.txt
create mode 100644 Documentation/devicetree/bindings/serial/sprd-serial.txt

diff --git a/Documentation/devicetree/bindings/arm/sprd.txt b/Documentation/devicetree/bindings/arm/sprd.txt
new file mode 100644
index 0000000..40b40d6
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/sprd.txt
@@ -0,0 +1,11 @@
+Spreadtrum Sharkl Platforms Device Tree Bindings
+----------------------------------------------------
+
+Sharkl is a Spreadtrum's SoC Platform which is based
+on ARM 64-bit processor.
+
+Sharkl3 FPGA board with Sharkl3 SoC based on the
+Sharkl Platform shall have the following properties.
+
+Required root node properties:
+ - compatible = "sprd,sharkl3-fpga", "sprd,sharkl3";
diff --git a/Documentation/devicetree/bindings/serial/sprd-serial.txt b/Documentation/devicetree/bindings/serial/sprd-serial.txt
new file mode 100644
index 0000000..c97b0a6
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/sprd-serial.txt
@@ -0,0 +1,6 @@
+* Spreadtrum serial UART
+
+Required properties:
+- compatible: must be "sprd,serial"
+- reg: offset and length of the register set for the device
+- interrupts: exactly one interrupt specifier
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index ac7269f..5dbf7db 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -129,6 +129,7 @@ smsc Standard Microsystems Corporation
snps Synopsys, Inc.
solidrun SolidRun
spansion Spansion Inc.
+sprd Spreadtrum Communications Inc.
st STMicroelectronics
ste ST-Ericsson
stericsson ST-Ericsson
--
1.7.9.5
Mark Rutland
2014-10-17 12:50:34 UTC
Permalink
Post by Chunyan Zhang
Adds Spreadtrum's prefix "sprd" to vendor-prefixes file.
Adds the devicetree binding documentation for Spreadtrum's serial
and Sharkl3 SoC based on the Sharkl Platform which is the 64-bit
SoC Platform of Spreadtrum.
---
Documentation/devicetree/bindings/arm/sprd.txt | 11 +++++++++++
.../devicetree/bindings/serial/sprd-serial.txt | 6 ++++++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
3 files changed, 18 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/sprd.txt
create mode 100644 Documentation/devicetree/bindings/serial/sprd-serial.txt
diff --git a/Documentation/devicetree/bindings/arm/sprd.txt b/Documentation/devicetree/bindings/arm/sprd.txt
new file mode 100644
index 0000000..40b40d6
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/sprd.txt
@@ -0,0 +1,11 @@
+Spreadtrum Sharkl Platforms Device Tree Bindings
+----------------------------------------------------
+
+Sharkl is a Spreadtrum's SoC Platform which is based
+on ARM 64-bit processor.
+
+Sharkl3 FPGA board with Sharkl3 SoC based on the
+Sharkl Platform shall have the following properties.
+
+ - compatible = "sprd,sharkl3-fpga", "sprd,sharkl3";
diff --git a/Documentation/devicetree/bindings/serial/sprd-serial.txt b/Documentation/devicetree/bindings/serial/sprd-serial.txt
new file mode 100644
index 0000000..c97b0a6
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/sprd-serial.txt
@@ -0,0 +1,6 @@
+* Spreadtrum serial UART
+
+- compatible: must be "sprd,serial"
+- reg: offset and length of the register set for the device
+- interrupts: exactly one interrupt specifier
I'm still a little wary of then name "sprd,serial". What was the first
device to feature this UART, if it doesn't have a specific name of its
own?
Post by Chunyan Zhang
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index ac7269f..5dbf7db 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -129,6 +129,7 @@ smsc Standard Microsystems Corporation
snps Synopsys, Inc.
solidrun SolidRun
spansion Spansion Inc.
+sprd Spreadtrum Communications Inc.
st STMicroelectronics
ste ST-Ericsson
stericsson ST-Ericsson
The vendor prefix addition looks fine to me.

Thanks,
Mark.
Arnd Bergmann
2014-10-20 13:48:46 UTC
Permalink
Post by Chunyan Zhang
Adds Spreadtrum's prefix "sprd" to vendor-prefixes file.
Adds the devicetree binding documentation for Spreadtrum's serial
and Sharkl3 SoC based on the Sharkl Platform which is the 64-bit
SoC Platform of Spreadtrum.
Acked-by: Arnd Bergmann <***@arndb.de>

Chunyan Zhang
2014-10-17 09:54:24 UTC
Permalink
From: Zhizhou Zhang <***@spreadtrum.com>

Adds support for Spreadtrum's Sharkl Platform in the arm64 Kconfig
and defconfig files.

Signed-off-by: Zhizhou Zhang <***@spreadtrum.com>
Signed-off-by: Chunyan Zhang <***@spreadtrum.com>
---
arch/arm64/Kconfig | 6 ++++++
arch/arm64/configs/defconfig | 1 +
2 files changed, 7 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index fd4e81a..eac2e2c 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -134,6 +134,12 @@ source "kernel/Kconfig.freezer"

menu "Platform selection"

+config ARCH_SHARKL
+ bool "Spreadtrum 64-bit SoC Platform"
+ help
+ Sharkl is a Spreadtrum's SoC Platform which is based
+ on ARM 64-bit processor.
+
config ARCH_VEXPRESS
bool "ARMv8 software model (Versatile Express)"
select ARCH_REQUIRE_GPIOLIB
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index d92ef3c..c62ff98 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -32,6 +32,7 @@ CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_SHARKL=y
CONFIG_ARCH_VEXPRESS=y
CONFIG_ARCH_XGENE=y
CONFIG_SMP=y
--
1.7.9.5
Chunyan Zhang
2014-10-17 09:54:23 UTC
Permalink
From: Zhizhou Zhang <***@spreadtrum.com>

Adds the device tree support for Spreadtrum Sharkl3 SoC which is based on
Sharkl platform.

Sharkl platform contains the common nodes of Spreadtrum's arm64-based SoCs.

Signed-off-by: Zhizhou Zhang <***@spreadtrum.com>
Signed-off-by: Chunyan Zhang <***@spreadtrum.com>
---
arch/arm64/boot/dts/Makefile | 1 +
arch/arm64/boot/dts/sprd-sharkl.dtsi | 33 ++++++++++++++
arch/arm64/boot/dts/sprd-sharkl3-fpga.dts | 41 +++++++++++++++++
arch/arm64/boot/dts/sprd-sharkl3.dtsi | 69 +++++++++++++++++++++++++++++
4 files changed, 144 insertions(+)
create mode 100644 arch/arm64/boot/dts/sprd-sharkl.dtsi
create mode 100644 arch/arm64/boot/dts/sprd-sharkl3-fpga.dts
create mode 100644 arch/arm64/boot/dts/sprd-sharkl3.dtsi

diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index c52bdb0..0030e44 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_SHARKL) += sprd-sharkl3-fpga.dtb
dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb

diff --git a/arch/arm64/boot/dts/sprd-sharkl.dtsi b/arch/arm64/boot/dts/sprd-sharkl.dtsi
new file mode 100644
index 0000000..26a28c3
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd-sharkl.dtsi
@@ -0,0 +1,33 @@
+/*
+ * dtsi file for Spreadtrum(sprd) Sharkl Platform based on AArch64.
+ *
+ * Copyright (C) 2014, Spreadtrum Communications Inc.
+ *
+ * Sharkl Platform is the base of Spreadtrum arm64 SoCs whose common
+ * nodes are listed in this file.
+ *
+ * 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.
+ */
+
+/ {
+ interrupt-parent = <&gic>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ uart0: ***@70000000 {
+ compatible = "sprd,serial";
+ reg = <0 0x70000000 0 0x100>;
+ interrupts = <0 2 0xf04>;
+ status = "disabled";
+ };
+
+ uart1: ***@70100000 {
+ compatible = "sprd,serial";
+ reg = <0 0x70100000 0 0x100>;
+ interrupts = <0 3 0xf04>;
+ status = "disabled";
+ };
+};
diff --git a/arch/arm64/boot/dts/sprd-sharkl3-fpga.dts b/arch/arm64/boot/dts/sprd-sharkl3-fpga.dts
new file mode 100644
index 0000000..faa0a2e
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd-sharkl3-fpga.dts
@@ -0,0 +1,41 @@
+/*
+ * DTS file for Spreadtrum(sprd) Sharkl3 FPGA board based on
+ * the Sharkl Platform.
+ *
+ * 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/;
+
+#include "sprd-sharkl3.dtsi"
+
+/ {
+ model = "Spreadtrum Sharkl3 FPGA board";
+
+ compatible = "sprd,sharkl3-fpga", "sprd,sharkl3";
+
+ aliases {
+ };
+
+ ***@80000000 {
+ device_type = "memory";
+ reg = <0 0x80000000 0 0x20000000>;
+ };
+
+ chosen {
+ stdout-path = &uart0;
+ };
+
+ uart0: ***@70000000 {
+ status = "okay";
+ };
+
+ uart1: ***@70100000 {
+ status = "okay";
+ };
+};
diff --git a/arch/arm64/boot/dts/sprd-sharkl3.dtsi b/arch/arm64/boot/dts/sprd-sharkl3.dtsi
new file mode 100644
index 0000000..0ab4a94
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd-sharkl3.dtsi
@@ -0,0 +1,69 @@
+/*
+ * dtsi file for Spreadtrum(sprd) Sharkl3 SoC based on the Sharkl Platform.
+ *
+ * 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.
+ */
+
+#include "sprd-sharkl.dtsi"
+
+/ {
+ compatible = "sprd,sharkl3";
+
+ gic: interrupt-***@12001000 {
+ compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
+ #interrupt-cells = <3>;
+ interrupt-controller;
+ reg = <0 0x12001000 0 0x1000>,
+ <0 0x12002000 0 0x1000>,
+ <0 0x12004000 0 0x2000>,
+ <0 0x12006000 0 0x2000>;
+ };
+
+ cpus {
+ #address-cells = <2>;
+ #size-cells = <0>;
+
+ ***@0 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x0>;
+ enable-method = "psci";
+ };
+ ***@1 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x1>;
+ enable-method = "psci";
+ };
+ ***@2 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x2>;
+ enable-method = "psci";
+ };
+ ***@3 {
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x3>;
+ enable-method = "psci";
+ };
+ };
+
+ psci {
+ compatible = "arm,psci-0.2";
+ method = "smc";
+ };
+
+ timer {
+ compatible = "arm,armv8-timer";
+ interrupts = <1 13 0xff01>,
+ <1 14 0xff01>,
+ <1 11 0xff01>,
+ <1 10 0xff01>;
+ };
+};
--
1.7.9.5
Mark Rutland
2014-10-17 13:00:40 UTC
Permalink
Post by Chunyan Zhang
Adds the device tree support for Spreadtrum Sharkl3 SoC which is based on
Sharkl platform.
Sharkl platform contains the common nodes of Spreadtrum's arm64-based SoCs.
---
arch/arm64/boot/dts/Makefile | 1 +
arch/arm64/boot/dts/sprd-sharkl.dtsi | 33 ++++++++++++++
arch/arm64/boot/dts/sprd-sharkl3-fpga.dts | 41 +++++++++++++++++
arch/arm64/boot/dts/sprd-sharkl3.dtsi | 69 +++++++++++++++++++++++++++++
4 files changed, 144 insertions(+)
create mode 100644 arch/arm64/boot/dts/sprd-sharkl.dtsi
create mode 100644 arch/arm64/boot/dts/sprd-sharkl3-fpga.dts
create mode 100644 arch/arm64/boot/dts/sprd-sharkl3.dtsi
diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index c52bdb0..0030e44 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_SHARKL) += sprd-sharkl3-fpga.dtb
dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
diff --git a/arch/arm64/boot/dts/sprd-sharkl.dtsi b/arch/arm64/boot/dts/sprd-sharkl.dtsi
new file mode 100644
index 0000000..26a28c3
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd-sharkl.dtsi
@@ -0,0 +1,33 @@
+/*
+ * dtsi file for Spreadtrum(sprd) Sharkl Platform based on AArch64.
+ *
+ * Copyright (C) 2014, Spreadtrum Communications Inc.
+ *
+ * Sharkl Platform is the base of Spreadtrum arm64 SoCs whose common
+ * nodes are listed in this file.
+ *
+ * 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.
+ */
+
+/ {
+ interrupt-parent = <&gic>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ compatible = "sprd,serial";
+ reg = <0 0x70000000 0 0x100>;
+ interrupts = <0 2 0xf04>;
+ status = "disabled";
+ };
+
+ compatible = "sprd,serial";
+ reg = <0 0x70100000 0 0x100>;
+ interrupts = <0 3 0xf04>;
+ status = "disabled";
+ };
+};
diff --git a/arch/arm64/boot/dts/sprd-sharkl3-fpga.dts b/arch/arm64/boot/dts/sprd-sharkl3-fpga.dts
new file mode 100644
index 0000000..faa0a2e
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd-sharkl3-fpga.dts
@@ -0,0 +1,41 @@
+/*
+ * DTS file for Spreadtrum(sprd) Sharkl3 FPGA board based on
+ * the Sharkl Platform.
+ *
+ * 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/;
+
+#include "sprd-sharkl3.dtsi"
+
+/ {
+ model = "Spreadtrum Sharkl3 FPGA board";
For some reason this line begins with spaces rather than a tab, which
breaks the alignment and is a little annoying. Could you please fix the
spaces here to a tab?
Post by Chunyan Zhang
+
+ compatible = "sprd,sharkl3-fpga", "sprd,sharkl3";
+
+ aliases {
+ };
+
+ device_type = "memory";
+ reg = <0 0x80000000 0 0x20000000>;
+ };
+
+ chosen {
+ stdout-path = &uart0;
+ };
+
+ status = "okay";
+ };
+
+ status = "okay";
+ };
+};
diff --git a/arch/arm64/boot/dts/sprd-sharkl3.dtsi b/arch/arm64/boot/dts/sprd-sharkl3.dtsi
new file mode 100644
index 0000000..0ab4a94
--- /dev/null
+++ b/arch/arm64/boot/dts/sprd-sharkl3.dtsi
@@ -0,0 +1,69 @@
+/*
+ * dtsi file for Spreadtrum(sprd) Sharkl3 SoC based on the Sharkl Platform.
+ *
+ * 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.
+ */
+
+#include "sprd-sharkl.dtsi"
+
+/ {
+ compatible = "sprd,sharkl3";
+
+ compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
+ #interrupt-cells = <3>;
+ interrupt-controller;
+ reg = <0 0x12001000 0 0x1000>,
+ <0 0x12002000 0 0x1000>,
+ <0 0x12004000 0 0x2000>,
+ <0 0x12006000 0 0x2000>;
+ };
Could we move this after the cpus node please?
Post by Chunyan Zhang
+
+ cpus {
+ #address-cells = <2>;
+ #size-cells = <0>;
+
+ device_type = "cpu";
+ compatible = "arm,armv8";
Could we have the compatible string for the actual CPU rather than just
"arm,armv8"?
Post by Chunyan Zhang
+ reg = <0x0 0x0>;
+ enable-method = "psci";
+ };
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x1>;
+ enable-method = "psci";
+ };
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x2>;
+ enable-method = "psci";
+ };
+ device_type = "cpu";
+ compatible = "arm,armv8";
+ reg = <0x0 0x3>;
+ enable-method = "psci";
+ };
+ };
+
+ psci {
+ compatible = "arm,psci-0.2";
+ method = "smc";
+ };
What are you using as your PSCI implementation?
Post by Chunyan Zhang
+ timer {
+ compatible = "arm,armv8-timer";
+ interrupts = <1 13 0xff01>,
+ <1 14 0xff01>,
+ <1 11 0xff01>,
+ <1 10 0xff01>;
+ };
I take it that CNTFRQ is programmed correctly on all CPUs?

Thanks,
Mark.
Chunyan Zhang
2014-10-17 09:54:25 UTC
Permalink
Add serial driver for spreadtrum sharkl platform with earlycon
support at first.

Signed-off-by: Chunyan Zhang <***@spreadtrum.com>
---
drivers/tty/serial/Kconfig | 24 ++++++++++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/sprd-serial.c | 64 ++++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+)
create mode 100644 drivers/tty/serial/sprd-serial.c

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64..33b8f90 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -113,6 +113,30 @@ config SERIAL_SB1250_DUART_CONSOLE

If unsure, say Y.

+config SERIAL_SPRD
+ tristate "Support for SPRD serial"
+ depends on ARM || ARM64
+ select SERIAL_CORE
+ help
+ This enables the driver for the Spreadtrum's serial.
+
+config SERIAL_SPRD_NR
+ int "Maximum number of sprd serial ports"
+ depends on SERIAL_SPRD
+ default "4"
+
+config SERIAL_SPRD_CONSOLE
+ bool "SPRD UART console support"
+ depends on SERIAL_SPRD=y
+ select SERIAL_CORE_CONSOLE
+ select SERIAL_EARLYCON
+ help
+ Support for early debug console using Spreadtrum's 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_ATMEL
bool "AT91 / AT32 on-chip serial port support"
depends on ARCH_AT91 || AVR32
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 0080cc3..b16e0d4 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -92,6 +92,7 @@ obj-$(CONFIG_SERIAL_ARC) += arc_uart.o
obj-$(CONFIG_SERIAL_RP2) += rp2.o
obj-$(CONFIG_SERIAL_FSL_LPUART) += fsl_lpuart.o
obj-$(CONFIG_SERIAL_MEN_Z135) += men_z135_uart.o
+obj-$(CONFIG_SERIAL_SPRD) += sprd-serial.o

# GPIOLIB helpers for modem control lines
obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o
diff --git a/drivers/tty/serial/sprd-serial.c b/drivers/tty/serial/sprd-serial.c
new file mode 100644
index 0000000..9ae594f
--- /dev/null
+++ b/drivers/tty/serial/sprd-serial.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 UART_TXD 0x0000
+#define UART_RXD 0x0004
+#define UART_STS0 0x0008
+#define UART_STS1 0x000C
+#define UART_IEN 0x0010
+#define UART_ICLR 0x0014
+#define UART_CTL0 0x0018
+#define UART_CTL1 0x001C
+#define UART_CTL2 0x0020
+#define UART_CLKD0 0x0024
+#define UART_CLKD1 0x0028
+#define 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 + UART_STS0) & UART_LSR_TX_OVER))
+ ;
+ writeb(c, port->membase + 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
Mark Rutland
2014-10-17 13:03:54 UTC
Permalink
Post by Chunyan Zhang
Add serial driver for spreadtrum sharkl platform with earlycon
support at first.
---
drivers/tty/serial/Kconfig | 24 ++++++++++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/sprd-serial.c | 64 ++++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+)
create mode 100644 drivers/tty/serial/sprd-serial.c
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64..33b8f90 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -113,6 +113,30 @@ config SERIAL_SB1250_DUART_CONSOLE
If unsure, say Y.
+config SERIAL_SPRD
+ tristate "Support for SPRD serial"
+ depends on ARM || ARM64
+ select SERIAL_CORE
+ help
+ This enables the driver for the Spreadtrum's serial.
+
+config SERIAL_SPRD_NR
+ int "Maximum number of sprd serial ports"
+ depends on SERIAL_SPRD
+ default "4"
This is not used below.
Post by Chunyan Zhang
+
+config SERIAL_SPRD_CONSOLE
+ bool "SPRD UART console support"
+ depends on SERIAL_SPRD=y
+ select SERIAL_CORE_CONSOLE
+ select SERIAL_EARLYCON
+ help
+ Support for early debug console using Spreadtrum's 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.
There only appears to be an earlycon driver, and not "standard serial
driver".

What happens after earlycon?

Surely there should be a real driver to take ownership of the UART?

As far as I can see it won't be possible to boot your platform to a
prompt, because earlycon will have gone before that.

Thanks,
Mark.
Post by Chunyan Zhang
+
+
config SERIAL_ATMEL
bool "AT91 / AT32 on-chip serial port support"
depends on ARCH_AT91 || AVR32
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 0080cc3..b16e0d4 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -92,6 +92,7 @@ obj-$(CONFIG_SERIAL_ARC) += arc_uart.o
obj-$(CONFIG_SERIAL_RP2) += rp2.o
obj-$(CONFIG_SERIAL_FSL_LPUART) += fsl_lpuart.o
obj-$(CONFIG_SERIAL_MEN_Z135) += men_z135_uart.o
+obj-$(CONFIG_SERIAL_SPRD) += sprd-serial.o
# GPIOLIB helpers for modem control lines
obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o
diff --git a/drivers/tty/serial/sprd-serial.c b/drivers/tty/serial/sprd-serial.c
new file mode 100644
index 0000000..9ae594f
--- /dev/null
+++ b/drivers/tty/serial/sprd-serial.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 UART_TXD 0x0000
+#define UART_RXD 0x0004
+#define UART_STS0 0x0008
+#define UART_STS1 0x000C
+#define UART_IEN 0x0010
+#define UART_ICLR 0x0014
+#define UART_CTL0 0x0018
+#define UART_CTL1 0x001C
+#define UART_CTL2 0x0020
+#define UART_CLKD0 0x0024
+#define UART_CLKD1 0x0028
+#define 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 + UART_STS0) & UART_LSR_TX_OVER))
+ ;
+ writeb(c, port->membase + 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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Lyra Zhang
2014-10-20 07:27:24 UTC
Permalink
Post by Mark Rutland
Post by Chunyan Zhang
Add serial driver for spreadtrum sharkl platform with earlycon
support at first.
---
drivers/tty/serial/Kconfig | 24 ++++++++++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/sprd-serial.c | 64 ++++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+)
create mode 100644 drivers/tty/serial/sprd-serial.c
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64..33b8f90 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -113,6 +113,30 @@ config SERIAL_SB1250_DUART_CONSOLE
If unsure, say Y.
+config SERIAL_SPRD
+ tristate "Support for SPRD serial"
+ depends on ARM || ARM64
+ select SERIAL_CORE
+ help
+ This enables the driver for the Spreadtrum's serial.
+
+config SERIAL_SPRD_NR
+ int "Maximum number of sprd serial ports"
+ depends on SERIAL_SPRD
+ default "4"
This is not used below.
Ok, I'll remove it in v3.
Post by Mark Rutland
Post by Chunyan Zhang
+
+config SERIAL_SPRD_CONSOLE
+ bool "SPRD UART console support"
+ depends on SERIAL_SPRD=y
+ select SERIAL_CORE_CONSOLE
+ select SERIAL_EARLYCON
+ help
+ Support for early debug console using Spreadtrum's 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.
There only appears to be an earlycon driver, and not "standard serial
driver".
What happens after earlycon?
Surely there should be a real driver to take ownership of the UART?
As far as I can see it won't be possible to boot your platform to a
prompt, because earlycon will have gone before that.
Thanks,
Mark.
We are planed to add standard serial driver after this patch-set is approved.
In the first patch we contribute to the upstream, I'd like to add
architecture related code of
Spreadtrum's Sharkl, and then we will add more functions about Sharkl3
SoC step by step.

I'm very glad to read your comments, if you have any suggestions, feel
free to tell us.

Thanks,
Chunyan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Mark Rutland
2014-10-20 10:32:13 UTC
Permalink
Post by Lyra Zhang
Post by Mark Rutland
Post by Chunyan Zhang
Add serial driver for spreadtrum sharkl platform with earlycon
support at first.
---
drivers/tty/serial/Kconfig | 24 ++++++++++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/sprd-serial.c | 64 ++++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+)
create mode 100644 drivers/tty/serial/sprd-serial.c
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64..33b8f90 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -113,6 +113,30 @@ config SERIAL_SB1250_DUART_CONSOLE
If unsure, say Y.
+config SERIAL_SPRD
+ tristate "Support for SPRD serial"
+ depends on ARM || ARM64
+ select SERIAL_CORE
+ help
+ This enables the driver for the Spreadtrum's serial.
+
+config SERIAL_SPRD_NR
+ int "Maximum number of sprd serial ports"
+ depends on SERIAL_SPRD
+ default "4"
This is not used below.
Ok, I'll remove it in v3.
Post by Mark Rutland
Post by Chunyan Zhang
+
+config SERIAL_SPRD_CONSOLE
+ bool "SPRD UART console support"
+ depends on SERIAL_SPRD=y
+ select SERIAL_CORE_CONSOLE
+ select SERIAL_EARLYCON
+ help
+ Support for early debug console using Spreadtrum's 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.
There only appears to be an earlycon driver, and not "standard serial
driver".
What happens after earlycon?
Surely there should be a real driver to take ownership of the UART?
As far as I can see it won't be possible to boot your platform to a
prompt, because earlycon will have gone before that.
Thanks,
Mark.
We are planed to add standard serial driver after this patch-set is approved.
In the first patch we contribute to the upstream, I'd like to add
architecture related code of
Spreadtrum's Sharkl, and then we will add more functions about Sharkl3
SoC step by step.
The series is simple enough that the only issues I've noticed are minor.
I'm happy with that.

However, the absence of a real UART driver means that this series alone
is not sufficient to boot your platform to a usable state. Given that
the rest of the series is simply plumbing, I think it would make sense
for that to accompany a full UART driver (or perhaps some other I/O like
ethernet) such that it's possible to interact with the platform.

Thanks,
Mark.
Lyra Zhang
2014-10-20 11:15:15 UTC
Permalink
Post by Mark Rutland
Post by Lyra Zhang
Post by Mark Rutland
Post by Chunyan Zhang
Add serial driver for spreadtrum sharkl platform with earlycon
support at first.
---
drivers/tty/serial/Kconfig | 24 ++++++++++++++
drivers/tty/serial/Makefile | 1 +
drivers/tty/serial/sprd-serial.c | 64 ++++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+)
create mode 100644 drivers/tty/serial/sprd-serial.c
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 26cec64..33b8f90 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -113,6 +113,30 @@ config SERIAL_SB1250_DUART_CONSOLE
If unsure, say Y.
+config SERIAL_SPRD
+ tristate "Support for SPRD serial"
+ depends on ARM || ARM64
+ select SERIAL_CORE
+ help
+ This enables the driver for the Spreadtrum's serial.
+
+config SERIAL_SPRD_NR
+ int "Maximum number of sprd serial ports"
+ depends on SERIAL_SPRD
+ default "4"
This is not used below.
Ok, I'll remove it in v3.
Post by Mark Rutland
Post by Chunyan Zhang
+
+config SERIAL_SPRD_CONSOLE
+ bool "SPRD UART console support"
+ depends on SERIAL_SPRD=y
+ select SERIAL_CORE_CONSOLE
+ select SERIAL_EARLYCON
+ help
+ Support for early debug console using Spreadtrum's 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.
There only appears to be an earlycon driver, and not "standard serial
driver".
What happens after earlycon?
Surely there should be a real driver to take ownership of the UART?
As far as I can see it won't be possible to boot your platform to a
prompt, because earlycon will have gone before that.
Thanks,
Mark.
We are planed to add standard serial driver after this patch-set is approved.
In the first patch we contribute to the upstream, I'd like to add
architecture related code of
Spreadtrum's Sharkl, and then we will add more functions about Sharkl3
SoC step by step.
The series is simple enough that the only issues I've noticed are minor.
I'm happy with that.
However, the absence of a real UART driver means that this series alone
is not sufficient to boot your platform to a usable state. Given that
the rest of the series is simply plumbing, I think it would make sense
for that to accompany a full UART driver (or perhaps some other I/O like
ethernet) such that it's possible to interact with the platform.
Ok, I see. I'll add a full UART driver in v3.
Thanks for your suggestion.

Best regards,
Chunyan
One Thousand Gnomes
2014-10-18 21:06:15 UTC
Permalink
On Fri, 17 Oct 2014 17:54:25 +0800
Post by Chunyan Zhang
Add serial driver for spreadtrum sharkl platform with earlycon
support at first.
+#define UART_TXD 0x0000
+#define UART_RXD 0x0004
+#define UART_STS0 0x0008
+#define UART_STS1 0x000C
+#define UART_IEN 0x0010
+#define UART_ICLR 0x0014
+#define UART_CTL0 0x0018
+#define UART_CTL1 0x001C
+#define UART_CTL2 0x0020
+#define UART_CLKD0 0x0024
+#define UART_CLKD1 0x0028
+#define UART_STS2 0x002C
+
+/*line status */
+#define UART_LSR_TX_OVER (0x1<<15)
Given we use UART_ for all the 8250 defines it might be better to use
something else - SHARK_LSR_TX_OVER etc to avoid future confusion
Post by Chunyan Zhang
+static void serial_sprd_putc(struct uart_port *port, int c)
+{
+ while (!(readl(port->membase + UART_STS0) & UART_LSR_TX_OVER))
+ ;
+ writeb(c, port->membase + 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;
+}
This seems fine but it would be useful to see both the earlycon and the
main uart/console driver and how they fit together.

Alan
Orson Zhai
2014-10-20 10:23:38 UTC
Permalink
On Sun, Oct 19, 2014 at 5:06 AM, One Thousand Gnomes
Post by One Thousand Gnomes
On Fri, 17 Oct 2014 17:54:25 +0800
Post by Chunyan Zhang
Add serial driver for spreadtrum sharkl platform with earlycon
support at first.
+#define UART_TXD 0x0000
+#define UART_RXD 0x0004
+#define UART_STS0 0x0008
+#define UART_STS1 0x000C
+#define UART_IEN 0x0010
+#define UART_ICLR 0x0014
+#define UART_CTL0 0x0018
+#define UART_CTL1 0x001C
+#define UART_CTL2 0x0020
+#define UART_CLKD0 0x0024
+#define UART_CLKD1 0x0028
+#define UART_STS2 0x002C
+
+/*line status */
+#define UART_LSR_TX_OVER (0x1<<15)
Given we use UART_ for all the 8250 defines it might be better to use
something else - SHARK_LSR_TX_OVER etc to avoid future confusion
Does it matter if those macro are only used in the specific c file?
From my point of view, private register macro could be treated as
static definitions like static variable or functions in C file.
I also noted that many people use a prefix for the other
manufacturers' macro definition in source file .
I have no intention to break the habit of kernel but just for discussion.
Post by One Thousand Gnomes
Post by Chunyan Zhang
+static void serial_sprd_putc(struct uart_port *port, int c)
+{
+ while (!(readl(port->membase + UART_STS0) & UART_LSR_TX_OVER))
+ ;
+ writeb(c, port->membase + 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;
+}
This seems fine but it would be useful to see both the earlycon and the
main uart/console driver and how they fit together.
Alan
Chunyan Zhang
2014-10-17 09:54:21 UTC
Permalink
The file of-serial.txt was only for 8250 compatible UART implementations,
so renamed it to 8250.txt to avoid confusing other persons.

Signed-off-by: Chunyan Zhang <***@spreadtrum.com>
---
Documentation/devicetree/bindings/serial/8250.txt | 50 ++++++++++++++++++++
.../devicetree/bindings/serial/of-serial.txt | 50 --------------------
2 files changed, 50 insertions(+), 50 deletions(-)
create mode 100644 Documentation/devicetree/bindings/serial/8250.txt
delete mode 100644 Documentation/devicetree/bindings/serial/of-serial.txt

diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt
new file mode 100644
index 0000000..7705477
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/8250.txt
@@ -0,0 +1,50 @@
+* UART (Universal Asynchronous Receiver/Transmitter)
+
+Required properties:
+- compatible : one of:
+ - "ns8250"
+ - "ns16450"
+ - "ns16550a"
+ - "ns16550"
+ - "ns16750"
+ - "ns16850"
+ - "nvidia,tegra20-uart"
+ - "nxp,lpc3220-uart"
+ - "ibm,qpace-nwp-serial"
+ - "altr,16550-FIFO32"
+ - "altr,16550-FIFO64"
+ - "altr,16550-FIFO128"
+ - "serial" if the port type is unknown.
+- reg : offset and length of the register set for the device.
+- interrupts : should contain uart interrupt.
+- clock-frequency : the input clock frequency for the UART
+ or
+ clocks phandle to refer to the clk used as per Documentation/devicetree
+ /bindings/clock/clock-bindings.txt
+
+Optional properties:
+- current-speed : the current active speed of the UART.
+- reg-offset : offset to apply to the mapbase from the start of the registers.
+- reg-shift : quantity to shift the register offsets by.
+- reg-io-width : the size (in bytes) of the IO accesses that should be
+ performed on the device. There are some systems that require 32-bit
+ accesses to the UART (e.g. TI davinci).
+- used-by-rtas : set to indicate that the port is in use by the OpenFirmware
+ RTAS and should not be registered.
+- no-loopback-test: set to indicate that the port does not implements loopback
+ test mode
+- fifo-size: the fifo size of the UART.
+- auto-flow-control: one way to enable automatic flow control support. The
+ driver is allowed to detect support for the capability even without this
+ property.
+- has-hw-flow-control: the hardware has flow control capability.
+
+Example:
+
+ ***@80230000 {
+ compatible = "ns8250";
+ reg = <0x80230000 0x100>;
+ clock-frequency = <3686400>;
+ interrupts = <10>;
+ reg-shift = <2>;
+ };
diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt
deleted file mode 100644
index 7705477..0000000
--- a/Documentation/devicetree/bindings/serial/of-serial.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-* UART (Universal Asynchronous Receiver/Transmitter)
-
-Required properties:
-- compatible : one of:
- - "ns8250"
- - "ns16450"
- - "ns16550a"
- - "ns16550"
- - "ns16750"
- - "ns16850"
- - "nvidia,tegra20-uart"
- - "nxp,lpc3220-uart"
- - "ibm,qpace-nwp-serial"
- - "altr,16550-FIFO32"
- - "altr,16550-FIFO64"
- - "altr,16550-FIFO128"
- - "serial" if the port type is unknown.
-- reg : offset and length of the register set for the device.
-- interrupts : should contain uart interrupt.
-- clock-frequency : the input clock frequency for the UART
- or
- clocks phandle to refer to the clk used as per Documentation/devicetree
- /bindings/clock/clock-bindings.txt
-
-Optional properties:
-- current-speed : the current active speed of the UART.
-- reg-offset : offset to apply to the mapbase from the start of the registers.
-- reg-shift : quantity to shift the register offsets by.
-- reg-io-width : the size (in bytes) of the IO accesses that should be
- performed on the device. There are some systems that require 32-bit
- accesses to the UART (e.g. TI davinci).
-- used-by-rtas : set to indicate that the port is in use by the OpenFirmware
- RTAS and should not be registered.
-- no-loopback-test: set to indicate that the port does not implements loopback
- test mode
-- fifo-size: the fifo size of the UART.
-- auto-flow-control: one way to enable automatic flow control support. The
- driver is allowed to detect support for the capability even without this
- property.
-- has-hw-flow-control: the hardware has flow control capability.
-
-Example:
-
- ***@80230000 {
- compatible = "ns8250";
- reg = <0x80230000 0x100>;
- clock-frequency = <3686400>;
- interrupts = <10>;
- reg-shift = <2>;
- };
--
1.7.9.5
Mark Rutland
2014-10-17 13:12:00 UTC
Permalink
[adding Arnd to Cc, as this was his suggestion]
Post by Chunyan Zhang
The file of-serial.txt was only for 8250 compatible UART implementations,
so renamed it to 8250.txt to avoid confusing other persons.
This makes sense to me, so:

Acked-by: Mark Rutland <***@arm.com>

In future please use git format-patch -C -M when moving things around.
It should detect that this is a rename and generate a trivial diff,
rather than featuring every line of the file twice.

Thanks,
Mark.
Post by Chunyan Zhang
---
Documentation/devicetree/bindings/serial/8250.txt | 50 ++++++++++++++++++++
.../devicetree/bindings/serial/of-serial.txt | 50 --------------------
2 files changed, 50 insertions(+), 50 deletions(-)
create mode 100644 Documentation/devicetree/bindings/serial/8250.txt
delete mode 100644 Documentation/devicetree/bindings/serial/of-serial.txt
diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt
new file mode 100644
index 0000000..7705477
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/8250.txt
@@ -0,0 +1,50 @@
+* UART (Universal Asynchronous Receiver/Transmitter)
+
+ - "ns8250"
+ - "ns16450"
+ - "ns16550a"
+ - "ns16550"
+ - "ns16750"
+ - "ns16850"
+ - "nvidia,tegra20-uart"
+ - "nxp,lpc3220-uart"
+ - "ibm,qpace-nwp-serial"
+ - "altr,16550-FIFO32"
+ - "altr,16550-FIFO64"
+ - "altr,16550-FIFO128"
+ - "serial" if the port type is unknown.
+- reg : offset and length of the register set for the device.
+- interrupts : should contain uart interrupt.
+- clock-frequency : the input clock frequency for the UART
+ or
+ clocks phandle to refer to the clk used as per Documentation/devicetree
+ /bindings/clock/clock-bindings.txt
+
+- current-speed : the current active speed of the UART.
+- reg-offset : offset to apply to the mapbase from the start of the registers.
+- reg-shift : quantity to shift the register offsets by.
+- reg-io-width : the size (in bytes) of the IO accesses that should be
+ performed on the device. There are some systems that require 32-bit
+ accesses to the UART (e.g. TI davinci).
+- used-by-rtas : set to indicate that the port is in use by the OpenFirmware
+ RTAS and should not be registered.
+- no-loopback-test: set to indicate that the port does not implements loopback
+ test mode
+- fifo-size: the fifo size of the UART.
+- auto-flow-control: one way to enable automatic flow control support. The
+ driver is allowed to detect support for the capability even without this
+ property.
+- has-hw-flow-control: the hardware has flow control capability.
+
+
+ compatible = "ns8250";
+ reg = <0x80230000 0x100>;
+ clock-frequency = <3686400>;
+ interrupts = <10>;
+ reg-shift = <2>;
+ };
diff --git a/Documentation/devicetree/bindings/serial/of-serial.txt b/Documentation/devicetree/bindings/serial/of-serial.txt
deleted file mode 100644
index 7705477..0000000
--- a/Documentation/devicetree/bindings/serial/of-serial.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-* UART (Universal Asynchronous Receiver/Transmitter)
-
- - "ns8250"
- - "ns16450"
- - "ns16550a"
- - "ns16550"
- - "ns16750"
- - "ns16850"
- - "nvidia,tegra20-uart"
- - "nxp,lpc3220-uart"
- - "ibm,qpace-nwp-serial"
- - "altr,16550-FIFO32"
- - "altr,16550-FIFO64"
- - "altr,16550-FIFO128"
- - "serial" if the port type is unknown.
-- reg : offset and length of the register set for the device.
-- interrupts : should contain uart interrupt.
-- clock-frequency : the input clock frequency for the UART
- or
- clocks phandle to refer to the clk used as per Documentation/devicetree
- /bindings/clock/clock-bindings.txt
-
-- current-speed : the current active speed of the UART.
-- reg-offset : offset to apply to the mapbase from the start of the registers.
-- reg-shift : quantity to shift the register offsets by.
-- reg-io-width : the size (in bytes) of the IO accesses that should be
- performed on the device. There are some systems that require 32-bit
- accesses to the UART (e.g. TI davinci).
-- used-by-rtas : set to indicate that the port is in use by the OpenFirmware
- RTAS and should not be registered.
-- no-loopback-test: set to indicate that the port does not implements loopback
- test mode
-- fifo-size: the fifo size of the UART.
-- auto-flow-control: one way to enable automatic flow control support. The
- driver is allowed to detect support for the capability even without this
- property.
-- has-hw-flow-control: the hardware has flow control capability.
-
-
- compatible = "ns8250";
- reg = <0x80230000 0x100>;
- clock-frequency = <3686400>;
- interrupts = <10>;
- reg-shift = <2>;
- };
--
1.7.9.5
Arnd Bergmann
2014-10-20 13:47:42 UTC
Permalink
Post by Chunyan Zhang
The file of-serial.txt was only for 8250 compatible UART implementations,
so renamed it to 8250.txt to avoid confusing other persons.
---
Documentation/devicetree/bindings/serial/8250.txt | 50 ++++++++++++++++++++
.../devicetree/bindings/serial/of-serial.txt | 50 --------------------
2 files changed, 50 insertions(+), 50 deletions(-)
Patch looks good, but please use 'git format-patch -M' when generating it,
to avoid having the whole add/remove in the patch, for easier review.

Arnd
Loading...