linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/7] Initial Device Tree support for S3C64xx
@ 2013-01-09 23:41 Tomasz Figa
  2013-01-09 23:41 ` [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

This series is an initial proposal of 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 to the point of
mounting rootfs, which fails, because there are no storage devices available,
but should be fine as a start and will be extended in future, hopefully with
help of all S3C64xx board maintainers.

Tomasz Figa (7):
  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: Fix build error with CONFIG_S3C_DEV_FB disabled
  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        | 44 +++++++++++++
 arch/arm/boot/dts/s3c6410.dtsi                | 33 ++++++++++
 arch/arm/boot/dts/s3c64xx.dtsi                | 73 +++++++++++++++++++++
 arch/arm/common/vic.c                         |  9 ++-
 arch/arm/mach-s3c64xx/Kconfig                 | 13 ++++
 arch/arm/mach-s3c64xx/Makefile                |  1 +
 arch/arm/mach-s3c64xx/common.c                | 20 +++++-
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c       | 93 +++++++++++++++++++++++++++
 arch/arm/mach-s3c64xx/pm.c                    |  4 +-
 12 files changed, 323 insertions(+), 7 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

-- 
1.8.1

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

* [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree
  2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
@ 2013-01-09 23:41 ` Tomasz Figa
  2013-01-10 11:03   ` Mark Brown
  2013-01-09 23:41 ` [RFC PATCH 2/7] ARM: common: vic: Fix invalid first IRQ number in OF-based registration Tomasz Figa
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 Documentation/devicetree/bindings/arm/vic.txt | 6 ++++++
 arch/arm/common/vic.c                         | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt
index 266716b..bb7137c 100644
--- a/Documentation/devicetree/bindings/arm/vic.txt
+++ b/Documentation/devicetree/bindings/arm/vic.txt
@@ -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>;
 	};
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index e4df17c..c2889da 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -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;
 }
-- 
1.8.1

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

* [RFC PATCH 2/7] ARM: common: vic: Fix invalid first IRQ number in OF-based registration
  2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
  2013-01-09 23:41 ` [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
@ 2013-01-09 23:41 ` Tomasz Figa
  2013-01-09 23:41 ` [RFC PATCH 3/7] ARM: s3c64xx: Add support for OF-based VIC initialization Tomasz Figa
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/common/vic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index c2889da..8001994 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -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;
 }
-- 
1.8.1

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

* [RFC PATCH 3/7] ARM: s3c64xx: Add support for OF-based VIC initialization
  2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
  2013-01-09 23:41 ` [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
  2013-01-09 23:41 ` [RFC PATCH 2/7] ARM: common: vic: Fix invalid first IRQ number in OF-based registration Tomasz Figa
@ 2013-01-09 23:41 ` Tomasz Figa
  2013-01-10 11:10   ` Mark Brown
  2013-01-09 23:41 ` [RFC PATCH 4/7] ARM: s3c64xx: Fix build error with CONFIG_S3C_DEV_FB disabled Tomasz Figa
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/mach-s3c64xx/common.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index aef303b..798c5d4 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -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,13 +182,26 @@ 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, },
+	{},
+};
+#endif
+
 void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
 {
 	printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
 
-	/* initialise the pair of VICs */
-	vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
-	vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
+	if (!of_have_populated_dt()) {
+		/* initialise the pair of VICs */
+		vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME);
+		vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME);
+	}
+#ifdef CONFIG_OF
+	else
+		of_irq_init(s3c64xx_dt_irq_match);
+#endif
 
 	/* add the timer sub-irqs */
 	s3c_init_vic_timer_irq(5, IRQ_TIMER0);
-- 
1.8.1

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

* [RFC PATCH 4/7] ARM: s3c64xx: Fix build error with CONFIG_S3C_DEV_FB disabled
  2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
                   ` (2 preceding siblings ...)
  2013-01-09 23:41 ` [RFC PATCH 3/7] ARM: s3c64xx: Add support for OF-based VIC initialization Tomasz Figa
