Skip to contentSkip to conversation

Initial Device Tree support for S3C64xx

PATCH New Tomasz Figa 6 participants 18 messages Jan 13, 2013 – Jan 28, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Initial Device Tree support for S3C64xx

This series is 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.

Tomasz Figa (6):
ARM: common: vic: Parse interrupt and resume masks from device tree
ARM: common: vic: Fix invalid first IRQ number in OF-based
registration
ARM: s3c64xx: Add support for OF-based VIC initialization
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                | 97 +++++++++++++++++++++++++++
 arch/arm/common/vic.c                         |  9 ++-
 arch/arm/mach-s3c64xx/Kconfig                 | 13 ++++
 arch/arm/mach-s3c64xx/Makefile                |  1 +
 arch/arm/mach-s3c64xx/common.c                | 16 +++++
 arch/arm/mach-s3c64xx/common.h                |  4 ++
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c       | 84 +++++++++++++++++++++++
 12 files changed, 345 insertions(+), 2 deletions(-)
 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
#1 lore raw

PATCH 1/6 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 ++++++
 arch/arm/common/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>;
 	};
arch/arm/common/vic.c +6 -1
index e4df17c..c2889da 100644
@@ -407,6 +407,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;
@@ -415,10 +417,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 -1 as first IRQ makes the simple domain allocate descriptors
 	 */
-	__vic_init(regs, -1, ~0, ~0, node);
+	__vic_init(regs, -1, interrupt_mask, wakeup_mask, node);
 
 	return 0;
 }
Signature · 1 line
1.8.1
#2 lore raw

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

Quoted 17 lines · Tomasz Figa

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 ++++++
 arch/arm/common/vic.c                         | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/vic.txt +0 -0
index 266716b..bb7137c 100644

Documentation/devicetree/bindings/arm/vic.txt Required properties: · line 21

Quoted 4 lines
Documentation/devicetree/bindings/arm/vic.txt +1 -0
@@ -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)

Can you explain why this is needed and is not just the OR of all interrupts described in the DT?

Documentation/devicetree/bindings/arm/vic.txt Required properties: · line 23

Quoted 2 lines
Documentation/devicetree/bindings/arm/vic.txt +2 -0
+- wakeup-mask : Bit mask of interrupt sources that can wake up the system
+  (defaults to all allowed)

Seems like this would be all VIC interrupts unless the wake-up handling is done in some shadow controller. If the former is true, then wake-up capability is really a property of individual devices. If the later, then this property would belong in that shadow controller.

Rob

Quoted 40 lines
Documentation/devicetree/bindings/arm/vic.txt +3 -0
 Example:
 
@@ -26,4 +29,7 @@ Example:
 		interrupt-controller;
 		#interrupt-cells = <1>;
 		reg = <0x60000 0x1000>;
+
+		interrupt-mask = <0xffffff7f>;
+		wakeup-mask = <0x0000ff7f>;
 	};
arch/arm/common/vic.c +6 -1
index e4df17c..c2889da 100644
@@ -407,6 +407,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;
@@ -415,10 +417,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 -1 as first IRQ makes the simple domain allocate descriptors
 	 */
-	__vic_init(regs, -1, ~0, ~0, node);
+	__vic_init(regs, -1, interrupt_mask, wakeup_mask, node);
 
 	return 0;
 }
#3 lore raw

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

Hi Rob,

2013/1/14 Rob Herring <[email protected]>:

Quoted 20 lines · Tomasz Figa
Quoted 19 lines

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 ++++++
 arch/arm/common/vic.c                         | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/vic.txt +0 -0
index 266716b..bb7137c 100644
@@ -18,6 +18,9 @@ Required properties:
 Optional properties:
 
Quoted 5 lines

Documentation/devicetree/bindings/arm/vic.txt Required properties: · line 21

Quoted 2 lines
Documentation/devicetree/bindings/arm/vic.txt +1 -0
 - interrupts : Interrupt source for parent controllers if the VIC is nested.
+- interrupt-mask : Bit mask of valid interrupt sources (defaults to all valid)

Can you explain why this is needed and is not just the OR of all interrupts described in the DT?

Well, it depends what you mean with interrupts described in the DT.

Basically this mask is used for sanity checks of request_irq calls, by denying interrupts non-existent on given platform.

Quoted 7 lines

Documentation/devicetree/bindings/arm/vic.txt Required properties: · line 23

