Skip to contentSkip to conversation

Initial Device Tree support for S3C64xx

PATCH Superseded Tomasz Figa 2 participants 7 messages Mar 9, 2013 – Mar 25, 2013

Subsystems (7)

v4 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v4 cover Initial Device Tree support for S3C64xx

This series adds Device Tree support for Samsung S3C64xx SoC series.

It fixes several problems preventing from booting an S3C64xx-based system using Device Tree, adds all the infrastructure for Device Tree-based board support, including mach-s3c64xx-dt and dts include files for S3C64xx SoCs, and (very) basic device tree source for FriendlyARM Mini6410 board.

Current support is very limited and allows only basic bootup with UART and SDHCI, but should be fine as a start and will be extended in future, hopefully with help of S3C64xx board maintainers.

This series depends on my other series reworking samsung-time for multiplatform:
[PATCH v3 00/12] ARM: samsung-time: Prepare for multiplatform support
http://thread.gmane.org/gmane.linux.kernel.samsung-soc/16664

Changes since v3:
- Rebased onto current for-next branch of Kgene's tree
- Updated timer node for next version of samsung-time patches
- Replaced local s3c64xx_dt_init_irq with irqchip_init

Changes since v2:
- Updated timer node for next version of samsung-time patches

Changes since v1:
- Dropped two VIC-related patches that are no longer necessary
- Added Device Tree-based instantation of system timers
- Corrected VIC interrupt specifiers
- Adjusted CPU compatible values and dropped @id

Tomasz Figa (4):
ARM: common: vic: Parse interrupt and resume masks from device tree
ARM: s3c64xx: Add board file for boot using Device Tree
ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs
ARM: dts: Add dts file for S3C6410-based Mini6410 board

 Documentation/devicetree/bindings/arm/vic.txt |   6 ++
 arch/arm/boot/dts/Makefile                    |   1 +
 arch/arm/boot/dts/s3c6400.dtsi                |  33 ++++++++
 arch/arm/boot/dts/s3c6410-mini6410.dts        |  50 ++++++++++++
 arch/arm/boot/dts/s3c6410.dtsi                |  33 ++++++++
 arch/arm/boot/dts/s3c64xx.dtsi                | 106 ++++++++++++++++++++++++++
 arch/arm/mach-s3c64xx/Kconfig                 |  14 ++++
 arch/arm/mach-s3c64xx/Makefile                |   1 +
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c       |  83 ++++++++++++++++++++
 drivers/irqchip/irq-vic.c                     |   7 +-
 10 files changed, 333 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/s3c6400.dtsi
 create mode 100644 arch/arm/boot/dts/s3c6410-mini6410.dts
 create mode 100644 arch/arm/boot/dts/s3c6410.dtsi
 create mode 100644 arch/arm/boot/dts/s3c64xx.dtsi
 create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH v4 1/4 ARM: common: vic: Parse interrupt and resume masks from device tree

This patch extends vic_of_init to parse valid interrupt sources and resume sources masks from device tree.

If mask values are not specified in device tree, all sources are assumed to be valid, as before this patch.

---
 Documentation/devicetree/bindings/arm/vic.txt | 6 ++++++
 drivers/irqchip/irq-vic.c                     | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/vic.txt +6 -0
index 266716b..bb7137c 100644
@@ -18,6 +18,9 @@ Required properties:
 Optional properties:
 
 - interrupts : Interrupt source for parent controllers if the VIC is nested.
+- interrupt-mask : Bit mask of valid interrupt sources (defaults to all valid)
+- wakeup-mask : Bit mask of interrupt sources that can wake up the system
+  (defaults to all allowed)
 
 Example:
 
@@ -26,4 +29,7 @@ Example:
 		interrupt-controller;
 		#interrupt-cells = <1>;
 		reg = <0x60000 0x1000>;
+
+		interrupt-mask = <0xffffff7f>;
+		wakeup-mask = <0x0000ff7f>;
 	};
drivers/irqchip/irq-vic.c +6 -1
index 3cf97aa..61602df 100644
@@ -468,6 +468,8 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
 int __init vic_of_init(struct device_node *node, struct device_node *parent)
 {
 	void __iomem *regs;
+	u32 interrupt_mask = ~0;
+	u32 wakeup_mask = ~0;
 
 	if (WARN(parent, "non-root VICs are not supported"))
 		return -EINVAL;
@@ -476,10 +478,13 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
 	if (WARN_ON(!regs))
 		return -EIO;
 
+	of_property_read_u32(node, "interrupt-mask", &interrupt_mask);
+	of_property_read_u32(node, "wakeup-mask", &wakeup_mask);
+
 	/*
 	 * Passing 0 as first IRQ makes the simple domain allocate descriptors
 	 */
-	__vic_init(regs, 0, ~0, ~0, node);
+	__vic_init(regs, 0, interrupt_mask, wakeup_mask, node);
 
 	return 0;
 }
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH v4 2/4 ARM: s3c64xx: Add board file for boot using Device Tree

