Skip to contentSkip to conversation

arm64: add new support Samsung GH7 SoC and SSDK board

PATCH Superseded Kukjin Kim 2 participants 6 messages Mar 17, 2014 – Mar 21, 2014

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

v3 cover arm64: add new support Samsung GH7 SoC and SSDK board

This adds support for Samsung ARMv8 core based GH7 SoC and its evaluation SSDK board.

Changes since v2:
- add comment about reserved memory
- reduced size of reserved memory
- add 4 more cores
- add specific compatible string for pmu
- change model strin for SSDK-GH7 board
- add DT ml in Cc

Note, still missing clocks for serial and it will be added later.

Changes since v1:
- remove model and compatible in dtsi
- remove inclusion /dts-v1/ in dtsi
- add aliase for serial0
- remove compatible cortex-a9-gic for gic
- remove clock-frequncy for timer
- change number of address-cells and size-cells to 2
- enable ARCH_GH7 in single defconfig for arm64

There were many comments for SoC vendor's Kconfig entry but now I have no choice except adding ARCH_GH7 and enabling it in current single defconfig for arm64 by default.

[PATCH v3 1/3] arm64: dts: add initial dts for Samsung GH7 SoC and SSDK-GH7 board [PATCH v3 2/3] arm64: defconfig: Enable ARCH_GH7 by default
[PATCH v3 3/3] Documentation: DT: add new entry for Samsung GH7 SoC and SSDK board

author
#1 lore raw

PATCH v3 1/3 arm64: dts: add initial dts for Samsung GH7 SoC and SSDK-GH7 board

---
 arch/arm64/boot/dts/samsung-gh7.dtsi     | 134 +++++++++++++++++++++++++++++++
 arch/arm64/boot/dts/samsung-ssdk-gh7.dts |  26 ++++++
 2 files changed, 160 insertions(+)
 create mode 100644 arch/arm64/boot/dts/samsung-gh7.dtsi
 create mode 100644 arch/arm64/boot/dts/samsung-ssdk-gh7.dts
arch/arm64/boot/dts/samsung-gh7.dtsi new file +134 -0
new file mode 100644
index 0000000..d3ab914
@@ -0,0 +1,134 @@
+/*
+ * SAMSUNG GH7 SoC device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/memreserve/ 0xFEC00000 0x1400000;	/* EL3 monitor, secure intepreter */
+
+/ {
+	interrupt-parent = <&gic>;
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		serial0 = "/amba/uart at 12c00000";
+	};
+
+	cpus {
+		#address-cells = <2>;
+		#size-cells = <0>;
+
+		cpu at 000 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x000>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 001 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x001>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 002 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x002>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 003 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x003>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 100 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x100>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 101 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x101>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 102 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x102>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+		cpu at 103 {
+			device_type = "cpu";
+			compatible = "arm,armv8";
+			reg = <0x0 0x103>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x8000fff8>;
+		};
+	};
+
+	gic: interrupt-controller at 1C000000 {
+		compatible = "arm,cortex-a15-gic";
+		#interrupt-cells = <3>;
+		interrupt-controller;
+		reg = <0x0 0x1C001000 0 0x1000>,	/* GIC Dist */
+		      <0x0 0x1C002000 0 0x1000>,	/* GIC CPU */
+		      <0x0 0x1C004000 0 0x2000>,	/* GIC VCPU Control */
+		      <0x0 0x1C006000 0 0x2000>;	/* GIC VCPU */
+		interrupts = <1 9 0xf04>;	/* GIC Maintenence IRQ */
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <1 13 0xff01>,	/* Secure Phys IRQ */
+			     <1 14 0xff01>,	/* Non-secure Phys IRQ */
+			     <1 11 0xff01>,	/* Virt IRQ */
+			     <1 10 0xff01>;	/* Hyp IRQ */
+	};
+
+	pmu {
+		compatible = "samsung,gh7-pmu", "armv8-pmuv3";
+		interrupts = <0 294 0>,
+			     <0 295 0>,
+			     <0 296 0>,
+			     <0 297 0>,
+			     <0 298 0>,
+			     <0 299 0>,
+			     <0 300 0>,
+			     <0 301 0>;
+	};
+
+	amba {
+		compatible = "arm,amba-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		serial at 12c00000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x12c00000 0 0x10000>;
+			interrupts = <0 418 0>;
+		};
+
+		serial at 12c20000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x12c20000 0 0x10000>;
+			interrupts = <0 420 0>;
+		};
+	};
+};
arch/arm64/boot/dts/samsung-ssdk-gh7.dts new file +26 -0
new file mode 100644
index 0000000..80bd93c
@@ -0,0 +1,26 @@
+/*
+ * SAMSUNG SSDK-GH7 board device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/dts-v1/;
+#include "samsung-gh7.dtsi"
+
+/ {
+	model = "samsung,SSDK-GH7";
+	compatible = "samsung,ssdk-gh7", "samsung,gh7";
+
+	chosen {
+	};
+
+	memory at 80000000 {
+		device_type = "memory";
+		reg = <0x00000000 0x80000000 0 0x80000000>;
+	};
+};
Signature · 1 line
1.8.2.1.339.g52a3e01
reviewer
#2 lore raw

PATCH v3 1/3 arm64: dts: add initial dts for Samsung GH7 SoC and SSDK-GH7 board

Hi,

Quoted 18 lines · Kukjin Kim
---
 arch/arm64/boot/dts/samsung-gh7.dtsi     | 134 +++++++++++++++++++++++++++++++
 arch/arm64/boot/dts/samsung-ssdk-gh7.dts |  26 ++++++
 2 files changed, 160 insertions(+)
 create mode 100644 arch/arm64/boot/dts/samsung-gh7.dtsi
 create mode 100644 arch/arm64/boot/dts/samsung-ssdk-gh7.dts
arch/arm64/boot/dts/samsung-gh7.dtsi new file +2 -0
new file mode 100644
index 0000000..d3ab914
@@ -0,0 +1,134 @@
+/*
+ * SAMSUNG GH7 SoC device tree source

arch/arm64/boot/dts/samsung-gh7.dtsi line 12

Quoted 10 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +10 -0
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/memreserve/ 0xFEC00000 0x1400000;	/* EL3 monitor, secure intepreter */