Quoted 2 lines
Documentation/devicetree/bindings/arm/vic.txt +2 -0
+- wakeup-mask : Bit mask of interrupt sources that can wake up the system
+  (defaults to all allowed)

Seems like this would be all VIC interrupts unless the wake-up handling is done in some shadow controller. If the former is true, then wake-up capability is really a property of individual devices. If the later, then this property would belong in that shadow controller.

Yes, there is a shadow controller used for configuring which of the available wake-up signals shall be used.

Still, I don't see how I should model it in the device tree, since its VIC whose set_irq_wake callback is called.

Before Device Tree, both interrupt and wake-up masks were being passed as arguments to vic_init function. This is what made me add them as DT attributes of VIC.

Best regards,
Tomasz Figa

P.S. Rob, sorry for the original message. I have clicked "reply" instead of "reply to all" in the mobile GMail client.

Quoted 43 lines

Rob

Quoted 40 lines
Documentation/devicetree/bindings/arm/vic.txt +3 -0
 Example:
 
@@ -26,4 +29,7 @@ Example:
              interrupt-controller;
              #interrupt-cells = <1>;
              reg = <0x60000 0x1000>;
+
+             interrupt-mask = <0xffffff7f>;
+             wakeup-mask = <0x0000ff7f>;
      };
arch/arm/common/vic.c +6 -1
index e4df17c..c2889da 100644
@@ -407,6 +407,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;
@@ -415,10 +417,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 -1 as first IRQ makes the simple domain allocate descriptors
       */
-     __vic_init(regs, -1, ~0, ~0, node);
+     __vic_init(regs, -1, interrupt_mask, wakeup_mask, node);
 
      return 0;
 }
#4 lore raw

PATCH 2/6 ARM: common: vic: Fix invalid first IRQ number in OF-based registration

In reply to Tomasz Figa

Without this patch, vic_of_init passed -1 as first IRQ number to __vic_init (as signed int), then to vic_register (now as unsigned int equals to 0xffffffff) and finally to irq_domain_add_simple (again as unsigned 0xffffffff), which tries to allocate irq descriptors starting from IRQ 0xffffffff, which obviously is bound to fail.

This patch corrects OF-based VIC registration by locating VICs in IRQ address space starting from IRQ 32 and then placing one VIC after another. This is similar to the solution used with GIC and allows to maintain compatibility with legacy code using static IRQ numbers.

---
 arch/arm/common/vic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/common/vic.c +2 -2
index c2889da..8001994 100644
@@ -421,9 +421,9 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
 	of_property_read_u32(node, "wakeup-mask", &wakeup_mask);
 
 	/*
-	 * Passing -1 as first IRQ makes the simple domain allocate descriptors
+	 * Use IRQ numbers starting from 32 and placing each VIC after another
 	 */
-	__vic_init(regs, -1, interrupt_mask, wakeup_mask, node);
+	__vic_init(regs, 32 + (32 * vic_id), interrupt_mask, wakeup_mask, node);
 
 	return 0;
 }
Signature · 1 line
1.8.1
#5 lore raw

PATCH 3/6 ARM: s3c64xx: Add support for OF-based VIC initialization

In reply to Tomasz Figa

This patch modifies IRQ initialization code of S3C64xx to support Device Tree-based initialization of VICs.

---
 arch/arm/mach-s3c64xx/common.c | 16 ++++++++++++++++
 arch/arm/mach-s3c64xx/common.h |  4 ++++
 2 files changed, 20 insertions(+)
arch/arm/mach-s3c64xx/common.c +16 -0
index aef303b..b9c5bec 100644
@@ -19,6 +19,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
+#include <linux/of_irq.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
@@ -181,6 +182,21 @@ core_initcall(s3c64xx_dev_init);
 			 1 << (IRQ_HSMMC1 - IRQ_VIC1_BASE) |	\
 			 1 << (IRQ_HSMMC2 - IRQ_VIC1_BASE))
 