In reply to Tomasz Figa

This patch adds board file that will be used to boot S3C64xx-based boards using Device Tree.

---
 arch/arm/mach-s3c64xx/Kconfig           | 14 ++++++
 arch/arm/mach-s3c64xx/Makefile          |  1 +
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 83 +++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
arch/arm/mach-s3c64xx/Kconfig +14 -0
index 283cb77..771e2c2 100644
@@ -311,3 +311,17 @@ config MACH_WLF_CRAGG_6410
 	select SAMSUNG_GPIO_EXTRA128
 	help
 	  Machine support for the Wolfson Cragganmore S3C6410 variant.
+
+config MACH_S3C64XX_DT
+	bool "Samsung S3C6400/S3C6410 machine using Device Tree"
+	select CLKSRC_OF
+	select CPU_S3C6400
+	select CPU_S3C6410
+	select USE_OF
+	help
+	  Machine support for Samsung S3C6400/S3C6410 machines with Device Tree
+	  enabled.
+	  Select this if a fdt blob is available for your S3C64XX SoC based
+	  board.
+	  Note: This is under development and not all peripherals can be
+	  supported with this machine file.
arch/arm/mach-s3c64xx/Makefile +1 -0
index f9ce1dc..59b3d06 100644
@@ -58,3 +58,4 @@ obj-$(CONFIG_MACH_SMARTQ7)		+= mach-smartq7.o
 obj-$(CONFIG_MACH_SMDK6400)		+= mach-smdk6400.o
 obj-$(CONFIG_MACH_SMDK6410)		+= mach-smdk6410.o
 obj-$(CONFIG_MACH_WLF_CRAGG_6410)	+= mach-crag6410.o mach-crag6410-module.o
+obj-$(CONFIG_MACH_S3C64XX_DT)		+= mach-s3c64xx-dt.o
arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
1.8.1.5
#3 lore raw

PATCH v4 3/4 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

In reply to Tomasz Figa

This patch adds basic device tree definitions for Samsung S3C64xx SoCs.

Since all the SoCs in the series are very similar, the files are created hierarchically - one file for the whole series and then separate files for particular SoCs including the common one.

---
 arch/arm/boot/dts/s3c6400.dtsi |  33 +++++++++++++
 arch/arm/boot/dts/s3c6410.dtsi |  33 +++++++++++++
 arch/arm/boot/dts/s3c64xx.dtsi | 106 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 172 insertions(+)
 create mode 100644 arch/arm/boot/dts/s3c6400.dtsi
 create mode 100644 arch/arm/boot/dts/s3c6410.dtsi
 create mode 100644 arch/arm/boot/dts/s3c64xx.dtsi
arch/arm/boot/dts/s3c6400.dtsi new file +33 -0
new file mode 100644
index 0000000..76106b8
@@ -0,0 +1,33 @@
+/*
+ * Samsung's S3C6400 SoC device tree source
+ *
+ * Copyright (c) 2013 Tomasz Figa <[email protected]>
+ *
+ * Samsung's S3C6400 SoC device nodes are listed in this file. S3C6400
+ * based board files can include this file and provide values for board specfic
+ * bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in
+ * S3C6400 SoC. As device tree coverage for S3C6400 increases, additional
+ * nodes can be added to this file.
+ *
+ * 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.
+*/
+
+/include/ "s3c64xx.dtsi"
+
+/ {
+	compatible = "samsung,s3c6400";
+
+	vic0: interrupt-controller at 71200000 {
+		interrupt-mask = <0xfffffe1f>;
+		wakeup-mask = <0x00200004>;
+	};
+
+	vic1: interrupt-controller at 71300000 {
+		interrupt-mask = <0xffffffff>;
+		wakeup-mask = <0x53020000>;
+	};
+};
arch/arm/boot/dts/s3c6410.dtsi new file +33 -0
new file mode 100644
index 0000000..4a74df9
@@ -0,0 +1,33 @@
+/*
+ * Samsung's S3C6410 SoC device tree source
+ *
+ * Copyright (c) 2013 Tomasz Figa <[email protected]>
+ *
+ * Samsung's S3C6410 SoC device nodes are listed in this file. S3C6410
+ * based board files can include this file and provide values for board specfic
+ * bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in
+ * S3C6410 SoC. As device tree coverage for S3C6410 increases, additional
+ * nodes can be added to this file.
+ *
+ * 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.
+*/
+
+/include/ "s3c64xx.dtsi"
+
+/ {
+	compatible = "samsung,s3c6410";
+
+	vic0: interrupt-controller at 71200000 {
+		interrupt-mask = <0xffffff7f>;
+		wakeup-mask = <0x00200004>;
+	};
+
+	vic1: interrupt-controller at 71300000 {
+		interrupt-mask = <0xffffffff>;
+		wakeup-mask = <0x53020000>;
+	};
+};
arch/arm/boot/dts/s3c64xx.dtsi new file +106 -0