@ 2013-01-09 23:41 ` Tomasz Figa
  2013-01-10  0:15   ` Kukjin Kim
  2013-01-09 23:41 ` [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree Tomasz Figa
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

If there is no board selecting CONFIG_S3C_DEV_FB enabled, build will fail on
arch/arm/mach-s3c64xx/pm.c, where s3c_device_fb is referenced.

This patch adds ifdef guard around the code making it compile only when
CONFIG_S3C_DEV_FB is enabled.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/mach-s3c64xx/pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index f6b13a2..3686785 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -338,10 +338,10 @@ int __init s3c64xx_pm_init(void)
 
 	for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
 		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
-
+#ifdef CONFIG_S3C_DEV_FB
 	if (dev_get_platdata(&s3c_device_fb.dev))
 		pm_genpd_add_device(&s3c64xx_pm_f.pd, &s3c_device_fb.dev);
-
+#endif
 	return 0;
 }
 
-- 
1.8.1

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

* [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree
  2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
                   ` (3 preceding siblings ...)
  2013-01-09 23:41 ` [RFC PATCH 4/7] ARM: s3c64xx: Fix build error with CONFIG_S3C_DEV_FB disabled Tomasz Figa
@ 2013-01-09 23:41 ` Tomasz Figa
  2013-01-10  0:24   ` Kukjin Kim
  2013-01-10 10:52   ` Mark Brown
  2013-01-09 23:41 ` [RFC PATCH 6/7] ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs Tomasz Figa
  2013-01-09 23:41 ` [RFC PATCH 7/7] ARM: dts: Add dts file for S3C6410-based Mini6410 board Tomasz Figa
  6 siblings, 2 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/mach-s3c64xx/Kconfig           | 13 +++++
 arch/arm/mach-s3c64xx/Makefile          |  1 +
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 93 +++++++++++++++++++++++++++++++++
 3 files changed, 107 insertions(+)
 create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 131c862..a43b3f7 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -309,3 +309,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.
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index f9ce1dc..59b3d06 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -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
diff --git a/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
new file mode 100644
index 0000000..f5725ce
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
@@ -0,0 +1,93 @@
+/*
+ * Samsung's S3C64XX flattened device tree enabled machine
+ *
+ * Copyright (c) 2012 Tomasz Figa <tomasz.figa@gmail.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.
+*/
+
+#include <linux/of_platform.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/arch.h>
+#include <asm/hardware/vic.h>
+#include <mach/map.h>
+
+#include <plat/cpu.h>
+#include <plat/regs-serial.h>
+#include <plat/s5p-time.h>
+
+#include "common.h"
+
+/*
+ * The following lookup table is used to override device names when devices
+ * are registered from device tree. This is temporarily added to enable
+ * device tree support addition for the Exynos4 architecture.
+ *
+ * For drivers that require platform data to be provided from the machine
+ * file, a platform data pointer can also be supplied along with the
+ * devices names. Usually, the platform data elements that cannot be parsed
+ * from the device tree by the drivers (example: function pointers) are
+ * supplied. But it should be noted that this is a temporary mechanism and
+ * at some point, the drivers should be capable of parsing all the platform
+ * data from the device tree.
+ */
+static const struct of_dev_auxdata s3c64xx_auxdata_lookup[] __initconst = {
+	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART0,
+				"s3c6400-uart.0", NULL),
+	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART1,
+				"s3c6400-uart.1", NULL),
+	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART2,
+				"s3c6400-uart.2", NULL),
+	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART3,
+				"s3c6400-uart.3", NULL),
+	{},
+};
+
+static void __init s3c64xx_dt_map_io(void)
+{
+	s3c64xx_init_io(NULL, 0);
+	s3c24xx_init_clocks(12000000);
+}
+
+static void __init s3c64xx_dt_machine_init(void)
+{
+	of_platform_populate(NULL, of_default_bus_match_table,
+				s3c64xx_auxdata_lookup, NULL);
+}
+
+static char const *s3c6400_dt_compat[] __initdata = {
+	"samsung,s3c6400",
+	NULL
+};
+
+DT_MACHINE_START(S3C6400_DT, "Samsung S3C6400 (Flattened Device Tree)")
+	/* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
+	.init_irq	= s3c6400_init_irq,
+	.map_io		= s3c64xx_dt_map_io,
+	.handle_irq	= vic_handle_irq,
+	.init_machine	= s3c64xx_dt_machine_init,
+	.init_late	= s3c64xx_init_late,
+	.timer		= &s3c24xx_timer,
+	.dt_compat	= s3c6400_dt_compat,
+	.restart        = s3c64xx_restart,
+MACHINE_END
+
+static char const *s3c6410_dt_compat[] __initdata = {
+	"samsung,s3c6410",
+	NULL
+};
+
+DT_MACHINE_START(S3C6410_DT, "Samsung S3C6410 (Flattened Device Tree)")
+	/* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
+	.init_irq	= s3c6410_init_irq,
+	.map_io		= s3c64xx_dt_map_io,
+	.handle_irq	= vic_handle_irq,
+	.init_machine	= s3c64xx_dt_machine_init,
+	.init_late	= s3c64xx_init_late,
+	.timer		= &s3c24xx_timer,
+	.dt_compat	= s3c6410_dt_compat,
+	.restart        = s3c64xx_restart,
+MACHINE_END
-- 
1.8.1

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

* [RFC PATCH 6/7] ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs
  2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
                   ` (4 preceding siblings ...)
  2013-01-09 23:41 ` [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree Tomasz Figa
@ 2013-01-09 23:41 ` Tomasz Figa
  2013-01-09 23:41 ` [RFC PATCH 7/7] ARM: dts: Add dts file for S3C6410-based Mini6410 board Tomasz Figa
  6 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/boot/dts/s3c6400.dtsi | 33 +++++++++++++++++++
 arch/arm/boot/dts/s3c6410.dtsi | 33 +++++++++++++++++++
 arch/arm/boot/dts/s3c64xx.dtsi | 73 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 139 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

diff --git a/arch/arm/boot/dts/s3c6400.dtsi b/arch/arm/boot/dts/s3c6400.dtsi
new file mode 100644
index 0000000..8c77a81
--- /dev/null
+++ b/arch/arm/boot/dts/s3c6400.dtsi
@@ -0,0 +1,33 @@
+/*
+ * Samsung's S3C6400 SoC device tree source
+ *
+ * Copyright (c) 2012 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * 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>;
+	};
+};
diff --git a/arch/arm/boot/dts/s3c6410.dtsi b/arch/arm/boot/dts/s3c6410.dtsi
new file mode 100644
index 0000000..faefaffc
--- /dev/null
+++ b/arch/arm/boot/dts/s3c6410.dtsi
@@ -0,0 +1,33 @@
+/*
+ * Samsung's S3C6410 SoC device tree source
+ *
+ * Copyright (c) 2012 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * 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>;
+	};
+};
diff --git a/arch/arm/boot/dts/s3c64xx.dtsi b/arch/arm/boot/dts/s3c64xx.dtsi
new file mode 100644
index 0000000..75a1f8a
--- /dev/null
+++ b/arch/arm/boot/dts/s3c64xx.dtsi
@@ -0,0 +1,73 @@
+/*
+ * Samsung's S3C64xx SoC series common device tree source
+ *
+ * Copyright (c) 2012 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * 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 {
+		cpu at 0 {
+			compatible = "arm,arm1176jzf-s";
+		};
+	};
+
+	vic0: interrupt-controller at 71200000 {
+		compatible = "arm,pl192-vic";
+		interrupt-controller;
+		reg = <0x71200000 0x1000>;
+		#interrupt-cells = <1>;
+	};
+
+	vic1: interrupt-controller at 71300000 {
+		compatible = "arm,pl192-vic";
+		interrupt-controller;
+		reg = <0x71300000 0x1000>;
+		#interrupt-cells = <1>;
+	};
+
+	serial at 7f005000 {
+		compatible = "samsung,s3c6400-uart";
+		reg = <0x7f005000 0x100>;
+		interrupt-parent = <&vic1>;
+		interrupts = <5 0>;
+		status = "disabled";
+	};
+
+	serial at 7f005400 {
+		compatible = "samsung,s3c6400-uart";
+		reg = <0x7f005400 0x100>;
+		interrupt-parent = <&vic1>;
+		interrupts = <6 0>;
+		status = "disabled";
+	};
+
+	serial at 7f005800 {
+		compatible = "samsung,s3c6400-uart";
+		reg = <0x7f005800 0x100>;
+		interrupt-parent = <&vic1>;
+		interrupts = <7 0>;
+		status = "disabled";
+	};
+
+	serial at 7f005c00 {
+		compatible = "samsung,s3c6400-uart";
+		reg = <0x7f005c00 0x100>;
+		interrupt-parent = <&vic1>;
+		interrupts = <8 0>;
+		status = "disabled";
+	};
+};
-- 
1.8.1

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

* [RFC PATCH 7/7] ARM: dts: Add dts file for S3C6410-based Mini6410 board
  2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
                   ` (5 preceding siblings ...)
  2013-01-09 23:41 ` [RFC PATCH 6/7] ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs Tomasz Figa
@ 2013-01-09 23:41 ` Tomasz Figa
  6 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-09 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/boot/dts/Makefile             |  1 +
 arch/arm/boot/dts/s3c6410-mini6410.dts | 44 ++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 arch/arm/boot/dts/s3c6410-mini6410.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index e44da40..9ca30ea 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -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 \
diff --git a/arch/arm/boot/dts/s3c6410-mini6410.dts b/arch/arm/boot/dts/s3c6410-mini6410.dts
new file mode 100644
index 0000000..a5ceade
--- /dev/null
+++ b/arch/arm/boot/dts/s3c6410-mini6410.dts
@@ -0,0 +1,44 @@
+/*
+ * Samsung's S3C6410 based Mini6410 board device tree source
+ *
+ * Copyright (c) 2012 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * Device tree source file for FriendlyARM Mini6410 board which is based on
+ * Samsung's S3C6410 SoC.
+ *
+ * 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/ "s3c6410.dtsi"
+
+/ {
+	model = "FriendlyARM Mini6410 board based on S3C6410";
+	compatible = "friendlyarm,mini6410", "samsung,s3c6410";
+
+	memory {
+		reg = <0x50000000 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttySAC0,115200n8 earlyprintk";
+	};
+
+	serial at 7f005000 {
+		status = "okay";
+	};
+
+	serial at 7f005400 {
+		status = "okay";
+	};
+
+	serial at 7f005800 {
+		status = "okay";
+	};
+
+	serial at 7f005c00 {
+		status = "okay";
+	};
+};
-- 
1.8.1

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

* [RFC PATCH 4/7] ARM: s3c64xx: Fix build error with CONFIG_S3C_DEV_FB disabled
  2013-01-09 23:41 ` [RFC PATCH 4/7] ARM: s3c64xx: Fix build error with CONFIG_S3C_DEV_FB disabled Tomasz Figa
@ 2013-01-10  0:15   ` Kukjin Kim
  2013-01-10  0:32     ` Tomasz Figa
  0 siblings, 1 reply; 18+ messages in thread
From: Kukjin Kim @ 2013-01-10  0:15 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz Figa wrote:
> 
> If there is no board selecting CONFIG_S3C_DEV_FB enabled, build will fail
on
> arch/arm/mach-s3c64xx/pm.c, where s3c_device_fb is referenced.
> 
> This patch adds ifdef guard around the code making it compile only when
> CONFIG_S3C_DEV_FB is enabled.
> 
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> ---
>  arch/arm/mach-s3c64xx/pm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
> index f6b13a2..3686785 100644
> --- a/arch/arm/mach-s3c64xx/pm.c
> +++ b/arch/arm/mach-s3c64xx/pm.c
> @@ -338,10 +338,10 @@ int __init s3c64xx_pm_init(void)
> 
>  	for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
>  		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
> -
> +#ifdef CONFIG_S3C_DEV_FB
>  	if (dev_get_platdata(&s3c_device_fb.dev))
>  		pm_genpd_add_device(&s3c64xx_pm_f.pd,
> &s3c_device_fb.dev);
> -
> +#endif
>  	return 0;
>  }
> 
> --
> 1.8.1

This should be separated patch from this series as a fix.

Let me pick this up into -fixes.

Thanks.

- Kukjin

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

* [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree
  2013-01-09 23:41 ` [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree Tomasz Figa
@ 2013-01-10  0:24   ` Kukjin Kim
  2013-01-10  0:38     ` Tomasz Figa
  2013-01-10 10:52   ` Mark Brown
  1 sibling, 1 reply; 18+ messages in thread
From: Kukjin Kim @ 2013-01-10  0:24 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz Figa wrote:
> 
> This patch adds board file that will be used to boot S3C64xx-based boards
> using Device Tree.
> 
> Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> ---
>  arch/arm/mach-s3c64xx/Kconfig           | 13 +++++
>  arch/arm/mach-s3c64xx/Makefile          |  1 +
>  arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 93
> +++++++++++++++++++++++++++++++++
>  3 files changed, 107 insertions(+)
>  create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
> 
> diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-
> s3c64xx/Kconfig
> index 131c862..a43b3f7 100644
> --- a/arch/arm/mach-s3c64xx/Kconfig
> +++ b/arch/arm/mach-s3c64xx/Kconfig
> @@ -309,3 +309,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.
> diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-
> s3c64xx/Makefile
> index f9ce1dc..59b3d06 100644
> --- a/arch/arm/mach-s3c64xx/Makefile
> +++ b/arch/arm/mach-s3c64xx/Makefile
> @@ -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
> diff --git a/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c b/arch/arm/mach-
> s3c64xx/mach-s3c64xx-dt.c
> new file mode 100644
> index 0000000..f5725ce
> --- /dev/null
> +++ b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
> @@ -0,0 +1,93 @@
> +/*
> + * Samsung's S3C64XX flattened device tree enabled machine
> + *
> + * Copyright (c) 2012 Tomasz Figa <tomasz.figa@gmail.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.
> +*/
> +
> +#include <linux/of_platform.h>
> +#include <linux/serial_core.h>
> +
> +#include <asm/mach/arch.h>
> +#include <asm/hardware/vic.h>
> +#include <mach/map.h>
> +
> +#include <plat/cpu.h>
> +#include <plat/regs-serial.h>
> +#include <plat/s5p-time.h>
> +
> +#include "common.h"
> +
> +/*
> + * The following lookup table is used to override device names when
> devices
> + * are registered from device tree. This is temporarily added to enable
> + * device tree support addition for the Exynos4 architecture.
> + *
> + * For drivers that require platform data to be provided from the machine
> + * file, a platform data pointer can also be supplied along with the
> + * devices names. Usually, the platform data elements that cannot be
> parsed
> + * from the device tree by the drivers (example: function pointers) are
> + * supplied. But it should be noted that this is a temporary mechanism
and
> + * at some point, the drivers should be capable of parsing all the
platform
> + * data from the device tree.
> + */
> +static const struct of_dev_auxdata s3c64xx_auxdata_lookup[] __initconst =
> {
> +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART0,
> +				"s3c6400-uart.0", NULL),
> +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART1,
> +				"s3c6400-uart.1", NULL),
> +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART2,
> +				"s3c6400-uart.2", NULL),
> +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART3,
> +				"s3c6400-uart.3", NULL),