+#ifdef CONFIG_OF
+static const struct of_device_id s3c64xx_dt_irq_match[] = {
+	{ .compatible = "arm,pl192-vic", .data = vic_of_init, },
+	{},
+};
+
+void __init s3c64xx_of_init_irq(void)
+{
+	of_irq_init(s3c64xx_dt_irq_match);
+
+	/* FIXME: add the timer sub-irqs */
+	s3c_init_vic_timer_irq(5, IRQ_TIMER0);
+}
+#endif
+
 void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
 {
 	printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
arch/arm/mach-s3c64xx/common.h +4 -0
index 6cfc99b..711f3e0 100644
@@ -58,4 +58,8 @@ int __init s3c64xx_pm_late_initcall(void);
 static inline int s3c64xx_pm_late_initcall(void) { return 0; }
 #endif
 
+#ifdef CONFIG_OF
+extern void s3c64xx_of_init_irq(void);
+#endif
+
 #endif /* __ARCH_ARM_MACH_S3C64XX_COMMON_H */
Signature · 1 line
1.8.1
#6 lore raw

PATCH 4/6 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           | 13 +++++
 arch/arm/mach-s3c64xx/Makefile          |  1 +
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 84 +++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+)
 create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
arch/arm/mach-s3c64xx/Kconfig +13 -0
index 283cb77..b1c7106 100644
@@ -311,3 +311,16 @@ 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 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 +84 -0

84 lines not on this page · raw message

Signature · 1 line
1.8.1
#7 lore raw

PATCH 5/6 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 | 97 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 163 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 +97 -0

97 lines not on this page · raw message

Signature · 1 line
1.8.1
#8 lore raw

PATCH 5/6 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

Hello,

This all looks good. I just have a couple of comments about the cpus node.

Quoted 7 lines · 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.

[...]