As I've mentioned, I'm concerned that this is even in the non-secure address space that the kernel can access. Why is this not hidden from the kernel entirely? Why is it expected to be mapped in and reserved?

Additionally, the memory the used by the spin-table (0x0 0x8000fff8) has not been reserved, and thus the kernel is free to clobber it.

[...]

arch/arm64/boot/dts/samsung-gh7.dtsi line 86

Quoted 2 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +2 -0
+	gic: interrupt-controller at 1C000000 {
+		compatible = "arm,cortex-a15-gic";

For targeting any future workarounds I would very much prefer a more specific string.

[...]

arch/arm64/boot/dts/samsung-gh7.dtsi line 114

Quoted 11 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +11 -0
+	pmu {
+		compatible = "samsung,gh7-pmu", "armv8-pmuv3";
+		interrupts = <0 294 0>,
+			     <0 295 0>,
+			     <0 296 0>,
+			     <0 297 0>,
+			     <0 298 0>,
+			     <0 299 0>,
+			     <0 300 0>,
+			     <0 301 0>;
+	};

These are all missing a trigger type (thus making them unusable), and as "GH7" is the SoC name rather than the CPU name, the compatible string is somewhat bad.

Quoted 8 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +8 -0
+
+	amba {
+		compatible = "arm,amba-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		serial at 12c00000 {

arch/arm64/boot/dts/samsung-gh7.dtsi line 132

Quoted 10 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +10 -0
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x12c00000 0 0x10000>;
+			interrupts = <0 418 0>;
+		};
+
+		serial at 12c20000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x12c20000 0 0x10000>;
+			interrupts = <0 420 0>;
+		};

While the primecell bindings and PL011 bindings state that clocks are optional, the primecell bus code requires a clock named apb_pclk, and the pl011 driver requires a clock (which it expects to be UARTCLK) to acquire the frequency from. As neither are provided I do not see how this DT could possibly be used to boot a usable system.

Additionally the interrupt trigger types are missing.

Given that these are the only IO devices described in the dtsi/dts combination, and they do not appear to be usable, what is the point in merging this?

Cheers,
Mark.

author
#3 lore raw

PATCH v3 1/3 arm64: dts: add initial dts for Samsung GH7 SoC and SSDK-GH7 board

Quoted 3 lines · Mark Rutland

Hi,

Hi Mark,

[...]

Quoted 6 lines
Quoted 1 line

+/memreserve/ 0xFEC00000 0x1400000; /* EL3 monitor, secure intepreter */

As I've mentioned, I'm concerned that this is even in the non-secure address space that the kernel can access. Why is this not hidden from the kernel entirely? Why is it expected to be mapped in and reserved?

OK, I will make kernel cannot access the memory area with hiding.

Quoted 3 lines

Additionally, the memory the used by the spin-table (0x0 0x8000fff8) has not been reserved, and thus the kernel is free to clobber it.

Oops, I missed. OK I will add following instead of above.

+/memreserve/ 0x80000000 0x00010000;

Quoted 8 lines

[...]

arch/arm64/boot/dts/samsung-gh7.dtsi line 86