I'd prefer to use 0x7F005000 instead of S3C_PA_UART0 so that we can remove
the static definitions at the map.h

> +	{},
> +};
> +
> +static void __init s3c64xx_dt_map_io(void)
> +{
> +	s3c64xx_init_io(NULL, 0);
> +	s3c24xx_init_clocks(12000000);

The value of xtal clock for s3c24xx_init_clocks() should be defined via dt
according to board condition _next_time_  because it can be different on
each board, it's same on current s3c64xx boards though.

> +}
> +
> +static void __init s3c64xx_dt_machine_init(void)
> +{
> +	of_platform_populate(NULL, of_default_bus_match_table,
> +				s3c64xx_auxdata_lookup, NULL);
> +}
> +
> +static char const *s3c6400_dt_compat[] __initdata = {
> +	"samsung,s3c6400",
> +	NULL
> +};
> +
> +DT_MACHINE_START(S3C6400_DT, "Samsung S3C6400 (Flattened Device
> Tree)")
> +	/* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
> +	.init_irq	= s3c6400_init_irq,
> +	.map_io		= s3c64xx_dt_map_io,
> +	.handle_irq	= vic_handle_irq,
> +	.init_machine	= s3c64xx_dt_machine_init,
> +	.init_late	= s3c64xx_init_late,
> +	.timer		= &s3c24xx_timer,
> +	.dt_compat	= s3c6400_dt_compat,
> +	.restart        = s3c64xx_restart,
> +MACHINE_END
> +
> +static char const *s3c6410_dt_compat[] __initdata = {
> +	"samsung,s3c6410",
> +	NULL
> +};

I think, we don't need separation.

+static char const *s3c64xx_dt_compat[] __initdata = {
+	"samsung,s3c6400",
+	"samsung,s3c6410",
+	NULL
+};

> +
> +DT_MACHINE_START(S3C6410_DT, "Samsung S3C6410 (Flattened Device
> Tree)")
> +	/* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
> +	.init_irq	= s3c6410_init_irq,
> +	.map_io		= s3c64xx_dt_map_io,
> +	.handle_irq	= vic_handle_irq,
> +	.init_machine	= s3c64xx_dt_machine_init,
> +	.init_late	= s3c64xx_init_late,
> +	.timer		= &s3c24xx_timer,
> +	.dt_compat	= s3c6410_dt_compat,

+	.dt_compat	= s3c64xx_dt_compat,

> +	.restart        = s3c64xx_restart,
> +MACHINE_END
> --
> 1.8.1

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

* [RFC PATCH 4/7] ARM: s3c64xx: Fix build error with CONFIG_S3C_DEV_FB disabled
  2013-01-10  0:15   ` Kukjin Kim
@ 2013-01-10  0:32     ` Tomasz Figa
  0 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-10  0:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kukjin,

On Wednesday 09 of January 2013 16:15:23 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > If there is no board selecting CONFIG_S3C_DEV_FB enabled, build will
> > fail
> on
> 
> > arch/arm/mach-s3c64xx/pm.c, where s3c_device_fb is referenced.
> > 
> > This patch adds ifdef guard around the code making it compile only
> > when
> > CONFIG_S3C_DEV_FB is enabled.
> > 
> > Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> > ---
> > 
> >  arch/arm/mach-s3c64xx/pm.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
> > index f6b13a2..3686785 100644
> > --- a/arch/arm/mach-s3c64xx/pm.c
> > +++ b/arch/arm/mach-s3c64xx/pm.c
> > @@ -338,10 +338,10 @@ int __init s3c64xx_pm_init(void)
> > 
> >  	for (i = 0; i < ARRAY_SIZE(s3c64xx_pm_domains); i++)
> >  	
> >  		pm_genpd_init(&s3c64xx_pm_domains[i]->pd, NULL, false);
> > 
> > -
> > +#ifdef CONFIG_S3C_DEV_FB
> > 
> >  	if (dev_get_platdata(&s3c_device_fb.dev))
> >  	
> >  		pm_genpd_add_device(&s3c64xx_pm_f.pd,
> > 
> > &s3c_device_fb.dev);
> > -
> > +#endif
> > 
> >  	return 0;
> >  
> >  }
> > 
> > --
> > 1.8.1
> 
> This should be separated patch from this series as a fix.

Right.
 
> Let me pick this up into -fixes.

No problem.

Best regards,
Tomasz Figa

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

* [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree
  2013-01-10  0:24   ` Kukjin Kim
@ 2013-01-10  0:38     ` Tomasz Figa
  0 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-10  0:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kukjin,

On Wednesday 09 of January 2013 16:24:42 Kukjin Kim wrote:
> Tomasz Figa wrote:
> > This patch adds board file that will be used to boot S3C64xx-based
> > boards using Device Tree.
> > 
> > Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
> > ---
> > 
> >  arch/arm/mach-s3c64xx/Kconfig           | 13 +++++
> >  arch/arm/mach-s3c64xx/Makefile          |  1 +
> >  arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 93
> > 
> > +++++++++++++++++++++++++++++++++
> > 
> >  3 files changed, 107 insertions(+)
> >  create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
> > 
> > diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-
> > s3c64xx/Kconfig
> > index 131c862..a43b3f7 100644
> > --- a/arch/arm/mach-s3c64xx/Kconfig
> > +++ b/arch/arm/mach-s3c64xx/Kconfig
> > @@ -309,3 +309,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.
> > diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-
> > s3c64xx/Makefile
> > index f9ce1dc..59b3d06 100644
> > --- a/arch/arm/mach-s3c64xx/Makefile
> > +++ b/arch/arm/mach-s3c64xx/Makefile
> > @@ -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
> > diff --git a/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c b/arch/arm/mach-
> > s3c64xx/mach-s3c64xx-dt.c
> > new file mode 100644
> > index 0000000..f5725ce
> > --- /dev/null
> > +++ b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c
> > @@ -0,0 +1,93 @@
> > +/*
> > + * Samsung's S3C64XX flattened device tree enabled machine
> > + *
> > + * Copyright (c) 2012 Tomasz Figa <tomasz.figa@gmail.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.
> > +*/
> > +
> > +#include <linux/of_platform.h>
> > +#include <linux/serial_core.h>
> > +
> > +#include <asm/mach/arch.h>
> > +#include <asm/hardware/vic.h>
> > +#include <mach/map.h>
> > +
> > +#include <plat/cpu.h>
> > +#include <plat/regs-serial.h>
> > +#include <plat/s5p-time.h>
> > +
> > +#include "common.h"
> > +
> > +/*
> > + * The following lookup table is used to override device names when
> > devices
> > + * are registered from device tree. This is temporarily added to
> > enable + * device tree support addition for the Exynos4 architecture.
> > + *
> > + * For drivers that require platform data to be provided from the
> > machine + * file, a platform data pointer can also be supplied along
> > with the + * devices names. Usually, the platform data elements that
> > cannot be parsed
> > + * from the device tree by the drivers (example: function pointers)
> > are + * supplied. But it should be noted that this is a temporary
> > mechanism
> and
> 
> > + * at some point, the drivers should be capable of parsing all the
> 
> platform
> 
> > + * data from the device tree.
> > + */
> > +static const struct of_dev_auxdata s3c64xx_auxdata_lookup[]
> > __initconst = {
> > +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART0,
> > +				"s3c6400-uart.0", NULL),
> > +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART1,
> > +				"s3c6400-uart.1", NULL),
> > +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART2,
> > +				"s3c6400-uart.2", NULL),
> > +	OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART3,
> > +				"s3c6400-uart.3", NULL),
> 
> I'd prefer to use 0x7F005000 instead of S3C_PA_UART0 so that we can
> remove the static definitions at the map.h