Quoted 22 lines
arch/arm/boot/dts/s3c64xx.dtsi new file +16 -0
new file mode 100644
index 0000000..55d6e08
@@ -0,0 +1,97 @@
+/*
+ * Samsung's S3C64xx SoC series common device tree source
+ *
+ * Copyright (c) 2013 Tomasz Figa <[email protected]>
+ *
+ * Samsung's S3C64xx SoC series device nodes are listed in this file.
+ * Particular SoCs from S3C64xx series can include this file and provide
+ * values for SoCs specfic bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in
+ * S3C64xx SoCs. As device tree coverage for S3C64xx 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.

arch/arm/boot/dts/s3c64xx.dtsi line 26

Quoted 10 lines
arch/arm/boot/dts/s3c64xx.dtsi new file +10 -0
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	cpus {
+		cpu at 0 {
+			compatible = "arm,arm1176jzf-s";
+		};
+	};

You can drop the unit address from the cpu node - it's meant to be there to differentiate multiple nodes (and is supposed to match the reg property, which the 1176jzf-s can't have, as it doesn't have an MPIDR).

Also, "arm,arm1176jzf-s" isn't listed in the binding doc. There was a question about how to maintain this list [1], but I can't seem to find a conclusion, if any were reached. It might be worth appending "arm,arm1176" to the compatible list for the cpu node in case we want to enable something via dt for all 1176 variations.

Dave, Lorenzo, any thoughts?

[...]

Thanks,
Mark.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2012-November/131362.html

#9 lore raw

PATCH 5/6 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

Quoted 43 lines · Mark Rutland

Hello,

This all looks good. I just have a couple of comments about the cpus node.

Quoted 7 lines · 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.

[...]

Quoted 28 lines
arch/arm/boot/dts/s3c64xx.dtsi new file +22 -0
new file mode 100644
index 0000000..55d6e08
@@ -0,0 +1,97 @@
+/*
+ * Samsung's S3C64xx SoC series common device tree source
+ *
+ * Copyright (c) 2013 Tomasz Figa <[email protected]>
+ *
+ * Samsung's S3C64xx SoC series device nodes are listed in this file.
+ * Particular SoCs from S3C64xx series can include this file and provide
+ * values for SoCs specfic bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in
+ * S3C64xx SoCs. As device tree coverage for S3C64xx 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/ "skeleton.dtsi"
+
+/ {
+	cpus {
Quoted 8 lines

arch/arm/boot/dts/s3c64xx.dtsi line 26

Quoted 4 lines
arch/arm/boot/dts/s3c64xx.dtsi new file +4 -0
+		cpu at 0 {
+			compatible = "arm,arm1176jzf-s";
+		};
+	};

You can drop the unit address from the cpu node - it's meant to be there to differentiate multiple nodes (and is supposed to match the reg property, which the 1176jzf-s can't have, as it doesn't have an MPIDR).

Well, this is a point that I should consider since the kernel docs I wrote are misleading, they require the reg property that can not be there on UP. True, MPIDR does not exist in this case, but I have to document this in the bindings since it is unclear.

Quoted 8 lines

Also, "arm,arm1176jzf-s" isn't listed in the binding doc. There was a question about how to maintain this list [1], but I can't seem to find a conclusion, if any were reached. It might be worth appending "arm,arm1176" to the compatible list for the cpu node in case we want to enable something via dt for all 1176 variations.

Dave, Lorenzo, any thoughts?

Eh, frankly I do not know how to handle this. Either we add a compatible string to the bindings anytime a DT gets merged in the kernel but how to maintain it, it has to be defined. Happy to hear some feedback on this.

Lorenzo

#10 lore raw

PATCH 5/6 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

Quoted 65 lines · Lorenzo Pieralisi
Quoted 43 lines · Mark Rutland

Hello,

This all looks good. I just have a couple of comments about the cpus node.

Quoted 7 lines · 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.

[...]

Quoted 28 lines
arch/arm/boot/dts/s3c64xx.dtsi new file +22 -0
new file mode 100644
index 0000000..55d6e08
@@ -0,0 +1,97 @@
+/*
+ * Samsung's S3C64xx SoC series common device tree source
+ *
+ * Copyright (c) 2013 Tomasz Figa <[email protected]>
+ *
+ * Samsung's S3C64xx SoC series device nodes are listed in this file.
+ * Particular SoCs from S3C64xx series can include this file and provide
+ * values for SoCs specfic bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in
+ * S3C64xx SoCs. As device tree coverage for S3C64xx 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/ "skeleton.dtsi"
+
+/ {
+	cpus {
Quoted 8 lines

arch/arm/boot/dts/s3c64xx.dtsi line 26

Quoted 4 lines
arch/arm/boot/dts/s3c64xx.dtsi new file +4 -0
+		cpu at 0 {
+			compatible = "arm,arm1176jzf-s";
+		};
+	};

You can drop the unit address from the cpu node - it's meant to be there to differentiate multiple nodes (and is supposed to match the reg property, which the 1176jzf-s can't have, as it doesn't have an MPIDR).

Well, this is a point that I should consider since the kernel docs I wrote are misleading, they require the reg property that can not be there on UP. True, MPIDR does not exist in this case, but I have to document this in the bindings since it is unclear.

Quoted 7 lines

Also, "arm,arm1176jzf-s" isn't listed in the binding doc. There was a question about how to maintain this list [1], but I can't seem to find a conclusion, if any were reached. It might be worth appending "arm,arm1176" to the compatible list for the cpu node in case we want to enable something via dt for all 1176 variations.

Quoted 6 lines
Quoted 1 line

Dave, Lorenzo, any thoughts?

Eh, frankly I do not know how to handle this. Either we add a compatible string to the bindings anytime a DT gets merged in the kernel but how to maintain it, it has to be defined. Happy to hear some feedback on this.

Well, the number of CPU types does not grow rapidly. It will be much less than one per SoC -- so keeping the list up to date shouldn't be that much effort.

For ARM1176JZF-S, it could make sense for the comatible list to be

	"arm,arm1176jzf-s", "arm,arm1176"

...since the differences between 1176 variants are software probeable (i.e., whether there is an FPU or not). AFAIK the J, Z apply to all ARM1176, and the -S (synthesisable RTL) is nothing to do with software. The kernel probably only really needs to know "arm,arm1176".

Cheers
---Dave

Quoted 3 lines

Lorenzo

#11 lore raw

PATCH 5/6 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

Hi,

Quoted 80 lines · On Wednesday 16 of January 2013 10:59:57 Dave Martin wrote:
Quoted 68 lines · Lorenzo Pieralisi
Quoted 47 lines · Mark Rutland

Hello,

This all looks good. I just have a couple of comments about the cpus node.> >

Quoted 8 lines · 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.

[...]

Quoted 31 lines
(quoted diff) +0 -0

b/arch/arm/boot/dts/s3c64xx.dtsi new file mode 100644 index 0000000..55d6e08

arch/arm/boot/dts/s3c64xx.dtsi new file +6 -0
@@ -0,0 +1,97 @@
+/*
+ * Samsung's S3C64xx SoC series common device tree source
+ *
+ * Copyright (c) 2013 Tomasz Figa <[email protected]>
+ *
+ * Samsung's S3C64xx SoC series device nodes are listed in this

file.
+ * Particular SoCs from S3C64xx series can include this file and provide + * values for SoCs specfic bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in + * S3C64xx SoCs. As device tree coverage for S3C64xx 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.
+ */