106 lines not on this page · raw message

Signature · 1 line
1.8.1.5
#4 lore raw

PATCH v4 4/4 ARM: dts: Add dts file for S3C6410-based Mini6410 board

In reply to Tomasz Figa

This patch adds basic device tree sources for FriendlyARM Mini6410 board based on Samsung S3C6410 SoC.

---
 arch/arm/boot/dts/Makefile             |  1 +
 arch/arm/boot/dts/s3c6410-mini6410.dts | 50 ++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 arch/arm/boot/dts/s3c6410-mini6410.dts
arch/arm/boot/dts/Makefile +1 -0
index d3cd880..1a370e6 100644
@@ -137,6 +137,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
 	hrefprev60.dtb \
 	hrefv60plus.dtb \
 	ccu9540.dtb
+dtb-$(CONFIG_ARCH_S3C64XX) += s3c6410-mini6410.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
 	r8a7740-armadillo800eva.dtb \
 	sh73a0-kzm9g.dtb \
arch/arm/boot/dts/s3c6410-mini6410.dts new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
1.8.1.5
#5 lore raw

v4 cover Initial Device Tree support for S3C64xx

In reply to Tomasz Figa

Hi,

Quoted 31 lines · On Saturday 09 of March 2013 21:29:31 Tomasz Figa wrote:

This series adds Device Tree support for Samsung S3C64xx SoC series.

It fixes several problems preventing from booting an S3C64xx-based system using Device Tree, adds all the infrastructure for Device Tree-based board support, including mach-s3c64xx-dt and dts include files for S3C64xx SoCs, and (very) basic device tree source for FriendlyARM Mini6410 board.

Current support is very limited and allows only basic bootup with UART and SDHCI, but should be fine as a start and will be extended in future, hopefully with help of S3C64xx board maintainers.

This series depends on my other series reworking samsung-time for
multiplatform: [PATCH v3 00/12] ARM: samsung-time: Prepare for multiplatform support
http://thread.gmane.org/gmane.linux.kernel.samsung-soc/16664

Changes since v3:
- Rebased onto current for-next branch of Kgene's tree
- Updated timer node for next version of samsung-time patches
- Replaced local s3c64xx_dt_init_irq with irqchip_init

Changes since v2:
- Updated timer node for next version of samsung-time patches

Changes since v1:
- Dropped two VIC-related patches that are no longer necessary
- Added Device Tree-based instantation of system timers
- Corrected VIC interrupt specifiers
- Adjusted CPU compatible values and dropped @id

Quoted 5 lines

Tomasz Figa (4):
ARM: common: vic: Parse interrupt and resume masks from device tree
ARM: s3c64xx: Add board file for boot using Device Tree
ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs
ARM: dts: Add dts file for S3C6410-based Mini6410 board

Any comments for this series?

Best regards,
Tomasz

#6 lore raw

v4 cover Initial Device Tree support for S3C64xx

Quoted 35 lines · Tomasz Figa

Hi,

Quoted 31 lines · On Saturday 09 of March 2013 21:29:31 Tomasz Figa wrote:

This series adds Device Tree support for Samsung S3C64xx SoC series.

It fixes several problems preventing from booting an S3C64xx-based system using Device Tree, adds all the infrastructure for Device Tree-based board support, including mach-s3c64xx-dt and dts include files for S3C64xx SoCs, and (very) basic device tree source for FriendlyARM Mini6410 board.

Current support is very limited and allows only basic bootup with UART and SDHCI, but should be fine as a start and will be extended in future, hopefully with help of S3C64xx board maintainers.

This series depends on my other series reworking samsung-time for
multiplatform: [PATCH v3 00/12] ARM: samsung-time: Prepare for multiplatform support
http://thread.gmane.org/gmane.linux.kernel.samsung-soc/16664

Changes since v3:
- Rebased onto current for-next branch of Kgene's tree
- Updated timer node for next version of samsung-time patches
- Replaced local s3c64xx_dt_init_irq with irqchip_init

Changes since v2:
- Updated timer node for next version of samsung-time patches

Changes since v1:
- Dropped two VIC-related patches that are no longer necessary
- Added Device Tree-based instantation of system timers
- Corrected VIC interrupt specifiers
- Adjusted CPU compatible values and dropped @id

Quoted 8 lines
Quoted 5 lines

Tomasz Figa (4):
ARM: common: vic: Parse interrupt and resume masks from device tree
ARM: s3c64xx: Add board file for boot using Device Tree
ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs
ARM: dts: Add dts file for S3C6410-based Mini6410 board

Any comments for this series?

Basically, looks good to me but I need to check your samsung-time patches, if any updates, let you know.

Thanks.

- Kukjin