Ideally, I would like to completely get rid of this and start cleanly with 
common clock framework, but support for it would be probably based on 
Thomas Abraham's code for Exynos, which would have to be merged first.

So for now I will replace symbolic addresses with numeric ones, as you 
suggested.

> > +	{},
> > +};
> > +
> > +static void __init s3c64xx_dt_map_io(void)
> > +{
> > +	s3c64xx_init_io(NULL, 0);
> > +	s3c24xx_init_clocks(12000000);
> 
> The value of xtal clock for s3c24xx_init_clocks() should be defined via
> dt according to board condition _next_time_  because it can be
> different on each board, it's same on current s3c64xx boards though.

This is yet another issue that will be solved by using Common 
Clock Framework.

> > +}
> > +
> > +static void __init s3c64xx_dt_machine_init(void)
> > +{
> > +	of_platform_populate(NULL, of_default_bus_match_table,
> > +				s3c64xx_auxdata_lookup, NULL);
> > +}
> > +
> > +static char const *s3c6400_dt_compat[] __initdata = {
> > +	"samsung,s3c6400",
> > +	NULL
> > +};
> > +
> > +DT_MACHINE_START(S3C6400_DT, "Samsung S3C6400 (Flattened Device
> > Tree)")
> > +	/* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
> > +	.init_irq	= s3c6400_init_irq,
> > +	.map_io		= s3c64xx_dt_map_io,
> > +	.handle_irq	= vic_handle_irq,
> > +	.init_machine	= s3c64xx_dt_machine_init,
> > +	.init_late	= s3c64xx_init_late,
> > +	.timer		= &s3c24xx_timer,
> > +	.dt_compat	= s3c6400_dt_compat,
> > +	.restart        = s3c64xx_restart,
> > +MACHINE_END
> > +
> > +static char const *s3c6410_dt_compat[] __initdata = {
> > +	"samsung,s3c6410",
> > +	NULL
> > +};
> 
> I think, we don't need separation.

These two differ in init_irq callback, but now as I look at it, all the 
data are already being parsed from device tree, so I will just add 
s3c64xx_of_init_irq and make just one DT machine.

Best regards,
Tomasz Figa

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

* [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree
  2013-01-09 23:41 ` [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree Tomasz Figa
  2013-01-10  0:24   ` Kukjin Kim
@ 2013-01-10 10:52   ` Mark Brown
  2013-01-10 10:55     ` Tomasz Figa
  1 sibling, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-01-10 10:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 10, 2013 at 12:41:47AM +0100, Tomasz Figa wrote:

> + * The following lookup table is used to override device names when devices
> + * are registered from device tree. This is temporarily added to enable
> + * device tree support addition for the Exynos4 architecture.

Cut'n'paste.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130110/1b0db75f/attachment.sig>

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

* [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree
  2013-01-10 10:52   ` Mark Brown
@ 2013-01-10 10:55     ` Tomasz Figa
  0 siblings, 0 replies; 18+ messages in thread
From: Tomasz Figa @ 2013-01-10 10:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mark,

On Thursday 10 of January 2013 10:52:22 Mark Brown wrote:
> On Thu, Jan 10, 2013 at 12:41:47AM +0100, Tomasz Figa wrote:
> > + * The following lookup table is used to override device names when
> > devices + * are registered from device tree. This is temporarily
> > added to enable + * device tree support addition for the Exynos4
> > architecture.
> Cut'n'paste.

Oh my, you got me. ;)

I will correct it in next version. Thanks for spotting this.

Best regards,
Tomasz Figa

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

* [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree
  2013-01-09 23:41 ` [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
@ 2013-01-10 11:03   ` Mark Brown
  2013-01-10 11:10     ` Tomasz Figa
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-01-10 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 10, 2013 at 12:41:43AM +0100, Tomasz Figa wrote:

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

Should this really be configured in the VIC itself?  It seems like
something that might change at runtime (for example, due to the user
configuring wakes in sysfs).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130110/f067b762/attachment.sig>

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

* [RFC PATCH 3/7] ARM: s3c64xx: Add support for OF-based VIC initialization
  2013-01-09 23:41 ` [RFC PATCH 3/7] ARM: s3c64xx: Add support for OF-based VIC initialization Tomasz Figa
@ 2013-01-10 11:10   ` Mark Brown
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2013-01-10 11:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 10, 2013 at 12:41:45AM +0100, Tomasz Figa wrote:
> This patch modifies IRQ initialization code of S3C64xx to support
> Device Tree-based initialization of VICs.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130110/0e98cde9/attachment.sig>

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

* [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree
  2013-01-10 11:03   ` Mark Brown
@ 2013-01-10 11:10     ` Tomasz Figa
  2013-01-10 11:24       ` Mark Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Tomasz Figa @ 2013-01-10 11:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 10 of January 2013 11:03:14 Mark Brown wrote:
> On Thu, Jan 10, 2013 at 12:41:43AM +0100, Tomasz Figa wrote:
> > +- 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)
> 
> Should this really be configured in the VIC itself?  It seems like
> something that might change at runtime (for example, due to the user
> configuring wakes in sysfs).

This is not the runtime interrupt/wakeup mask, but a global mask of 
available interrupt/wakeup lines on particular platform, which still have 
to be configured and enabled appropriately by user.

Best regards,
Tomasz Figa

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

* [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree
  2013-01-10 11:10     ` Tomasz Figa
@ 2013-01-10 11:24       ` Mark Brown
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2013-01-10 11:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 10, 2013 at 12:10:38PM +0100, Tomasz Figa wrote:

> This is not the runtime interrupt/wakeup mask, but a global mask of 
> available interrupt/wakeup lines on particular platform, which still have 
> to be configured and enabled appropriately by user.

Ah, OK.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130110/29a757b2/attachment.sig>

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

end of thread, other threads:[~2013-01-10 11:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 23:41 [RFC PATCH 0/7] Initial Device Tree support for S3C64xx Tomasz Figa
2013-01-09 23:41 ` [RFC PATCH 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree Tomasz Figa
2013-01-10 11:03   ` Mark Brown
2013-01-10 11:10     ` Tomasz Figa
2013-01-10 11:24       ` Mark Brown
2013-01-09 23:41 ` [RFC PATCH 2/7] ARM: common: vic: Fix invalid first IRQ number in OF-based registration Tomasz Figa
2013-01-09 23:41 ` [RFC PATCH 3/7] ARM: s3c64xx: Add support for OF-based VIC initialization Tomasz Figa
2013-01-10 11:10   ` Mark Brown
2013-01-09 23:41 ` [RFC PATCH 4/7] ARM: s3c64xx: Fix build error with CONFIG_S3C_DEV_FB disabled Tomasz Figa
2013-01-10  0:15   ` Kukjin Kim
2013-01-10  0:32     ` Tomasz Figa
2013-01-09 23:41 ` [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree Tomasz Figa
2013-01-10  0:24   ` Kukjin Kim
2013-01-10  0:38     ` Tomasz Figa
2013-01-10 10:52   ` Mark Brown
2013-01-10 10:55     ` Tomasz Figa
2013-01-09 23:41 ` [RFC PATCH 6/7] ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs Tomasz Figa
2013-01-09 23:41 ` [RFC PATCH 7/7] ARM: dts: Add dts file for S3C6410-based Mini6410 board Tomasz Figa

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