arch/arm/boot/dts/s3c64xx.dtsi new file +6 -0
+
+/include/ "skeleton.dtsi"
+
+/ {
+	cpus {
+		cpu at 0 {
Quoted 8 lines

arch/arm/boot/dts/s3c64xx.dtsi line 26

Quoted 3 lines
arch/arm/boot/dts/s3c64xx.dtsi new file +3 -0
+			compatible = "arm,arm1176jzf-s";
+		};
+	};

You can drop the unit address from the cpu node - it's meant to be there to differentiate multiple nodes (and is supposed to match the reg property, which the 1176jzf-s can't have, as it doesn't have an MPIDR).

Well, this is a point that I should consider since the kernel docs I wrote are misleading, they require the reg property that can not be there on UP. True, MPIDR does not exist in this case, but I have to document this in the bindings since it is unclear.

Quoted 6 lines

Also, "arm,arm1176jzf-s" isn't listed in the binding doc. There was a question about how to maintain this list [1], but I can't seem to find a conclusion, if any were reached. It might be worth appending "arm,arm1176" to the compatible list for the cpu node in case we want to enable something via dt for all 1176 variations.

Quoted 6 lines
Quoted 1 line

Dave, Lorenzo, any thoughts?

Eh, frankly I do not know how to handle this. Either we add a compatible string to the bindings anytime a DT gets merged in the kernel but how to maintain it, it has to be defined. Happy to hear some feedback on this.

Well, the number of CPU types does not grow rapidly. It will be much less than one per SoC -- so keeping the list up to date shouldn't be that much effort.

Quoted 8 lines

For ARM1176JZF-S, it could make sense for the comatible list to be

	"arm,arm1176jzf-s", "arm,arm1176"

...since the differences between 1176 variants are software probeable (i.e., whether there is an FPU or not). AFAIK the J, Z apply to all ARM1176, and the -S (synthesisable RTL) is nothing to do with software. The kernel probably only really needs to know "arm,arm1176".

OK. So the conclusion is that I should change the cpus node to following:

       cpus {
               cpu {
                       compatible = "arm,arm1176jzf-s", "arm,arm1176";
               };
       };

Am I right?

Best regards,
Tomasz

#12 lore raw

PATCH 5/6 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

Tomasz Figa wrote:

[...]

Quoted 13 lines
Quoted 4 lines

Well, the number of CPU types does not grow rapidly. It will be much less than one per SoC -- so keeping the list up to date shouldn't be that much effort.

Quoted 8 lines

For ARM1176JZF-S, it could make sense for the comatible list to be

	"arm,arm1176jzf-s", "arm,arm1176"

...since the differences between 1176 variants are software probeable (i.e., whether there is an FPU or not). AFAIK the J, Z apply to all ARM1176, and the -S (synthesisable RTL) is nothing to do with software. The kernel probably only really needs to know "arm,arm1176".

Quoted 4 lines

OK. So the conclusion is that I should change the cpus node to following:

       cpus {
               cpu {

cpu at 0 { ?

Quoted 6 lines
                       compatible = "arm,arm1176jzf-s", "arm,arm1176";
               };
       };

Am I right?

I think so :-)

- Kukjin

#13 lore raw

PATCH 5/6 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

Quoted 17 lines · Kukjin Kim

Tomasz Figa wrote:

[...]

Quoted 13 lines
Quoted 12 lines

Well, the number of CPU types does not grow rapidly. It will be much less than one per SoC -- so keeping the list up to date shouldn't be that much effort.

For ARM1176JZF-S, it could make sense for the comatible list to be

	"arm,arm1176jzf-s", "arm,arm1176"

...since the differences between 1176 variants are software probeable (i.e., whether there is an FPU or not). AFAIK the J, Z apply to all ARM1176, and the -S (synthesisable RTL) is nothing to do with software. The kernel probably only really needs to know "arm,arm1176".

Quoted 6 lines
Quoted 4 lines

OK. So the conclusion is that I should change the cpus node to following:

       cpus {
               cpu {

cpu at 0 { ?

As the CPU has no MPIDR, and thus doesn't have a reg property, there's no reason to have a unit address. Just "cpu" should be fine.

Quoted 11 lines
Quoted 7 lines
                       compatible = "arm,arm1176jzf-s", "arm,arm1176";
               };
       };

Am I right?

I think so :-)

- Kukjin

As Dave pointed out, the "jzf-s" portion might be superfluous. It's worth having the "arm,arm1176", though.

Thanks,
Mark.

#14 lore raw

PATCH 5/6 ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

Quoted 35 lines · Mark Rutland
Quoted 17 lines · Kukjin Kim

Tomasz Figa wrote:

[...]

Quoted 13 lines
Quoted 12 lines

Well, the number of CPU types does not grow rapidly. It will be much less than one per SoC -- so keeping the list up to date shouldn't be that much effort.

For ARM1176JZF-S, it could make sense for the comatible list to be

	"arm,arm1176jzf-s", "arm,arm1176"

...since the differences between 1176 variants are software probeable (i.e., whether there is an FPU or not). AFAIK the J, Z apply to all ARM1176, and the -S (synthesisable RTL) is nothing to do with software. The kernel probably only really needs to know "arm,arm1176".

Quoted 6 lines
Quoted 4 lines

OK. So the conclusion is that I should change the cpus node to following:

       cpus {
               cpu {

cpu at 0 { ?

As the CPU has no MPIDR, and thus doesn't have a reg property, there's no reason to have a unit address. Just "cpu" should be fine.

Quoted 7 lines
Quoted 7 lines
                       compatible = "arm,arm1176jzf-s", "arm,arm1176";
               };
       };

Am I right?

Quoted 7 lines
Quoted 4 lines

I think so :-)

- Kukjin

As Dave pointed out, the "jzf-s" portion might be superfluous. It's worth having the "arm,arm1176", though.

I think we should always have a fully-qualified part name as the first compatible entry, following general devicetree policy. It's better to have this and not need it than to discover later that we want it and incompatibly backport it in.

Before deciding, do we follow a consistent policy for other CPUs, such as arm1136?

The issues there are similar: the only software-visible difference between arm1136j-s and arm1136jf-s should be the absence/presence of VFP, and it looks like the code in vfpmodule.c should be able to probe it.

Cheers
---Dave

#15 lore raw

PATCH 6/6 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 e44da40..9ca30ea 100644
@@ -120,6 +120,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
#16 lore raw

cover Initial Device Tree support for S3C64xx

In reply to Tomasz Figa
Quoted 33 lines · On Sunday 13 of January 2013 02:10:52 Tomasz Figa wrote:

This series is 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.

Tomasz Figa (6):
ARM: common: vic: Parse interrupt and resume masks from device tree
ARM: common: vic: Fix invalid first IRQ number in OF-based
registration
ARM: s3c64xx: Add support for OF-based VIC initialization
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                | 97
+++++++++++++++++++++++++++ arch/arm/common/vic.c                      
  |  9 ++-
 arch/arm/mach-s3c64xx/Kconfig                 | 13 ++++
 arch/arm/mach-s3c64xx/Makefile                |  1 +
 arch/arm/mach-s3c64xx/common.c                | 16 +++++
 arch/arm/mach-s3c64xx/common.h                |  4 ++
Quoted 8 lines
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c       | 84
+++++++++++++++++++++++ 12 files changed, 345 insertions(+), 2
deletions(-)
 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

Any other comments on this series?

Best regards,
Tomasz

#17 lore raw

cover Initial Device Tree support for S3C64xx

Quoted 44 lines · Tomasz Figa
Quoted 33 lines · On Sunday 13 of January 2013 02:10:52 Tomasz Figa wrote:

This series is 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.

Tomasz Figa (6):
ARM: common: vic: Parse interrupt and resume masks from device tree
ARM: common: vic: Fix invalid first IRQ number in OF-based
registration
ARM: s3c64xx: Add support for OF-based VIC initialization
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                | 97
+++++++++++++++++++++++++++ arch/arm/common/vic.c
  |  9 ++-
 arch/arm/mach-s3c64xx/Kconfig                 | 13 ++++
 arch/arm/mach-s3c64xx/Makefile                |  1 +
 arch/arm/mach-s3c64xx/common.c                | 16 +++++
 arch/arm/mach-s3c64xx/common.h                |  4 ++
Quoted 8 lines
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c       | 84
+++++++++++++++++++++++ 12 files changed, 345 insertions(+), 2
deletions(-)
 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
Quoted 2 lines

Any other comments on this series?

Looks good to me. But would be better if the vic changes could get ack ;-)

Thanks.

- Kukjin