Quoted 2 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +2 -0
+	gic: interrupt-controller at 1C000000 {
+		compatible = "arm,cortex-a15-gic";

For targeting any future workarounds I would very much prefer a more specific string.

If any workarounds are required later, will add specific string then.

Quoted 18 lines

[...]

arch/arm64/boot/dts/samsung-gh7.dtsi line 114

Quoted 11 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +11 -0
+	pmu {
+		compatible = "samsung,gh7-pmu", "armv8-pmuv3";
+		interrupts = <0 294 0>,
+			     <0 295 0>,
+			     <0 296 0>,
+			     <0 297 0>,
+			     <0 298 0>,
+			     <0 299 0>,
+			     <0 300 0>,
+			     <0 301 0>;
+	};

These are all missing a trigger type (thus making them unusable), and as "GH7" is the SoC name rather than the CPU name, the compatible string is somewhat bad.

Oops, it should be 8.

And yes, as I've mentioned "GH7" is SoC name not CPU name.

I'm still thinking _really_ I need to use CPU specific name for GH7 SoC because we don't need to handle for the specific CPU implementation in kernel even we didn't name it.

Quoted 25 lines
Quoted 8 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +8 -0
+
+	amba {
+		compatible = "arm,amba-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		serial at 12c00000 {

arch/arm64/boot/dts/samsung-gh7.dtsi line 132

Quoted 10 lines
arch/arm64/boot/dts/samsung-gh7.dtsi new file +10 -0
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x12c00000 0 0x10000>;
+			interrupts = <0 418 0>;
+		};
+
+		serial at 12c20000 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0 0x12c20000 0 0x10000>;
+			interrupts = <0 420 0>;
+		};

While the primecell bindings and PL011 bindings state that clocks are optional, the primecell bus code requires a clock named apb_pclk, and the pl011 driver requires a clock (which it expects to be UARTCLK) to acquire the frequency from. As neither are provided I do not see how this DT could possibly be used to boot a usable system.

Quoted 6 lines

Additionally the interrupt trigger types are missing.

Given that these are the only IO devices described in the dtsi/dts combination, and they do not appear to be usable, what is the point in merging this?

Definitely, it is meaningful because we can enhance everything more based on this for the mass product.

Thanks for your time.

- Kukjin

author
#4 lore raw

PATCH v3 2/3 arm64: defconfig: Enable ARCH_GH7 by default

In reply to Kukjin Kim

This patch adds support for Samsung GH7 SoC in arm64/Kconfig and enable Samsung GH7 based SSDK_GH7 in single defconfig for arm64.

Cc Catalin Marinas <[email protected]>
---
 arch/arm64/Kconfig           | 5 +++++
 arch/arm64/boot/dts/Makefile | 1 +
 arch/arm64/configs/defconfig | 1 +
 3 files changed, 7 insertions(+)
arch/arm64/Kconfig +5 -0
index dd4327f..7d71823 100644
@@ -111,6 +111,11 @@ source "kernel/Kconfig.freezer"
 
 menu "Platform selection"
 
+config ARCH_GH7
+	bool "Samsung ARMv8 GH7 SoC"
+	help
+	  This enables support for Samsung GH7 SoC
+
 config ARCH_VEXPRESS
 	bool "ARMv8 software model (Versatile Express)"
 	select ARCH_REQUIRE_GPIOLIB
arch/arm64/boot/dts/Makefile +1 -0
index c52bdb0..54fb0cf 100644
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_ARCH_GH7) += samsung-ssdk-gh7.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb foundation-v8.dtb
 dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
 
arch/arm64/configs/defconfig +1 -0
index 84139be..d683890 100644
@@ -23,6 +23,7 @@ CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_GH7=y
 CONFIG_ARCH_VEXPRESS=y
 CONFIG_ARCH_XGENE=y
 CONFIG_SMP=y
Signature · 1 line
1.8.2.1.339.g52a3e01
author
#5 lore raw

PATCH v3 3/3 Documentation: DT: add new entry for Samsung GH7 SoC and SSDK board

In reply to Kukjin Kim
---
 Documentation/devicetree/bindings/arm/samsung-boards.txt | 9 +++++++++
 1 file changed, 9 insertions(+)
Documentation/devicetree/bindings/arm/samsung-boards.txt +9 -0
index 2168ed3..d6b5493 100644
@@ -16,3 +16,12 @@ Optional:
 		compatible = "samsung,secure-firmware";
 		reg = <0x0203F000 0x1000>;
 	};
+
+* Samsung's GH7 based SSDK-GH7 evaluation board
+
+SSDK-GH7 evaluation board is based on Samsung's GH7 SoC which has ARMv8 cores.
+
+Required root node properties:
+    - compatible = should be one or more of the following.
+        (a) "samsung,ssdk-gh7" - for Samsung's SSDK-GH7 eval board.
+        (b) "samsung,gh7"  - for boards based on GH7 SoC.
Signature · 1 line
1.8.2.1.339.g52a3e01