All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-01 18:20 ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first patch cleans up kirkwood_init() by moving a flag setting to it's
appropriate location.  This will help later when converting the audio driver.

Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
board-dt.c  This way, as drivers are converted, their init calls can be removed
from kirkwood_dt_init() and non-fdt users won't be affected (they call
kirkwood_init()).

Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
drivers remain for a later patch series.

Jason Cooper (4):
  ARM: kirkwood: move var setting to correct location.
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: convert rtc-mv to fdt.
  ARM: kirkwood: convert orion-wdt to fdt.

 arch/arm/boot/dts/kirkwood.dtsi   |   12 ++++++++++
 arch/arm/mach-kirkwood/board-dt.c |   28 ++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   10 ++++----
 arch/arm/mach-kirkwood/common.h   |    6 +++++
 drivers/rtc/rtc-mv.c              |   19 ++++++++++++++++
 drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
 6 files changed, 101 insertions(+), 18 deletions(-)

-- 
1.7.3.4

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-01 18:20 ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first patch cleans up kirkwood_init() by moving a flag setting to it's
appropriate location.  This will help later when converting the audio driver.

Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
board-dt.c  This way, as drivers are converted, their init calls can be removed
from kirkwood_dt_init() and non-fdt users won't be affected (they call
kirkwood_init()).

Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
drivers remain for a later patch series.

Jason Cooper (4):
  ARM: kirkwood: move var setting to correct location.
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: convert rtc-mv to fdt.
  ARM: kirkwood: convert orion-wdt to fdt.

 arch/arm/boot/dts/kirkwood.dtsi   |   12 ++++++++++
 arch/arm/mach-kirkwood/board-dt.c |   28 ++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   10 ++++----
 arch/arm/mach-kirkwood/common.h   |    6 +++++
 drivers/rtc/rtc-mv.c              |   19 ++++++++++++++++
 drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
 6 files changed, 101 insertions(+), 18 deletions(-)

-- 
1.7.3.4

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

* [PATCH 1/4] ARM: kirkwood: move var setting to correct location.
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-01 18:20   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

This variable should be set within the driver init function that uses
it's struct, not in the generic init function.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 357fcde..d9e4d99 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -382,6 +382,7 @@ static struct platform_device kirkwood_pcm_device = {
 void __init kirkwood_audio_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_AUDIO;
+	kirkwood_i2s_data.tclk = kirkwood_tclk;
 	platform_device_register(&kirkwood_i2s_device);
 	platform_device_register(&kirkwood_pcm_device);
 }
@@ -450,7 +451,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
-- 
1.7.3.4

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

* [PATCH 1/4] ARM: kirkwood: move var setting to correct location.
@ 2012-03-01 18:20   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

This variable should be set within the driver init function that uses
it's struct, not in the generic init function.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 357fcde..d9e4d99 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -382,6 +382,7 @@ static struct platform_device kirkwood_pcm_device = {
 void __init kirkwood_audio_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_AUDIO;
+	kirkwood_i2s_data.tclk = kirkwood_tclk;
 	platform_device_register(&kirkwood_i2s_device);
 	platform_device_register(&kirkwood_pcm_device);
 }
@@ -450,7 +451,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
-- 
1.7.3.4

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

* [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init()
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-01 18:20   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-dt.c |   30 +++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 4960e63..a0cc28b 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -115,7 +117,33 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
+		kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index d9e4d99..167b6c8 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -279,7 +279,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -291,7 +291,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -303,7 +303,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -393,7 +393,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -436,7 +436,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init()
@ 2012-03-01 18:20   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-dt.c |   30 +++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 4960e63..a0cc28b 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -115,7 +117,33 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
+		kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index d9e4d99..167b6c8 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -279,7 +279,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -291,7 +291,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -303,7 +303,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -393,7 +393,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -436,7 +436,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-01 18:20   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

The comment at mach-kirkwood/common.c:469, says this device is in every
kirkwood board.  So, it is placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
 5 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..5fb185c 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,11 @@
 
 / {
 	compatible = "marvell,kirkwood";
+
+	rtc@f1010300 {
+		compatible = "marvell,rtc";
+		reg = <0xf1010300 0x1f>;
+		interrupts = <53>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index a0cc28b..6fc41ae 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 167b6c8..0c0375f 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..ca08826 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..38abbf7 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,8 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct rtc_plat_data *pdata;
+	struct device_node *np = pdev->dev.of_node;
 	resource_size_t size;
 	u32 rtc_time;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	if (np)
+		of_address_to_resource(np, 0, res);
+
 	if (!res)
 		return -ENODEV;
 
@@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
 
 	pdata->irq = platform_get_irq(pdev, 0);
 
+	of_property_read_u32(np, "interrupts", &pdata->irq);
+
 	platform_set_drvdata(pdev, pdata);
 
 	if (pdata->irq >= 0) {
@@ -294,11 +303,21 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "marvell,rtc", },
+	{}
+};
+#else
+#define rtc_mv_of_match_table NULL
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = rtc_mv_of_match_table,
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-01 18:20   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

The comment at mach-kirkwood/common.c:469, says this device is in every
kirkwood board.  So, it is placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
 5 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..5fb185c 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,11 @@
 
 / {
 	compatible = "marvell,kirkwood";
+
+	rtc at f1010300 {
+		compatible = "marvell,rtc";
+		reg = <0xf1010300 0x1f>;
+		interrupts = <53>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index a0cc28b..6fc41ae 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 167b6c8..0c0375f 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..ca08826 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..38abbf7 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,8 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct rtc_plat_data *pdata;
+	struct device_node *np = pdev->dev.of_node;
 	resource_size_t size;
 	u32 rtc_time;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	if (np)
+		of_address_to_resource(np, 0, res);
+
 	if (!res)
 		return -ENODEV;
 
@@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
 
 	pdata->irq = platform_get_irq(pdev, 0);
 
+	of_property_read_u32(np, "interrupts", &pdata->irq);
+
 	platform_set_drvdata(pdev, pdata);
 
 	if (pdata->irq >= 0) {
@@ -294,11 +303,21 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "marvell,rtc", },
+	{}
+};
+#else
+#define rtc_mv_of_match_table NULL
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = rtc_mv_of_match_table,
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-01 18:20   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

Converted register address to a variable so that it could be set from
fdt.  Also, pull clock frequency from fdt and clean up failure logic a
bit.

Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
 5 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 5fb185c..bf28424 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -8,5 +8,11 @@
 		reg = <0xf1010300 0x1f>;
 		interrupts = <53>;
 	};
+
+	wdt@fed20300 {
+		compatible = "marvell,orion-wdt";
+		reg = <0xfed20300 0x28>;
+		clock-frequency = <200000000>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 6fc41ae..7ef5fb7 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
 	kirkwood_crypto_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 0c0375f..35dc40b 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-void __init kirkwood_wdt_init(void)
+static void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index ca08826..ac4b2fb 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
 void kirkwood_crypto_init(void);
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..4be76ca 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/watchdog.h>
 #include <linux/init.h>
 #include <linux/uaccess.h>
@@ -28,9 +29,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +41,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static unsigned int wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +50,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +62,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +70,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +94,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +104,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,15 +238,23 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct device_node *np = pdev->dev.of_node;
 	int ret;
 
-	if (pdata) {
+	if (pdata)
 		wdt_tclk = pdata->tclk;
-	} else {
-		printk(KERN_ERR "Orion Watchdog misses platform data\n");
+
+	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
+
+	if (!wdt_tclk) {
+		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
 		return -ENODEV;
 	}
 
+	wdt_reg = TIMER_VIRT_BASE;
+
+	of_property_read_u32(np, "reg", &wdt_reg);
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
@@ -284,6 +294,15 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
 		orion_wdt_disable();
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id orion_wdt_of_match_table[] = {
+	{ .compatible = "marvell,orion-wdt", },
+	{},
+};
+#else
+#define orion_wdt_of_match_table NULL
+#endif
+
 static struct platform_driver orion_wdt_driver = {
 	.probe		= orion_wdt_probe,
 	.remove		= __devexit_p(orion_wdt_remove),
@@ -291,6 +310,7 @@ static struct platform_driver orion_wdt_driver = {
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "orion_wdt",
+		.of_match_table = orion_wdt_of_match_table,
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-01 18:20   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-01 18:20 UTC (permalink / raw)
  To: linux-arm-kernel

Converted register address to a variable so that it could be set from
fdt.  Also, pull clock frequency from fdt and clean up failure logic a
bit.

Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
 5 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 5fb185c..bf28424 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -8,5 +8,11 @@
 		reg = <0xf1010300 0x1f>;
 		interrupts = <53>;
 	};
+
+	wdt at fed20300 {
+		compatible = "marvell,orion-wdt";
+		reg = <0xfed20300 0x28>;
+		clock-frequency = <200000000>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 6fc41ae..7ef5fb7 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
 	kirkwood_crypto_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 0c0375f..35dc40b 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-void __init kirkwood_wdt_init(void)
+static void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index ca08826..ac4b2fb 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
 void kirkwood_crypto_init(void);
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..4be76ca 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/watchdog.h>
 #include <linux/init.h>
 #include <linux/uaccess.h>
@@ -28,9 +29,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +41,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static unsigned int wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +50,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +62,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +70,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +94,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +104,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,15 +238,23 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct device_node *np = pdev->dev.of_node;
 	int ret;
 
-	if (pdata) {
+	if (pdata)
 		wdt_tclk = pdata->tclk;
-	} else {
-		printk(KERN_ERR "Orion Watchdog misses platform data\n");
+
+	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
+
+	if (!wdt_tclk) {
+		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
 		return -ENODEV;
 	}
 
+	wdt_reg = TIMER_VIRT_BASE;
+
+	of_property_read_u32(np, "reg", &wdt_reg);
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
@@ -284,6 +294,15 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
 		orion_wdt_disable();
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id orion_wdt_of_match_table[] = {
+	{ .compatible = "marvell,orion-wdt", },
+	{},
+};
+#else
+#define orion_wdt_of_match_table NULL
+#endif
+
 static struct platform_driver orion_wdt_driver = {
 	.probe		= orion_wdt_probe,
 	.remove		= __devexit_p(orion_wdt_remove),
@@ -291,6 +310,7 @@ static struct platform_driver orion_wdt_driver = {
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "orion_wdt",
+		.of_match_table = orion_wdt_of_match_table,
 	},
 };
 
-- 
1.7.3.4

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-01 18:20   ` Jason Cooper
@ 2012-03-01 19:35       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 19:35 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 01 March 2012, Jason Cooper wrote:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
>
> @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  {
>  	struct resource *res;
>  	struct rtc_plat_data *pdata;
> +	struct device_node *np = pdev->dev.of_node;
>  	resource_size_t size;
>  	u32 rtc_time;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> +	if (np)
> +		of_address_to_resource(np, 0, res);
> +
>  	if (!res)
>  		return -ENODEV;
>  
> @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  
>  	pdata->irq = platform_get_irq(pdev, 0);
>  
> +	of_property_read_u32(np, "interrupts", &pdata->irq);
> +
>  	platform_set_drvdata(pdev, pdata);
>  
>  	if (pdata->irq >= 0) {

The two additions here don't seem necessary, the second one not even
correct: Any interrupts and register properties automatically get
turned into platform resources when the device is instatiated.

The interrupt number should not be taken verbatim from the device tree
because it is always local to the "interrupt-parent" node, so you would
have to use irq_of_parse_and map rather than reading the property
directly, but as I said you don't even need to do that for platform
devices.

	Arnd

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-01 19:35       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 19:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 March 2012, Jason Cooper wrote:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
>
> @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  {
>  	struct resource *res;
>  	struct rtc_plat_data *pdata;
> +	struct device_node *np = pdev->dev.of_node;
>  	resource_size_t size;
>  	u32 rtc_time;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> +	if (np)
> +		of_address_to_resource(np, 0, res);
> +
>  	if (!res)
>  		return -ENODEV;
>  
> @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  
>  	pdata->irq = platform_get_irq(pdev, 0);
>  
> +	of_property_read_u32(np, "interrupts", &pdata->irq);
> +
>  	platform_set_drvdata(pdev, pdata);
>  
>  	if (pdata->irq >= 0) {

The two additions here don't seem necessary, the second one not even
correct: Any interrupts and register properties automatically get
turned into platform resources when the device is instatiated.

The interrupt number should not be taken verbatim from the device tree
because it is always local to the "interrupt-parent" node, so you would
have to use irq_of_parse_and map rather than reading the property
directly, but as I said you don't even need to do that for platform
devices.

	Arnd

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-01 18:20   ` Jason Cooper
@ 2012-03-01 19:48       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 19:48 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 01 March 2012, Jason Cooper wrote:
>  static int heartbeat = -1;             /* module parameter (seconds) */
>  static unsigned int wdt_max_duration;  /* (seconds) */
>  static unsigned int wdt_tclk;
> +static unsigned int wdt_reg;
>  static unsigned long wdt_status;
> static DEFINE_SPINLOCK(wdt_lock);

This variable needs to be a 'void __iomem *', not an int.

> +       wdt_reg = TIMER_VIRT_BASE;
> +
> +       of_property_read_u32(np, "reg", &wdt_reg);
> +
>         if (orion_wdt_miscdev.parent)
>                 return -EBUSY;
>         orion_wdt_miscdev.parent = &pdev->dev;

Don't just read a reg property, but use the resource instead and ioremap it.

This driver still uses hardcoded virtual addresses for its registers, which
we're trying to get rid of. The best solution would be to always put the
register address into the platform device resources, either hardcoded for
classic boards or automatic through the device tree.

A reg property is special in that it's not just a number but is relative
to the "ranges" property of the parent device and can be multiple 32 bit
values for the address, which get turned into a CPU physical address using
of_translate_address().

	Arnd

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-01 19:48       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 19:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 March 2012, Jason Cooper wrote:
>  static int heartbeat = -1;             /* module parameter (seconds) */
>  static unsigned int wdt_max_duration;  /* (seconds) */
>  static unsigned int wdt_tclk;
> +static unsigned int wdt_reg;
>  static unsigned long wdt_status;
> static DEFINE_SPINLOCK(wdt_lock);

This variable needs to be a 'void __iomem *', not an int.

> +       wdt_reg = TIMER_VIRT_BASE;
> +
> +       of_property_read_u32(np, "reg", &wdt_reg);
> +
>         if (orion_wdt_miscdev.parent)
>                 return -EBUSY;
>         orion_wdt_miscdev.parent = &pdev->dev;

Don't just read a reg property, but use the resource instead and ioremap it.

This driver still uses hardcoded virtual addresses for its registers, which
we're trying to get rid of. The best solution would be to always put the
register address into the platform device resources, either hardcoded for
classic boards or automatic through the device tree.

A reg property is special in that it's not just a number but is relative
to the "ranges" property of the parent device and can be multiple 32 bit
values for the address, which get turned into a CPU physical address using
of_translate_address().

	Arnd

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-01 19:50   ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 19:50 UTC (permalink / raw)
  To: Jason Cooper; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel

On Thursday 01 March 2012, Jason Cooper wrote:
> This series begins the process of converting all of the drivers initialized
> from kirkwood_init() to devicetree.
> 
> The first patch cleans up kirkwood_init() by moving a flag setting to it's
> appropriate location.  This will help later when converting the audio driver.
> 
> Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
> board-dt.c  This way, as drivers are converted, their init calls can be removed
> from kirkwood_dt_init() and non-fdt users won't be affected (they call
> kirkwood_init()).
> 
> Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
> drivers remain for a later patch series.

Hi Jason,

Nice patch series! I've commented on a few details that need improving, but
it seems you're making good progress overall. Note that in other platforms,
we typically focus on converting all the devices outside of the soc first,
because that lets us get away from board files faster, but there is nothing
wrong in principle in converting the devices on the soc as well.

	Arnd

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-01 19:50   ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 19:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 March 2012, Jason Cooper wrote:
> This series begins the process of converting all of the drivers initialized
> from kirkwood_init() to devicetree.
> 
> The first patch cleans up kirkwood_init() by moving a flag setting to it's
> appropriate location.  This will help later when converting the audio driver.
> 
> Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
> board-dt.c  This way, as drivers are converted, their init calls can be removed
> from kirkwood_dt_init() and non-fdt users won't be affected (they call
> kirkwood_init()).
> 
> Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
> drivers remain for a later patch series.

Hi Jason,

Nice patch series! I've commented on a few details that need improving, but
it seems you're making good progress overall. Note that in other platforms,
we typically focus on converting all the devices outside of the soc first,
because that lets us get away from board files faster, but there is nothing
wrong in principle in converting the devices on the soc as well.

	Arnd

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-01 19:50   ` Arnd Bergmann
@ 2012-03-01 20:01       ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-01 20:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Mar 01, 2012 at 07:50:51PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason Cooper wrote:
> > This series begins the process of converting all of the drivers initialized
> > from kirkwood_init() to devicetree.
> > 
> > The first patch cleans up kirkwood_init() by moving a flag setting to it's
> > appropriate location.  This will help later when converting the audio driver.
> > 
> > Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
> > board-dt.c  This way, as drivers are converted, their init calls can be removed
> > from kirkwood_dt_init() and non-fdt users won't be affected (they call
> > kirkwood_init()).
> > 
> > Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
> > drivers remain for a later patch series.
> 
> Hi Jason,
> 
> Nice patch series! I've commented on a few details that need improving, but
> it seems you're making good progress overall. Note that in other platforms,
> we typically focus on converting all the devices outside of the soc first,
> because that lets us get away from board files faster, but there is nothing
> wrong in principle in converting the devices on the soc as well.

Thanks for the feedback.  I'll redo this series and resubmit.  Did you
catch my patch from yesterday?

[PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]

thx,

Jason.

[1] http://www.spinics.net/lists/arm-kernel/msg161975.html
> 
> 	Arnd
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-01 20:01       ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-01 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 01, 2012 at 07:50:51PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason Cooper wrote:
> > This series begins the process of converting all of the drivers initialized
> > from kirkwood_init() to devicetree.
> > 
> > The first patch cleans up kirkwood_init() by moving a flag setting to it's
> > appropriate location.  This will help later when converting the audio driver.
> > 
> > Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
> > board-dt.c  This way, as drivers are converted, their init calls can be removed
> > from kirkwood_dt_init() and non-fdt users won't be affected (they call
> > kirkwood_init()).
> > 
> > Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
> > drivers remain for a later patch series.
> 
> Hi Jason,
> 
> Nice patch series! I've commented on a few details that need improving, but
> it seems you're making good progress overall. Note that in other platforms,
> we typically focus on converting all the devices outside of the soc first,
> because that lets us get away from board files faster, but there is nothing
> wrong in principle in converting the devices on the soc as well.

Thanks for the feedback.  I'll redo this series and resubmit.  Did you
catch my patch from yesterday?

[PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]

thx,

Jason.

[1] http://www.spinics.net/lists/arm-kernel/msg161975.html
> 
> 	Arnd
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-01 20:01       ` Jason
@ 2012-03-01 20:28         ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 20:28 UTC (permalink / raw)
  To: Jason; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel

On Thursday 01 March 2012, Jason wrote:
> Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> catch my patch from yesterday?
> 
> [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]

Yes, I saw that. It looks good and I was just waiting if other people
have comments on it. Maybe you can put it into the same git tree as
these ones when they are ready and you send a pull request.

	Arnd

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-01 20:28         ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 20:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 March 2012, Jason wrote:
> Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> catch my patch from yesterday?
> 
> [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]

Yes, I saw that. It looks good and I was just waiting if other people
have comments on it. Maybe you can put it into the same git tree as
these ones when they are ready and you send a pull request.

	Arnd

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-01 20:28         ` Arnd Bergmann
@ 2012-03-01 21:23             ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-01 21:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Mar 01, 2012 at 08:28:04PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason wrote:
> > Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> > catch my patch from yesterday?
> > 
> > [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
> 
> Yes, I saw that. It looks good and I was just waiting if other people
> have comments on it. Maybe you can put it into the same git tree as
> these ones when they are ready and you send a pull request.

Okay, I have a local branch, 'dreamplug_dt' based at v3.3-rc3.  It
includes the two patches you've already merged into your tree:

c9780e7 ARM: kirkwood: add dreamplug (fdt) support.
dbc3c26 ARM: kirkwood: convert uart0 to devicetree.

Plus the spi/flash/partitions, and the most recent series.

Can I just do:

git push linux-kirkwood dreamplug_dt:kirkwood_dt

Then, issue a pull request for

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt

and reference the first uncommitted patch?

Most of the googlings for 'pull request' yield github's "click the
button", yuck.

Also, is there an equivalent to 'git format-patch/send-email' for pull
requests?  The pull requests I've looked at seem awfully consistent in
formatting.

thx,

Jason.

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-01 21:23             ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-01 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 01, 2012 at 08:28:04PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason wrote:
> > Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> > catch my patch from yesterday?
> > 
> > [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
> 
> Yes, I saw that. It looks good and I was just waiting if other people
> have comments on it. Maybe you can put it into the same git tree as
> these ones when they are ready and you send a pull request.

Okay, I have a local branch, 'dreamplug_dt' based at v3.3-rc3.  It
includes the two patches you've already merged into your tree:

c9780e7 ARM: kirkwood: add dreamplug (fdt) support.
dbc3c26 ARM: kirkwood: convert uart0 to devicetree.

Plus the spi/flash/partitions, and the most recent series.

Can I just do:

git push linux-kirkwood dreamplug_dt:kirkwood_dt

Then, issue a pull request for

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt

and reference the first uncommitted patch?

Most of the googlings for 'pull request' yield github's "click the
button", yuck.

Also, is there an equivalent to 'git format-patch/send-email' for pull
requests?  The pull requests I've looked at seem awfully consistent in
formatting.

thx,

Jason.

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-01 19:35       ` Arnd Bergmann
@ 2012-03-01 21:26           ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-01 21:26 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Mar 01, 2012 at 07:35:58PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason Cooper wrote:
> > The comment at mach-kirkwood/common.c:469, says this device is in every
> > kirkwood board.  So, it is placed in kirkwood.dtsi.
> >
> > @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  {
> >  	struct resource *res;
> >  	struct rtc_plat_data *pdata;
> > +	struct device_node *np = pdev->dev.of_node;
> >  	resource_size_t size;
> >  	u32 rtc_time;
> >  
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +	if (np)
> > +		of_address_to_resource(np, 0, res);
> > +
> >  	if (!res)
> >  		return -ENODEV;
> >  
> > @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  
> >  	pdata->irq = platform_get_irq(pdev, 0);
> >  
> > +	of_property_read_u32(np, "interrupts", &pdata->irq);
> > +
> >  	platform_set_drvdata(pdev, pdata);
> >  
> >  	if (pdata->irq >= 0) {
> 
> The two additions here don't seem necessary, the second one not even
> correct: Any interrupts and register properties automatically get
> turned into platform resources when the device is instatiated.
> 
> The interrupt number should not be taken verbatim from the device tree
> because it is always local to the "interrupt-parent" node, so you would
> have to use irq_of_parse_and map rather than reading the property
> directly, but as I said you don't even need to do that for platform
> devices.

Learning everyday... :-)

thx,

Jason.

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-01 21:26           ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-01 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 01, 2012 at 07:35:58PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason Cooper wrote:
> > The comment at mach-kirkwood/common.c:469, says this device is in every
> > kirkwood board.  So, it is placed in kirkwood.dtsi.
> >
> > @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  {
> >  	struct resource *res;
> >  	struct rtc_plat_data *pdata;
> > +	struct device_node *np = pdev->dev.of_node;
> >  	resource_size_t size;
> >  	u32 rtc_time;
> >  
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +	if (np)
> > +		of_address_to_resource(np, 0, res);
> > +
> >  	if (!res)
> >  		return -ENODEV;
> >  
> > @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  
> >  	pdata->irq = platform_get_irq(pdev, 0);
> >  
> > +	of_property_read_u32(np, "interrupts", &pdata->irq);
> > +
> >  	platform_set_drvdata(pdev, pdata);
> >  
> >  	if (pdata->irq >= 0) {
> 
> The two additions here don't seem necessary, the second one not even
> correct: Any interrupts and register properties automatically get
> turned into platform resources when the device is instatiated.
> 
> The interrupt number should not be taken verbatim from the device tree
> because it is always local to the "interrupt-parent" node, so you would
> have to use irq_of_parse_and map rather than reading the property
> directly, but as I said you don't even need to do that for platform
> devices.

Learning everyday... :-)

thx,

Jason.

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-01 21:23             ` Jason
@ 2012-03-01 22:14                 ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 22:14 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 01 March 2012, Jason wrote:
> On Thu, Mar 01, 2012 at 08:28:04PM +0000, Arnd Bergmann wrote:
> > On Thursday 01 March 2012, Jason wrote:
> > > Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> > > catch my patch from yesterday?
> > > 
> > > [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
> > 
> > Yes, I saw that. It looks good and I was just waiting if other people
> > have comments on it. Maybe you can put it into the same git tree as
> > these ones when they are ready and you send a pull request.
> 
> Okay, I have a local branch, 'dreamplug_dt' based at v3.3-rc3.  It
> includes the two patches you've already merged into your tree:
> 
> c9780e7 ARM: kirkwood: add dreamplug (fdt) support.
> dbc3c26 ARM: kirkwood: convert uart0 to devicetree.
> 
> Plus the spi/flash/partitions, and the most recent series.
> 
> Can I just do:
> 
> git push linux-kirkwood dreamplug_dt:kirkwood_dt
> 
> Then, issue a pull request for
> 
> git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt
> 
> and reference the first uncommitted patch?

I have other commit IDs for the two patches that I took from your
emails, so you should rebase the other patches on top of the
version that I have in the arm-soc/kirkwood/board branch, otherwise
we end up with duplicate commits my tree when I pull them again.

> Most of the googlings for 'pull request' yield github's "click the
> button", yuck.
> 
> Also, is there an equivalent to 'git format-patch/send-email' for pull
> requests?  The pull requests I've looked at seem awfully consistent in
> formatting.

It's "git request-pull".

	Arnd

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-01 22:14                 ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-01 22:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 March 2012, Jason wrote:
> On Thu, Mar 01, 2012 at 08:28:04PM +0000, Arnd Bergmann wrote:
> > On Thursday 01 March 2012, Jason wrote:
> > > Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> > > catch my patch from yesterday?
> > > 
> > > [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
> > 
> > Yes, I saw that. It looks good and I was just waiting if other people
> > have comments on it. Maybe you can put it into the same git tree as
> > these ones when they are ready and you send a pull request.
> 
> Okay, I have a local branch, 'dreamplug_dt' based at v3.3-rc3.  It
> includes the two patches you've already merged into your tree:
> 
> c9780e7 ARM: kirkwood: add dreamplug (fdt) support.
> dbc3c26 ARM: kirkwood: convert uart0 to devicetree.
> 
> Plus the spi/flash/partitions, and the most recent series.
> 
> Can I just do:
> 
> git push linux-kirkwood dreamplug_dt:kirkwood_dt
> 
> Then, issue a pull request for
> 
> git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt
> 
> and reference the first uncommitted patch?

I have other commit IDs for the two patches that I took from your
emails, so you should rebase the other patches on top of the
version that I have in the arm-soc/kirkwood/board branch, otherwise
we end up with duplicate commits my tree when I pull them again.

> Most of the googlings for 'pull request' yield github's "click the
> button", yuck.
> 
> Also, is there an equivalent to 'git format-patch/send-email' for pull
> requests?  The pull requests I've looked at seem awfully consistent in
> formatting.

It's "git request-pull".

	Arnd

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

* Re: [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init()
  2012-03-01 18:20   ` Jason Cooper
@ 2012-03-02  7:09       ` Grant Likely
  -1 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-02  7:09 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu,  1 Mar 2012 18:20:53 +0000, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
> convert drivers, we can remove the platform call, eg
> kirkwood_rtc_init().  This maintains compatibility with non-fdt
> configurations because they still call kirkwood_init() in common.c.
> 
> As drivers are converted, we will reinstate the 'static' qualifier in
> common.c.
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> ---
>  arch/arm/mach-kirkwood/board-dt.c |   30 +++++++++++++++++++++++++++++-
>  arch/arm/mach-kirkwood/common.c   |   12 ++++++------
>  arch/arm/mach-kirkwood/common.h   |    8 ++++++++
>  3 files changed, 43 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 4960e63..a0cc28b 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -29,7 +29,9 @@
>  #include <linux/spi/orion_spi.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
>  #include <mach/kirkwood.h>
> +#include <mach/bridge-regs.h>
>  #include <plat/mvsdio.h>
>  #include "common.h"
>  #include "mpp.h"
> @@ -115,7 +117,33 @@ static void __init dreamplug_init(void)
>  
>  static void __init kirkwood_dt_init(void)
>  {
> -	kirkwood_init();
> +	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
> +		kirkwood_id(), kirkwood_tclk);

Nit: pr_info()

g.

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

* [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init()
@ 2012-03-02  7:09       ` Grant Likely
  0 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-02  7:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu,  1 Mar 2012 18:20:53 +0000, Jason Cooper <jason@lakedaemon.net> wrote:
> We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
> convert drivers, we can remove the platform call, eg
> kirkwood_rtc_init().  This maintains compatibility with non-fdt
> configurations because they still call kirkwood_init() in common.c.
> 
> As drivers are converted, we will reinstate the 'static' qualifier in
> common.c.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/mach-kirkwood/board-dt.c |   30 +++++++++++++++++++++++++++++-
>  arch/arm/mach-kirkwood/common.c   |   12 ++++++------
>  arch/arm/mach-kirkwood/common.h   |    8 ++++++++
>  3 files changed, 43 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 4960e63..a0cc28b 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -29,7 +29,9 @@
>  #include <linux/spi/orion_spi.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
>  #include <mach/kirkwood.h>
> +#include <mach/bridge-regs.h>
>  #include <plat/mvsdio.h>
>  #include "common.h"
>  #include "mpp.h"
> @@ -115,7 +117,33 @@ static void __init dreamplug_init(void)
>  
>  static void __init kirkwood_dt_init(void)
>  {
> -	kirkwood_init();
> +	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
> +		kirkwood_id(), kirkwood_tclk);

Nit: pr_info()

g.

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-01 18:20   ` Jason Cooper
@ 2012-03-02  7:19     ` Grant Likely
  -1 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-02  7:19 UTC (permalink / raw)
  To: arnd; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

On Thu,  1 Mar 2012 18:20:54 +0000, Jason Cooper <jason@lakedaemon.net> wrote:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
>  5 files changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 771c6bb..5fb185c 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,11 @@
>  
>  / {
>  	compatible = "marvell,kirkwood";
> +
> +	rtc@f1010300 {
> +		compatible = "marvell,rtc";
> +		reg = <0xf1010300 0x1f>;
> +		interrupts = <53>;
> +	};
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index a0cc28b..6fc41ae 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
>  
>  	/* internal devices that every board has */
> -	kirkwood_rtc_init();
>  	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 167b6c8..0c0375f 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
>  /*****************************************************************************
>   * SoC RTC
>   ****************************************************************************/
> -void __init kirkwood_rtc_init(void)
> +static void __init kirkwood_rtc_init(void)

This undoes the code changed in the previous patch.  If you reorder the patches then
this change goes away in both.

>  {
>  	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index c382447..ca08826 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
>  
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_rtc_init(void);
>  void kirkwood_wdt_init(void);
>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 768e2ed..38abbf7 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -12,6 +12,8 @@
>  #include <linux/bcd.h>
>  #include <linux/io.h>
>  #include <linux/platform_device.h>
> +#include <linux/of_address.h>
> +#include <linux/of.h>
>  #include <linux/delay.h>
>  #include <linux/gfp.h>
>  #include <linux/module.h>
> @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  {
>  	struct resource *res;
>  	struct rtc_plat_data *pdata;
> +	struct device_node *np = pdev->dev.of_node;
>  	resource_size_t size;
>  	u32 rtc_time;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> +	if (np)
> +		of_address_to_resource(np, 0, res);
> +

This should not be needed.  The of_platform_populate() code should have
filled the platform_device with mem resources.

>  	if (!res)
>  		return -ENODEV;
>  
> @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  
>  	pdata->irq = platform_get_irq(pdev, 0);
>  
> +	of_property_read_u32(np, "interrupts", &pdata->irq);
> +

Definitely don't do this.  Same as with memory regions, the irq will be
pre-populated in the platform device resource table.  platform_get_irq()
should already work.

>  	platform_set_drvdata(pdev, pdata);
>  
>  	if (pdata->irq >= 0) {
> @@ -294,11 +303,21 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id rtc_mv_of_match_table[] = {
> +	{ .compatible = "marvell,rtc", },
> +	{}
> +};
> +#else
> +#define rtc_mv_of_match_table NULL
> +#endif
> +
>  static struct platform_driver mv_rtc_driver = {
>  	.remove		= __exit_p(mv_rtc_remove),
>  	.driver		= {
>  		.name	= "rtc-mv",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = rtc_mv_of_match_table,

should be:
		.of_match_table = of_match_ptr(rtc_mv_of_match_table),

that would get rid of the #else clause above.

>  	},
>  };
>  
> -- 
> 1.7.3.4
> 

-- 
email sent from notmuch.vim plugin

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-02  7:19     ` Grant Likely
  0 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-02  7:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu,  1 Mar 2012 18:20:54 +0000, Jason Cooper <jason@lakedaemon.net> wrote:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
>  5 files changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 771c6bb..5fb185c 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,11 @@
>  
>  / {
>  	compatible = "marvell,kirkwood";
> +
> +	rtc at f1010300 {
> +		compatible = "marvell,rtc";
> +		reg = <0xf1010300 0x1f>;
> +		interrupts = <53>;
> +	};
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index a0cc28b..6fc41ae 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
>  
>  	/* internal devices that every board has */
> -	kirkwood_rtc_init();
>  	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 167b6c8..0c0375f 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
>  /*****************************************************************************
>   * SoC RTC
>   ****************************************************************************/
> -void __init kirkwood_rtc_init(void)
> +static void __init kirkwood_rtc_init(void)

This undoes the code changed in the previous patch.  If you reorder the patches then
this change goes away in both.

>  {
>  	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index c382447..ca08826 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
>  
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_rtc_init(void);
>  void kirkwood_wdt_init(void);
>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 768e2ed..38abbf7 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -12,6 +12,8 @@
>  #include <linux/bcd.h>
>  #include <linux/io.h>
>  #include <linux/platform_device.h>
> +#include <linux/of_address.h>
> +#include <linux/of.h>
>  #include <linux/delay.h>
>  #include <linux/gfp.h>
>  #include <linux/module.h>
> @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  {
>  	struct resource *res;
>  	struct rtc_plat_data *pdata;
> +	struct device_node *np = pdev->dev.of_node;
>  	resource_size_t size;
>  	u32 rtc_time;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +
> +	if (np)
> +		of_address_to_resource(np, 0, res);
> +

This should not be needed.  The of_platform_populate() code should have
filled the platform_device with mem resources.

>  	if (!res)
>  		return -ENODEV;
>  
> @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
>  
>  	pdata->irq = platform_get_irq(pdev, 0);
>  
> +	of_property_read_u32(np, "interrupts", &pdata->irq);
> +

Definitely don't do this.  Same as with memory regions, the irq will be
pre-populated in the platform device resource table.  platform_get_irq()
should already work.

>  	platform_set_drvdata(pdev, pdata);
>  
>  	if (pdata->irq >= 0) {
> @@ -294,11 +303,21 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id rtc_mv_of_match_table[] = {
> +	{ .compatible = "marvell,rtc", },
> +	{}
> +};
> +#else
> +#define rtc_mv_of_match_table NULL
> +#endif
> +
>  static struct platform_driver mv_rtc_driver = {
>  	.remove		= __exit_p(mv_rtc_remove),
>  	.driver		= {
>  		.name	= "rtc-mv",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = rtc_mv_of_match_table,

should be:
		.of_match_table = of_match_ptr(rtc_mv_of_match_table),

that would get rid of the #else clause above.

>  	},
>  };
>  
> -- 
> 1.7.3.4
> 

-- 
email sent from notmuch.vim plugin

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-01 18:20   ` Jason Cooper
@ 2012-03-02  7:22       ` Grant Likely
  -1 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-02  7:22 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu,  1 Mar 2012 18:20:55 +0000, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> Converted register address to a variable so that it could be set from
> fdt.  Also, pull clock frequency from fdt and clean up failure logic a
> bit.
> 
> Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
> placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
>  5 files changed, 39 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 5fb185c..bf28424 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -8,5 +8,11 @@
>  		reg = <0xf1010300 0x1f>;
>  		interrupts = <53>;
>  	};
> +
> +	wdt@fed20300 {
> +		compatible = "marvell,orion-wdt";
> +		reg = <0xfed20300 0x28>;
> +		clock-frequency = <200000000>;
> +	};
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 6fc41ae..7ef5fb7 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
>  
>  	/* internal devices that every board has */
> -	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
>  	kirkwood_crypto_init();
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 0c0375f..35dc40b 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
>  /*****************************************************************************
>   * Watchdog
>   ****************************************************************************/
> -void __init kirkwood_wdt_init(void)
> +static void __init kirkwood_wdt_init(void)
>  {
>  	orion_wdt_init(kirkwood_tclk);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index ca08826..ac4b2fb 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
>  
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_wdt_init(void);

Similar comment here; patch undoes changes made in patch 2.

>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
>  void kirkwood_crypto_init(void);
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 4ad78f8..4be76ca 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -17,6 +17,7 @@
>  #include <linux/fs.h>
>  #include <linux/miscdevice.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/watchdog.h>
>  #include <linux/init.h>
>  #include <linux/uaccess.h>
> @@ -28,9 +29,9 @@
>  /*
>   * Watchdog timer block registers.
>   */
> -#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
> +#define TIMER_CTRL		0x0000
>  #define  WDT_EN			0x0010
> -#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
> +#define WDT_VAL			0x0024
>  
>  #define WDT_MAX_CYCLE_COUNT	0xffffffff
>  #define WDT_IN_USE		0
> @@ -40,6 +41,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
>  static int heartbeat = -1;		/* module parameter (seconds) */
>  static unsigned int wdt_max_duration;	/* (seconds) */
>  static unsigned int wdt_tclk;
> +static unsigned int wdt_reg;
>  static unsigned long wdt_status;
>  static DEFINE_SPINLOCK(wdt_lock);
>  
> @@ -48,7 +50,7 @@ static void orion_wdt_ping(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Reload watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -60,7 +62,7 @@ static void orion_wdt_enable(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Set watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	/* Clear watchdog timer interrupt */
>  	reg = readl(BRIDGE_CAUSE);
> @@ -68,9 +70,9 @@ static void orion_wdt_enable(void)
>  	writel(reg, BRIDGE_CAUSE);
>  
>  	/* Enable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg |= WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	/* Enable reset on watchdog */
>  	reg = readl(RSTOUTn_MASK);
> @@ -92,9 +94,9 @@ static void orion_wdt_disable(void)
>  	writel(reg, RSTOUTn_MASK);
>  
>  	/* Disable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg &= ~WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -102,7 +104,7 @@ static void orion_wdt_disable(void)
>  static int orion_wdt_get_timeleft(int *time_left)
>  {
>  	spin_lock(&wdt_lock);
> -	*time_left = readl(WDT_VAL) / wdt_tclk;
> +	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
>  	spin_unlock(&wdt_lock);
>  	return 0;
>  }
> @@ -236,15 +238,23 @@ static struct miscdevice orion_wdt_miscdev = {
>  static int __devinit orion_wdt_probe(struct platform_device *pdev)
>  {
>  	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
> +	struct device_node *np = pdev->dev.of_node;
>  	int ret;
>  
> -	if (pdata) {
> +	if (pdata)
>  		wdt_tclk = pdata->tclk;
> -	} else {
> -		printk(KERN_ERR "Orion Watchdog misses platform data\n");
> +
> +	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
> +
> +	if (!wdt_tclk) {
> +		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
>  		return -ENODEV;
>  	}
>  
> +	wdt_reg = TIMER_VIRT_BASE;
> +
> +	of_property_read_u32(np, "reg", &wdt_reg);
> +

Never decode 'reg' directly.  Always use platform_get_resource() for
platform devices.  That works for DT and non-DT users.

>  	if (orion_wdt_miscdev.parent)
>  		return -EBUSY;
>  	orion_wdt_miscdev.parent = &pdev->dev;
> @@ -284,6 +294,15 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
>  		orion_wdt_disable();
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id orion_wdt_of_match_table[] = {
> +	{ .compatible = "marvell,orion-wdt", },
> +	{},
> +};
> +#else
> +#define orion_wdt_of_match_table NULL
> +#endif
> +
>  static struct platform_driver orion_wdt_driver = {
>  	.probe		= orion_wdt_probe,
>  	.remove		= __devexit_p(orion_wdt_remove),
> @@ -291,6 +310,7 @@ static struct platform_driver orion_wdt_driver = {
>  	.driver		= {
>  		.owner	= THIS_MODULE,
>  		.name	= "orion_wdt",
> +		.of_match_table = orion_wdt_of_match_table,

of_match_ptr()

>  	},
>  };
>  
> -- 
> 1.7.3.4
> 

-- 
email sent from notmuch.vim plugin

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02  7:22       ` Grant Likely
  0 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-02  7:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu,  1 Mar 2012 18:20:55 +0000, Jason Cooper <jason@lakedaemon.net> wrote:
> Converted register address to a variable so that it could be set from
> fdt.  Also, pull clock frequency from fdt and clean up failure logic a
> bit.
> 
> Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
> placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
>  5 files changed, 39 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 5fb185c..bf28424 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -8,5 +8,11 @@
>  		reg = <0xf1010300 0x1f>;
>  		interrupts = <53>;
>  	};
> +
> +	wdt at fed20300 {
> +		compatible = "marvell,orion-wdt";
> +		reg = <0xfed20300 0x28>;
> +		clock-frequency = <200000000>;
> +	};
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 6fc41ae..7ef5fb7 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
>  
>  	/* internal devices that every board has */
> -	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
>  	kirkwood_crypto_init();
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 0c0375f..35dc40b 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
>  /*****************************************************************************
>   * Watchdog
>   ****************************************************************************/
> -void __init kirkwood_wdt_init(void)
> +static void __init kirkwood_wdt_init(void)
>  {
>  	orion_wdt_init(kirkwood_tclk);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index ca08826..ac4b2fb 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
>  
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_wdt_init(void);

Similar comment here; patch undoes changes made in patch 2.

>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
>  void kirkwood_crypto_init(void);
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 4ad78f8..4be76ca 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -17,6 +17,7 @@
>  #include <linux/fs.h>
>  #include <linux/miscdevice.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/watchdog.h>
>  #include <linux/init.h>
>  #include <linux/uaccess.h>
> @@ -28,9 +29,9 @@
>  /*
>   * Watchdog timer block registers.
>   */
> -#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
> +#define TIMER_CTRL		0x0000
>  #define  WDT_EN			0x0010
> -#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
> +#define WDT_VAL			0x0024
>  
>  #define WDT_MAX_CYCLE_COUNT	0xffffffff
>  #define WDT_IN_USE		0
> @@ -40,6 +41,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
>  static int heartbeat = -1;		/* module parameter (seconds) */
>  static unsigned int wdt_max_duration;	/* (seconds) */
>  static unsigned int wdt_tclk;
> +static unsigned int wdt_reg;
>  static unsigned long wdt_status;
>  static DEFINE_SPINLOCK(wdt_lock);
>  
> @@ -48,7 +50,7 @@ static void orion_wdt_ping(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Reload watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -60,7 +62,7 @@ static void orion_wdt_enable(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Set watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	/* Clear watchdog timer interrupt */
>  	reg = readl(BRIDGE_CAUSE);
> @@ -68,9 +70,9 @@ static void orion_wdt_enable(void)
>  	writel(reg, BRIDGE_CAUSE);
>  
>  	/* Enable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg |= WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	/* Enable reset on watchdog */
>  	reg = readl(RSTOUTn_MASK);
> @@ -92,9 +94,9 @@ static void orion_wdt_disable(void)
>  	writel(reg, RSTOUTn_MASK);
>  
>  	/* Disable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg &= ~WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -102,7 +104,7 @@ static void orion_wdt_disable(void)
>  static int orion_wdt_get_timeleft(int *time_left)
>  {
>  	spin_lock(&wdt_lock);
> -	*time_left = readl(WDT_VAL) / wdt_tclk;
> +	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
>  	spin_unlock(&wdt_lock);
>  	return 0;
>  }
> @@ -236,15 +238,23 @@ static struct miscdevice orion_wdt_miscdev = {
>  static int __devinit orion_wdt_probe(struct platform_device *pdev)
>  {
>  	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
> +	struct device_node *np = pdev->dev.of_node;
>  	int ret;
>  
> -	if (pdata) {
> +	if (pdata)
>  		wdt_tclk = pdata->tclk;
> -	} else {
> -		printk(KERN_ERR "Orion Watchdog misses platform data\n");
> +
> +	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
> +
> +	if (!wdt_tclk) {
> +		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
>  		return -ENODEV;
>  	}
>  
> +	wdt_reg = TIMER_VIRT_BASE;
> +
> +	of_property_read_u32(np, "reg", &wdt_reg);
> +

Never decode 'reg' directly.  Always use platform_get_resource() for
platform devices.  That works for DT and non-DT users.

>  	if (orion_wdt_miscdev.parent)
>  		return -EBUSY;
>  	orion_wdt_miscdev.parent = &pdev->dev;
> @@ -284,6 +294,15 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
>  		orion_wdt_disable();
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id orion_wdt_of_match_table[] = {
> +	{ .compatible = "marvell,orion-wdt", },
> +	{},
> +};
> +#else
> +#define orion_wdt_of_match_table NULL
> +#endif
> +
>  static struct platform_driver orion_wdt_driver = {
>  	.probe		= orion_wdt_probe,
>  	.remove		= __devexit_p(orion_wdt_remove),
> @@ -291,6 +310,7 @@ static struct platform_driver orion_wdt_driver = {
>  	.driver		= {
>  		.owner	= THIS_MODULE,
>  		.name	= "orion_wdt",
> +		.of_match_table = orion_wdt_of_match_table,

of_match_ptr()

>  	},
>  };
>  
> -- 
> 1.7.3.4
> 

-- 
email sent from notmuch.vim plugin

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-01 18:20   ` Jason Cooper
@ 2012-03-02  9:15     ` Simon Guinot
  -1 siblings, 0 replies; 272+ messages in thread
From: Simon Guinot @ 2012-03-02  9:15 UTC (permalink / raw)
  To: Jason Cooper; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel, arnd


[-- Attachment #1.1: Type: text/plain, Size: 7380 bytes --]

Hi Jason,

On Thu, Mar 01, 2012 at 06:20:55PM +0000, Jason Cooper wrote:
> Converted register address to a variable so that it could be set from
> fdt.  Also, pull clock frequency from fdt and clean up failure logic a
> bit.
> 
> Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
> placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
>  5 files changed, 39 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 5fb185c..bf28424 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -8,5 +8,11 @@
>  		reg = <0xf1010300 0x1f>;
>  		interrupts = <53>;
>  	};
> +
> +	wdt@fed20300 {
> +		compatible = "marvell,orion-wdt";
> +		reg = <0xfed20300 0x28>;
> +		clock-frequency = <200000000>;
> +	};

How this will work for boards using a different clock frequency (TCLK) ?
Here, we could have 166MHz for example.

Can this node be updated during the board initialization with a detected
TCLK value ?

Or maybe this clock-frequency can reference a TCLK frequency defined in
a board specific dts (I don't know if the DT format allow such things) ?

Regards,

Simon

>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 6fc41ae..7ef5fb7 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
>  
>  	/* internal devices that every board has */
> -	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
>  	kirkwood_crypto_init();
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 0c0375f..35dc40b 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
>  /*****************************************************************************
>   * Watchdog
>   ****************************************************************************/
> -void __init kirkwood_wdt_init(void)
> +static void __init kirkwood_wdt_init(void)
>  {
>  	orion_wdt_init(kirkwood_tclk);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index ca08826..ac4b2fb 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
>  
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_wdt_init(void);
>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
>  void kirkwood_crypto_init(void);
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 4ad78f8..4be76ca 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -17,6 +17,7 @@
>  #include <linux/fs.h>
>  #include <linux/miscdevice.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/watchdog.h>
>  #include <linux/init.h>
>  #include <linux/uaccess.h>
> @@ -28,9 +29,9 @@
>  /*
>   * Watchdog timer block registers.
>   */
> -#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
> +#define TIMER_CTRL		0x0000
>  #define  WDT_EN			0x0010
> -#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
> +#define WDT_VAL			0x0024
>  
>  #define WDT_MAX_CYCLE_COUNT	0xffffffff
>  #define WDT_IN_USE		0
> @@ -40,6 +41,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
>  static int heartbeat = -1;		/* module parameter (seconds) */
>  static unsigned int wdt_max_duration;	/* (seconds) */
>  static unsigned int wdt_tclk;
> +static unsigned int wdt_reg;
>  static unsigned long wdt_status;
>  static DEFINE_SPINLOCK(wdt_lock);
>  
> @@ -48,7 +50,7 @@ static void orion_wdt_ping(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Reload watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -60,7 +62,7 @@ static void orion_wdt_enable(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Set watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	/* Clear watchdog timer interrupt */
>  	reg = readl(BRIDGE_CAUSE);
> @@ -68,9 +70,9 @@ static void orion_wdt_enable(void)
>  	writel(reg, BRIDGE_CAUSE);
>  
>  	/* Enable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg |= WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	/* Enable reset on watchdog */
>  	reg = readl(RSTOUTn_MASK);
> @@ -92,9 +94,9 @@ static void orion_wdt_disable(void)
>  	writel(reg, RSTOUTn_MASK);
>  
>  	/* Disable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg &= ~WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -102,7 +104,7 @@ static void orion_wdt_disable(void)
>  static int orion_wdt_get_timeleft(int *time_left)
>  {
>  	spin_lock(&wdt_lock);
> -	*time_left = readl(WDT_VAL) / wdt_tclk;
> +	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
>  	spin_unlock(&wdt_lock);
>  	return 0;
>  }
> @@ -236,15 +238,23 @@ static struct miscdevice orion_wdt_miscdev = {
>  static int __devinit orion_wdt_probe(struct platform_device *pdev)
>  {
>  	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
> +	struct device_node *np = pdev->dev.of_node;
>  	int ret;
>  
> -	if (pdata) {
> +	if (pdata)
>  		wdt_tclk = pdata->tclk;
> -	} else {
> -		printk(KERN_ERR "Orion Watchdog misses platform data\n");
> +
> +	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
> +
> +	if (!wdt_tclk) {
> +		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
>  		return -ENODEV;
>  	}
>  
> +	wdt_reg = TIMER_VIRT_BASE;
> +
> +	of_property_read_u32(np, "reg", &wdt_reg);
> +
>  	if (orion_wdt_miscdev.parent)
>  		return -EBUSY;
>  	orion_wdt_miscdev.parent = &pdev->dev;
> @@ -284,6 +294,15 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
>  		orion_wdt_disable();
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id orion_wdt_of_match_table[] = {
> +	{ .compatible = "marvell,orion-wdt", },
> +	{},
> +};
> +#else
> +#define orion_wdt_of_match_table NULL
> +#endif
> +
>  static struct platform_driver orion_wdt_driver = {
>  	.probe		= orion_wdt_probe,
>  	.remove		= __devexit_p(orion_wdt_remove),
> @@ -291,6 +310,7 @@ static struct platform_driver orion_wdt_driver = {
>  	.driver		= {
>  		.owner	= THIS_MODULE,
>  		.name	= "orion_wdt",
> +		.of_match_table = orion_wdt_of_match_table,
>  	},
>  };
>  
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02  9:15     ` Simon Guinot
  0 siblings, 0 replies; 272+ messages in thread
From: Simon Guinot @ 2012-03-02  9:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,

On Thu, Mar 01, 2012 at 06:20:55PM +0000, Jason Cooper wrote:
> Converted register address to a variable so that it could be set from
> fdt.  Also, pull clock frequency from fdt and clean up failure logic a
> bit.
> 
> Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
> placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
>  5 files changed, 39 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 5fb185c..bf28424 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -8,5 +8,11 @@
>  		reg = <0xf1010300 0x1f>;
>  		interrupts = <53>;
>  	};
> +
> +	wdt at fed20300 {
> +		compatible = "marvell,orion-wdt";
> +		reg = <0xfed20300 0x28>;
> +		clock-frequency = <200000000>;
> +	};

How this will work for boards using a different clock frequency (TCLK) ?
Here, we could have 166MHz for example.

Can this node be updated during the board initialization with a detected
TCLK value ?

Or maybe this clock-frequency can reference a TCLK frequency defined in
a board specific dts (I don't know if the DT format allow such things) ?

Regards,

Simon

>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 6fc41ae..7ef5fb7 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
>  
>  	/* internal devices that every board has */
> -	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
>  	kirkwood_crypto_init();
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index 0c0375f..35dc40b 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
>  /*****************************************************************************
>   * Watchdog
>   ****************************************************************************/
> -void __init kirkwood_wdt_init(void)
> +static void __init kirkwood_wdt_init(void)
>  {
>  	orion_wdt_init(kirkwood_tclk);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index ca08826..ac4b2fb 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
>  
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_wdt_init(void);
>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
>  void kirkwood_crypto_init(void);
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 4ad78f8..4be76ca 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -17,6 +17,7 @@
>  #include <linux/fs.h>
>  #include <linux/miscdevice.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/watchdog.h>
>  #include <linux/init.h>
>  #include <linux/uaccess.h>
> @@ -28,9 +29,9 @@
>  /*
>   * Watchdog timer block registers.
>   */
> -#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
> +#define TIMER_CTRL		0x0000
>  #define  WDT_EN			0x0010
> -#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
> +#define WDT_VAL			0x0024
>  
>  #define WDT_MAX_CYCLE_COUNT	0xffffffff
>  #define WDT_IN_USE		0
> @@ -40,6 +41,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
>  static int heartbeat = -1;		/* module parameter (seconds) */
>  static unsigned int wdt_max_duration;	/* (seconds) */
>  static unsigned int wdt_tclk;
> +static unsigned int wdt_reg;
>  static unsigned long wdt_status;
>  static DEFINE_SPINLOCK(wdt_lock);
>  
> @@ -48,7 +50,7 @@ static void orion_wdt_ping(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Reload watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -60,7 +62,7 @@ static void orion_wdt_enable(void)
>  	spin_lock(&wdt_lock);
>  
>  	/* Set watchdog duration */
> -	writel(wdt_tclk * heartbeat, WDT_VAL);
> +	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
>  
>  	/* Clear watchdog timer interrupt */
>  	reg = readl(BRIDGE_CAUSE);
> @@ -68,9 +70,9 @@ static void orion_wdt_enable(void)
>  	writel(reg, BRIDGE_CAUSE);
>  
>  	/* Enable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg |= WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	/* Enable reset on watchdog */
>  	reg = readl(RSTOUTn_MASK);
> @@ -92,9 +94,9 @@ static void orion_wdt_disable(void)
>  	writel(reg, RSTOUTn_MASK);
>  
>  	/* Disable watchdog timer */
> -	reg = readl(TIMER_CTRL);
> +	reg = readl(wdt_reg + TIMER_CTRL);
>  	reg &= ~WDT_EN;
> -	writel(reg, TIMER_CTRL);
> +	writel(reg, wdt_reg + TIMER_CTRL);
>  
>  	spin_unlock(&wdt_lock);
>  }
> @@ -102,7 +104,7 @@ static void orion_wdt_disable(void)
>  static int orion_wdt_get_timeleft(int *time_left)
>  {
>  	spin_lock(&wdt_lock);
> -	*time_left = readl(WDT_VAL) / wdt_tclk;
> +	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
>  	spin_unlock(&wdt_lock);
>  	return 0;
>  }
> @@ -236,15 +238,23 @@ static struct miscdevice orion_wdt_miscdev = {
>  static int __devinit orion_wdt_probe(struct platform_device *pdev)
>  {
>  	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
> +	struct device_node *np = pdev->dev.of_node;
>  	int ret;
>  
> -	if (pdata) {
> +	if (pdata)
>  		wdt_tclk = pdata->tclk;
> -	} else {
> -		printk(KERN_ERR "Orion Watchdog misses platform data\n");
> +
> +	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
> +
> +	if (!wdt_tclk) {
> +		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
>  		return -ENODEV;
>  	}
>  
> +	wdt_reg = TIMER_VIRT_BASE;
> +
> +	of_property_read_u32(np, "reg", &wdt_reg);
> +
>  	if (orion_wdt_miscdev.parent)
>  		return -EBUSY;
>  	orion_wdt_miscdev.parent = &pdev->dev;
> @@ -284,6 +294,15 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
>  		orion_wdt_disable();
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id orion_wdt_of_match_table[] = {
> +	{ .compatible = "marvell,orion-wdt", },
> +	{},
> +};
> +#else
> +#define orion_wdt_of_match_table NULL
> +#endif
> +
>  static struct platform_driver orion_wdt_driver = {
>  	.probe		= orion_wdt_probe,
>  	.remove		= __devexit_p(orion_wdt_remove),
> @@ -291,6 +310,7 @@ static struct platform_driver orion_wdt_driver = {
>  	.driver		= {
>  		.owner	= THIS_MODULE,
>  		.name	= "orion_wdt",
> +		.of_match_table = orion_wdt_of_match_table,
>  	},
>  };
>  
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120302/8a34daf6/attachment.sig>

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-02  7:19     ` Grant Likely
@ 2012-03-02  9:48       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02  9:48 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

On Friday 02 March 2012, Grant Likely wrote:
> > --- a/arch/arm/mach-kirkwood/common.c
> > +++ b/arch/arm/mach-kirkwood/common.c
> > @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
> >  /*****************************************************************************
> >   * SoC RTC
> >   ****************************************************************************/
> > -void __init kirkwood_rtc_init(void)
> > +static void __init kirkwood_rtc_init(void)
> 
> This undoes the code changed in the previous patch.  If you reorder the patches then
> this change goes away in both.
> 

That would break bisection because you end up with two rtc devices after this
patch without first moving out the kirkwood_rtc_init into board-dt.c

	Arnd

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-02  9:48       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02  9:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Grant Likely wrote:
> > --- a/arch/arm/mach-kirkwood/common.c
> > +++ b/arch/arm/mach-kirkwood/common.c
> > @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
> >  /*****************************************************************************
> >   * SoC RTC
> >   ****************************************************************************/
> > -void __init kirkwood_rtc_init(void)
> > +static void __init kirkwood_rtc_init(void)
> 
> This undoes the code changed in the previous patch.  If you reorder the patches then
> this change goes away in both.
> 

That would break bisection because you end up with two rtc devices after this
patch without first moving out the kirkwood_rtc_init into board-dt.c

	Arnd

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02  9:15     ` Simon Guinot
@ 2012-03-02 14:15         ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 14:15 UTC (permalink / raw)
  To: Simon Guinot
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Mar 02, 2012 at 10:15:11AM +0100, Simon Guinot wrote:
> Hi Jason,
> 
> On Thu, Mar 01, 2012 at 06:20:55PM +0000, Jason Cooper wrote:
> > Converted register address to a variable so that it could be set from
> > fdt.  Also, pull clock frequency from fdt and clean up failure logic a
> > bit.
> > 
> > Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
> > placed in kirkwood.dtsi.
> > 
> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> > ---
> >  arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
> >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> >  arch/arm/mach-kirkwood/common.c   |    2 +-
> >  arch/arm/mach-kirkwood/common.h   |    1 -
> >  drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
> >  5 files changed, 39 insertions(+), 15 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> > index 5fb185c..bf28424 100644
> > --- a/arch/arm/boot/dts/kirkwood.dtsi
> > +++ b/arch/arm/boot/dts/kirkwood.dtsi
> > @@ -8,5 +8,11 @@
> >  		reg = <0xf1010300 0x1f>;
> >  		interrupts = <53>;
> >  	};
> > +
> > +	wdt@fed20300 {
> > +		compatible = "marvell,orion-wdt";
> > +		reg = <0xfed20300 0x28>;
> > +		clock-frequency = <200000000>;
> > +	};
> 
> How this will work for boards using a different clock frequency (TCLK) ?
> Here, we could have 166MHz for example.
> 
> Can this node be updated during the board initialization with a detected
> TCLK value ?
> 
> Or maybe this clock-frequency can reference a TCLK frequency defined in
> a board specific dts (I don't know if the DT format allow such things) ?

Grr... good catch.  I originally had this in kirkwood-dreamplug.dts,
which is always 200000000.  That's not the case in kirkwood.dtsi.  What
I would like to do, and I haven't had time to look into it (I thought I
would tackle it later as a refinement :-( ), is a reference of some
sort, eg:

in kirkwood.dtsi:

/ {
	compatible = "marvell,kirkwood";
	tclk:clock-frequency = <200000000>;

	wdt@fed20300 {
		compatible = "marvell,orion-wdt";
		reg = <0xfed20300 0x28>;
		clock-frequency = &tclk;
	};
};

then, in kirkwood-foobar.dts

/include/ "kirkwood.dtsi"

/ {
	model = "foobar";
	compatible = "...";
	tclk:clock-frequency = <166000000>;
};

but I'm not sure if that would work.

In any case, the simplest answer is to set clock-frequency in
kirkwood-dreamplug.dts as a root node property, and then each driver
that needs tclk, requests the clock-frequency from the root node.
Hopefully, Grant can chime in on this one.

Thanks for the review,

Jason.

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 14:15         ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 14:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 10:15:11AM +0100, Simon Guinot wrote:
> Hi Jason,
> 
> On Thu, Mar 01, 2012 at 06:20:55PM +0000, Jason Cooper wrote:
> > Converted register address to a variable so that it could be set from
> > fdt.  Also, pull clock frequency from fdt and clean up failure logic a
> > bit.
> > 
> > Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
> > placed in kirkwood.dtsi.
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > ---
> >  arch/arm/boot/dts/kirkwood.dtsi   |    6 +++++
> >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> >  arch/arm/mach-kirkwood/common.c   |    2 +-
> >  arch/arm/mach-kirkwood/common.h   |    1 -
> >  drivers/watchdog/orion_wdt.c      |   44 ++++++++++++++++++++++++++----------
> >  5 files changed, 39 insertions(+), 15 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> > index 5fb185c..bf28424 100644
> > --- a/arch/arm/boot/dts/kirkwood.dtsi
> > +++ b/arch/arm/boot/dts/kirkwood.dtsi
> > @@ -8,5 +8,11 @@
> >  		reg = <0xf1010300 0x1f>;
> >  		interrupts = <53>;
> >  	};
> > +
> > +	wdt at fed20300 {
> > +		compatible = "marvell,orion-wdt";
> > +		reg = <0xfed20300 0x28>;
> > +		clock-frequency = <200000000>;
> > +	};
> 
> How this will work for boards using a different clock frequency (TCLK) ?
> Here, we could have 166MHz for example.
> 
> Can this node be updated during the board initialization with a detected
> TCLK value ?
> 
> Or maybe this clock-frequency can reference a TCLK frequency defined in
> a board specific dts (I don't know if the DT format allow such things) ?

Grr... good catch.  I originally had this in kirkwood-dreamplug.dts,
which is always 200000000.  That's not the case in kirkwood.dtsi.  What
I would like to do, and I haven't had time to look into it (I thought I
would tackle it later as a refinement :-( ), is a reference of some
sort, eg:

in kirkwood.dtsi:

/ {
	compatible = "marvell,kirkwood";
	tclk:clock-frequency = <200000000>;

	wdt at fed20300 {
		compatible = "marvell,orion-wdt";
		reg = <0xfed20300 0x28>;
		clock-frequency = &tclk;
	};
};

then, in kirkwood-foobar.dts

/include/ "kirkwood.dtsi"

/ {
	model = "foobar";
	compatible = "...";
	tclk:clock-frequency = <166000000>;
};

but I'm not sure if that would work.

In any case, the simplest answer is to set clock-frequency in
kirkwood-dreamplug.dts as a root node property, and then each driver
that needs tclk, requests the clock-frequency from the root node.
Hopefully, Grant can chime in on this one.

Thanks for the review,

Jason.

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 14:15         ` Jason
@ 2012-03-02 14:56             ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 14:56 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Simon Guinot,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Friday 02 March 2012, Jason wrote:
> Grr... good catch.  I originally had this in kirkwood-dreamplug.dts,
> which is always 200000000.  That's not the case in kirkwood.dtsi.  What
> I would like to do, and I haven't had time to look into it (I thought I
> would tackle it later as a refinement :-( ), is a reference of some
> sort, eg:
> 
> in kirkwood.dtsi:
> 
> / {
>         compatible = "marvell,kirkwood";
>         tclk:clock-frequency = <200000000>;
> 
>         wdt@fed20300 {
>                 compatible = "marvell,orion-wdt";
>                 reg = <0xfed20300 0x28>;
>                 clock-frequency = &tclk;
>         };
> };
> 
> then, in kirkwood-foobar.dts
> 
> include "kirkwood.dtsi"
> 
> / {
>         model = "foobar";
>         compatible = "...";
>         tclk:clock-frequency = <166000000>;
> };
> 
> but I'm not sure if that would work.

That would make wdt@fed20300/clock-frequency a phandle pointing to the
root property, which is not what we want here.

> In any case, the simplest answer is to set clock-frequency in
> kirkwood-dreamplug.dts as a root node property, and then each driver
> that needs tclk, requests the clock-frequency from the root node.
> Hopefully, Grant can chime in on this one.

I think you can just pick a reasonable default value for
wdt@fed20300/clock-frequency, and let the board override that
by setting it to something else if necessary. I suppose this
will also change a bit when kirkwood gets moved over to generic
clk support in the future and starts using the clk binding instead
of what you do now.

	Arnd

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 14:56             ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 14:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Jason wrote:
> Grr... good catch.  I originally had this in kirkwood-dreamplug.dts,
> which is always 200000000.  That's not the case in kirkwood.dtsi.  What
> I would like to do, and I haven't had time to look into it (I thought I
> would tackle it later as a refinement :-( ), is a reference of some
> sort, eg:
> 
> in kirkwood.dtsi:
> 
> / {
>         compatible = "marvell,kirkwood";
>         tclk:clock-frequency = <200000000>;
> 
>         wdt at fed20300 {
>                 compatible = "marvell,orion-wdt";
>                 reg = <0xfed20300 0x28>;
>                 clock-frequency = &tclk;
>         };
> };
> 
> then, in kirkwood-foobar.dts
> 
> include "kirkwood.dtsi"
> 
> / {
>         model = "foobar";
>         compatible = "...";
>         tclk:clock-frequency = <166000000>;
> };
> 
> but I'm not sure if that would work.

That would make wdt at fed20300/clock-frequency a phandle pointing to the
root property, which is not what we want here.

> In any case, the simplest answer is to set clock-frequency in
> kirkwood-dreamplug.dts as a root node property, and then each driver
> that needs tclk, requests the clock-frequency from the root node.
> Hopefully, Grant can chime in on this one.

I think you can just pick a reasonable default value for
wdt at fed20300/clock-frequency, and let the board override that
by setting it to something else if necessary. I suppose this
will also change a bit when kirkwood gets moved over to generic
clk support in the future and starts using the clk binding instead
of what you do now.

	Arnd

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 14:56             ` Arnd Bergmann
@ 2012-03-02 15:36               ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 15:36 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: grant.likely, devicetree-discuss, Simon Guinot, linux-arm-kernel

On Fri, Mar 02, 2012 at 02:56:47PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > Grr... good catch.  I originally had this in kirkwood-dreamplug.dts,
> > which is always 200000000.  That's not the case in kirkwood.dtsi.  What
> > I would like to do, and I haven't had time to look into it (I thought I
> > would tackle it later as a refinement :-( ), is a reference of some
> > sort, eg:
> > 
> > in kirkwood.dtsi:
> > 
> > / {
> >         compatible = "marvell,kirkwood";
> >         tclk:clock-frequency = <200000000>;
> > 
> >         wdt@fed20300 {
> >                 compatible = "marvell,orion-wdt";
> >                 reg = <0xfed20300 0x28>;
> >                 clock-frequency = &tclk;
> >         };
> > };
> > 
> > then, in kirkwood-foobar.dts
> > 
> > include "kirkwood.dtsi"
> > 
> > / {
> >         model = "foobar";
> >         compatible = "...";
> >         tclk:clock-frequency = <166000000>;
> > };
> > 
> > but I'm not sure if that would work.
> 
> That would make wdt@fed20300/clock-frequency a phandle pointing to the
> root property, which is not what we want here.

The 200000000 value is not the actual value used in most drivers [1],
but rather the speed of the system clock [2] (hence, my inclination to
make it a root property), the drivers have been pulling this number from
a global variable [3] and dividing/rounding it as needed for their own needs
[1].

Since it's derived from the SoC core [2], it would seem to make sense to
have a root "clock-frequency" in the board dts.  Am I missing something?
Is there a better way to do this?

> > In any case, the simplest answer is to set clock-frequency in
> > kirkwood-dreamplug.dts as a root node property, and then each driver
> > that needs tclk, requests the clock-frequency from the root node.
> > Hopefully, Grant can chime in on this one.
> 
> I think you can just pick a reasonable default value for
> wdt@fed20300/clock-frequency, and let the board override that
> by setting it to something else if necessary.

True, for now, I can just set clock-frequency for each device to the
exact same value and we'll polish later once we have a better idea of
the pattern it's following.

> I suppose this will also change a bit when kirkwood gets moved over to
> generic clk support in the future and starts using the clk binding
> instead of what you do now.

Yes, I don't want to over-think it, but I would like to make sure it's
in the correct place, since it is a global property of the board.

thanks for the review,

Jason.

[1] drivers/spi/spi-orion.c:110-117,500,501

# 110-117 ### orion_spi_baudrate_set()
        tclk_hz = orion_spi->tclk;

        /*
         * the supported rates are: 4,6,8...30
         * round up as we look for equal or less speed
         */
        rate = DIV_ROUND_UP(tclk_hz, speed);
        rate = roundup(rate, 2);
# 500-501 ### orion_spi_probe()
        spi->max_speed = DIV_ROUND_UP(spi->tclk, 4);
        spi->min_speed = DIV_ROUND_UP(spi->tclk, 30);
#############

[2] arch/arm/mach-kirkwood/common.c:320-332

# 320-332 ###
int kirkwood_tclk;

static int __init kirkwood_find_tclk(void)
{
        u32 dev, rev;

        kirkwood_pcie_id(&dev, &rev);

        if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
                if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
                        return 200000000;

        return 166666667;
}
#############

[3] arch/arm/mach-kirkwood/common.c:235

# 235 ####### kirkwood_spi_init()
        orion_spi_init(SPI_PHYS_BASE, kirkwood_tclk);
#############

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 15:36               ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 02:56:47PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > Grr... good catch.  I originally had this in kirkwood-dreamplug.dts,
> > which is always 200000000.  That's not the case in kirkwood.dtsi.  What
> > I would like to do, and I haven't had time to look into it (I thought I
> > would tackle it later as a refinement :-( ), is a reference of some
> > sort, eg:
> > 
> > in kirkwood.dtsi:
> > 
> > / {
> >         compatible = "marvell,kirkwood";
> >         tclk:clock-frequency = <200000000>;
> > 
> >         wdt at fed20300 {
> >                 compatible = "marvell,orion-wdt";
> >                 reg = <0xfed20300 0x28>;
> >                 clock-frequency = &tclk;
> >         };
> > };
> > 
> > then, in kirkwood-foobar.dts
> > 
> > include "kirkwood.dtsi"
> > 
> > / {
> >         model = "foobar";
> >         compatible = "...";
> >         tclk:clock-frequency = <166000000>;
> > };
> > 
> > but I'm not sure if that would work.
> 
> That would make wdt at fed20300/clock-frequency a phandle pointing to the
> root property, which is not what we want here.

The 200000000 value is not the actual value used in most drivers [1],
but rather the speed of the system clock [2] (hence, my inclination to
make it a root property), the drivers have been pulling this number from
a global variable [3] and dividing/rounding it as needed for their own needs
[1].

Since it's derived from the SoC core [2], it would seem to make sense to
have a root "clock-frequency" in the board dts.  Am I missing something?
Is there a better way to do this?

> > In any case, the simplest answer is to set clock-frequency in
> > kirkwood-dreamplug.dts as a root node property, and then each driver
> > that needs tclk, requests the clock-frequency from the root node.
> > Hopefully, Grant can chime in on this one.
> 
> I think you can just pick a reasonable default value for
> wdt at fed20300/clock-frequency, and let the board override that
> by setting it to something else if necessary.

True, for now, I can just set clock-frequency for each device to the
exact same value and we'll polish later once we have a better idea of
the pattern it's following.

> I suppose this will also change a bit when kirkwood gets moved over to
> generic clk support in the future and starts using the clk binding
> instead of what you do now.

Yes, I don't want to over-think it, but I would like to make sure it's
in the correct place, since it is a global property of the board.

thanks for the review,

Jason.

[1] drivers/spi/spi-orion.c:110-117,500,501

# 110-117 ### orion_spi_baudrate_set()
        tclk_hz = orion_spi->tclk;

        /*
         * the supported rates are: 4,6,8...30
         * round up as we look for equal or less speed
         */
        rate = DIV_ROUND_UP(tclk_hz, speed);
        rate = roundup(rate, 2);
# 500-501 ### orion_spi_probe()
        spi->max_speed = DIV_ROUND_UP(spi->tclk, 4);
        spi->min_speed = DIV_ROUND_UP(spi->tclk, 30);
#############

[2] arch/arm/mach-kirkwood/common.c:320-332

# 320-332 ###
int kirkwood_tclk;

static int __init kirkwood_find_tclk(void)
{
        u32 dev, rev;

        kirkwood_pcie_id(&dev, &rev);

        if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
                if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
                        return 200000000;

        return 166666667;
}
#############

[3] arch/arm/mach-kirkwood/common.c:235

# 235 ####### kirkwood_spi_init()
        orion_spi_init(SPI_PHYS_BASE, kirkwood_tclk);
#############

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-02  7:19     ` Grant Likely
@ 2012-03-02 16:27       ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 16:27 UTC (permalink / raw)
  To: Grant Likely
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Mar 02, 2012 at 01:19:39AM -0600, Grant Likely wrote:
> On Thu,  1 Mar 2012 18:20:54 +0000, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> > The comment at mach-kirkwood/common.c:469, says this device is in every
> > kirkwood board.  So, it is placed in kirkwood.dtsi.
> > 
> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> > ---
> >  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
> >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> >  arch/arm/mach-kirkwood/common.c   |    2 +-
> >  arch/arm/mach-kirkwood/common.h   |    1 -
> >  drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
> >  5 files changed, 26 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> > index 771c6bb..5fb185c 100644
> > --- a/arch/arm/boot/dts/kirkwood.dtsi
> > +++ b/arch/arm/boot/dts/kirkwood.dtsi
> > @@ -2,5 +2,11 @@
> >  
> >  / {
> >  	compatible = "marvell,kirkwood";
> > +
> > +	rtc@f1010300 {
> > +		compatible = "marvell,rtc";
> > +		reg = <0xf1010300 0x1f>;
> > +		interrupts = <53>;
> > +	};
> >  };
> >  
> > diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> > index a0cc28b..6fc41ae 100644
> > --- a/arch/arm/mach-kirkwood/board-dt.c
> > +++ b/arch/arm/mach-kirkwood/board-dt.c
> > @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
> >  #endif
> >  
> >  	/* internal devices that every board has */
> > -	kirkwood_rtc_init();
> >  	kirkwood_wdt_init();
> >  	kirkwood_xor0_init();
> >  	kirkwood_xor1_init();
> > diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> > index 167b6c8..0c0375f 100644
> > --- a/arch/arm/mach-kirkwood/common.c
> > +++ b/arch/arm/mach-kirkwood/common.c
> > @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
> >  /*****************************************************************************
> >   * SoC RTC
> >   ****************************************************************************/
> > -void __init kirkwood_rtc_init(void)
> > +static void __init kirkwood_rtc_init(void)
> 
> This undoes the code changed in the previous patch.  If you reorder the patches then
> this change goes away in both.

My goal was to make sure the series could compile with and without fdt
no matter where a bisect might land in the series.  What would cause a
reorder?

> >  {
> >  	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
> >  }
> > diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> > index c382447..ca08826 100644
> > --- a/arch/arm/mach-kirkwood/common.h
> > +++ b/arch/arm/mach-kirkwood/common.h
> > @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
> >  
> >  char *kirkwood_id(void);
> >  void kirkwood_l2_init(void);
> > -void kirkwood_rtc_init(void);
> >  void kirkwood_wdt_init(void);
> >  void kirkwood_xor0_init(void);
> >  void kirkwood_xor1_init(void);
> > diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> > index 768e2ed..38abbf7 100644
> > --- a/drivers/rtc/rtc-mv.c
> > +++ b/drivers/rtc/rtc-mv.c
> > @@ -12,6 +12,8 @@
> >  #include <linux/bcd.h>
> >  #include <linux/io.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/of_address.h>
> > +#include <linux/of.h>
> >  #include <linux/delay.h>
> >  #include <linux/gfp.h>
> >  #include <linux/module.h>
> > @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  {
> >  	struct resource *res;
> >  	struct rtc_plat_data *pdata;
> > +	struct device_node *np = pdev->dev.of_node;
> >  	resource_size_t size;
> >  	u32 rtc_time;
> >  
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +	if (np)
> > +		of_address_to_resource(np, 0, res);
> > +
> 
> This should not be needed.  The of_platform_populate() code should have
> filled the platform_device with mem resources.

fixed in next version.

> >  	if (!res)
> >  		return -ENODEV;
> >  
> > @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  
> >  	pdata->irq = platform_get_irq(pdev, 0);
> >  
> > +	of_property_read_u32(np, "interrupts", &pdata->irq);
> > +
> 
> Definitely don't do this.  Same as with memory regions, the irq will be
> pre-populated in the platform device resource table.  platform_get_irq()
> should already work.

Same.

> >  	platform_set_drvdata(pdev, pdata);
> >  
> >  	if (pdata->irq >= 0) {
> > @@ -294,11 +303,21 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +#ifdef CONFIG_OF
> > +static struct of_device_id rtc_mv_of_match_table[] = {
> > +	{ .compatible = "marvell,rtc", },
> > +	{}
> > +};
> > +#else
> > +#define rtc_mv_of_match_table NULL
> > +#endif
> > +
> >  static struct platform_driver mv_rtc_driver = {
> >  	.remove		= __exit_p(mv_rtc_remove),
> >  	.driver		= {
> >  		.name	= "rtc-mv",
> >  		.owner	= THIS_MODULE,
> > +		.of_match_table = rtc_mv_of_match_table,
> 
> should be:
> 		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
> 
> that would get rid of the #else clause above.

fixed across kirkwood patches so far.

Thanks for the review.

Jason.

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-02 16:27       ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 16:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 01:19:39AM -0600, Grant Likely wrote:
> On Thu,  1 Mar 2012 18:20:54 +0000, Jason Cooper <jason@lakedaemon.net> wrote:
> > The comment at mach-kirkwood/common.c:469, says this device is in every
> > kirkwood board.  So, it is placed in kirkwood.dtsi.
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > ---
> >  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
> >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> >  arch/arm/mach-kirkwood/common.c   |    2 +-
> >  arch/arm/mach-kirkwood/common.h   |    1 -
> >  drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
> >  5 files changed, 26 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> > index 771c6bb..5fb185c 100644
> > --- a/arch/arm/boot/dts/kirkwood.dtsi
> > +++ b/arch/arm/boot/dts/kirkwood.dtsi
> > @@ -2,5 +2,11 @@
> >  
> >  / {
> >  	compatible = "marvell,kirkwood";
> > +
> > +	rtc at f1010300 {
> > +		compatible = "marvell,rtc";
> > +		reg = <0xf1010300 0x1f>;
> > +		interrupts = <53>;
> > +	};
> >  };
> >  
> > diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> > index a0cc28b..6fc41ae 100644
> > --- a/arch/arm/mach-kirkwood/board-dt.c
> > +++ b/arch/arm/mach-kirkwood/board-dt.c
> > @@ -135,7 +135,6 @@ static void __init kirkwood_dt_init(void)
> >  #endif
> >  
> >  	/* internal devices that every board has */
> > -	kirkwood_rtc_init();
> >  	kirkwood_wdt_init();
> >  	kirkwood_xor0_init();
> >  	kirkwood_xor1_init();
> > diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> > index 167b6c8..0c0375f 100644
> > --- a/arch/arm/mach-kirkwood/common.c
> > +++ b/arch/arm/mach-kirkwood/common.c
> > @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
> >  /*****************************************************************************
> >   * SoC RTC
> >   ****************************************************************************/
> > -void __init kirkwood_rtc_init(void)
> > +static void __init kirkwood_rtc_init(void)
> 
> This undoes the code changed in the previous patch.  If you reorder the patches then
> this change goes away in both.

My goal was to make sure the series could compile with and without fdt
no matter where a bisect might land in the series.  What would cause a
reorder?

> >  {
> >  	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
> >  }
> > diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> > index c382447..ca08826 100644
> > --- a/arch/arm/mach-kirkwood/common.h
> > +++ b/arch/arm/mach-kirkwood/common.h
> > @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
> >  
> >  char *kirkwood_id(void);
> >  void kirkwood_l2_init(void);
> > -void kirkwood_rtc_init(void);
> >  void kirkwood_wdt_init(void);
> >  void kirkwood_xor0_init(void);
> >  void kirkwood_xor1_init(void);
> > diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> > index 768e2ed..38abbf7 100644
> > --- a/drivers/rtc/rtc-mv.c
> > +++ b/drivers/rtc/rtc-mv.c
> > @@ -12,6 +12,8 @@
> >  #include <linux/bcd.h>
> >  #include <linux/io.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/of_address.h>
> > +#include <linux/of.h>
> >  #include <linux/delay.h>
> >  #include <linux/gfp.h>
> >  #include <linux/module.h>
> > @@ -218,10 +220,15 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  {
> >  	struct resource *res;
> >  	struct rtc_plat_data *pdata;
> > +	struct device_node *np = pdev->dev.of_node;
> >  	resource_size_t size;
> >  	u32 rtc_time;
> >  
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +
> > +	if (np)
> > +		of_address_to_resource(np, 0, res);
> > +
> 
> This should not be needed.  The of_platform_populate() code should have
> filled the platform_device with mem resources.

fixed in next version.

> >  	if (!res)
> >  		return -ENODEV;
> >  
> > @@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
> >  
> >  	pdata->irq = platform_get_irq(pdev, 0);
> >  
> > +	of_property_read_u32(np, "interrupts", &pdata->irq);
> > +
> 
> Definitely don't do this.  Same as with memory regions, the irq will be
> pre-populated in the platform device resource table.  platform_get_irq()
> should already work.

Same.

> >  	platform_set_drvdata(pdev, pdata);
> >  
> >  	if (pdata->irq >= 0) {
> > @@ -294,11 +303,21 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +#ifdef CONFIG_OF
> > +static struct of_device_id rtc_mv_of_match_table[] = {
> > +	{ .compatible = "marvell,rtc", },
> > +	{}
> > +};
> > +#else
> > +#define rtc_mv_of_match_table NULL
> > +#endif
> > +
> >  static struct platform_driver mv_rtc_driver = {
> >  	.remove		= __exit_p(mv_rtc_remove),
> >  	.driver		= {
> >  		.name	= "rtc-mv",
> >  		.owner	= THIS_MODULE,
> > +		.of_match_table = rtc_mv_of_match_table,
> 
> should be:
> 		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
> 
> that would get rid of the #else clause above.

fixed across kirkwood patches so far.

Thanks for the review.

Jason.

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-01 22:14                 ` Arnd Bergmann
@ 2012-03-02 16:31                   ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 16:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel

On Thu, Mar 01, 2012 at 10:14:06PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason wrote:
> > On Thu, Mar 01, 2012 at 08:28:04PM +0000, Arnd Bergmann wrote:
> > > On Thursday 01 March 2012, Jason wrote:
> > > > Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> > > > catch my patch from yesterday?
> > > > 
> > > > [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
> > > 
> > > Yes, I saw that. It looks good and I was just waiting if other people
> > > have comments on it. Maybe you can put it into the same git tree as
> > > these ones when they are ready and you send a pull request.
> > 
> > Okay, I have a local branch, 'dreamplug_dt' based at v3.3-rc3.  It
> > includes the two patches you've already merged into your tree:
> > 
> > c9780e7 ARM: kirkwood: add dreamplug (fdt) support.
> > dbc3c26 ARM: kirkwood: convert uart0 to devicetree.
> > 
> > Plus the spi/flash/partitions, and the most recent series.
> > 
> > Can I just do:
> > 
> > git push linux-kirkwood dreamplug_dt:kirkwood_dt
> > 
> > Then, issue a pull request for
> > 
> > git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt
> > 
> > and reference the first uncommitted patch?
> 
> I have other commit IDs for the two patches that I took from your
> emails, so you should rebase the other patches on top of the
> version that I have in the arm-soc/kirkwood/board branch, otherwise
> we end up with duplicate commits my tree when I pull them again.

Got it, I cherry-picked the series over and incorporated Grant's
suggestions.

> > Most of the googlings for 'pull request' yield github's "click the
> > button", yuck.
> > 
> > Also, is there an equivalent to 'git format-patch/send-email' for pull
> > requests?  The pull requests I've looked at seem awfully consistent in
> > formatting.
> 
> It's "git request-pull".

Of course it is.  :-)  duh.  Thanks.  I'm pushing to my tree now.  I'll
probably submit the series attached to the pull request just so it's
easy to review and easy to pull (hopefully).

Thanks for all the help.

Jason.

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 16:31                   ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 16:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 01, 2012 at 10:14:06PM +0000, Arnd Bergmann wrote:
> On Thursday 01 March 2012, Jason wrote:
> > On Thu, Mar 01, 2012 at 08:28:04PM +0000, Arnd Bergmann wrote:
> > > On Thursday 01 March 2012, Jason wrote:
> > > > Thanks for the feedback.  I'll redo this series and resubmit.  Did you
> > > > catch my patch from yesterday?
> > > > 
> > > > [PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
> > > 
> > > Yes, I saw that. It looks good and I was just waiting if other people
> > > have comments on it. Maybe you can put it into the same git tree as
> > > these ones when they are ready and you send a pull request.
> > 
> > Okay, I have a local branch, 'dreamplug_dt' based at v3.3-rc3.  It
> > includes the two patches you've already merged into your tree:
> > 
> > c9780e7 ARM: kirkwood: add dreamplug (fdt) support.
> > dbc3c26 ARM: kirkwood: convert uart0 to devicetree.
> > 
> > Plus the spi/flash/partitions, and the most recent series.
> > 
> > Can I just do:
> > 
> > git push linux-kirkwood dreamplug_dt:kirkwood_dt
> > 
> > Then, issue a pull request for
> > 
> > git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt
> > 
> > and reference the first uncommitted patch?
> 
> I have other commit IDs for the two patches that I took from your
> emails, so you should rebase the other patches on top of the
> version that I have in the arm-soc/kirkwood/board branch, otherwise
> we end up with duplicate commits my tree when I pull them again.

Got it, I cherry-picked the series over and incorporated Grant's
suggestions.

> > Most of the googlings for 'pull request' yield github's "click the
> > button", yuck.
> > 
> > Also, is there an equivalent to 'git format-patch/send-email' for pull
> > requests?  The pull requests I've looked at seem awfully consistent in
> > formatting.
> 
> It's "git request-pull".

Of course it is.  :-)  duh.  Thanks.  I'm pushing to my tree now.  I'll
probably submit the series attached to the pull request just so it's
easy to review and easy to pull (hopefully).

Thanks for all the help.

Jason.

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 15:36               ` Jason
@ 2012-03-02 16:48                 ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 16:48 UTC (permalink / raw)
  To: Jason, mturquette
  Cc: grant.likely, Andrew Lunn, devicetree-discuss, Simon Guinot,
	linux-arm-kernel

On Friday 02 March 2012, Jason wrote:
> > 
> > That would make wdt@fed20300/clock-frequency a phandle pointing to the
> > root property, which is not what we want here.
> 
> The 200000000 value is not the actual value used in most drivers [1],
> but rather the speed of the system clock [2] (hence, my inclination to
> make it a root property), the drivers have been pulling this number from
> a global variable [3] and dividing/rounding it as needed for their own needs
> [1].

Ah, I see. If you put a "clock-frequency" property into a device node,
it should definitely be the frequency used by that device, not the system
clock that it is derived from.

> Since it's derived from the SoC core [2], it would seem to make sense to
> have a root "clock-frequency" in the board dts.  Am I missing something?
> Is there a better way to do this?

The correct solution would be to use the clock binding, but I'm not sure
how far we are in making that final or usable.

> > > In any case, the simplest answer is to set clock-frequency in
> > > kirkwood-dreamplug.dts as a root node property, and then each driver
> > > that needs tclk, requests the clock-frequency from the root node.
> > > Hopefully, Grant can chime in on this one.
> > 
> > I think you can just pick a reasonable default value for
> > wdt@fed20300/clock-frequency, and let the board override that
> > by setting it to something else if necessary.
> 
> True, for now, I can just set clock-frequency for each device to the
> exact same value and we'll polish later once we have a better idea of
> the pattern it's following.
> 
> > I suppose this will also change a bit when kirkwood gets moved over to
> > generic clk support in the future and starts using the clk binding
> > instead of what you do now.
> 
> Yes, I don't want to over-think it, but I would like to make sure it's
> in the correct place, since it is a global property of the board.

Andrew Lunn said that he has a patch for plat-orion to use the generic
clock framework. I think we should look at that before introducing
a hack that will have to be removed again very soon.

Kirkwood/orion is probably not a bad platform to add to the initial
set of platforms for which we use the common clk infrastructure,
so maybe the best way forward for you is to take Andrews patches
and build on top of that. It might mean that your follow-on patches
get delayed until v3.5 instead of going into v3.4, but the initial
code you have in arm-soc is working already and you can work on
getting it the clock code right in the initial code.

	Arnd

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 16:48                 ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 16:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Jason wrote:
> > 
> > That would make wdt at fed20300/clock-frequency a phandle pointing to the
> > root property, which is not what we want here.
> 
> The 200000000 value is not the actual value used in most drivers [1],
> but rather the speed of the system clock [2] (hence, my inclination to
> make it a root property), the drivers have been pulling this number from
> a global variable [3] and dividing/rounding it as needed for their own needs
> [1].

Ah, I see. If you put a "clock-frequency" property into a device node,
it should definitely be the frequency used by that device, not the system
clock that it is derived from.

> Since it's derived from the SoC core [2], it would seem to make sense to
> have a root "clock-frequency" in the board dts.  Am I missing something?
> Is there a better way to do this?

The correct solution would be to use the clock binding, but I'm not sure
how far we are in making that final or usable.

> > > In any case, the simplest answer is to set clock-frequency in
> > > kirkwood-dreamplug.dts as a root node property, and then each driver
> > > that needs tclk, requests the clock-frequency from the root node.
> > > Hopefully, Grant can chime in on this one.
> > 
> > I think you can just pick a reasonable default value for
> > wdt at fed20300/clock-frequency, and let the board override that
> > by setting it to something else if necessary.
> 
> True, for now, I can just set clock-frequency for each device to the
> exact same value and we'll polish later once we have a better idea of
> the pattern it's following.
> 
> > I suppose this will also change a bit when kirkwood gets moved over to
> > generic clk support in the future and starts using the clk binding
> > instead of what you do now.
> 
> Yes, I don't want to over-think it, but I would like to make sure it's
> in the correct place, since it is a global property of the board.

Andrew Lunn said that he has a patch for plat-orion to use the generic
clock framework. I think we should look at that before introducing
a hack that will have to be removed again very soon.

Kirkwood/orion is probably not a bad platform to add to the initial
set of platforms for which we use the common clk infrastructure,
so maybe the best way forward for you is to take Andrews patches
and build on top of that. It might mean that your follow-on patches
get delayed until v3.5 instead of going into v3.4, but the initial
code you have in arm-soc is working already and you can work on
getting it the clock code right in the initial code.

	Arnd

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-02 16:31                   ` Jason
@ 2012-03-02 16:58                       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 16:58 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason

On Friday 02 March 2012, Jason wrote:
> > 
> > I have other commit IDs for the two patches that I took from your
> > emails, so you should rebase the other patches on top of the
> > version that I have in the arm-soc/kirkwood/board branch, otherwise
> > we end up with duplicate commits my tree when I pull them again.
> 
> Got it, I cherry-picked the series over and incorporated Grant's
> suggestions.
> 

Just making sure you know about this one:

git rebase -i --onto arm-soc/kirkwood/board torvalds/master

The '-i' lets you pick which ones you want to move over, then it
applies all patches from the current branch that are not on
torvalds/master on top of the last commit from arm-soc/kirkwood/board.

If you don't know it yet, I suggest you play with this for an hour
or so that will be very well invested time. If you knew this, then nevermind.

	Arnd

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 16:58                       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Jason wrote:
> > 
> > I have other commit IDs for the two patches that I took from your
> > emails, so you should rebase the other patches on top of the
> > version that I have in the arm-soc/kirkwood/board branch, otherwise
> > we end up with duplicate commits my tree when I pull them again.
> 
> Got it, I cherry-picked the series over and incorporated Grant's
> suggestions.
> 

Just making sure you know about this one:

git rebase -i --onto arm-soc/kirkwood/board torvalds/master

The '-i' lets you pick which ones you want to move over, then it
applies all patches from the current branch that are not on
torvalds/master on top of the last commit from arm-soc/kirkwood/board.

If you don't know it yet, I suggest you play with this for an hour
or so that will be very well invested time. If you knew this, then nevermind.

	Arnd

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 16:48                 ` Arnd Bergmann
@ 2012-03-02 17:02                   ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:02 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Lunn, mturquette, devicetree-discuss, grant.likely,
	Simon Guinot, linux-arm-kernel

On Fri, Mar 02, 2012 at 04:48:51PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > > 
> > > That would make wdt@fed20300/clock-frequency a phandle pointing to the
> > > root property, which is not what we want here.
> > 
> > The 200000000 value is not the actual value used in most drivers [1],
> > but rather the speed of the system clock [2] (hence, my inclination to
> > make it a root property), the drivers have been pulling this number from
> > a global variable [3] and dividing/rounding it as needed for their own needs
> > [1].
> 
> Ah, I see. If you put a "clock-frequency" property into a device node,
> it should definitely be the frequency used by that device, not the system
> clock that it is derived from.

Whew, glad to know I'm not crazy.

> > Since it's derived from the SoC core [2], it would seem to make sense to
> > have a root "clock-frequency" in the board dts.  Am I missing something?
> > Is there a better way to do this?
> 
> The correct solution would be to use the clock binding, but I'm not sure
> how far we are in making that final or usable.
> 
> > > > In any case, the simplest answer is to set clock-frequency in
> > > > kirkwood-dreamplug.dts as a root node property, and then each driver
> > > > that needs tclk, requests the clock-frequency from the root node.
> > > > Hopefully, Grant can chime in on this one.
> > > 
> > > I think you can just pick a reasonable default value for
> > > wdt@fed20300/clock-frequency, and let the board override that
> > > by setting it to something else if necessary.
> > 
> > True, for now, I can just set clock-frequency for each device to the
> > exact same value and we'll polish later once we have a better idea of
> > the pattern it's following.
> > 
> > > I suppose this will also change a bit when kirkwood gets moved over to
> > > generic clk support in the future and starts using the clk binding
> > > instead of what you do now.
> > 
> > Yes, I don't want to over-think it, but I would like to make sure it's
> > in the correct place, since it is a global property of the board.
> 
> Andrew Lunn said that he has a patch for plat-orion to use the generic
> clock framework. I think we should look at that before introducing
> a hack that will have to be removed again very soon.

I asked him for it earlier [1], apparently it's a very invasive patch
series which breaks things.  I would like to look at it as a reference,
even if applying it isn't a good idea.

How about it, Andrew?

> Kirkwood/orion is probably not a bad platform to add to the initial
> set of platforms for which we use the common clk infrastructure,
> so maybe the best way forward for you is to take Andrews patches
> and build on top of that.

Agreed.

> It might mean that your follow-on patches get delayed until v3.5
> instead of going into v3.4, but the initial code you have in arm-soc
> is working already and you can work on getting it the clock code right
> in the initial code.

In [1] I was trying to setup a stand-in, eg kirkwood_get_clock() and
kirkwood_put_clock() that could be replaced once the clock code lands.
That way, we're on the right path, but not blocked waiting for the clock
code.

thx,

Jason.

[1] http://www.spinics.net/lists/arm-kernel/msg162284.html

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 17:02                   ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 04:48:51PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > > 
> > > That would make wdt at fed20300/clock-frequency a phandle pointing to the
> > > root property, which is not what we want here.
> > 
> > The 200000000 value is not the actual value used in most drivers [1],
> > but rather the speed of the system clock [2] (hence, my inclination to
> > make it a root property), the drivers have been pulling this number from
> > a global variable [3] and dividing/rounding it as needed for their own needs
> > [1].
> 
> Ah, I see. If you put a "clock-frequency" property into a device node,
> it should definitely be the frequency used by that device, not the system
> clock that it is derived from.

Whew, glad to know I'm not crazy.

> > Since it's derived from the SoC core [2], it would seem to make sense to
> > have a root "clock-frequency" in the board dts.  Am I missing something?
> > Is there a better way to do this?
> 
> The correct solution would be to use the clock binding, but I'm not sure
> how far we are in making that final or usable.
> 
> > > > In any case, the simplest answer is to set clock-frequency in
> > > > kirkwood-dreamplug.dts as a root node property, and then each driver
> > > > that needs tclk, requests the clock-frequency from the root node.
> > > > Hopefully, Grant can chime in on this one.
> > > 
> > > I think you can just pick a reasonable default value for
> > > wdt at fed20300/clock-frequency, and let the board override that
> > > by setting it to something else if necessary.
> > 
> > True, for now, I can just set clock-frequency for each device to the
> > exact same value and we'll polish later once we have a better idea of
> > the pattern it's following.
> > 
> > > I suppose this will also change a bit when kirkwood gets moved over to
> > > generic clk support in the future and starts using the clk binding
> > > instead of what you do now.
> > 
> > Yes, I don't want to over-think it, but I would like to make sure it's
> > in the correct place, since it is a global property of the board.
> 
> Andrew Lunn said that he has a patch for plat-orion to use the generic
> clock framework. I think we should look at that before introducing
> a hack that will have to be removed again very soon.

I asked him for it earlier [1], apparently it's a very invasive patch
series which breaks things.  I would like to look at it as a reference,
even if applying it isn't a good idea.

How about it, Andrew?

> Kirkwood/orion is probably not a bad platform to add to the initial
> set of platforms for which we use the common clk infrastructure,
> so maybe the best way forward for you is to take Andrews patches
> and build on top of that.

Agreed.

> It might mean that your follow-on patches get delayed until v3.5
> instead of going into v3.4, but the initial code you have in arm-soc
> is working already and you can work on getting it the clock code right
> in the initial code.

In [1] I was trying to setup a stand-in, eg kirkwood_get_clock() and
kirkwood_put_clock() that could be replaced once the clock code lands.
That way, we're on the right path, but not blocked waiting for the clock
code.

thx,

Jason.

[1] http://www.spinics.net/lists/arm-kernel/msg162284.html

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

* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-02 16:58                       ` Arnd Bergmann
@ 2012-03-02 17:04                         ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:04 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel

On Fri, Mar 02, 2012 at 04:58:11PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > > 
> > > I have other commit IDs for the two patches that I took from your
> > > emails, so you should rebase the other patches on top of the
> > > version that I have in the arm-soc/kirkwood/board branch, otherwise
> > > we end up with duplicate commits my tree when I pull them again.
> > 
> > Got it, I cherry-picked the series over and incorporated Grant's
> > suggestions.
> > 
> 
> Just making sure you know about this one:
> 
> git rebase -i --onto arm-soc/kirkwood/board torvalds/master
> 
> The '-i' lets you pick which ones you want to move over, then it
> applies all patches from the current branch that are not on
> torvalds/master on top of the last commit from arm-soc/kirkwood/board.
> 
> If you don't know it yet, I suggest you play with this for an hour
> or so that will be very well invested time. If you knew this, then nevermind.

I use the daylights out of git rebase -i, but hadn't made use of --onto
yet.  Thanks for the tip.

thx,

Jason.

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

* [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 17:04                         ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 04:58:11PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > > 
> > > I have other commit IDs for the two patches that I took from your
> > > emails, so you should rebase the other patches on top of the
> > > version that I have in the arm-soc/kirkwood/board branch, otherwise
> > > we end up with duplicate commits my tree when I pull them again.
> > 
> > Got it, I cherry-picked the series over and incorporated Grant's
> > suggestions.
> > 
> 
> Just making sure you know about this one:
> 
> git rebase -i --onto arm-soc/kirkwood/board torvalds/master
> 
> The '-i' lets you pick which ones you want to move over, then it
> applies all patches from the current branch that are not on
> torvalds/master on top of the last commit from arm-soc/kirkwood/board.
> 
> If you don't know it yet, I suggest you play with this for an hour
> or so that will be very well invested time. If you knew this, then nevermind.

I use the daylights out of git rebase -i, but hadn't made use of --onto
yet.  Thanks for the tip.

thx,

Jason.

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

* [PATCH 0/5 v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-02 17:50     ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first patch converts an off-SoC driver (spi) to device tree and moves flash
partition definitions to the device tree.  This was previously it's own
submission, but I've included it here since I want this series to match the
subsequent pull request against arm-soc/kirkwood/board.

The second patch cleans up kirkwood_init() by moving a flag setting to it's
appropriate location.  This will help later when converting the audio driver.

Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
board-dt.c  This way, as drivers are converted, their init calls can be removed
from kirkwood_dt_init() and non-fdt users won't be affected (they call
kirkwood_init()).

Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
drivers remain for a later patch series.

Jason Cooper (5):
  ARM: kirkwood: covert orion-spi to fdt.
  ARM: kirkwood: move var setting to correct location.
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: convert rtc-mv to fdt.
  ARM: kirkwood: convert orion-wdt to fdt.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi          |   12 +++++
 arch/arm/mach-kirkwood/board-dt.c        |   67 +++++++++++------------------
 arch/arm/mach-kirkwood/common.c          |   21 +++++++--
 arch/arm/mach-kirkwood/common.h          |    6 +++
 drivers/rtc/rtc-mv.c                     |    7 +++
 drivers/spi/spi-orion.c                  |   37 +++++++++++++++--
 drivers/watchdog/orion_wdt.c             |   48 ++++++++++++++++-----
 8 files changed, 170 insertions(+), 62 deletions(-)

-- 
1.7.3.4

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

* [PATCH 0/5 v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 17:50     ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first patch converts an off-SoC driver (spi) to device tree and moves flash
partition definitions to the device tree.  This was previously it's own
submission, but I've included it here since I want this series to match the
subsequent pull request against arm-soc/kirkwood/board.

The second patch cleans up kirkwood_init() by moving a flag setting to it's
appropriate location.  This will help later when converting the audio driver.

Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in
board-dt.c  This way, as drivers are converted, their init calls can be removed
from kirkwood_dt_init() and non-fdt users won't be affected (they call
kirkwood_init()).

Last, I converted the two easiest drivers, rtc and wdt.  The xor and crypto
drivers remain for a later patch series.

Jason Cooper (5):
  ARM: kirkwood: covert orion-spi to fdt.
  ARM: kirkwood: move var setting to correct location.
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: convert rtc-mv to fdt.
  ARM: kirkwood: convert orion-wdt to fdt.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi          |   12 +++++
 arch/arm/mach-kirkwood/board-dt.c        |   67 +++++++++++------------------
 arch/arm/mach-kirkwood/common.c          |   21 +++++++--
 arch/arm/mach-kirkwood/common.h          |    6 +++
 drivers/rtc/rtc-mv.c                     |    7 +++
 drivers/spi/spi-orion.c                  |   37 +++++++++++++++--
 drivers/watchdog/orion_wdt.c             |   48 ++++++++++++++++-----
 8 files changed, 170 insertions(+), 62 deletions(-)

-- 
1.7.3.4

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

* [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
  2012-03-02 17:50     ` Jason Cooper
@ 2012-03-02 17:50         ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On the Globalscale Dreamplug (Marvell Kirkwood Development Platform),
2MB of NOR flash are used to hold the bootloader, bootloader
environment, and devicetree blob.  It is connected via spi.

Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---

Changes from v1:

    - used of_match_ptr() as suggested by Grant Likely

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |   40 ------------------------------
 arch/arm/mach-kirkwood/common.c          |   11 ++++++++
 drivers/spi/spi-orion.c                  |   37 ++++++++++++++++++++++++---
 4 files changed, 78 insertions(+), 44 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 8a5dff8..bdf2ddc 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -22,4 +22,38 @@
 		interrupts = <33>;
 		clock-frequency = <200000000>;
 	};
+
+	spi@f1010600 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		compatible = "marvell,orion-spi";
+		reg = <0xf1010600 0x1ff>;
+		clock-frequency = <200000000>;
+
+		flash@0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			compatible = "macronix,mx25l1606e", "jedec-flash";
+
+			spi-max-frequency = <50000000>;
+			reg = <0>;
+
+			partition@0 {
+				label = "U-Boot";
+				reg = <0x0 0x100000>;
+			};
+
+			partition@100000 {
+				label = "U-Boot Environment";
+				reg = <0x100000 0x080000>;
+			};
+
+			partition@180000 {
+				label = "Flattened Device Tree";
+				reg = <0x180000 0x080000>;
+			};
+		};
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index fbe6405..4960e63 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -39,42 +39,6 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = {
 	{ }
 };
 
-struct mtd_partition dreamplug_partitions[] = {
-	{
-		.name	= "u-boot",
-		.size	= SZ_512K,
-		.offset = 0,
-	},
-	{
-		.name	= "u-boot env",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K,
-	},
-	{
-		.name	= "dtb",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K + SZ_512K,
-	},
-};
-
-static const struct flash_platform_data dreamplug_spi_slave_data = {
-	.type		= "mx25l1606e",
-	.name		= "spi_flash",
-	.parts		= dreamplug_partitions,
-	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
-};
-
-static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &dreamplug_spi_slave_data,
-		.irq		= -1,
-		.max_speed_hz	= 50000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
 static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
@@ -140,10 +104,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	spi_register_board_info(dreamplug_spi_slave_info,
-				ARRAY_SIZE(dreamplug_spi_slave_info));
-	kirkwood_spi_init();
-
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index cc15426..357fcde 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
 #include <linux/ata_platform.h>
 #include <linux/mtd/nand.h>
 #include <linux/dma-mapping.h>
+#include <linux/of.h>
 #include <net/dsa.h>
 #include <asm/page.h>
 #include <asm/timex.h>
@@ -481,6 +482,9 @@ static int __init kirkwood_clock_gate(void)
 {
 	unsigned int curr = readl(CLOCK_GATING_CTRL);
 	u32 dev, rev;
+#ifdef CONFIG_OF
+	struct device_node *dp;
+#endif
 
 	kirkwood_pcie_id(&dev, &rev);
 	printk(KERN_DEBUG "Gating clock of unused units\n");
@@ -524,6 +528,13 @@ static int __init kirkwood_clock_gate(void)
 	} else  /* keep this bit set for devices that don't have PCIe1 */
 		kirkwood_clk_ctrl |= CGC_PEX1;
 
+#ifdef CONFIG_OF
+	dp = of_find_node_by_path("/");
+	if (dp && of_device_is_available(of_find_compatible_node(dp, NULL,
+							  "marvell,orion-spi")))
+		kirkwood_clk_ctrl |= CGC_RUNIT;
+#endif
+
 	/* Now gate clock the required units */
 	writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
 	printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..acfb240 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -18,6 +18,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/orion_spi.h>
 #include <linux/module.h>
+#include <linux/of_device.h>
 #include <asm/unaligned.h>
 
 #define DRIVER_NAME			"orion_spi"
@@ -45,6 +46,8 @@ struct orion_spi {
 	void __iomem		*base;
 	unsigned int		max_speed;
 	unsigned int		min_speed;
+	unsigned int		tclk;
+	unsigned int		clock_fix;
 	struct orion_spi_info	*spi_info;
 };
 
@@ -104,7 +107,7 @@ static int orion_spi_baudrate_set(struct spi_device *spi, unsigned int speed)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	tclk_hz = orion_spi->spi_info->tclk;
+	tclk_hz = orion_spi->tclk;
 
 	/*
 	 * the supported rates are: 4,6,8...30
@@ -360,7 +363,7 @@ static int orion_spi_setup(struct spi_device *spi)
 	orion_spi = spi_master_get_devdata(spi->master);
 
 	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
+	if (orion_spi->clock_fix)
 		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
 				  (1 << 14));
 
@@ -474,6 +477,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	master->setup = orion_spi_setup;
 	master->transfer = orion_spi_transfer;
 	master->num_chipselect = ORION_NUM_CHIPSELECTS;
+	master->dev.of_node = pdev->dev.of_node;
 
 	dev_set_drvdata(&pdev->dev, master);
 
@@ -481,8 +485,26 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	spi->master = master;
 	spi->spi_info = spi_info;
 
-	spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
-	spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
+	if (spi_info)
+		spi->tclk = spi_info->tclk;
+
+	of_property_read_u32(master->dev.of_node,
+				"clock-frequency", &spi->tclk);
+
+	if (!spi->tclk) {
+		dev_err(&pdev->dev, "cannot set clock rate\n");
+		status = -EINVAL;
+		goto out;
+	}
+
+	spi->max_speed = DIV_ROUND_UP(spi->tclk, 4);
+	spi->min_speed = DIV_ROUND_UP(spi->tclk, 30);
+
+	if (spi_info)
+		spi->clock_fix = spi_info->enable_clock_fix;
+
+	if (of_find_property(master->dev.of_node, "spi-clock-fix", NULL))
+		spi->clock_fix = 1;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (r == NULL) {
@@ -541,10 +563,17 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
 
+static struct of_device_id spi_orion_of_match_table[] __devinitdata = {
+	{ .compatible = "marvell,orion-spi", },
+	{}
+};
+MODULE_DEVICE_TABLE(of, spi_orion_of_match_table);
+
 static struct platform_driver orion_spi_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(spi_orion_of_match_table),
 	},
 	.remove		= __exit_p(orion_spi_remove),
 };
-- 
1.7.3.4

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

* [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
@ 2012-03-02 17:50         ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

On the Globalscale Dreamplug (Marvell Kirkwood Development Platform),
2MB of NOR flash are used to hold the bootloader, bootloader
environment, and devicetree blob.  It is connected via spi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v1:

    - used of_match_ptr() as suggested by Grant Likely

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |   40 ------------------------------
 arch/arm/mach-kirkwood/common.c          |   11 ++++++++
 drivers/spi/spi-orion.c                  |   37 ++++++++++++++++++++++++---
 4 files changed, 78 insertions(+), 44 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 8a5dff8..bdf2ddc 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -22,4 +22,38 @@
 		interrupts = <33>;
 		clock-frequency = <200000000>;
 	};
+
+	spi at f1010600 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		compatible = "marvell,orion-spi";
+		reg = <0xf1010600 0x1ff>;
+		clock-frequency = <200000000>;
+
+		flash at 0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			compatible = "macronix,mx25l1606e", "jedec-flash";
+
+			spi-max-frequency = <50000000>;
+			reg = <0>;
+
+			partition at 0 {
+				label = "U-Boot";
+				reg = <0x0 0x100000>;
+			};
+
+			partition at 100000 {
+				label = "U-Boot Environment";
+				reg = <0x100000 0x080000>;
+			};
+
+			partition at 180000 {
+				label = "Flattened Device Tree";
+				reg = <0x180000 0x080000>;
+			};
+		};
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index fbe6405..4960e63 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -39,42 +39,6 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = {
 	{ }
 };
 
-struct mtd_partition dreamplug_partitions[] = {
-	{
-		.name	= "u-boot",
-		.size	= SZ_512K,
-		.offset = 0,
-	},
-	{
-		.name	= "u-boot env",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K,
-	},
-	{
-		.name	= "dtb",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K + SZ_512K,
-	},
-};
-
-static const struct flash_platform_data dreamplug_spi_slave_data = {
-	.type		= "mx25l1606e",
-	.name		= "spi_flash",
-	.parts		= dreamplug_partitions,
-	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
-};
-
-static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &dreamplug_spi_slave_data,
-		.irq		= -1,
-		.max_speed_hz	= 50000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
 static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
@@ -140,10 +104,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	spi_register_board_info(dreamplug_spi_slave_info,
-				ARRAY_SIZE(dreamplug_spi_slave_info));
-	kirkwood_spi_init();
-
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index cc15426..357fcde 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
 #include <linux/ata_platform.h>
 #include <linux/mtd/nand.h>
 #include <linux/dma-mapping.h>
+#include <linux/of.h>
 #include <net/dsa.h>
 #include <asm/page.h>
 #include <asm/timex.h>
@@ -481,6 +482,9 @@ static int __init kirkwood_clock_gate(void)
 {
 	unsigned int curr = readl(CLOCK_GATING_CTRL);
 	u32 dev, rev;
+#ifdef CONFIG_OF
+	struct device_node *dp;
+#endif
 
 	kirkwood_pcie_id(&dev, &rev);
 	printk(KERN_DEBUG "Gating clock of unused units\n");
@@ -524,6 +528,13 @@ static int __init kirkwood_clock_gate(void)
 	} else  /* keep this bit set for devices that don't have PCIe1 */
 		kirkwood_clk_ctrl |= CGC_PEX1;
 
+#ifdef CONFIG_OF
+	dp = of_find_node_by_path("/");
+	if (dp && of_device_is_available(of_find_compatible_node(dp, NULL,
+							  "marvell,orion-spi")))
+		kirkwood_clk_ctrl |= CGC_RUNIT;
+#endif
+
 	/* Now gate clock the required units */
 	writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
 	printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..acfb240 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -18,6 +18,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/orion_spi.h>
 #include <linux/module.h>
+#include <linux/of_device.h>
 #include <asm/unaligned.h>
 
 #define DRIVER_NAME			"orion_spi"
@@ -45,6 +46,8 @@ struct orion_spi {
 	void __iomem		*base;
 	unsigned int		max_speed;
 	unsigned int		min_speed;
+	unsigned int		tclk;
+	unsigned int		clock_fix;
 	struct orion_spi_info	*spi_info;
 };
 
@@ -104,7 +107,7 @@ static int orion_spi_baudrate_set(struct spi_device *spi, unsigned int speed)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	tclk_hz = orion_spi->spi_info->tclk;
+	tclk_hz = orion_spi->tclk;
 
 	/*
 	 * the supported rates are: 4,6,8...30
@@ -360,7 +363,7 @@ static int orion_spi_setup(struct spi_device *spi)
 	orion_spi = spi_master_get_devdata(spi->master);
 
 	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
+	if (orion_spi->clock_fix)
 		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
 				  (1 << 14));
 
@@ -474,6 +477,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	master->setup = orion_spi_setup;
 	master->transfer = orion_spi_transfer;
 	master->num_chipselect = ORION_NUM_CHIPSELECTS;
+	master->dev.of_node = pdev->dev.of_node;
 
 	dev_set_drvdata(&pdev->dev, master);
 
@@ -481,8 +485,26 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	spi->master = master;
 	spi->spi_info = spi_info;
 
-	spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
-	spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
+	if (spi_info)
+		spi->tclk = spi_info->tclk;
+
+	of_property_read_u32(master->dev.of_node,
+				"clock-frequency", &spi->tclk);
+
+	if (!spi->tclk) {
+		dev_err(&pdev->dev, "cannot set clock rate\n");
+		status = -EINVAL;
+		goto out;
+	}
+
+	spi->max_speed = DIV_ROUND_UP(spi->tclk, 4);
+	spi->min_speed = DIV_ROUND_UP(spi->tclk, 30);
+
+	if (spi_info)
+		spi->clock_fix = spi_info->enable_clock_fix;
+
+	if (of_find_property(master->dev.of_node, "spi-clock-fix", NULL))
+		spi->clock_fix = 1;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (r == NULL) {
@@ -541,10 +563,17 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
 
+static struct of_device_id spi_orion_of_match_table[] __devinitdata = {
+	{ .compatible = "marvell,orion-spi", },
+	{}
+};
+MODULE_DEVICE_TABLE(of, spi_orion_of_match_table);
+
 static struct platform_driver orion_spi_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(spi_orion_of_match_table),
 	},
 	.remove		= __exit_p(orion_spi_remove),
 };
-- 
1.7.3.4

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

* [PATCH 2/5] ARM: kirkwood: move var setting to correct location.
  2012-03-02 17:50     ` Jason Cooper
@ 2012-03-02 17:50       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

This variable should be set within the driver init function that uses
it's struct, not in the generic init function.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 357fcde..d9e4d99 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -382,6 +382,7 @@ static struct platform_device kirkwood_pcm_device = {
 void __init kirkwood_audio_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_AUDIO;
+	kirkwood_i2s_data.tclk = kirkwood_tclk;
 	platform_device_register(&kirkwood_i2s_device);
 	platform_device_register(&kirkwood_pcm_device);
 }
@@ -450,7 +451,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
-- 
1.7.3.4

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

* [PATCH 2/5] ARM: kirkwood: move var setting to correct location.
@ 2012-03-02 17:50       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

This variable should be set within the driver init function that uses
it's struct, not in the generic init function.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 357fcde..d9e4d99 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -382,6 +382,7 @@ static struct platform_device kirkwood_pcm_device = {
 void __init kirkwood_audio_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_AUDIO;
+	kirkwood_i2s_data.tclk = kirkwood_tclk;
 	platform_device_register(&kirkwood_i2s_device);
 	platform_device_register(&kirkwood_pcm_device);
 }
@@ -450,7 +451,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
-- 
1.7.3.4

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

* [PATCH 3/5 v2] ARM: kirkwood: fdt: absorb kirkwood_init()
  2012-03-02 17:50     ` Jason Cooper
@ 2012-03-02 17:50       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes since v1:

    - changed printk() to pr_info() as suggested by Grant Likely.

 arch/arm/mach-kirkwood/board-dt.c |   29 ++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 4960e63..2a45656 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -115,7 +117,32 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index d9e4d99..167b6c8 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -279,7 +279,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -291,7 +291,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -303,7 +303,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -393,7 +393,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -436,7 +436,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 3/5 v2] ARM: kirkwood: fdt: absorb kirkwood_init()
@ 2012-03-02 17:50       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes since v1:

    - changed printk() to pr_info() as suggested by Grant Likely.

 arch/arm/mach-kirkwood/board-dt.c |   29 ++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 4960e63..2a45656 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -115,7 +117,32 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index d9e4d99..167b6c8 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -279,7 +279,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -291,7 +291,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -303,7 +303,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -393,7 +393,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -436,7 +436,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-02 17:50     ` Jason Cooper
@ 2012-03-02 17:50       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

The comment at mach-kirkwood/common.c:469, says this device is in every
kirkwood board.  So, it is placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes since v1:

    - removed unnecessary of_*() code from _probe()
    - use of_match_ptr()

 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/rtc/rtc-mv.c              |    7 +++++++
 5 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..5fb185c 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,11 @@
 
 / {
 	compatible = "marvell,kirkwood";
+
+	rtc@f1010300 {
+		compatible = "marvell,rtc";
+		reg = <0xf1010300 0x1f>;
+		interrupts = <53>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 2a45656..6e18338 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -134,7 +134,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 167b6c8..0c0375f 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..ca08826 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..3108b18 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "marvell,rtc", },
+	{}
+};
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-02 17:50       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

The comment at mach-kirkwood/common.c:469, says this device is in every
kirkwood board.  So, it is placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes since v1:

    - removed unnecessary of_*() code from _probe()
    - use of_match_ptr()

 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/rtc/rtc-mv.c              |    7 +++++++
 5 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..5fb185c 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,11 @@
 
 / {
 	compatible = "marvell,kirkwood";
+
+	rtc at f1010300 {
+		compatible = "marvell,rtc";
+		reg = <0xf1010300 0x1f>;
+		interrupts = <53>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 2a45656..6e18338 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -134,7 +134,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 167b6c8..0c0375f 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..ca08826 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..3108b18 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "marvell,rtc", },
+	{}
+};
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 17:50     ` Jason Cooper
@ 2012-03-02 17:50       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

Converted register address to a variable so that it could be set from
fdt.  Also, pull clock frequency from fdt and clean up failure logic a
bit.

Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes since v1:

    - use of_match_ptr()

 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/watchdog/orion_wdt.c      |   48 +++++++++++++++++++++++++++---------
 5 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 5fb185c..bf28424 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -8,5 +8,11 @@
 		reg = <0xf1010300 0x1f>;
 		interrupts = <53>;
 	};
+
+	wdt@fed20300 {
+		compatible = "marvell,orion-wdt";
+		reg = <0xfed20300 0x28>;
+		clock-frequency = <200000000>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 6e18338..fb03318 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -134,7 +134,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
 	kirkwood_crypto_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 0c0375f..35dc40b 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-void __init kirkwood_wdt_init(void)
+static void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index ca08826..ac4b2fb 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
 void kirkwood_crypto_init(void);
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..8704b98 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -17,6 +17,8 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include <linux/of.h>
 #include <linux/watchdog.h>
 #include <linux/init.h>
 #include <linux/uaccess.h>
@@ -28,9 +30,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +42,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static void __iomem *wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +51,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +63,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +71,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +95,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +105,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,15 +239,30 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct device_node *np = pdev->dev.of_node;
+	struct resource res;
 	int ret;
 
-	if (pdata) {
+	if (pdata)
 		wdt_tclk = pdata->tclk;
-	} else {
-		printk(KERN_ERR "Orion Watchdog misses platform data\n");
+
+	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
+
+	if (!wdt_tclk) {
+		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
 		return -ENODEV;
 	}
 
+	wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
+
+	ret = of_address_to_resource(np, 0, &res);
+	if (ret) {
+		printk(KERN_ERR "invalid address\n");
+		return ret;
+	}
+
+	wdt_reg = ioremap(res.start, res.end - res.start);
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
@@ -284,6 +302,11 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
 		orion_wdt_disable();
 }
 
+static struct of_device_id orion_wdt_of_match_table[] = {
+	{ .compatible = "marvell,orion-wdt", },
+	{},
+};
+
 static struct platform_driver orion_wdt_driver = {
 	.probe		= orion_wdt_probe,
 	.remove		= __devexit_p(orion_wdt_remove),
@@ -291,6 +314,7 @@ static struct platform_driver orion_wdt_driver = {
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "orion_wdt",
+		.of_match_table = of_match_ptr(orion_wdt_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 17:50       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-02 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

Converted register address to a variable so that it could be set from
fdt.  Also, pull clock frequency from fdt and clean up failure logic a
bit.

Same as rtc-mv, this device is used in all kirkwood boards.  So, it is
placed in kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes since v1:

    - use of_match_ptr()

 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 drivers/watchdog/orion_wdt.c      |   48 +++++++++++++++++++++++++++---------
 5 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 5fb185c..bf28424 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -8,5 +8,11 @@
 		reg = <0xf1010300 0x1f>;
 		interrupts = <53>;
 	};
+
+	wdt at fed20300 {
+		compatible = "marvell,orion-wdt";
+		reg = <0xfed20300 0x28>;
+		clock-frequency = <200000000>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 6e18338..fb03318 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -134,7 +134,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
 	kirkwood_crypto_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 0c0375f..35dc40b 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -303,7 +303,7 @@ void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-void __init kirkwood_wdt_init(void)
+static void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index ca08826..ac4b2fb 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
 void kirkwood_crypto_init(void);
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..8704b98 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -17,6 +17,8 @@
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include <linux/of.h>
 #include <linux/watchdog.h>
 #include <linux/init.h>
 #include <linux/uaccess.h>
@@ -28,9 +30,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +42,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static void __iomem *wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +51,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +63,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +71,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +95,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +105,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,15 +239,30 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct device_node *np = pdev->dev.of_node;
+	struct resource res;
 	int ret;
 
-	if (pdata) {
+	if (pdata)
 		wdt_tclk = pdata->tclk;
-	} else {
-		printk(KERN_ERR "Orion Watchdog misses platform data\n");
+
+	of_property_read_u32(np, "clock-frequency", &wdt_tclk);
+
+	if (!wdt_tclk) {
+		printk(KERN_ERR "Orion Watchdog can't get clock freq\n");
 		return -ENODEV;
 	}
 
+	wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
+
+	ret = of_address_to_resource(np, 0, &res);
+	if (ret) {
+		printk(KERN_ERR "invalid address\n");
+		return ret;
+	}
+
+	wdt_reg = ioremap(res.start, res.end - res.start);
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
@@ -284,6 +302,11 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
 		orion_wdt_disable();
 }
 
+static struct of_device_id orion_wdt_of_match_table[] = {
+	{ .compatible = "marvell,orion-wdt", },
+	{},
+};
+
 static struct platform_driver orion_wdt_driver = {
 	.probe		= orion_wdt_probe,
 	.remove		= __devexit_p(orion_wdt_remove),
@@ -291,6 +314,7 @@ static struct platform_driver orion_wdt_driver = {
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "orion_wdt",
+		.of_match_table = of_match_ptr(orion_wdt_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* Re: [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-02 17:50     ` Jason Cooper
@ 2012-03-02 17:52         ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:52 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:

  ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)

are available in the git repository at:
  git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test

Jason Cooper (5):
      ARM: kirkwood: covert orion-spi to fdt.
      ARM: kirkwood: move var setting to correct location.
      ARM: kirkwood: fdt: absorb kirkwood_init()
      ARM: kirkwood: convert rtc-mv to fdt.
      ARM: kirkwood: convert orion-wdt to fdt.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi          |   12 +++++
 arch/arm/mach-kirkwood/board-dt.c        |   67 +++++++++++------------------
 arch/arm/mach-kirkwood/common.c          |   21 +++++++--
 arch/arm/mach-kirkwood/common.h          |    6 +++
 drivers/rtc/rtc-mv.c                     |    7 +++
 drivers/spi/spi-orion.c                  |   37 +++++++++++++++--
 drivers/watchdog/orion_wdt.c             |   48 ++++++++++++++++-----
 8 files changed, 170 insertions(+), 62 deletions(-)

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

* [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 17:52         ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:52 UTC (permalink / raw)
  To: linux-arm-kernel

The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:

  ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)

are available in the git repository at:
  git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test

Jason Cooper (5):
      ARM: kirkwood: covert orion-spi to fdt.
      ARM: kirkwood: move var setting to correct location.
      ARM: kirkwood: fdt: absorb kirkwood_init()
      ARM: kirkwood: convert rtc-mv to fdt.
      ARM: kirkwood: convert orion-wdt to fdt.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi          |   12 +++++
 arch/arm/mach-kirkwood/board-dt.c        |   67 +++++++++++------------------
 arch/arm/mach-kirkwood/common.c          |   21 +++++++--
 arch/arm/mach-kirkwood/common.h          |    6 +++
 drivers/rtc/rtc-mv.c                     |    7 +++
 drivers/spi/spi-orion.c                  |   37 +++++++++++++++--
 drivers/watchdog/orion_wdt.c             |   48 ++++++++++++++++-----
 8 files changed, 170 insertions(+), 62 deletions(-)

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

* Re: [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-02 17:52         ` Jason
@ 2012-03-02 17:56             ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:56 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Oops, forgot to remove the Re:...

On Fri, Mar 02, 2012 at 12:52:33PM -0500, Jason wrote:
> The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> 
>   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> 
> are available in the git repository at:
>   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> 
> Jason Cooper (5):
>       ARM: kirkwood: covert orion-spi to fdt.
>       ARM: kirkwood: move var setting to correct location.
>       ARM: kirkwood: fdt: absorb kirkwood_init()
>       ARM: kirkwood: convert rtc-mv to fdt.
>       ARM: kirkwood: convert orion-wdt to fdt.
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++
>  arch/arm/boot/dts/kirkwood.dtsi          |   12 +++++
>  arch/arm/mach-kirkwood/board-dt.c        |   67 +++++++++++------------------
>  arch/arm/mach-kirkwood/common.c          |   21 +++++++--
>  arch/arm/mach-kirkwood/common.h          |    6 +++
>  drivers/rtc/rtc-mv.c                     |    7 +++
>  drivers/spi/spi-orion.c                  |   37 +++++++++++++++--
>  drivers/watchdog/orion_wdt.c             |   48 ++++++++++++++++-----
>  8 files changed, 170 insertions(+), 62 deletions(-)
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 17:56             ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 17:56 UTC (permalink / raw)
  To: linux-arm-kernel

Oops, forgot to remove the Re:...

On Fri, Mar 02, 2012 at 12:52:33PM -0500, Jason wrote:
> The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> 
>   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> 
> are available in the git repository at:
>   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> 
> Jason Cooper (5):
>       ARM: kirkwood: covert orion-spi to fdt.
>       ARM: kirkwood: move var setting to correct location.
>       ARM: kirkwood: fdt: absorb kirkwood_init()
>       ARM: kirkwood: convert rtc-mv to fdt.
>       ARM: kirkwood: convert orion-wdt to fdt.
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++
>  arch/arm/boot/dts/kirkwood.dtsi          |   12 +++++
>  arch/arm/mach-kirkwood/board-dt.c        |   67 +++++++++++------------------
>  arch/arm/mach-kirkwood/common.c          |   21 +++++++--
>  arch/arm/mach-kirkwood/common.h          |    6 +++
>  drivers/rtc/rtc-mv.c                     |    7 +++
>  drivers/spi/spi-orion.c                  |   37 +++++++++++++++--
>  drivers/watchdog/orion_wdt.c             |   48 ++++++++++++++++-----
>  8 files changed, 170 insertions(+), 62 deletions(-)
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 17:50       ` Jason Cooper
@ 2012-03-02 18:32           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 18:32 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Friday 02 March 2012, Jason Cooper wrote:
> +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> +
> +       ret = of_address_to_resource(np, 0, &res);
> +       if (ret) {
> +               printk(KERN_ERR "invalid address\n");
> +               return ret;
> +       }
> +
> +       wdt_reg = ioremap(res.start, res.end - res.start);
> +

This will break non-dt uses because you overwrite the wdt_reg value.

As I commented before, I think the best approach would be to
provide a hardcoded resource for the device in the legacy case
and just use platform_get_resource() to get the resource
and ioremap it in either case.

of_address_to_resource() works only for the DT case, while
platform_get_resource() works in either case.

You need to add something like

8<---
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 089899a..d16f43f 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -568,13 +568,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
  ****************************************************************************/
 static struct orion_wdt_platform_data orion_wdt_data;
 
+static struct resource orion_wdt_resource =
+               DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28);
+
 static struct platform_device orion_wdt_device = {
        .name           = "orion_wdt",
        .id             = -1,
        .dev            = {
                .platform_data  = &orion_wdt_data,
        },
-       .num_resources  = 0,
+       .resources      = &orion_wdt_resource,
+       .num_resources  = 1,
 };
 
 void __init orion_wdt_init(unsigned long tclk)
---->8

and an appropriate definition for TIMER_PHYS_BASE.


	Arnd

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

* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 18:32           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Jason Cooper wrote:
> +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> +
> +       ret = of_address_to_resource(np, 0, &res);
> +       if (ret) {
> +               printk(KERN_ERR "invalid address\n");
> +               return ret;
> +       }
> +
> +       wdt_reg = ioremap(res.start, res.end - res.start);
> +

This will break non-dt uses because you overwrite the wdt_reg value.

As I commented before, I think the best approach would be to
provide a hardcoded resource for the device in the legacy case
and just use platform_get_resource() to get the resource
and ioremap it in either case.

of_address_to_resource() works only for the DT case, while
platform_get_resource() works in either case.

You need to add something like

8<---
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 089899a..d16f43f 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -568,13 +568,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
  ****************************************************************************/
 static struct orion_wdt_platform_data orion_wdt_data;
 
+static struct resource orion_wdt_resource =
+               DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28);
+
 static struct platform_device orion_wdt_device = {
        .name           = "orion_wdt",
        .id             = -1,
        .dev            = {
                .platform_data  = &orion_wdt_data,
        },
-       .num_resources  = 0,
+       .resources      = &orion_wdt_resource,
+       .num_resources  = 1,
 };
 
 void __init orion_wdt_init(unsigned long tclk)
---->8

and an appropriate definition for TIMER_PHYS_BASE.


	Arnd

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

* Re: [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 18:32           ` Arnd Bergmann
@ 2012-03-02 19:57               ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 19:57 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason Cooper wrote:
> > +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> > +
> > +       ret = of_address_to_resource(np, 0, &res);
> > +       if (ret) {
> > +               printk(KERN_ERR "invalid address\n");
> > +               return ret;
> > +       }
> > +
> > +       wdt_reg = ioremap(res.start, res.end - res.start);
> > +
> 
> This will break non-dt uses because you overwrite the wdt_reg value.

I thought for non-dt configurations of_.*() zeroed out.  No problem, I
must've misunderstood something from earlier.

> As I commented before, I think the best approach would be to
> provide a hardcoded resource for the device in the legacy case
> and just use platform_get_resource() to get the resource
> and ioremap it in either case.

Sorry, my denseness got in the way.  When you said hardcoded, I thought
you meant #define TIMER_VIRT_BASE .

> of_address_to_resource() works only for the DT case, while
> platform_get_resource() works in either case.
> 
> You need to add something like

Ahh... now *that* makes sense.

> 8<---
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index 089899a..d16f43f 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -568,13 +568,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
>   ****************************************************************************/
>  static struct orion_wdt_platform_data orion_wdt_data;
>  
> +static struct resource orion_wdt_resource =
> +               DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28);
> +
>  static struct platform_device orion_wdt_device = {
>         .name           = "orion_wdt",
>         .id             = -1,
>         .dev            = {
>                 .platform_data  = &orion_wdt_data,
>         },
> -       .num_resources  = 0,
> +       .resources      = &orion_wdt_resource,
> +       .num_resources  = 1,
>  };
>  
>  void __init orion_wdt_init(unsigned long tclk)
> ---->8
> 
> and an appropriate definition for TIMER_PHYS_BASE.

thx,

Jason.

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

* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 19:57               ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-02 19:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason Cooper wrote:
> > +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> > +
> > +       ret = of_address_to_resource(np, 0, &res);
> > +       if (ret) {
> > +               printk(KERN_ERR "invalid address\n");
> > +               return ret;
> > +       }
> > +
> > +       wdt_reg = ioremap(res.start, res.end - res.start);
> > +
> 
> This will break non-dt uses because you overwrite the wdt_reg value.

I thought for non-dt configurations of_.*() zeroed out.  No problem, I
must've misunderstood something from earlier.

> As I commented before, I think the best approach would be to
> provide a hardcoded resource for the device in the legacy case
> and just use platform_get_resource() to get the resource
> and ioremap it in either case.

Sorry, my denseness got in the way.  When you said hardcoded, I thought
you meant #define TIMER_VIRT_BASE .

> of_address_to_resource() works only for the DT case, while
> platform_get_resource() works in either case.
> 
> You need to add something like

Ahh... now *that* makes sense.

> 8<---
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index 089899a..d16f43f 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -568,13 +568,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
>   ****************************************************************************/
>  static struct orion_wdt_platform_data orion_wdt_data;
>  
> +static struct resource orion_wdt_resource =
> +               DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28);
> +
>  static struct platform_device orion_wdt_device = {
>         .name           = "orion_wdt",
>         .id             = -1,
>         .dev            = {
>                 .platform_data  = &orion_wdt_data,
>         },
> -       .num_resources  = 0,
> +       .resources      = &orion_wdt_resource,
> +       .num_resources  = 1,
>  };
>  
>  void __init orion_wdt_init(unsigned long tclk)
> ---->8
> 
> and an appropriate definition for TIMER_PHYS_BASE.

thx,

Jason.

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
       [not found]           ` <201203021832.34901.arnd-r2nGTMty4D4@public.gmane.org>
  2012-03-02 19:57               ` Jason
@ 2012-03-02 20:00             ` Jason
       [not found]               ` <20120302200034.GQ11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
  2012-03-03 10:08               ` Russell King - ARM Linux
  2 siblings, 1 reply; 272+ messages in thread
From: Jason @ 2012-03-02 20:00 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:

  ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)

are available in the git repository at:
  git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test

Jason Cooper (5):
      ARM: kirkwood: covert orion-spi to fdt.
      ARM: kirkwood: move var setting to correct location.
      ARM: kirkwood: fdt: absorb kirkwood_init()
      ARM: kirkwood: convert rtc-mv to fdt.
      ARM: kirkwood: convert orion-wdt to fdt.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi          |   12 +++++
 arch/arm/mach-kirkwood/board-dt.c        |   67 +++++++++++------------------
 arch/arm/mach-kirkwood/common.c          |   21 +++++++--
 arch/arm/mach-kirkwood/common.h          |    6 +++
 arch/arm/plat-orion/common.c             |    7 +++-
 drivers/rtc/rtc-mv.c                     |    7 +++
 drivers/spi/spi-orion.c                  |   37 +++++++++++++++--
 drivers/watchdog/orion_wdt.c             |   46 +++++++++++++++-----
 9 files changed, 174 insertions(+), 63 deletions(-)

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

* Re: [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 19:57               ` Jason
@ 2012-03-02 20:02                   ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 20:02 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Friday 02 March 2012, Jason wrote:
> On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
>
> > As I commented before, I think the best approach would be to
> > provide a hardcoded resource for the device in the legacy case
> > and just use platform_get_resource() to get the resource
> > and ioremap it in either case.
> 
> Sorry, my denseness got in the way.  When you said hardcoded, I thought
> you meant #define TIMER_VIRT_BASE .

Using TIMER_VIRT_BASE wouldn't be all that wrong either, but I think it's
better to use the same code path in both ways. Using a resource also has
the nice side-effect of allowing us to build a multiplatform kernel for
anything that uses orion-wdt but has different constants for TIMER_VIRT_BASE.

	Arnd

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

* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 20:02                   ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Jason wrote:
> On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
>
> > As I commented before, I think the best approach would be to
> > provide a hardcoded resource for the device in the legacy case
> > and just use platform_get_resource() to get the resource
> > and ioremap it in either case.
> 
> Sorry, my denseness got in the way.  When you said hardcoded, I thought
> you meant #define TIMER_VIRT_BASE .

Using TIMER_VIRT_BASE wouldn't be all that wrong either, but I think it's
better to use the same code path in both ways. Using a resource also has
the nice side-effect of allowing us to build a multiplatform kernel for
anything that uses orion-wdt but has different constants for TIMER_VIRT_BASE.

	Arnd

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-02 20:00             ` [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs " Jason
@ 2012-03-02 20:35                   ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 20:35 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Friday 02 March 2012, Jason wrote:
> The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> 
>   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> 
> are available in the git repository at:
>   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> 

Applied to next/dt branch.

Thanks,

	Arnd

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 20:35                   ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Jason wrote:
> The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> 
>   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> 
> are available in the git repository at:
>   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> 

Applied to next/dt branch.

Thanks,

	Arnd

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-02 20:35                   ` Arnd Bergmann
@ 2012-03-02 21:18                       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 21:18 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason, Nicolas Pitre

On Friday 02 March 2012, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> > 
> >   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> > 
> > are available in the git repository at:
> >   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> > 
> 
> Applied to next/dt branch.

On second thought, I should probably wait for the maintainer to comment
as well ;-)

Nico, does this look ok to you?

	Arnd

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-02 21:18                       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-02 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 02 March 2012, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason wrote:
> > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> > 
> >   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> > 
> > are available in the git repository at:
> >   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> > 
> 
> Applied to next/dt branch.

On second thought, I should probably wait for the maintainer to comment
as well ;-)

Nico, does this look ok to you?

	Arnd

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 17:02                   ` Jason
@ 2012-03-02 22:36                       ` Andrew Lunn
  -1 siblings, 0 replies; 272+ messages in thread
From: Andrew Lunn @ 2012-03-02 22:36 UTC (permalink / raw)
  To: Jason
  Cc: Andrew Lunn, mturquette-QSEj5FYQhm4dnm+yROfE0A,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Simon Guinot,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

> > Andrew Lunn said that he has a patch for plat-orion to use the generic
> > clock framework. I think we should look at that before introducing
> > a hack that will have to be removed again very soon.
> 
> I asked him for it earlier [1], apparently it's a very invasive patch
> series which breaks things.  I would like to look at it as a reference,
> even if applying it isn't a good idea.

I did not say it breaks things. I said i have a habit of breaking
orion5x, because i cannot test it.

I will send the patches as RFC on Sunday. I'm traveling at the moment.

  Andrew

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-02 22:36                       ` Andrew Lunn
  0 siblings, 0 replies; 272+ messages in thread
From: Andrew Lunn @ 2012-03-02 22:36 UTC (permalink / raw)
  To: linux-arm-kernel

> > Andrew Lunn said that he has a patch for plat-orion to use the generic
> > clock framework. I think we should look at that before introducing
> > a hack that will have to be removed again very soon.
> 
> I asked him for it earlier [1], apparently it's a very invasive patch
> series which breaks things.  I would like to look at it as a reference,
> even if applying it isn't a good idea.

I did not say it breaks things. I said i have a habit of breaking
orion5x, because i cannot test it.

I will send the patches as RFC on Sunday. I'm traveling at the moment.

  Andrew

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

* Re: [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 18:32           ` Arnd Bergmann
@ 2012-03-03 10:08               ` Russell King - ARM Linux
  -1 siblings, 0 replies; 272+ messages in thread
From: Russell King - ARM Linux @ 2012-03-03 10:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason Cooper wrote:
> > +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> > +
> > +       ret = of_address_to_resource(np, 0, &res);
> > +       if (ret) {
> > +               printk(KERN_ERR "invalid address\n");
> > +               return ret;
> > +       }
> > +
> > +       wdt_reg = ioremap(res.start, res.end - res.start);
> > +
> 
> This will break non-dt uses because you overwrite the wdt_reg value.

Don't also forget that "res.end - res.start" is also not correct, and
resource_size() should be used to prevent that kind of error.

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

* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-03 10:08               ` Russell King - ARM Linux
  0 siblings, 0 replies; 272+ messages in thread
From: Russell King - ARM Linux @ 2012-03-03 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
> On Friday 02 March 2012, Jason Cooper wrote:
> > +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> > +
> > +       ret = of_address_to_resource(np, 0, &res);
> > +       if (ret) {
> > +               printk(KERN_ERR "invalid address\n");
> > +               return ret;
> > +       }
> > +
> > +       wdt_reg = ioremap(res.start, res.end - res.start);
> > +
> 
> This will break non-dt uses because you overwrite the wdt_reg value.

Don't also forget that "res.end - res.start" is also not correct, and
resource_size() should be used to prevent that kind of error.

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

* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-02 22:36                       ` Andrew Lunn
@ 2012-03-03 22:54                           ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-03 22:54 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: mturquette-QSEj5FYQhm4dnm+yROfE0A,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Simon Guinot,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Mar 02, 2012 at 11:36:29PM +0100, Andrew Lunn wrote:
> > > Andrew Lunn said that he has a patch for plat-orion to use the generic
> > > clock framework. I think we should look at that before introducing
> > > a hack that will have to be removed again very soon.
> > 
> > I asked him for it earlier [1], apparently it's a very invasive patch
> > series which breaks things.  I would like to look at it as a reference,
> > even if applying it isn't a good idea.
> 
> I did not say it breaks things. I said i have a habit of breaking
> orion5x, because i cannot test it.

Wow, you're right, I was way off.  I must not have read that over before
sending.  My mistake.

> I will send the patches as RFC on Sunday. I'm traveling at the moment.

Awesome, thanks.

Jason.

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

* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-03 22:54                           ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-03 22:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 02, 2012 at 11:36:29PM +0100, Andrew Lunn wrote:
> > > Andrew Lunn said that he has a patch for plat-orion to use the generic
> > > clock framework. I think we should look at that before introducing
> > > a hack that will have to be removed again very soon.
> > 
> > I asked him for it earlier [1], apparently it's a very invasive patch
> > series which breaks things.  I would like to look at it as a reference,
> > even if applying it isn't a good idea.
> 
> I did not say it breaks things. I said i have a habit of breaking
> orion5x, because i cannot test it.

Wow, you're right, I was way off.  I must not have read that over before
sending.  My mistake.

> I will send the patches as RFC on Sunday. I'm traveling at the moment.

Awesome, thanks.

Jason.

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

* Re: [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
  2012-03-03 10:08               ` Russell King - ARM Linux
@ 2012-03-03 23:05                   ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-03 23:05 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sat, Mar 03, 2012 at 10:08:53AM +0000, Russell King - ARM Linux wrote:
> On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
> > On Friday 02 March 2012, Jason Cooper wrote:
> > > +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> > > +
> > > +       ret = of_address_to_resource(np, 0, &res);
> > > +       if (ret) {
> > > +               printk(KERN_ERR "invalid address\n");
> > > +               return ret;
> > > +       }
> > > +
> > > +       wdt_reg = ioremap(res.start, res.end - res.start);
> > > +
> > 
> > This will break non-dt uses because you overwrite the wdt_reg value.
> 
> Don't also forget that "res.end - res.start" is also not correct, and
> resource_size() should be used to prevent that kind of error.

Russell, thanks for the review.  I'll redo this one and resubmit my
pull-request to Arnd.  I assume that we don't won't this to be a
separate patch as a future bisect could land inbetween this patch and
the fix.

Sorry for the extra work Arnd.

thx,

Jason.

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

* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
@ 2012-03-03 23:05                   ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-03 23:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Mar 03, 2012 at 10:08:53AM +0000, Russell King - ARM Linux wrote:
> On Fri, Mar 02, 2012 at 06:32:33PM +0000, Arnd Bergmann wrote:
> > On Friday 02 March 2012, Jason Cooper wrote:
> > > +       wdt_reg = (void __iomem *)TIMER_VIRT_BASE;
> > > +
> > > +       ret = of_address_to_resource(np, 0, &res);
> > > +       if (ret) {
> > > +               printk(KERN_ERR "invalid address\n");
> > > +               return ret;
> > > +       }
> > > +
> > > +       wdt_reg = ioremap(res.start, res.end - res.start);
> > > +
> > 
> > This will break non-dt uses because you overwrite the wdt_reg value.
> 
> Don't also forget that "res.end - res.start" is also not correct, and
> resource_size() should be used to prevent that kind of error.

Russell, thanks for the review.  I'll redo this one and resubmit my
pull-request to Arnd.  I assume that we don't won't this to be a
separate patch as a future bisect could land inbetween this patch and
the fix.

Sorry for the extra work Arnd.

thx,

Jason.

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-01 18:20   ` Jason Cooper
@ 2012-03-04 14:59     ` Michael Walle
  -1 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 14:59 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: grant.likely, devicetree-discuss, Jason Cooper, arnd

Am Donnerstag 01 März 2012, 19:20:54 schrieb Jason Cooper:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
>  5 files changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi
> b/arch/arm/boot/dts/kirkwood.dtsi index 771c6bb..5fb185c 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,11 @@
> 
>  / {
>  	compatible = "marvell,kirkwood";
> +
> +	rtc@f1010300 {
> +		compatible = "marvell,rtc";
what about the names used here?

in my older patch series i flagged all converted devices with two 
compatibility names. Eg:

       { .compatible = "marvell,orion5x-rtc", },
       { .compatible = "marvell,kirkwood-rtc", },

IMHO marvell,rtc is i little too general, i guess marvell won't have only one 
rtc ;)

Other opinions?

-- 
Michael

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-04 14:59     ` Michael Walle
  0 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 14:59 UTC (permalink / raw)
  To: linux-arm-kernel

Am Donnerstag 01 M?rz 2012, 19:20:54 schrieb Jason Cooper:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/rtc/rtc-mv.c              |   19 +++++++++++++++++++
>  5 files changed, 26 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi
> b/arch/arm/boot/dts/kirkwood.dtsi index 771c6bb..5fb185c 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,11 @@
> 
>  / {
>  	compatible = "marvell,kirkwood";
> +
> +	rtc at f1010300 {
> +		compatible = "marvell,rtc";
what about the names used here?

in my older patch series i flagged all converted devices with two 
compatibility names. Eg:

       { .compatible = "marvell,orion5x-rtc", },
       { .compatible = "marvell,kirkwood-rtc", },

IMHO marvell,rtc is i little too general, i guess marvell won't have only one 
rtc ;)

Other opinions?

-- 
Michael

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

* Re: [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-02 17:50       ` Jason Cooper
@ 2012-03-04 15:12         ` Michael Walle
  -1 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 15:12 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: grant.likely, devicetree-discuss, Jason Cooper, arnd

Am Freitag 02 März 2012, 18:50:21 schrieb Jason Cooper:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> 
> Changes since v1:
> 
>     - removed unnecessary of_*() code from _probe()
>     - use of_match_ptr()
> 
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/rtc/rtc-mv.c              |    7 +++++++
>  5 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi
> b/arch/arm/boot/dts/kirkwood.dtsi index 771c6bb..5fb185c 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,11 @@
> 
>  / {
>  	compatible = "marvell,kirkwood";
> +
> +	rtc@f1010300 {
> +		compatible = "marvell,rtc";
> +		reg = <0xf1010300 0x1f>;
> +		interrupts = <53>;
> +	};
>  };
> 
> diff --git a/arch/arm/mach-kirkwood/board-dt.c
> b/arch/arm/mach-kirkwood/board-dt.c index 2a45656..6e18338 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -134,7 +134,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
> 
>  	/* internal devices that every board has */
> -	kirkwood_rtc_init();
>  	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
> diff --git a/arch/arm/mach-kirkwood/common.c
> b/arch/arm/mach-kirkwood/common.c index 167b6c8..0c0375f 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition
> *parts, int nr_parts,
> /*************************************************************************
> **** * SoC RTC
>  
> **************************************************************************
> **/ -void __init kirkwood_rtc_init(void)
> +static void __init kirkwood_rtc_init(void)
>  {
>  	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h
> b/arch/arm/mach-kirkwood/common.h index c382447..ca08826 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
> 
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_rtc_init(void);
>  void kirkwood_wdt_init(void);
>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 768e2ed..3108b18 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -12,6 +12,7 @@
>  #include <linux/bcd.h>
>  #include <linux/io.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/delay.h>
>  #include <linux/gfp.h>
>  #include <linux/module.h>
> @@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct
> platform_device *pdev) return 0;
>  }
> 
> +static struct of_device_id rtc_mv_of_match_table[] = {
> +	{ .compatible = "marvell,rtc", },
> +	{}
> +};
> +
Isn't here an ifdef CONFIG_OF missing to prevent compiler warnings?

>  static struct platform_driver mv_rtc_driver = {
>  	.remove		= __exit_p(mv_rtc_remove),
>  	.driver		= {
>  		.name	= "rtc-mv",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
>  	},
>  };


-- 
Michael

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

* [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-04 15:12         ` Michael Walle
  0 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag 02 M?rz 2012, 18:50:21 schrieb Jason Cooper:
> The comment at mach-kirkwood/common.c:469, says this device is in every
> kirkwood board.  So, it is placed in kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> 
> Changes since v1:
> 
>     - removed unnecessary of_*() code from _probe()
>     - use of_match_ptr()
> 
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  drivers/rtc/rtc-mv.c              |    7 +++++++
>  5 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi
> b/arch/arm/boot/dts/kirkwood.dtsi index 771c6bb..5fb185c 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,11 @@
> 
>  / {
>  	compatible = "marvell,kirkwood";
> +
> +	rtc at f1010300 {
> +		compatible = "marvell,rtc";
> +		reg = <0xf1010300 0x1f>;
> +		interrupts = <53>;
> +	};
>  };
> 
> diff --git a/arch/arm/mach-kirkwood/board-dt.c
> b/arch/arm/mach-kirkwood/board-dt.c index 2a45656..6e18338 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -134,7 +134,6 @@ static void __init kirkwood_dt_init(void)
>  #endif
> 
>  	/* internal devices that every board has */
> -	kirkwood_rtc_init();
>  	kirkwood_wdt_init();
>  	kirkwood_xor0_init();
>  	kirkwood_xor1_init();
> diff --git a/arch/arm/mach-kirkwood/common.c
> b/arch/arm/mach-kirkwood/common.c index 167b6c8..0c0375f 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition
> *parts, int nr_parts,
> /*************************************************************************
> **** * SoC RTC
>  
> **************************************************************************
> **/ -void __init kirkwood_rtc_init(void)
> +static void __init kirkwood_rtc_init(void)
>  {
>  	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
>  }
> diff --git a/arch/arm/mach-kirkwood/common.h
> b/arch/arm/mach-kirkwood/common.h index c382447..ca08826 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
> 
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -void kirkwood_rtc_init(void);
>  void kirkwood_wdt_init(void);
>  void kirkwood_xor0_init(void);
>  void kirkwood_xor1_init(void);
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 768e2ed..3108b18 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -12,6 +12,7 @@
>  #include <linux/bcd.h>
>  #include <linux/io.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/delay.h>
>  #include <linux/gfp.h>
>  #include <linux/module.h>
> @@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct
> platform_device *pdev) return 0;
>  }
> 
> +static struct of_device_id rtc_mv_of_match_table[] = {
> +	{ .compatible = "marvell,rtc", },
> +	{}
> +};
> +
Isn't here an ifdef CONFIG_OF missing to prevent compiler warnings?

>  static struct platform_driver mv_rtc_driver = {
>  	.remove		= __exit_p(mv_rtc_remove),
>  	.driver		= {
>  		.name	= "rtc-mv",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
>  	},
>  };


-- 
Michael

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-04 14:59     ` Michael Walle
@ 2012-03-04 16:48       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-04 16:48 UTC (permalink / raw)
  To: Michael Walle
  Cc: grant.likely, devicetree-discuss, Jason Cooper, linux-arm-kernel

On Sunday 04 March 2012, Michael Walle wrote:
> in my older patch series i flagged all converted devices with two 
> compatibility names. Eg:
> 
>        { .compatible = "marvell,orion5x-rtc", },
>        { .compatible = "marvell,kirkwood-rtc", },
> 
> IMHO marvell,rtc is i little too general, i guess marvell won't have only one 
> rtc ;)
> 
> Other opinions?

Being specific is certainly good, and it may also be a good idea to
list the first one it's compatible with in the device tree source.

So the device tree for a 88F6281 soc could list

	compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc", "marvell,orion-rtc";

This would give the device driver the option which one to bind to. Anything that
has an rtc compatible with the one in orion should list that one, so that the driver
only has to list that one if they are truely identical, but if the driver has to
get modified later to know the difference between orion and kirkwood rtcs, it can
check the more specific value.

	Arnd

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-04 16:48       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-04 16:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday 04 March 2012, Michael Walle wrote:
> in my older patch series i flagged all converted devices with two 
> compatibility names. Eg:
> 
>        { .compatible = "marvell,orion5x-rtc", },
>        { .compatible = "marvell,kirkwood-rtc", },
> 
> IMHO marvell,rtc is i little too general, i guess marvell won't have only one 
> rtc ;)
> 
> Other opinions?

Being specific is certainly good, and it may also be a good idea to
list the first one it's compatible with in the device tree source.

So the device tree for a 88F6281 soc could list

	compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc", "marvell,orion-rtc";

This would give the device driver the option which one to bind to. Anything that
has an rtc compatible with the one in orion should list that one, so that the driver
only has to list that one if they are truely identical, but if the driver has to
get modified later to know the difference between orion and kirkwood rtcs, it can
check the more specific value.

	Arnd

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

* Re: [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-04 15:12         ` Michael Walle
@ 2012-03-04 16:50           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-04 16:50 UTC (permalink / raw)
  To: Michael Walle
  Cc: grant.likely, devicetree-discuss, Jason Cooper, linux-arm-kernel

On Sunday 04 March 2012, Michael Walle wrote:
> > @@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct
> > platform_device *pdev) return 0;
> >  }
> > 
> > +static struct of_device_id rtc_mv_of_match_table[] = {
> > +     { .compatible = "marvell,rtc", },
> > +     {}
> > +};
> > +
> Isn't here an ifdef CONFIG_OF missing to prevent compiler warnings?
> 

Yes, I guess so. I keep thinking that an __unused attribute would
actually be more helpful here because it lets the compiler automatically
discard the symbol when it's not used, but we still get potential
compiler errors and warnings if something inside of the unused data
is broken.

	Arnd

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

* [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-04 16:50           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-04 16:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday 04 March 2012, Michael Walle wrote:
> > @@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct
> > platform_device *pdev) return 0;
> >  }
> > 
> > +static struct of_device_id rtc_mv_of_match_table[] = {
> > +     { .compatible = "marvell,rtc", },
> > +     {}
> > +};
> > +
> Isn't here an ifdef CONFIG_OF missing to prevent compiler warnings?
> 

Yes, I guess so. I keep thinking that an __unused attribute would
actually be more helpful here because it lets the compiler automatically
discard the symbol when it's not used, but we still get potential
compiler errors and warnings if something inside of the unused data
is broken.

	Arnd

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

* Re: [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
  2012-03-02 17:50         ` Jason Cooper
@ 2012-03-04 18:12           ` Michael Walle
  -1 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 18:12 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: grant.likely, devicetree-discuss, Jason Cooper, arnd

Am Freitag 02 März 2012, 18:50:18 schrieb Jason Cooper:
> On the Globalscale Dreamplug (Marvell Kirkwood Development Platform),
> 2MB of NOR flash are used to hold the bootloader, bootloader
> environment, and devicetree blob.  It is connected via spi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> 
> Changes from v1:
> 
>     - used of_match_ptr() as suggested by Grant Likely
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/board-dt.c        |   40
> ------------------------------ arch/arm/mach-kirkwood/common.c          | 
>  11 ++++++++
>  drivers/spi/spi-orion.c                  |   37
> ++++++++++++++++++++++++--- 4 files changed, 78 insertions(+), 44
> deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts
> b/arch/arm/boot/dts/kirkwood-dreamplug.dts index 8a5dff8..bdf2ddc 100644
> --- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -22,4 +22,38 @@
>  		interrupts = <33>;
>  		clock-frequency = <200000000>;
>  	};
> +
> +	spi@f1010600 {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		compatible = "marvell,orion-spi";
> +		reg = <0xf1010600 0x1ff>;
> +		clock-frequency = <200000000>;
> +
> +		flash@0 {
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			compatible = "macronix,mx25l1606e", "jedec-flash";
> +
> +			spi-max-frequency = <50000000>;
> +			reg = <0>;
> +
> +			partition@0 {
> +				label = "U-Boot";
> +				reg = <0x0 0x100000>;
> +			};
> +
> +			partition@100000 {
> +				label = "U-Boot Environment";
> +				reg = <0x100000 0x080000>;
> +			};
> +
> +			partition@180000 {
> +				label = "Flattened Device Tree";
> +				reg = <0x180000 0x080000>;
> +			};
> +		};
> +	};
>  };
> diff --git a/arch/arm/mach-kirkwood/board-dt.c
> b/arch/arm/mach-kirkwood/board-dt.c index fbe6405..4960e63 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -39,42 +39,6 @@ static struct of_device_id kirkwood_dt_match_table[]
> __initdata = { { }
>  };
> 
> -struct mtd_partition dreamplug_partitions[] = {
> -	{
> -		.name	= "u-boot",
> -		.size	= SZ_512K,
> -		.offset = 0,
> -	},
> -	{
> -		.name	= "u-boot env",
> -		.size	= SZ_64K,
> -		.offset = SZ_512K + SZ_512K,
> -	},
> -	{
> -		.name	= "dtb",
> -		.size	= SZ_64K,
> -		.offset = SZ_512K + SZ_512K + SZ_512K,
> -	},
> -};
> -
> -static const struct flash_platform_data dreamplug_spi_slave_data = {
> -	.type		= "mx25l1606e",
> -	.name		= "spi_flash",
> -	.parts		= dreamplug_partitions,
> -	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
> -};
> -
> -static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
> -	{
> -		.modalias	= "m25p80",
> -		.platform_data	= &dreamplug_spi_slave_data,
> -		.irq		= -1,
> -		.max_speed_hz	= 50000000,
> -		.bus_num	= 0,
> -		.chip_select	= 0,
> -	},
> -};
> -
>  static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
>  	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
>  };
> @@ -140,10 +104,6 @@ static void __init dreamplug_init(void)
>  	 */
>  	kirkwood_mpp_conf(dreamplug_mpp_config);
> 
> -	spi_register_board_info(dreamplug_spi_slave_info,
> -				ARRAY_SIZE(dreamplug_spi_slave_info));
> -	kirkwood_spi_init();
> -
>  	kirkwood_ehci_init();
>  	kirkwood_ge00_init(&dreamplug_ge00_data);
>  	kirkwood_ge01_init(&dreamplug_ge01_data);
> diff --git a/arch/arm/mach-kirkwood/common.c
> b/arch/arm/mach-kirkwood/common.c index cc15426..357fcde 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -15,6 +15,7 @@
>  #include <linux/ata_platform.h>
>  #include <linux/mtd/nand.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/of.h>
>  #include <net/dsa.h>
>  #include <asm/page.h>
>  #include <asm/timex.h>
> @@ -481,6 +482,9 @@ static int __init kirkwood_clock_gate(void)
>  {
>  	unsigned int curr = readl(CLOCK_GATING_CTRL);
>  	u32 dev, rev;
> +#ifdef CONFIG_OF
> +	struct device_node *dp;
> +#endif
> 
>  	kirkwood_pcie_id(&dev, &rev);
>  	printk(KERN_DEBUG "Gating clock of unused units\n");
> @@ -524,6 +528,13 @@ static int __init kirkwood_clock_gate(void)
>  	} else  /* keep this bit set for devices that don't have PCIe1 */
>  		kirkwood_clk_ctrl |= CGC_PEX1;
> 
> +#ifdef CONFIG_OF
> +	dp = of_find_node_by_path("/");
> +	if (dp && of_device_is_available(of_find_compatible_node(dp, NULL,
> +							  "marvell,orion-
spi")))
> +		kirkwood_clk_ctrl |= CGC_RUNIT;
> +#endif
> +
>  	/* Now gate clock the required units */
>  	writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
>  	printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index 13448c8..acfb240 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -18,6 +18,7 @@
>  #include <linux/spi/spi.h>
>  #include <linux/spi/orion_spi.h>
>  #include <linux/module.h>
> +#include <linux/of_device.h>
>  #include <asm/unaligned.h>
> 
>  #define DRIVER_NAME			"orion_spi"
> @@ -45,6 +46,8 @@ struct orion_spi {
>  	void __iomem		*base;
>  	unsigned int		max_speed;
>  	unsigned int		min_speed;
> +	unsigned int		tclk;
> +	unsigned int		clock_fix;
>  	struct orion_spi_info	*spi_info;
>  };
> 
> @@ -104,7 +107,7 @@ static int orion_spi_baudrate_set(struct spi_device
> *spi, unsigned int speed)
> 
>  	orion_spi = spi_master_get_devdata(spi->master);
> 
> -	tclk_hz = orion_spi->spi_info->tclk;
> +	tclk_hz = orion_spi->tclk;
> 
>  	/*
>  	 * the supported rates are: 4,6,8...30
> @@ -360,7 +363,7 @@ static int orion_spi_setup(struct spi_device *spi)
>  	orion_spi = spi_master_get_devdata(spi->master);
> 
>  	/* Fix ac timing if required.   */
> -	if (orion_spi->spi_info->enable_clock_fix)
> +	if (orion_spi->clock_fix)
>  		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
>  				  (1 << 14));
> 
> @@ -474,6 +477,7 @@ static int __init orion_spi_probe(struct
> platform_device *pdev) master->setup = orion_spi_setup;
>  	master->transfer = orion_spi_transfer;
>  	master->num_chipselect = ORION_NUM_CHIPSELECTS;
> +	master->dev.of_node = pdev->dev.of_node;
> 
>  	dev_set_drvdata(&pdev->dev, master);
> 
> @@ -481,8 +485,26 @@ static int __init orion_spi_probe(struct
> platform_device *pdev) spi->master = master;
>  	spi->spi_info = spi_info;
> 
> -	spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
> -	spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
> +	if (spi_info)
> +		spi->tclk = spi_info->tclk;
> +
> +	of_property_read_u32(master->dev.of_node,
> +				"clock-frequency", &spi->tclk);
> +
> +	if (!spi->tclk) {
> +		dev_err(&pdev->dev, "cannot set clock rate\n");
shouldn't you check the return value of of_property_read_u32 instead? and 
report a more meaningful error message, eg no valid clock-frequency property 
in the OF case?

> +		status = -EINVAL;
> +		goto out;
> +	}
> +
> +	spi->max_speed = DIV_ROUND_UP(spi->tclk, 4);
> +	spi->min_speed = DIV_ROUND_UP(spi->tclk, 30);
> +
> +	if (spi_info)
> +		spi->clock_fix = spi_info->enable_clock_fix;
> +
> +	if (of_find_property(master->dev.of_node, "spi-clock-fix", NULL))
> +		spi->clock_fix = 1;
> 
>  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (r == NULL) {
> @@ -541,10 +563,17 @@ static int __exit orion_spi_remove(struct
> platform_device *pdev)
> 
>  MODULE_ALIAS("platform:" DRIVER_NAME);
> 

#ifdef CONFIG_OF
> +static struct of_device_id spi_orion_of_match_table[] __devinitdata = {
> +	{ .compatible = "marvell,orion-spi", },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, spi_orion_of_match_table);
#endif

>  static struct platform_driver orion_spi_driver = {
>  	.driver = {
>  		.name	= DRIVER_NAME,
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(spi_orion_of_match_table),
>  	},
>  	.remove		= __exit_p(orion_spi_remove),
>  };


-- 
Michael

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

* [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
@ 2012-03-04 18:12           ` Michael Walle
  0 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 18:12 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag 02 M?rz 2012, 18:50:18 schrieb Jason Cooper:
> On the Globalscale Dreamplug (Marvell Kirkwood Development Platform),
> 2MB of NOR flash are used to hold the bootloader, bootloader
> environment, and devicetree blob.  It is connected via spi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> 
> Changes from v1:
> 
>     - used of_match_ptr() as suggested by Grant Likely
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |   34 +++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/board-dt.c        |   40
> ------------------------------ arch/arm/mach-kirkwood/common.c          | 
>  11 ++++++++
>  drivers/spi/spi-orion.c                  |   37
> ++++++++++++++++++++++++--- 4 files changed, 78 insertions(+), 44
> deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts
> b/arch/arm/boot/dts/kirkwood-dreamplug.dts index 8a5dff8..bdf2ddc 100644
> --- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -22,4 +22,38 @@
>  		interrupts = <33>;
>  		clock-frequency = <200000000>;
>  	};
> +
> +	spi at f1010600 {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		compatible = "marvell,orion-spi";
> +		reg = <0xf1010600 0x1ff>;
> +		clock-frequency = <200000000>;
> +
> +		flash at 0 {
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			compatible = "macronix,mx25l1606e", "jedec-flash";
> +
> +			spi-max-frequency = <50000000>;
> +			reg = <0>;
> +
> +			partition at 0 {
> +				label = "U-Boot";
> +				reg = <0x0 0x100000>;
> +			};
> +
> +			partition at 100000 {
> +				label = "U-Boot Environment";
> +				reg = <0x100000 0x080000>;
> +			};
> +
> +			partition at 180000 {
> +				label = "Flattened Device Tree";
> +				reg = <0x180000 0x080000>;
> +			};
> +		};
> +	};
>  };
> diff --git a/arch/arm/mach-kirkwood/board-dt.c
> b/arch/arm/mach-kirkwood/board-dt.c index fbe6405..4960e63 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -39,42 +39,6 @@ static struct of_device_id kirkwood_dt_match_table[]
> __initdata = { { }
>  };
> 
> -struct mtd_partition dreamplug_partitions[] = {
> -	{
> -		.name	= "u-boot",
> -		.size	= SZ_512K,
> -		.offset = 0,
> -	},
> -	{
> -		.name	= "u-boot env",
> -		.size	= SZ_64K,
> -		.offset = SZ_512K + SZ_512K,
> -	},
> -	{
> -		.name	= "dtb",
> -		.size	= SZ_64K,
> -		.offset = SZ_512K + SZ_512K + SZ_512K,
> -	},
> -};
> -
> -static const struct flash_platform_data dreamplug_spi_slave_data = {
> -	.type		= "mx25l1606e",
> -	.name		= "spi_flash",
> -	.parts		= dreamplug_partitions,
> -	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
> -};
> -
> -static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
> -	{
> -		.modalias	= "m25p80",
> -		.platform_data	= &dreamplug_spi_slave_data,
> -		.irq		= -1,
> -		.max_speed_hz	= 50000000,
> -		.bus_num	= 0,
> -		.chip_select	= 0,
> -	},
> -};
> -
>  static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
>  	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
>  };
> @@ -140,10 +104,6 @@ static void __init dreamplug_init(void)
>  	 */
>  	kirkwood_mpp_conf(dreamplug_mpp_config);
> 
> -	spi_register_board_info(dreamplug_spi_slave_info,
> -				ARRAY_SIZE(dreamplug_spi_slave_info));
> -	kirkwood_spi_init();
> -
>  	kirkwood_ehci_init();
>  	kirkwood_ge00_init(&dreamplug_ge00_data);
>  	kirkwood_ge01_init(&dreamplug_ge01_data);
> diff --git a/arch/arm/mach-kirkwood/common.c
> b/arch/arm/mach-kirkwood/common.c index cc15426..357fcde 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -15,6 +15,7 @@
>  #include <linux/ata_platform.h>
>  #include <linux/mtd/nand.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/of.h>
>  #include <net/dsa.h>
>  #include <asm/page.h>
>  #include <asm/timex.h>
> @@ -481,6 +482,9 @@ static int __init kirkwood_clock_gate(void)
>  {
>  	unsigned int curr = readl(CLOCK_GATING_CTRL);
>  	u32 dev, rev;
> +#ifdef CONFIG_OF
> +	struct device_node *dp;
> +#endif
> 
>  	kirkwood_pcie_id(&dev, &rev);
>  	printk(KERN_DEBUG "Gating clock of unused units\n");
> @@ -524,6 +528,13 @@ static int __init kirkwood_clock_gate(void)
>  	} else  /* keep this bit set for devices that don't have PCIe1 */
>  		kirkwood_clk_ctrl |= CGC_PEX1;
> 
> +#ifdef CONFIG_OF
> +	dp = of_find_node_by_path("/");
> +	if (dp && of_device_is_available(of_find_compatible_node(dp, NULL,
> +							  "marvell,orion-
spi")))
> +		kirkwood_clk_ctrl |= CGC_RUNIT;
> +#endif
> +
>  	/* Now gate clock the required units */
>  	writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
>  	printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index 13448c8..acfb240 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -18,6 +18,7 @@
>  #include <linux/spi/spi.h>
>  #include <linux/spi/orion_spi.h>
>  #include <linux/module.h>
> +#include <linux/of_device.h>
>  #include <asm/unaligned.h>
> 
>  #define DRIVER_NAME			"orion_spi"
> @@ -45,6 +46,8 @@ struct orion_spi {
>  	void __iomem		*base;
>  	unsigned int		max_speed;
>  	unsigned int		min_speed;
> +	unsigned int		tclk;
> +	unsigned int		clock_fix;
>  	struct orion_spi_info	*spi_info;
>  };
> 
> @@ -104,7 +107,7 @@ static int orion_spi_baudrate_set(struct spi_device
> *spi, unsigned int speed)
> 
>  	orion_spi = spi_master_get_devdata(spi->master);
> 
> -	tclk_hz = orion_spi->spi_info->tclk;
> +	tclk_hz = orion_spi->tclk;
> 
>  	/*
>  	 * the supported rates are: 4,6,8...30
> @@ -360,7 +363,7 @@ static int orion_spi_setup(struct spi_device *spi)
>  	orion_spi = spi_master_get_devdata(spi->master);
> 
>  	/* Fix ac timing if required.   */
> -	if (orion_spi->spi_info->enable_clock_fix)
> +	if (orion_spi->clock_fix)
>  		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
>  				  (1 << 14));
> 
> @@ -474,6 +477,7 @@ static int __init orion_spi_probe(struct
> platform_device *pdev) master->setup = orion_spi_setup;
>  	master->transfer = orion_spi_transfer;
>  	master->num_chipselect = ORION_NUM_CHIPSELECTS;
> +	master->dev.of_node = pdev->dev.of_node;
> 
>  	dev_set_drvdata(&pdev->dev, master);
> 
> @@ -481,8 +485,26 @@ static int __init orion_spi_probe(struct
> platform_device *pdev) spi->master = master;
>  	spi->spi_info = spi_info;
> 
> -	spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
> -	spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
> +	if (spi_info)
> +		spi->tclk = spi_info->tclk;
> +
> +	of_property_read_u32(master->dev.of_node,
> +				"clock-frequency", &spi->tclk);
> +
> +	if (!spi->tclk) {
> +		dev_err(&pdev->dev, "cannot set clock rate\n");
shouldn't you check the return value of of_property_read_u32 instead? and 
report a more meaningful error message, eg no valid clock-frequency property 
in the OF case?

> +		status = -EINVAL;
> +		goto out;
> +	}
> +
> +	spi->max_speed = DIV_ROUND_UP(spi->tclk, 4);
> +	spi->min_speed = DIV_ROUND_UP(spi->tclk, 30);
> +
> +	if (spi_info)
> +		spi->clock_fix = spi_info->enable_clock_fix;
> +
> +	if (of_find_property(master->dev.of_node, "spi-clock-fix", NULL))
> +		spi->clock_fix = 1;
> 
>  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (r == NULL) {
> @@ -541,10 +563,17 @@ static int __exit orion_spi_remove(struct
> platform_device *pdev)
> 
>  MODULE_ALIAS("platform:" DRIVER_NAME);
> 

#ifdef CONFIG_OF
> +static struct of_device_id spi_orion_of_match_table[] __devinitdata = {
> +	{ .compatible = "marvell,orion-spi", },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, spi_orion_of_match_table);
#endif

>  static struct platform_driver orion_spi_driver = {
>  	.driver = {
>  		.name	= DRIVER_NAME,
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(spi_orion_of_match_table),
>  	},
>  	.remove		= __exit_p(orion_spi_remove),
>  };


-- 
Michael

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

* Re: [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
  2012-03-04 18:12           ` Michael Walle
@ 2012-03-04 20:29               ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-04 20:29 UTC (permalink / raw)
  To: Michael Walle
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sunday 04 March 2012, Michael Walle wrote:
> > @@ -481,8 +485,26 @@ static int __init orion_spi_probe(struct
> > platform_device *pdev) spi->master = master;
> >       spi->spi_info = spi_info;
> > 
> > -     spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
> > -     spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
> > +     if (spi_info)
> > +             spi->tclk = spi_info->tclk;
> > +
> > +     of_property_read_u32(master->dev.of_node,
> > +                             "clock-frequency", &spi->tclk);
> > +
> > +     if (!spi->tclk) {
> > +             dev_err(&pdev->dev, "cannot set clock rate\n");
> shouldn't you check the return value of of_property_read_u32 instead? and 
> report a more meaningful error message, eg no valid clock-frequency property 
> in the OF case?

I suggested this version, because it keeps the code very simple. Checking
the return value would of course be correct, but I don't think we
need any extra information here: there are only a few ways how this can
go wrong and it will be pretty obvious from the device tree when you
see the message.

	Arnd

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

* [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
@ 2012-03-04 20:29               ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-04 20:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday 04 March 2012, Michael Walle wrote:
> > @@ -481,8 +485,26 @@ static int __init orion_spi_probe(struct
> > platform_device *pdev) spi->master = master;
> >       spi->spi_info = spi_info;
> > 
> > -     spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
> > -     spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
> > +     if (spi_info)
> > +             spi->tclk = spi_info->tclk;
> > +
> > +     of_property_read_u32(master->dev.of_node,
> > +                             "clock-frequency", &spi->tclk);
> > +
> > +     if (!spi->tclk) {
> > +             dev_err(&pdev->dev, "cannot set clock rate\n");
> shouldn't you check the return value of of_property_read_u32 instead? and 
> report a more meaningful error message, eg no valid clock-frequency property 
> in the OF case?

I suggested this version, because it keeps the code very simple. Checking
the return value would of course be correct, but I don't think we
need any extra information here: there are only a few ways how this can
go wrong and it will be pretty obvious from the device tree when you
see the message.

	Arnd

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-04 16:48       ` Arnd Bergmann
@ 2012-03-04 22:27           ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-04 22:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Michael Walle, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Mar 04, 2012 at 04:48:17PM +0000, Arnd Bergmann wrote:
> On Sunday 04 March 2012, Michael Walle wrote:
> > in my older patch series i flagged all converted devices with two 
> > compatibility names. Eg:
> > 
> >        { .compatible = "marvell,orion5x-rtc", },
> >        { .compatible = "marvell,kirkwood-rtc", },
> > 
> > IMHO marvell,rtc is i little too general, i guess marvell won't have only one 
> > rtc ;)
> > 
> > Other opinions?
> 
> Being specific is certainly good, and it may also be a good idea to
> list the first one it's compatible with in the device tree source.
> 
> So the device tree for a 88F6281 soc could list
> 
> 	compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc", "marvell,orion-rtc";

I'll go ahead and make this style of change throughout.  I assume
"marvell,88f6281-rtc" would only be for SoC internal devices?  eg, the spi
driver wouldn't follow that convention.  I'll see if I can dig up a part
number on it.

> This would give the device driver the option which one to bind to. Anything that
> has an rtc compatible with the one in orion should list that one, so that the driver
> only has to list that one if they are truely identical, but if the driver has to
> get modified later to know the difference between orion and kirkwood rtcs, it can
> check the more specific value.
> 
> 	Arnd

thx,

Jason.

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-04 22:27           ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-04 22:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Mar 04, 2012 at 04:48:17PM +0000, Arnd Bergmann wrote:
> On Sunday 04 March 2012, Michael Walle wrote:
> > in my older patch series i flagged all converted devices with two 
> > compatibility names. Eg:
> > 
> >        { .compatible = "marvell,orion5x-rtc", },
> >        { .compatible = "marvell,kirkwood-rtc", },
> > 
> > IMHO marvell,rtc is i little too general, i guess marvell won't have only one 
> > rtc ;)
> > 
> > Other opinions?
> 
> Being specific is certainly good, and it may also be a good idea to
> list the first one it's compatible with in the device tree source.
> 
> So the device tree for a 88F6281 soc could list
> 
> 	compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc", "marvell,orion-rtc";

I'll go ahead and make this style of change throughout.  I assume
"marvell,88f6281-rtc" would only be for SoC internal devices?  eg, the spi
driver wouldn't follow that convention.  I'll see if I can dig up a part
number on it.

> This would give the device driver the option which one to bind to. Anything that
> has an rtc compatible with the one in orion should list that one, so that the driver
> only has to list that one if they are truely identical, but if the driver has to
> get modified later to know the difference between orion and kirkwood rtcs, it can
> check the more specific value.
> 
> 	Arnd

thx,

Jason.

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

* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-04 22:27           ` Jason
@ 2012-03-04 23:22             ` Michael Walle
  -1 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 23:22 UTC (permalink / raw)
  To: Jason; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel, Arnd Bergmann

Am Sonntag 04 März 2012, 23:27:10 schrieb Jason:
> On Sun, Mar 04, 2012 at 04:48:17PM +0000, Arnd Bergmann wrote:
> > On Sunday 04 March 2012, Michael Walle wrote:
> > > in my older patch series i flagged all converted devices with two
> > > 
> > > compatibility names. Eg:
> > >        { .compatible = "marvell,orion5x-rtc", },
> > >        { .compatible = "marvell,kirkwood-rtc", },
> > > 
> > > IMHO marvell,rtc is i little too general, i guess marvell won't have
> > > only one rtc ;)
> > > 
> > > Other opinions?
> > 
> > Being specific is certainly good, and it may also be a good idea to
> > list the first one it's compatible with in the device tree source.
> > 
> > So the device tree for a 88F6281 soc could list
> > 
> > 	compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc",
> > 	"marvell,orion-rtc";
> 
> I'll go ahead and make this style of change throughout.  I assume
> "marvell,88f6281-rtc" would only be for SoC internal devices?  eg, the spi
> driver wouldn't follow that convention.  I'll see if I can dig up a part
> number on it.

following the filename spi-orion.c i guess it should use 'marvell,orion-spi'.

-- 
Michael

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

* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-04 23:22             ` Michael Walle
  0 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-04 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

Am Sonntag 04 M?rz 2012, 23:27:10 schrieb Jason:
> On Sun, Mar 04, 2012 at 04:48:17PM +0000, Arnd Bergmann wrote:
> > On Sunday 04 March 2012, Michael Walle wrote:
> > > in my older patch series i flagged all converted devices with two
> > > 
> > > compatibility names. Eg:
> > >        { .compatible = "marvell,orion5x-rtc", },
> > >        { .compatible = "marvell,kirkwood-rtc", },
> > > 
> > > IMHO marvell,rtc is i little too general, i guess marvell won't have
> > > only one rtc ;)
> > > 
> > > Other opinions?
> > 
> > Being specific is certainly good, and it may also be a good idea to
> > list the first one it's compatible with in the device tree source.
> > 
> > So the device tree for a 88F6281 soc could list
> > 
> > 	compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc",
> > 	"marvell,orion-rtc";
> 
> I'll go ahead and make this style of change throughout.  I assume
> "marvell,88f6281-rtc" would only be for SoC internal devices?  eg, the spi
> driver wouldn't follow that convention.  I'll see if I can dig up a part
> number on it.

following the filename spi-orion.c i guess it should use 'marvell,orion-spi'.

-- 
Michael

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

* Re: [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
  2012-03-04 16:50           ` Arnd Bergmann
@ 2012-03-05  0:17               ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05  0:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Michael Walle, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Mar 04, 2012 at 04:50:52PM +0000, Arnd Bergmann wrote:
> On Sunday 04 March 2012, Michael Walle wrote:
> > > @@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct
> > > platform_device *pdev) return 0;
> > >  }
> > > 
> > > +static struct of_device_id rtc_mv_of_match_table[] = {
> > > +     { .compatible = "marvell,rtc", },
> > > +     {}
> > > +};
> > > +
> > Isn't here an ifdef CONFIG_OF missing to prevent compiler warnings?
> > 
> 
> Yes, I guess so. I keep thinking that an __unused attribute would
> actually be more helpful here because it lets the compiler automatically
> discard the symbol when it's not used, but we still get potential
> compiler errors and warnings if something inside of the unused data
> is broken.

Hmmm, in the process of responding, I looked up Grant's original email
[1] to show justification.  However, rereading it shows I was
overzealous in my desire to remove #ifdef's.  :-P  Grant only said
adding of_match_ptr() would remove the #else portion of my original
code:

#ifdef CONFIG_OF
...
#else
#define rtc_mv_of_match_table = NULL;
#endif

I'll restore the #ifdef/#endif across the kirkwood code I've changed so
far, without the #else.  __unused shouldn't be necessary, then.

Thanks for the review, Michael.

thx,

Jason.

[1] http://www.spinics.net/lists/arm-kernel/msg162595.html

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

* [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
@ 2012-03-05  0:17               ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05  0:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Mar 04, 2012 at 04:50:52PM +0000, Arnd Bergmann wrote:
> On Sunday 04 March 2012, Michael Walle wrote:
> > > @@ -294,11 +295,17 @@ static int __exit mv_rtc_remove(struct
> > > platform_device *pdev) return 0;
> > >  }
> > > 
> > > +static struct of_device_id rtc_mv_of_match_table[] = {
> > > +     { .compatible = "marvell,rtc", },
> > > +     {}
> > > +};
> > > +
> > Isn't here an ifdef CONFIG_OF missing to prevent compiler warnings?
> > 
> 
> Yes, I guess so. I keep thinking that an __unused attribute would
> actually be more helpful here because it lets the compiler automatically
> discard the symbol when it's not used, but we still get potential
> compiler errors and warnings if something inside of the unused data
> is broken.

Hmmm, in the process of responding, I looked up Grant's original email
[1] to show justification.  However, rereading it shows I was
overzealous in my desire to remove #ifdef's.  :-P  Grant only said
adding of_match_ptr() would remove the #else portion of my original
code:

#ifdef CONFIG_OF
...
#else
#define rtc_mv_of_match_table = NULL;
#endif

I'll restore the #ifdef/#endif across the kirkwood code I've changed so
far, without the #else.  __unused shouldn't be necessary, then.

Thanks for the review, Michael.

thx,

Jason.

[1] http://www.spinics.net/lists/arm-kernel/msg162595.html

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-02 21:18                       ` Arnd Bergmann
@ 2012-03-05 18:49                           ` Nicolas Pitre
  -1 siblings, 0 replies; 272+ messages in thread
From: Nicolas Pitre @ 2012-03-05 18:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, 2 Mar 2012, Arnd Bergmann wrote:

> On Friday 02 March 2012, Arnd Bergmann wrote:
> > On Friday 02 March 2012, Jason wrote:
> > > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> > > 
> > >   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> > > 
> > > are available in the git repository at:
> > >   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> > > 
> > 
> > Applied to next/dt branch.
> 
> On second thought, I should probably wait for the maintainer to comment
> as well ;-)
> 
> Nico, does this look ok to you?

The clock frequency part being hardcoded to 200000 in the common .dtsi 
file looks wrong.  The clock may differ, and it used to (and should) be 
probed at run time, please see kirkwood_find_tclk().


Nicolas

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 18:49                           ` Nicolas Pitre
  0 siblings, 0 replies; 272+ messages in thread
From: Nicolas Pitre @ 2012-03-05 18:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2 Mar 2012, Arnd Bergmann wrote:

> On Friday 02 March 2012, Arnd Bergmann wrote:
> > On Friday 02 March 2012, Jason wrote:
> > > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> > > 
> > >   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> > > 
> > > are available in the git repository at:
> > >   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> > > 
> > 
> > Applied to next/dt branch.
> 
> On second thought, I should probably wait for the maintainer to comment
> as well ;-)
> 
> Nico, does this look ok to you?

The clock frequency part being hardcoded to 200000 in the common .dtsi 
file looks wrong.  The clock may differ, and it used to (and should) be 
probed at run time, please see kirkwood_find_tclk().


Nicolas

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-05 18:49                           ` Nicolas Pitre
@ 2012-03-05 19:15                               ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05 19:15 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, Mar 05, 2012 at 01:49:35PM -0500, Nicolas Pitre wrote:
> On Fri, 2 Mar 2012, Arnd Bergmann wrote:
> 
> > On Friday 02 March 2012, Arnd Bergmann wrote:
> > > On Friday 02 March 2012, Jason wrote:
> > > > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> > > > 
> > > >   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> > > > 
> > > > are available in the git repository at:
> > > >   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> > > > 
> > > 
> > > Applied to next/dt branch.
> > 
> > On second thought, I should probably wait for the maintainer to comment
> > as well ;-)
> > 
> > Nico, does this look ok to you?
> 
> The clock frequency part being hardcoded to 200000 in the common .dtsi 
> file looks wrong.  The clock may differ, and it used to (and should) be 
> probed at run time, please see kirkwood_find_tclk().

So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
call it?

One alternate idea I had was to have kirkwood-dreamplug.dts root hold

tclk: clock-frequency = <200000000>;

and then have the drivers ask for it.  afaict, tclk is constant per
board.

I'm fine with either way, but I'd rather have it in the dt.

thx,

Jason.

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 19:15                               ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05 19:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 05, 2012 at 01:49:35PM -0500, Nicolas Pitre wrote:
> On Fri, 2 Mar 2012, Arnd Bergmann wrote:
> 
> > On Friday 02 March 2012, Arnd Bergmann wrote:
> > > On Friday 02 March 2012, Jason wrote:
> > > > The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
> > > > 
> > > >   ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
> > > > 
> > > > are available in the git repository at:
> > > >   git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
> > > > 
> > > 
> > > Applied to next/dt branch.
> > 
> > On second thought, I should probably wait for the maintainer to comment
> > as well ;-)
> > 
> > Nico, does this look ok to you?
> 
> The clock frequency part being hardcoded to 200000 in the common .dtsi 
> file looks wrong.  The clock may differ, and it used to (and should) be 
> probed at run time, please see kirkwood_find_tclk().

So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
call it?

One alternate idea I had was to have kirkwood-dreamplug.dts root hold

tclk: clock-frequency = <200000000>;

and then have the drivers ask for it.  afaict, tclk is constant per
board.

I'm fine with either way, but I'd rather have it in the dt.

thx,

Jason.

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-05 19:15                               ` Jason
@ 2012-03-05 20:16                                   ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-05 20:16 UTC (permalink / raw)
  To: Jason
  Cc: Nicolas Pitre, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Monday 05 March 2012, Jason wrote:
> > 
> > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > file looks wrong.  The clock may differ, and it used to (and should) be 
> > probed at run time, please see kirkwood_find_tclk().
> 
> So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> call it?

If the drivers want to use it, I think it has to be orion_find_tclk for
drivers that are shared between multiple plat-orion platforms.

> One alternate idea I had was to have kirkwood-dreamplug.dts root hold
> 
> tclk: clock-frequency = <200000000>;
> 
> and then have the drivers ask for it.  afaict, tclk is constant per
> board.
> 
> I'm fine with either way, but I'd rather have it in the dt.

IMHO it's best to leave any such hacks out of the device tree for
now, until we have the proper clk bindings in place for kirkwood,
and then we can just use those.

	Arnd

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 20:16                                   ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-05 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 05 March 2012, Jason wrote:
> > 
> > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > file looks wrong.  The clock may differ, and it used to (and should) be 
> > probed at run time, please see kirkwood_find_tclk().
> 
> So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> call it?

If the drivers want to use it, I think it has to be orion_find_tclk for
drivers that are shared between multiple plat-orion platforms.

> One alternate idea I had was to have kirkwood-dreamplug.dts root hold
> 
> tclk: clock-frequency = <200000000>;
> 
> and then have the drivers ask for it.  afaict, tclk is constant per
> board.
> 
> I'm fine with either way, but I'd rather have it in the dt.

IMHO it's best to leave any such hacks out of the device tree for
now, until we have the proper clk bindings in place for kirkwood,
and then we can just use those.

	Arnd

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-05 20:16                                   ` Arnd Bergmann
@ 2012-03-05 20:29                                       ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05 20:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Nicolas Pitre, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> On Monday 05 March 2012, Jason wrote:
> > > 
> > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > probed at run time, please see kirkwood_find_tclk().
> > 
> > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > call it?
> 
> If the drivers want to use it, I think it has to be orion_find_tclk for
> drivers that are shared between multiple plat-orion platforms.

That's pretty much all of them  :-)

I'll rename it and move it to plat-orion/common.c.  This'll be fun.

> > One alternate idea I had was to have kirkwood-dreamplug.dts root hold
> > 
> > tclk: clock-frequency = <200000000>;
> > 
> > and then have the drivers ask for it.  afaict, tclk is constant per
> > board.
> > 
> > I'm fine with either way, but I'd rather have it in the dt.
> 
> IMHO it's best to leave any such hacks out of the device tree for
> now, until we have the proper clk bindings in place for kirkwood,
> and then we can just use those.

Ok.

thx,

Jason.

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 20:29                                       ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05 20:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> On Monday 05 March 2012, Jason wrote:
> > > 
> > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > probed at run time, please see kirkwood_find_tclk().
> > 
> > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > call it?
> 
> If the drivers want to use it, I think it has to be orion_find_tclk for
> drivers that are shared between multiple plat-orion platforms.

That's pretty much all of them  :-)

I'll rename it and move it to plat-orion/common.c.  This'll be fun.

> > One alternate idea I had was to have kirkwood-dreamplug.dts root hold
> > 
> > tclk: clock-frequency = <200000000>;
> > 
> > and then have the drivers ask for it.  afaict, tclk is constant per
> > board.
> > 
> > I'm fine with either way, but I'd rather have it in the dt.
> 
> IMHO it's best to leave any such hacks out of the device tree for
> now, until we have the proper clk bindings in place for kirkwood,
> and then we can just use those.

Ok.

thx,

Jason.

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-05 20:29                                       ` Jason
@ 2012-03-05 20:43                                           ` Nicolas Pitre
  -1 siblings, 0 replies; 272+ messages in thread
From: Nicolas Pitre @ 2012-03-05 20:43 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, 5 Mar 2012, Jason wrote:

> On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > On Monday 05 March 2012, Jason wrote:
> > > > 
> > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > probed at run time, please see kirkwood_find_tclk().
> > > 
> > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > call it?
> > 
> > If the drivers want to use it, I think it has to be orion_find_tclk for
> > drivers that are shared between multiple plat-orion platforms.
> 
> That's pretty much all of them  :-)
> 
> I'll rename it and move it to plat-orion/common.c.  This'll be fun.

No no...  This is not a function which is generic at all.  The _result_ 
i.e. core clock frequency value is a generic thing, not the method to 
determine it.


Nicolas

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 20:43                                           ` Nicolas Pitre
  0 siblings, 0 replies; 272+ messages in thread
From: Nicolas Pitre @ 2012-03-05 20:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 5 Mar 2012, Jason wrote:

> On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > On Monday 05 March 2012, Jason wrote:
> > > > 
> > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > probed at run time, please see kirkwood_find_tclk().
> > > 
> > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > call it?
> > 
> > If the drivers want to use it, I think it has to be orion_find_tclk for
> > drivers that are shared between multiple plat-orion platforms.
> 
> That's pretty much all of them  :-)
> 
> I'll rename it and move it to plat-orion/common.c.  This'll be fun.

No no...  This is not a function which is generic at all.  The _result_ 
i.e. core clock frequency value is a generic thing, not the method to 
determine it.


Nicolas

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-05 20:43                                           ` Nicolas Pitre
@ 2012-03-05 21:17                                               ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05 21:17 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote:
> On Mon, 5 Mar 2012, Jason wrote:
> 
> > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > > On Monday 05 March 2012, Jason wrote:
> > > > > 
> > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > > probed at run time, please see kirkwood_find_tclk().
> > > > 
> > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > > call it?
> > > 
> > > If the drivers want to use it, I think it has to be orion_find_tclk for
> > > drivers that are shared between multiple plat-orion platforms.
> > 
> > That's pretty much all of them  :-)
> > 
> > I'll rename it and move it to plat-orion/common.c.  This'll be fun.
> 
> No no...  This is not a function which is generic at all.  The _result_ 
> i.e. core clock frequency value is a generic thing, not the method to 
> determine it.

How about this?  Export a global variable, orion_tclk, and a function to
read it.  Then, make sure each sub arch sets the global.  Does this
sound viable until common clk lands?

thx,

Jason.

btw - when I received your email I was in the middle of convincing
myself that I could hack together a common orion_find_tclk().  It was
rapidly becoming a bad idea.  :-)

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 21:17                                               ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-05 21:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote:
> On Mon, 5 Mar 2012, Jason wrote:
> 
> > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > > On Monday 05 March 2012, Jason wrote:
> > > > > 
> > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > > probed at run time, please see kirkwood_find_tclk().
> > > > 
> > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > > call it?
> > > 
> > > If the drivers want to use it, I think it has to be orion_find_tclk for
> > > drivers that are shared between multiple plat-orion platforms.
> > 
> > That's pretty much all of them  :-)
> > 
> > I'll rename it and move it to plat-orion/common.c.  This'll be fun.
> 
> No no...  This is not a function which is generic at all.  The _result_ 
> i.e. core clock frequency value is a generic thing, not the method to 
> determine it.

How about this?  Export a global variable, orion_tclk, and a function to
read it.  Then, make sure each sub arch sets the global.  Does this
sound viable until common clk lands?

thx,

Jason.

btw - when I received your email I was in the middle of convincing
myself that I could hack together a common orion_find_tclk().  It was
rapidly becoming a bad idea.  :-)

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-05 21:17                                               ` Jason
@ 2012-03-05 21:27                                                   ` Nicolas Pitre
  -1 siblings, 0 replies; 272+ messages in thread
From: Nicolas Pitre @ 2012-03-05 21:27 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, 5 Mar 2012, Jason wrote:

> On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote:
> > On Mon, 5 Mar 2012, Jason wrote:
> > 
> > > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > > > On Monday 05 March 2012, Jason wrote:
> > > > > > 
> > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > > > probed at run time, please see kirkwood_find_tclk().
> > > > > 
> > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > > > call it?
> > > > 
> > > > If the drivers want to use it, I think it has to be orion_find_tclk for
> > > > drivers that are shared between multiple plat-orion platforms.
> > > 
> > > That's pretty much all of them  :-)
> > > 
> > > I'll rename it and move it to plat-orion/common.c.  This'll be fun.
> > 
> > No no...  This is not a function which is generic at all.  The _result_ 
> > i.e. core clock frequency value is a generic thing, not the method to 
> > determine it.
> 
> How about this?  Export a global variable, orion_tclk, and a function to
> read it.  Then, make sure each sub arch sets the global.  Does this
> sound viable until common clk lands?

Yep, looks fine.


Nicolas

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-05 21:27                                                   ` Nicolas Pitre
  0 siblings, 0 replies; 272+ messages in thread
From: Nicolas Pitre @ 2012-03-05 21:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 5 Mar 2012, Jason wrote:

> On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote:
> > On Mon, 5 Mar 2012, Jason wrote:
> > 
> > > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > > > On Monday 05 March 2012, Jason wrote:
> > > > > > 
> > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > > > probed at run time, please see kirkwood_find_tclk().
> > > > > 
> > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > > > call it?
> > > > 
> > > > If the drivers want to use it, I think it has to be orion_find_tclk for
> > > > drivers that are shared between multiple plat-orion platforms.
> > > 
> > > That's pretty much all of them  :-)
> > > 
> > > I'll rename it and move it to plat-orion/common.c.  This'll be fun.
> > 
> > No no...  This is not a function which is generic at all.  The _result_ 
> > i.e. core clock frequency value is a generic thing, not the method to 
> > determine it.
> 
> How about this?  Export a global variable, orion_tclk, and a function to
> read it.  Then, make sure each sub arch sets the global.  Does this
> sound viable until common clk lands?

Yep, looks fine.


Nicolas

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

* Re: [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
  2012-03-05 21:27                                                   ` Nicolas Pitre
@ 2012-03-06 14:29                                                       ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-06 14:29 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: andrew-g2DYL2Zd6BY, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, Mar 05, 2012 at 04:27:27PM -0500, Nicolas Pitre wrote:
> On Mon, 5 Mar 2012, Jason wrote:
> 
> > On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote:
> > > On Mon, 5 Mar 2012, Jason wrote:
> > > 
> > > > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > > > > On Monday 05 March 2012, Jason wrote:
> > > > > > > 
> > > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > > > > probed at run time, please see kirkwood_find_tclk().
> > > > > > 
> > > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > > > > call it?
> > > > > 
> > > > > If the drivers want to use it, I think it has to be orion_find_tclk for
> > > > > drivers that are shared between multiple plat-orion platforms.
> > > > 
> > > > That's pretty much all of them  :-)
> > > > 
> > > > I'll rename it and move it to plat-orion/common.c.  This'll be fun.
> > > 
> > > No no...  This is not a function which is generic at all.  The _result_ 
> > > i.e. core clock frequency value is a generic thing, not the method to 
> > > determine it.
> > 
> > How about this?  Export a global variable, orion_tclk, and a function to
> > read it.  Then, make sure each sub arch sets the global.  Does this
> > sound viable until common clk lands?
> 
> Yep, looks fine.

I just got a first look at Andrew's patches for using the generic clk
across plat/orion.  There's a lot of good stuff in there.  I'll start
building my series on top of his (and obviously Mike's clk series).

thx,

Jason.

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

* [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
@ 2012-03-06 14:29                                                       ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-06 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 05, 2012 at 04:27:27PM -0500, Nicolas Pitre wrote:
> On Mon, 5 Mar 2012, Jason wrote:
> 
> > On Mon, Mar 05, 2012 at 03:43:42PM -0500, Nicolas Pitre wrote:
> > > On Mon, 5 Mar 2012, Jason wrote:
> > > 
> > > > On Mon, Mar 05, 2012 at 08:16:26PM +0000, Arnd Bergmann wrote:
> > > > > On Monday 05 March 2012, Jason wrote:
> > > > > > > 
> > > > > > > The clock frequency part being hardcoded to 200000 in the common .dtsi 
> > > > > > > file looks wrong.  The clock may differ, and it used to (and should) be 
> > > > > > > probed at run time, please see kirkwood_find_tclk().
> > > > > > 
> > > > > > So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver
> > > > > > call it?
> > > > > 
> > > > > If the drivers want to use it, I think it has to be orion_find_tclk for
> > > > > drivers that are shared between multiple plat-orion platforms.
> > > > 
> > > > That's pretty much all of them  :-)
> > > > 
> > > > I'll rename it and move it to plat-orion/common.c.  This'll be fun.
> > > 
> > > No no...  This is not a function which is generic at all.  The _result_ 
> > > i.e. core clock frequency value is a generic thing, not the method to 
> > > determine it.
> > 
> > How about this?  Export a global variable, orion_tclk, and a function to
> > read it.  Then, make sure each sub arch sets the global.  Does this
> > sound viable until common clk lands?
> 
> Yep, looks fine.

I just got a first look at Andrew's patches for using the generic clk
across plat/orion.  There's a lot of good stuff in there.  I'll start
building my series on top of his (and obviously Mike's clk series).

thx,

Jason.

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

* [PATCH 0/14 v3] ARM: kirkwood: fdt: convert kirkwood to fdt
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-07  3:44   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd
  Cc: nicolas.pitre, andrew, Jason Cooper, devicetree-discuss,
	grant.likely, michael, linux-arm-kernel

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first two patches are code cleanup from Andrew Lunn.

The rest of the series are devicetree bindings for drivers that don't use tclk.
These should be safe to merge as they won't interfere with the clk/clkdev work
Andrew Lunn is working on.

Several of these are patches created by Michael Walle several months ago and he
has agreed to let me usher them in.  I've changed them in minor ways to conform
with advice I've been given over the past several weeks.

Overall changes since v2:

	- added Andrew Lunn's cleanup patches
	- reshuffled to more logical order
	- wrapped all struct of_device_id[]'s in #ifdef CONFIG_OF
	- s/marvell,/mrvl,/g
	- added orion-ehci
	- added mv_sata
	- prevent clocks from gating when booting from devicetree

Drivers yet to be converted are:

	orion-spi: uses tclk
	orion-wdt: uses tclk
	mvsdio:    uses tclk
	i2c:       uses freq_m/freq_n, not sure if that should use clk/clkdev
	mv_xor:    haven't figured out howto do shared resources/dma in fdt
	ge0/ge1:   haven't looked at it yet
	nand:      not needed for dreamplug, haven't looked yet

Please be aware that this is a complete reshuffle of the whole series and is
based purely against v3.3-rc3.

Interested folks can pull from:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt


Andrew Lunn (2):
  ARM: orion: spi: remove enable_clock_fix which is not used
  ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.

Jason Cooper (9):
  ARM: kirkwood: add dreamplug (fdt) support.
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: add interrupt controller to devicetree.
  ARM: kirkwood: convert uart0 to devicetree.
  ARM: kirkwood: rtc-mv devicetree bindings
  ARM: kirkwood: use devicetree for rtc-mv
  ARM: kirkwood: mv_cesa devicetree support.
  ARM: kirkwood: use devicetree for orion-ehci
  ARM: kirkwood: use devicetree to init sata_mv

Michael Walle (3):
  ARM: kirkwood: mv_cesa devicetree bindings
  ARM: kirkwood: ehci-orion: add device tree binding
  ARM: kirkwood: sata_mv: add device tree binding

 .../devicetree/bindings/crypto/mv_cesa.txt         |   18 ++
 .../devicetree/bindings/usb/ehci-orion.txt         |    5 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |   39 ++++
 arch/arm/boot/dts/kirkwood.dtsi                    |   26 +++
 arch/arm/mach-kirkwood/Kconfig                     |   14 ++
 arch/arm/mach-kirkwood/Makefile                    |    1 +
 arch/arm/mach-kirkwood/Makefile.boot               |    2 +
 arch/arm/mach-kirkwood/board-dt.c                  |  206 ++++++++++++++++++++
 arch/arm/mach-kirkwood/common.c                    |   41 ++++-
 arch/arm/mach-kirkwood/common.h                    |    6 +
 arch/arm/plat-orion/include/plat/audio.h           |    1 -
 drivers/ata/sata_mv.c                              |   18 ++-
 drivers/crypto/mv_cesa.c                           |   13 ++
 drivers/rtc/rtc-mv.c                               |    9 +
 drivers/spi/spi-orion.c                            |    5 -
 drivers/usb/host/ehci-orion.c                      |   50 +++++-
 include/linux/spi/orion_spi.h                      |    1 -
 17 files changed, 437 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/crypto/mv_cesa.txt
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-orion.txt
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 0/14 v3] ARM: kirkwood: fdt: convert kirkwood to fdt
@ 2012-03-07  3:44   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first two patches are code cleanup from Andrew Lunn.

The rest of the series are devicetree bindings for drivers that don't use tclk.
These should be safe to merge as they won't interfere with the clk/clkdev work
Andrew Lunn is working on.

Several of these are patches created by Michael Walle several months ago and he
has agreed to let me usher them in.  I've changed them in minor ways to conform
with advice I've been given over the past several weeks.

Overall changes since v2:

	- added Andrew Lunn's cleanup patches
	- reshuffled to more logical order
	- wrapped all struct of_device_id[]'s in #ifdef CONFIG_OF
	- s/marvell,/mrvl,/g
	- added orion-ehci
	- added mv_sata
	- prevent clocks from gating when booting from devicetree

Drivers yet to be converted are:

	orion-spi: uses tclk
	orion-wdt: uses tclk
	mvsdio:    uses tclk
	i2c:       uses freq_m/freq_n, not sure if that should use clk/clkdev
	mv_xor:    haven't figured out howto do shared resources/dma in fdt
	ge0/ge1:   haven't looked at it yet
	nand:      not needed for dreamplug, haven't looked yet

Please be aware that this is a complete reshuffle of the whole series and is
based purely against v3.3-rc3.

Interested folks can pull from:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt


Andrew Lunn (2):
  ARM: orion: spi: remove enable_clock_fix which is not used
  ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.

Jason Cooper (9):
  ARM: kirkwood: add dreamplug (fdt) support.
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: add interrupt controller to devicetree.
  ARM: kirkwood: convert uart0 to devicetree.
  ARM: kirkwood: rtc-mv devicetree bindings
  ARM: kirkwood: use devicetree for rtc-mv
  ARM: kirkwood: mv_cesa devicetree support.
  ARM: kirkwood: use devicetree for orion-ehci
  ARM: kirkwood: use devicetree to init sata_mv

Michael Walle (3):
  ARM: kirkwood: mv_cesa devicetree bindings
  ARM: kirkwood: ehci-orion: add device tree binding
  ARM: kirkwood: sata_mv: add device tree binding

 .../devicetree/bindings/crypto/mv_cesa.txt         |   18 ++
 .../devicetree/bindings/usb/ehci-orion.txt         |    5 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |   39 ++++
 arch/arm/boot/dts/kirkwood.dtsi                    |   26 +++
 arch/arm/mach-kirkwood/Kconfig                     |   14 ++
 arch/arm/mach-kirkwood/Makefile                    |    1 +
 arch/arm/mach-kirkwood/Makefile.boot               |    2 +
 arch/arm/mach-kirkwood/board-dt.c                  |  206 ++++++++++++++++++++
 arch/arm/mach-kirkwood/common.c                    |   41 ++++-
 arch/arm/mach-kirkwood/common.h                    |    6 +
 arch/arm/plat-orion/include/plat/audio.h           |    1 -
 drivers/ata/sata_mv.c                              |   18 ++-
 drivers/crypto/mv_cesa.c                           |   13 ++
 drivers/rtc/rtc-mv.c                               |    9 +
 drivers/spi/spi-orion.c                            |    5 -
 drivers/usb/host/ehci-orion.c                      |   50 +++++-
 include/linux/spi/orion_spi.h                      |    1 -
 17 files changed, 437 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/crypto/mv_cesa.txt
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-orion.txt
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 01/14] ARM: orion: spi: remove enable_clock_fix which is not used
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>

Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 drivers/spi/spi-orion.c       |    5 -----
 include/linux/spi/orion_spi.h |    1 -
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..e496f79 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
-		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
-				  (1 << 14));
-
 	if ((spi->max_speed_hz == 0)
 			|| (spi->max_speed_hz > orion_spi->max_speed))
 		spi->max_speed_hz = orion_spi->max_speed;
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
index decf6d8..b4d9fa6 100644
--- a/include/linux/spi/orion_spi.h
+++ b/include/linux/spi/orion_spi.h
@@ -11,7 +11,6 @@
 
 struct orion_spi_info {
 	u32	tclk;		/* no <linux/clk.h> support yet */
-	u32	enable_clock_fix;
 };
 
 
-- 
1.7.3.4

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

* [PATCH 01/14] ARM: orion: spi: remove enable_clock_fix which is not used
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 drivers/spi/spi-orion.c       |    5 -----
 include/linux/spi/orion_spi.h |    1 -
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..e496f79 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
-		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
-				  (1 << 14));
-
 	if ((spi->max_speed_hz == 0)
 			|| (spi->max_speed_hz > orion_spi->max_speed))
 		spi->max_speed_hz = orion_spi->max_speed;
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
index decf6d8..b4d9fa6 100644
--- a/include/linux/spi/orion_spi.h
+++ b/include/linux/spi/orion_spi.h
@@ -11,7 +11,6 @@
 
 struct orion_spi_info {
 	u32	tclk;		/* no <linux/clk.h> support yet */
-	u32	enable_clock_fix;
 };
 
 
-- 
1.7.3.4

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

* [PATCH 02/14] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>

It is not used anywhere in the sound driver.

Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 arch/arm/mach-kirkwood/common.c          |    1 -
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index cc15426..eacf7f5 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -449,7 +449,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h
index 885f8ab..d6a55bd 100644
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ b/arch/arm/plat-orion/include/plat/audio.h
@@ -2,7 +2,6 @@
 #define __PLAT_AUDIO_H
 
 struct kirkwood_asoc_platform_data {
-	u32 tclk;
 	int burst;
 };
 #endif
-- 
1.7.3.4

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

* [PATCH 02/14] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

It is not used anywhere in the sound driver.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c          |    1 -
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index cc15426..eacf7f5 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -449,7 +449,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h
index 885f8ab..d6a55bd 100644
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ b/arch/arm/plat-orion/include/plat/audio.h
@@ -2,7 +2,6 @@
 #define __PLAT_AUDIO_H
 
 struct kirkwood_asoc_platform_data {
-	u32 tclk;
 	int burst;
 };
 #endif
-- 
1.7.3.4

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

* [PATCH 03/14] ARM: kirkwood: add dreamplug (fdt) support.
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd
  Cc: nicolas.pitre, andrew, Jason Cooper, devicetree-discuss,
	grant.likely, michael, linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..578806d
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..702b955
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "mrvl,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell Kirkwood using flattened device tree.
+
+config MACH_DREAMPLUG_DT
+	bool "Marvell DreamPlug (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug (Flattened Device Tree).
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..76392af
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 03/14] ARM: kirkwood: add dreamplug (fdt) support.
@ 2012-03-07  3:44   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..578806d
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..702b955
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "mrvl,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell Kirkwood using flattened device tree.
+
+config MACH_DREAMPLUG_DT
+	bool "Marvell DreamPlug (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug (Flattened Device Tree).
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..76392af
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 04/14] ARM: kirkwood: fdt: absorb kirkwood_init()
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 arch/arm/mach-kirkwood/board-dt.c |   29 ++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 76392af..f514b42 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -157,7 +159,32 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index eacf7f5..ae90f60 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -278,7 +278,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -290,7 +290,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -302,7 +302,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -391,7 +391,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -434,7 +434,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 04/14] ARM: kirkwood: fdt: absorb kirkwood_init()
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-dt.c |   29 ++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 76392af..f514b42 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -157,7 +159,32 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index eacf7f5..ae90f60 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -278,7 +278,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -290,7 +290,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -302,7 +302,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -391,7 +391,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -434,7 +434,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 05/14] ARM: kirkwood: add interrupt controller to devicetree.
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Based on work by Michael Walle (commit a952154).

Used just the intc portion of the patch, fixed the register address, and
used of_find_compatible_node() instead.

Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    9 ++++++++-
 arch/arm/mach-kirkwood/board-dt.c |    7 +++++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 702b955..7896a1d 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,12 @@
 
 / {
 	compatible = "mrvl,kirkwood";
-};
+	interrupt-parent = <&intc>;
 
+	intc: interrupt-controller@fed20200 {
+		compatible = "mrvl,orion-intc";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		reg = <0xfed20200 0x20>;
+	};
+};
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index f514b42..f9f446b 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/irqdomain.h>
 #include <linux/mtd/partitions.h>
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
@@ -159,6 +160,8 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
+	struct device_node *node;
+
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
 
 	/*
@@ -175,6 +178,10 @@ static void __init kirkwood_dt_init(void)
 	kirkwood_l2_init();
 #endif
 
+	node = of_find_compatible_node(NULL, NULL, "mrvl,orion-intc");
+	if (node)
+		irq_domain_add_simple(node, 0);
+
 	/* internal devices that every board has */
 	kirkwood_rtc_init();
 	kirkwood_wdt_init();
-- 
1.7.3.4

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

* [PATCH 05/14] ARM: kirkwood: add interrupt controller to devicetree.
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Based on work by Michael Walle (commit a952154).

Used just the intc portion of the patch, fixed the register address, and
used of_find_compatible_node() instead.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    9 ++++++++-
 arch/arm/mach-kirkwood/board-dt.c |    7 +++++++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 702b955..7896a1d 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,12 @@
 
 / {
 	compatible = "mrvl,kirkwood";
-};
+	interrupt-parent = <&intc>;
 
+	intc: interrupt-controller at fed20200 {
+		compatible = "mrvl,orion-intc";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		reg = <0xfed20200 0x20>;
+	};
+};
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index f514b42..f9f446b 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/irqdomain.h>
 #include <linux/mtd/partitions.h>
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
@@ -159,6 +160,8 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
+	struct device_node *node;
+
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
 
 	/*
@@ -175,6 +178,10 @@ static void __init kirkwood_dt_init(void)
 	kirkwood_l2_init();
 #endif
 
+	node = of_find_compatible_node(NULL, NULL, "mrvl,orion-intc");
+	if (node)
+		irq_domain_add_simple(node, 0);
+
 	/* internal devices that every board has */
 	kirkwood_rtc_init();
 	kirkwood_wdt_init();
-- 
1.7.3.4

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dt.c.

Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
Reviewed-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Acked-by: Nicolas Pitre <nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 578806d..ebb2c87 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,4 +15,11 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
+	serial@f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index f9f446b..b55d25b 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -143,8 +143,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dt.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 578806d..ebb2c87 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,4 +15,11 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
+	serial at f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index f9f446b..b55d25b 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -143,8 +143,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* [PATCH 07/14] ARM: kirkwood: rtc-mv devicetree bindings
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.

 drivers/rtc/rtc-mv.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..0dd8421 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "mrvl,orion-rtc", },
+	{}
+};
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 07/14] ARM: kirkwood: rtc-mv devicetree bindings
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.

 drivers/rtc/rtc-mv.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..0dd8421 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "mrvl,orion-rtc", },
+	{}
+};
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.

 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 7896a1d..5960a8e 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -10,4 +10,10 @@
 		#interrupt-cells = <1>;
 		reg = <0xfed20200 0x20>;
 	};
+
+	rtc@f1010300 {
+		compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
+		reg = <0xf1010300 0x1f>;
+		interrupts = <53>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index b55d25b..deea565 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -181,7 +181,6 @@ static void __init kirkwood_dt_init(void)
 		irq_domain_add_simple(node, 0);
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index ae90f60..ef45244 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..ca08826 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-- 
1.7.3.4

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

* [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.

 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 7896a1d..5960a8e 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -10,4 +10,10 @@
 		#interrupt-cells = <1>;
 		reg = <0xfed20200 0x20>;
 	};
+
+	rtc at f1010300 {
+		compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
+		reg = <0xf1010300 0x1f>;
+		interrupts = <53>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index b55d25b..deea565 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -181,7 +181,6 @@ static void __init kirkwood_dt_init(void)
 		irq_domain_add_simple(node, 0);
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index ae90f60..ef45244 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..ca08826 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -53,7 +53,6 @@ void kirkwood_restart(char, const char *);
 
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-- 
1.7.3.4

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

* [PATCH 09/14] ARM: kirkwood: mv_cesa devicetree bindings
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>

Written by Michael Walle, modified by Jason Cooper to use Marvell ticker
symbol in compatible property.  Also, changed patch subject to conform
to standard convention.

Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.

 .../devicetree/bindings/crypto/mv_cesa.txt         |   18 ++++++++++++++++++
 drivers/crypto/mv_cesa.c                           |   13 +++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/crypto/mv_cesa.txt

diff --git a/Documentation/devicetree/bindings/crypto/mv_cesa.txt b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
new file mode 100644
index 0000000..aa7135b
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
@@ -0,0 +1,18 @@
+Marvell Cryptographic Engines And Security Accelerator
+
+Required properties:
+- compatible : should be "mrvl,orion-crypto"
+- reg : base physical address of the engine and length of memory mapped
+        region, followed by base physical address of sram and its memory
+		length
+- interrupts : interrupt number
+
+Examples:
+
+crypto@f1030000 {
+	compatible = "mrvl,orion-crypto";
+	reg = <0xf1030000 0x10000
+	       0xf5000000 0x800>;    /* sram */
+	interrupts = <22>;
+};
+
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
index 597235a..457f69f 100644
--- a/drivers/crypto/mv_cesa.c
+++ b/drivers/crypto/mv_cesa.c
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <crypto/internal/hash.h>
 #include <crypto/sha.h>
+#include <linux/of_platform.h>
 
 #include "mv_cesa.h"
 
@@ -1000,6 +1001,8 @@ static int mv_probe(struct platform_device *pdev)
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
 	if (!res)
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
 		return -ENXIO;
 
 	cp = kzalloc(sizeof(*cp), GFP_KERNEL);
@@ -1015,6 +1018,8 @@ static int mv_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram");
+	if (!res)
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	if (!res) {
 		ret = -ENXIO;
 		goto err_unmap_reg;
@@ -1118,12 +1123,20 @@ static int mv_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id mv_cesa_dt_ids[] = {
+	{ .compatible = "mrvl,orion-crypto", },
+	{},
+};
+#endif
+
 static struct platform_driver marvell_crypto = {
 	.probe		= mv_probe,
 	.remove		= mv_remove,
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "mv_crypto",
+		.of_match_table = of_match_ptr(mv_cesa_dt_ids),
 	},
 };
 MODULE_ALIAS("platform:mv_crypto");
-- 
1.7.3.4

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

* [PATCH 09/14] ARM: kirkwood: mv_cesa devicetree bindings
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Michael Walle <michael@walle.cc>

Written by Michael Walle, modified by Jason Cooper to use Marvell ticker
symbol in compatible property.  Also, changed patch subject to conform
to standard convention.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.

 .../devicetree/bindings/crypto/mv_cesa.txt         |   18 ++++++++++++++++++
 drivers/crypto/mv_cesa.c                           |   13 +++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/crypto/mv_cesa.txt

diff --git a/Documentation/devicetree/bindings/crypto/mv_cesa.txt b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
new file mode 100644
index 0000000..aa7135b
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
@@ -0,0 +1,18 @@
+Marvell Cryptographic Engines And Security Accelerator
+
+Required properties:
+- compatible : should be "mrvl,orion-crypto"
+- reg : base physical address of the engine and length of memory mapped
+        region, followed by base physical address of sram and its memory
+		length
+- interrupts : interrupt number
+
+Examples:
+
+crypto at f1030000 {
+	compatible = "mrvl,orion-crypto";
+	reg = <0xf1030000 0x10000
+	       0xf5000000 0x800>;    /* sram */
+	interrupts = <22>;
+};
+
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
index 597235a..457f69f 100644
--- a/drivers/crypto/mv_cesa.c
+++ b/drivers/crypto/mv_cesa.c
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <crypto/internal/hash.h>
 #include <crypto/sha.h>
+#include <linux/of_platform.h>
 
 #include "mv_cesa.h"
 
@@ -1000,6 +1001,8 @@ static int mv_probe(struct platform_device *pdev)
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
 	if (!res)
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
 		return -ENXIO;
 
 	cp = kzalloc(sizeof(*cp), GFP_KERNEL);
@@ -1015,6 +1018,8 @@ static int mv_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram");
+	if (!res)
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	if (!res) {
 		ret = -ENXIO;
 		goto err_unmap_reg;
@@ -1118,12 +1123,20 @@ static int mv_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id mv_cesa_dt_ids[] = {
+	{ .compatible = "mrvl,orion-crypto", },
+	{},
+};
+#endif
+
 static struct platform_driver marvell_crypto = {
 	.probe		= mv_probe,
 	.remove		= mv_remove,
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "mv_crypto",
+		.of_match_table = of_match_ptr(mv_cesa_dt_ids),
 	},
 };
 MODULE_ALIAS("platform:mv_crypto");
-- 
1.7.3.4

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

* [PATCH 10/14] ARM: kirkwood: mv_cesa devicetree support.
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Based on work by Michael Walle (commit a952154).

Used the crypto portion of the patch, integrated with board-dt.c

Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.
* make sure clock doesn't get disabled when booting fdt

 arch/arm/boot/dts/kirkwood.dtsi   |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |   14 +++++++++++++-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 5960a8e..a1634ae 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -16,4 +16,11 @@
 		reg = <0xf1010300 0x1f>;
 		interrupts = <53>;
 	};
+
+	crypto@f1030000 {
+		compatible = "mrvl,kirkwood-crypto", "mrvl,orion-crypto";
+		reg = <0xf1030000 0x10000>,
+		      <0xf5000000 0x800>;
+		interrupts = <22>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index deea565..638f261 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -184,7 +184,6 @@ static void __init kirkwood_dt_init(void)
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
-	kirkwood_crypto_init();
 
 #ifdef CONFIG_KEXEC
 	kexec_reinit = kirkwood_enable_pcie;
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index ef45244..154f1cf 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
 #include <linux/ata_platform.h>
 #include <linux/mtd/nand.h>
 #include <linux/dma-mapping.h>
+#include <linux/of.h>
 #include <net/dsa.h>
 #include <asm/page.h>
 #include <asm/timex.h>
@@ -267,7 +268,7 @@ void __init kirkwood_uart1_init(void)
 /*****************************************************************************
  * Cryptographic Engines and Security Accelerator (CESA)
  ****************************************************************************/
-void __init kirkwood_crypto_init(void)
+static void __init kirkwood_crypto_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_CRYPTO;
 	orion_crypto_init(CRYPTO_PHYS_BASE, KIRKWOOD_SRAM_PHYS_BASE,
@@ -480,6 +481,9 @@ static int __init kirkwood_clock_gate(void)
 {
 	unsigned int curr = readl(CLOCK_GATING_CTRL);
 	u32 dev, rev;
+#ifdef CONFIG_OF
+	struct device_node *np;
+#endif
 
 	kirkwood_pcie_id(&dev, &rev);
 	printk(KERN_DEBUG "Gating clock of unused units\n");
@@ -488,6 +492,14 @@ static int __init kirkwood_clock_gate(void)
 	/* Make sure those units are accessible */
 	writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
 
+#ifdef CONFIG_OF
+	np = of_find_compatible_node(NULL, NULL, "mrvl,orion-crypto");
+	if (np && of_device_is_available(np)) {
+		kirkwood_clk_ctrl |= CGC_CRYPTO;
+		of_node_put(np);
+	}
+#endif
+
 	/* For SATA: first shutdown the phy */
 	if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
 		/* Disable PLL and IVREF */
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index ca08826..76644e7 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -56,7 +56,6 @@ void kirkwood_l2_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-void kirkwood_crypto_init(void);
 
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
-- 
1.7.3.4

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

* [PATCH 10/14] ARM: kirkwood: mv_cesa devicetree support.
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Based on work by Michael Walle (commit a952154).

Used the crypto portion of the patch, integrated with board-dt.c

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from previous version:

* s/marvell,/mrvl,/g for compatible properties
* split into binding patch and a use patch.
* make sure clock doesn't get disabled when booting fdt

 arch/arm/boot/dts/kirkwood.dtsi   |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |   14 +++++++++++++-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 5960a8e..a1634ae 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -16,4 +16,11 @@
 		reg = <0xf1010300 0x1f>;
 		interrupts = <53>;
 	};
+
+	crypto at f1030000 {
+		compatible = "mrvl,kirkwood-crypto", "mrvl,orion-crypto";
+		reg = <0xf1030000 0x10000>,
+		      <0xf5000000 0x800>;
+		interrupts = <22>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index deea565..638f261 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -184,7 +184,6 @@ static void __init kirkwood_dt_init(void)
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
-	kirkwood_crypto_init();
 
 #ifdef CONFIG_KEXEC
 	kexec_reinit = kirkwood_enable_pcie;
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index ef45244..154f1cf 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
 #include <linux/ata_platform.h>
 #include <linux/mtd/nand.h>
 #include <linux/dma-mapping.h>
+#include <linux/of.h>
 #include <net/dsa.h>
 #include <asm/page.h>
 #include <asm/timex.h>
@@ -267,7 +268,7 @@ void __init kirkwood_uart1_init(void)
 /*****************************************************************************
  * Cryptographic Engines and Security Accelerator (CESA)
  ****************************************************************************/
-void __init kirkwood_crypto_init(void)
+static void __init kirkwood_crypto_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_CRYPTO;
 	orion_crypto_init(CRYPTO_PHYS_BASE, KIRKWOOD_SRAM_PHYS_BASE,
@@ -480,6 +481,9 @@ static int __init kirkwood_clock_gate(void)
 {
 	unsigned int curr = readl(CLOCK_GATING_CTRL);
 	u32 dev, rev;
+#ifdef CONFIG_OF
+	struct device_node *np;
+#endif
 
 	kirkwood_pcie_id(&dev, &rev);
 	printk(KERN_DEBUG "Gating clock of unused units\n");
@@ -488,6 +492,14 @@ static int __init kirkwood_clock_gate(void)
 	/* Make sure those units are accessible */
 	writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
 
+#ifdef CONFIG_OF
+	np = of_find_compatible_node(NULL, NULL, "mrvl,orion-crypto");
+	if (np && of_device_is_available(np)) {
+		kirkwood_clk_ctrl |= CGC_CRYPTO;
+		of_node_put(np);
+	}
+#endif
+
 	/* For SATA: first shutdown the phy */
 	if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
 		/* Disable PLL and IVREF */
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index ca08826..76644e7 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -56,7 +56,6 @@ void kirkwood_l2_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-void kirkwood_crypto_init(void);
 
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
-- 
1.7.3.4

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

* [PATCH 11/14] ARM: kirkwood: ehci-orion: add device tree binding
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>

Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 .../devicetree/bindings/usb/ehci-orion.txt         |    5 ++
 drivers/usb/host/ehci-orion.c                      |   50 +++++++++++++++++++-
 2 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-orion.txt

diff --git a/Documentation/devicetree/bindings/usb/ehci-orion.txt b/Documentation/devicetree/bindings/usb/ehci-orion.txt
new file mode 100644
index 0000000..b46d825
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ehci-orion.txt
@@ -0,0 +1,5 @@
+Marvell Orion SoC USB controller
+
+Required properties :
+ - compatible : should be "mrvl,orion-ehci".
+ - phy_version : should be "orion".
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 6c6a5a3..f1dec1d 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -12,6 +12,8 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/mbus.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 #include <plat/ehci-orion.h>
 
 #define rdl(off)	__raw_readl(hcd->regs + (off))
@@ -191,6 +193,29 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
 	}
 }
 
+static const char *phy_versions[] = {
+	[EHCI_PHY_NA]		= "",
+	[EHCI_PHY_ORION]	= "orion",
+	[EHCI_PHY_DD]		= "dd", /* XXX dd? */
+	[EHCI_PHY_KW]		= "kirkwood",
+};
+
+static const int get_phy_version(struct device_node *np)
+{
+	const char *pm;
+	int err, i;
+
+	err = of_property_read_string(np, "phy-version", &pm);
+	if (err < 0)
+		return err;
+
+	for (i = 0; i < ARRAY_SIZE(phy_versions); i++)
+		if (!strcasecmp(pm, phy_versions[i]))
+			return i;
+
+	return -ENODEV;
+}
+
 static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 {
 	struct orion_ehci_data *pd = pdev->dev.platform_data;
@@ -200,6 +225,7 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 	struct ehci_hcd *ehci;
 	void __iomem *regs;
 	int irq, err;
+	enum orion_ehci_phy_ver phy_version;
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -267,7 +293,15 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 	/*
 	 * setup Orion USB controller.
 	 */
-	switch (pd->phy_version) {
+	if (pdev->dev.of_node) {
+		phy_version = get_phy_version(pdev->dev.of_node);
+		if (phy_version < 0)
+			goto err3;
+	} else {
+		phy_version = pd->phy_version;
+	}
+
+	switch (phy_version) {
 	case EHCI_PHY_NA:	/* dont change USB phy settings */
 		break;
 	case EHCI_PHY_ORION:
@@ -312,9 +346,21 @@ static int __exit ehci_orion_drv_remove(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:orion-ehci");
 
+#ifdef CONFIG_OF
+static const struct of_device_id ehci_orion_dt_ids[] __devinitdata = {
+	{ .compatible = "mrvl,orion-ehci", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, ehci_orion_dt_ids);
+#endif
+
 static struct platform_driver ehci_orion_driver = {
 	.probe		= ehci_orion_drv_probe,
 	.remove		= __exit_p(ehci_orion_drv_remove),
 	.shutdown	= usb_hcd_platform_shutdown,
-	.driver.name	= "orion-ehci",
+	.driver = {
+		.name	= "orion-ehci",
+		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(ehci_orion_dt_ids),
+	},
 };
-- 
1.7.3.4

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

* [PATCH 11/14] ARM: kirkwood: ehci-orion: add device tree binding
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Michael Walle <michael@walle.cc>

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 .../devicetree/bindings/usb/ehci-orion.txt         |    5 ++
 drivers/usb/host/ehci-orion.c                      |   50 +++++++++++++++++++-
 2 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ehci-orion.txt

diff --git a/Documentation/devicetree/bindings/usb/ehci-orion.txt b/Documentation/devicetree/bindings/usb/ehci-orion.txt
new file mode 100644
index 0000000..b46d825
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ehci-orion.txt
@@ -0,0 +1,5 @@
+Marvell Orion SoC USB controller
+
+Required properties :
+ - compatible : should be "mrvl,orion-ehci".
+ - phy_version : should be "orion".
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 6c6a5a3..f1dec1d 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -12,6 +12,8 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/mbus.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 #include <plat/ehci-orion.h>
 
 #define rdl(off)	__raw_readl(hcd->regs + (off))
@@ -191,6 +193,29 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
 	}
 }
 
+static const char *phy_versions[] = {
+	[EHCI_PHY_NA]		= "",
+	[EHCI_PHY_ORION]	= "orion",
+	[EHCI_PHY_DD]		= "dd", /* XXX dd? */
+	[EHCI_PHY_KW]		= "kirkwood",
+};
+
+static const int get_phy_version(struct device_node *np)
+{
+	const char *pm;
+	int err, i;
+
+	err = of_property_read_string(np, "phy-version", &pm);
+	if (err < 0)
+		return err;
+
+	for (i = 0; i < ARRAY_SIZE(phy_versions); i++)
+		if (!strcasecmp(pm, phy_versions[i]))
+			return i;
+
+	return -ENODEV;
+}
+
 static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 {
 	struct orion_ehci_data *pd = pdev->dev.platform_data;
@@ -200,6 +225,7 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 	struct ehci_hcd *ehci;
 	void __iomem *regs;
 	int irq, err;
+	enum orion_ehci_phy_ver phy_version;
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -267,7 +293,15 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
 	/*
 	 * setup Orion USB controller.
 	 */
-	switch (pd->phy_version) {
+	if (pdev->dev.of_node) {
+		phy_version = get_phy_version(pdev->dev.of_node);
+		if (phy_version < 0)
+			goto err3;
+	} else {
+		phy_version = pd->phy_version;
+	}
+
+	switch (phy_version) {
 	case EHCI_PHY_NA:	/* dont change USB phy settings */
 		break;
 	case EHCI_PHY_ORION:
@@ -312,9 +346,21 @@ static int __exit ehci_orion_drv_remove(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:orion-ehci");
 
+#ifdef CONFIG_OF
+static const struct of_device_id ehci_orion_dt_ids[] __devinitdata = {
+	{ .compatible = "mrvl,orion-ehci", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, ehci_orion_dt_ids);
+#endif
+
 static struct platform_driver ehci_orion_driver = {
 	.probe		= ehci_orion_drv_probe,
 	.remove		= __exit_p(ehci_orion_drv_remove),
 	.shutdown	= usb_hcd_platform_shutdown,
-	.driver.name	= "orion-ehci",
+	.driver = {
+		.name	= "orion-ehci",
+		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(ehci_orion_dt_ids),
+	},
 };
-- 
1.7.3.4

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

* [PATCH 12/14] ARM: kirkwood: use devicetree for orion-ehci
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Original devicetree node from Michael Walle, changed to use
'mrvl,orion-ehci' for compatible property.

Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    1 -
 arch/arm/mach-kirkwood/common.c          |    6 ++++++
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index ebb2c87..f332380 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -22,4 +22,11 @@
 		interrupts = <33>;
 		clock-frequency = <200000000>;
 	};
+
+	ehci@f1050000 {
+		compatible = "mrvl,orion-ehci";
+		reg = <0xf1050000 0x1000>;
+		interrupts = <19>;
+		phy-version = "orion";
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 638f261..1034ac7 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -147,7 +147,6 @@ static void __init dreamplug_init(void)
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
 
-	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
 	kirkwood_sata_init(&dreamplug_sata_data);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 154f1cf..d0e8575 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -498,6 +498,12 @@ static int __init kirkwood_clock_gate(void)
 		kirkwood_clk_ctrl |= CGC_CRYPTO;
 		of_node_put(np);
 	}
+
+	np = of_find_compatible_node(NULL, NULL, "mrvl,orion-ehci");
+	if (np && of_device_is_available(np)) {
+		kirkwood_clk_ctrl |= CGC_USB0;
+		of_node_put(np);
+	}
 #endif
 
 	/* For SATA: first shutdown the phy */
-- 
1.7.3.4

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

* [PATCH 12/14] ARM: kirkwood: use devicetree for orion-ehci
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Original devicetree node from Michael Walle, changed to use
'mrvl,orion-ehci' for compatible property.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    1 -
 arch/arm/mach-kirkwood/common.c          |    6 ++++++
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index ebb2c87..f332380 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -22,4 +22,11 @@
 		interrupts = <33>;
 		clock-frequency = <200000000>;
 	};
+
+	ehci at f1050000 {
+		compatible = "mrvl,orion-ehci";
+		reg = <0xf1050000 0x1000>;
+		interrupts = <19>;
+		phy-version = "orion";
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 638f261..1034ac7 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -147,7 +147,6 @@ static void __init dreamplug_init(void)
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
 
-	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
 	kirkwood_sata_init(&dreamplug_sata_data);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 154f1cf..d0e8575 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -498,6 +498,12 @@ static int __init kirkwood_clock_gate(void)
 		kirkwood_clk_ctrl |= CGC_CRYPTO;
 		of_node_put(np);
 	}
+
+	np = of_find_compatible_node(NULL, NULL, "mrvl,orion-ehci");
+	if (np && of_device_is_available(np)) {
+		kirkwood_clk_ctrl |= CGC_USB0;
+		of_node_put(np);
+	}
 #endif
 
 	/* For SATA: first shutdown the phy */
-- 
1.7.3.4

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

* [PATCH 13/14] ARM: kirkwood: sata_mv: add device tree binding
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>

Based on devicetree work by Michael Walle.  Changed compatible property
to "mrvl,orion-sata", simplified retrieving nr_ports from fdt.

Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 drivers/ata/sata_mv.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 38950ea..ebd0d24 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -65,6 +65,7 @@
 #include <linux/mbus.h>
 #include <linux/bitops.h>
 #include <linux/gfp.h>
+#include <linux/of.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
@@ -4045,8 +4046,12 @@ static int mv_platform_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	/* allocate host */
-	mv_platform_data = pdev->dev.platform_data;
-	n_ports = mv_platform_data->n_ports;
+	if (pdev->dev.of_node)
+		of_property_read_u32(pdev->dev.of_node, "nr-ports", &n_ports);
+	else {
+		mv_platform_data = pdev->dev.platform_data;
+		n_ports = mv_platform_data->n_ports;
+	}
 
 	host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
 	hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);
@@ -4172,6 +4177,14 @@ static int mv_platform_resume(struct platform_device *pdev)
 #define mv_platform_resume NULL
 #endif
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_sata_dt_ids[] __devinitdata = {
+	{ .compatible = "mrvl,orion-sata", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mvsdio_dt_ids);
+#endif
+
 static struct platform_driver mv_platform_driver = {
 	.probe			= mv_platform_probe,
 	.remove			= __devexit_p(mv_platform_remove),
@@ -4180,6 +4193,7 @@ static struct platform_driver mv_platform_driver = {
 	.driver			= {
 				   .name = DRV_NAME,
 				   .owner = THIS_MODULE,
+				   .of_match_table = of_match_ptr(mv_sata_dt_ids),
 				  },
 };
 
-- 
1.7.3.4

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

* [PATCH 13/14] ARM: kirkwood: sata_mv: add device tree binding
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Michael Walle <michael@walle.cc>

Based on devicetree work by Michael Walle.  Changed compatible property
to "mrvl,orion-sata", simplified retrieving nr_ports from fdt.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 drivers/ata/sata_mv.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 38950ea..ebd0d24 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -65,6 +65,7 @@
 #include <linux/mbus.h>
 #include <linux/bitops.h>
 #include <linux/gfp.h>
+#include <linux/of.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
@@ -4045,8 +4046,12 @@ static int mv_platform_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	/* allocate host */
-	mv_platform_data = pdev->dev.platform_data;
-	n_ports = mv_platform_data->n_ports;
+	if (pdev->dev.of_node)
+		of_property_read_u32(pdev->dev.of_node, "nr-ports", &n_ports);
+	else {
+		mv_platform_data = pdev->dev.platform_data;
+		n_ports = mv_platform_data->n_ports;
+	}
 
 	host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
 	hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);
@@ -4172,6 +4177,14 @@ static int mv_platform_resume(struct platform_device *pdev)
 #define mv_platform_resume NULL
 #endif
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_sata_dt_ids[] __devinitdata = {
+	{ .compatible = "mrvl,orion-sata", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mvsdio_dt_ids);
+#endif
+
 static struct platform_driver mv_platform_driver = {
 	.probe			= mv_platform_probe,
 	.remove			= __devexit_p(mv_platform_remove),
@@ -4180,6 +4193,7 @@ static struct platform_driver mv_platform_driver = {
 	.driver			= {
 				   .name = DRV_NAME,
 				   .owner = THIS_MODULE,
+				   .of_match_table = of_match_ptr(mv_sata_dt_ids),
 				  },
 };
 
-- 
1.7.3.4

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

* [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
  2012-03-07  3:44   ` Jason Cooper
@ 2012-03-07  3:44       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Based on devicetree work by Michael Walle.  Changed compatible property
to "mrvl,orion-sata".

Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    5 -----
 arch/arm/mach-kirkwood/common.c          |   10 ++++++++++
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index f332380..8a28d5b 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -23,6 +23,13 @@
 		clock-frequency = <200000000>;
 	};
 
+	sata@f1080000 {
+		compatible = "mrvl,orion-sata";
+		reg = <0xf1080000 0x5000>;
+		interrupts = <21>;
+		nr-ports = <1>;
+	};
+
 	ehci@f1050000 {
 		compatible = "mrvl,orion-ehci";
 		reg = <0xf1050000 0x1000>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 1034ac7..12dec38 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -86,10 +86,6 @@ static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
 };
 
-static struct mv_sata_platform_data dreamplug_sata_data = {
-	.n_ports	= 1,
-};
-
 static struct mvsdio_platform_data dreamplug_mvsdio_data = {
 	/* unfortunately the CD signal has not been connected */
 };
@@ -149,7 +145,6 @@ static void __init dreamplug_init(void)
 
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
-	kirkwood_sata_init(&dreamplug_sata_data);
 	kirkwood_sdio_init(&dreamplug_mvsdio_data);
 
 	platform_device_register(&dreamplug_leds);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index d0e8575..70ee7ac 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -504,6 +504,16 @@ static int __init kirkwood_clock_gate(void)
 		kirkwood_clk_ctrl |= CGC_USB0;
 		of_node_put(np);
 	}
+
+	np = of_find_compatible_node(NULL, NULL, "mrvl,orion-sata");
+	if (np && of_device_is_available(np)) {
+		int nr_ports;
+		kirkwood_clk_ctrl |= CGC_SATA0;
+		of_property_read_u32(np, "nr-ports", &nr_ports);
+		if (nr_ports > 1)
+			kirkwood_clk_ctrl |= CGC_SATA1;
+		of_node_put(np);
+	}
 #endif
 
 	/* For SATA: first shutdown the phy */
-- 
1.7.3.4

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

* [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
@ 2012-03-07  3:44       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-07  3:44 UTC (permalink / raw)
  To: linux-arm-kernel

Based on devicetree work by Michael Walle.  Changed compatible property
to "mrvl,orion-sata".

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    5 -----
 arch/arm/mach-kirkwood/common.c          |   10 ++++++++++
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index f332380..8a28d5b 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -23,6 +23,13 @@
 		clock-frequency = <200000000>;
 	};
 
+	sata at f1080000 {
+		compatible = "mrvl,orion-sata";
+		reg = <0xf1080000 0x5000>;
+		interrupts = <21>;
+		nr-ports = <1>;
+	};
+
 	ehci at f1050000 {
 		compatible = "mrvl,orion-ehci";
 		reg = <0xf1050000 0x1000>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 1034ac7..12dec38 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -86,10 +86,6 @@ static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
 };
 
-static struct mv_sata_platform_data dreamplug_sata_data = {
-	.n_ports	= 1,
-};
-
 static struct mvsdio_platform_data dreamplug_mvsdio_data = {
 	/* unfortunately the CD signal has not been connected */
 };
@@ -149,7 +145,6 @@ static void __init dreamplug_init(void)
 
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
-	kirkwood_sata_init(&dreamplug_sata_data);
 	kirkwood_sdio_init(&dreamplug_mvsdio_data);
 
 	platform_device_register(&dreamplug_leds);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index d0e8575..70ee7ac 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -504,6 +504,16 @@ static int __init kirkwood_clock_gate(void)
 		kirkwood_clk_ctrl |= CGC_USB0;
 		of_node_put(np);
 	}
+
+	np = of_find_compatible_node(NULL, NULL, "mrvl,orion-sata");
+	if (np && of_device_is_available(np)) {
+		int nr_ports;
+		kirkwood_clk_ctrl |= CGC_SATA0;
+		of_property_read_u32(np, "nr-ports", &nr_ports);
+		if (nr_ports > 1)
+			kirkwood_clk_ctrl |= CGC_SATA1;
+		of_node_put(np);
+	}
 #endif
 
 	/* For SATA: first shutdown the phy */
-- 
1.7.3.4

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07  3:44       ` Jason Cooper
@ 2012-03-07 18:31         ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 18:31 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre, andrew, devicetree-discuss, grant.likely, michael,
	linux-arm-kernel

On Wednesday 07 March 2012, Jason Cooper wrote:
> +       serial@f1012000 {
> +               compatible = "ns16550a";
> +               reg = <0xf1012000 0xff>;
> +               reg-shift = <2>;
> +               interrupts = <33>;
> +               clock-frequency = <200000000>;
> +       };

I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
This is different from the way we define resources in Linux.

	Arnd

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 18:31         ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 18:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 07 March 2012, Jason Cooper wrote:
> +       serial at f1012000 {
> +               compatible = "ns16550a";
> +               reg = <0xf1012000 0xff>;
> +               reg-shift = <2>;
> +               interrupts = <33>;
> +               clock-frequency = <200000000>;
> +       };

I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
This is different from the way we define resources in Linux.

	Arnd

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

* Re: [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv
  2012-03-07  3:44       ` Jason Cooper
@ 2012-03-07 18:32           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 18:32 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wednesday 07 March 2012, Jason Cooper wrote:
> +
> +       rtc@f1010300 {
> +               compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
> +               reg = <0xf1010300 0x1f>;
> +               interrupts = <53>;
> +       };
>  };

Same as with the uart, this length should be 0x20 instead of 0x1f.

	Arnd

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

* [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv
@ 2012-03-07 18:32           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 07 March 2012, Jason Cooper wrote:
> +
> +       rtc at f1010300 {
> +               compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
> +               reg = <0xf1010300 0x1f>;
> +               interrupts = <53>;
> +       };
>  };

Same as with the uart, this length should be 0x20 instead of 0x1f.

	Arnd

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 18:31         ` Arnd Bergmann
@ 2012-03-07 18:37             ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 18:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason Cooper wrote:
> > +       serial@f1012000 {
> > +               compatible = "ns16550a";
> > +               reg = <0xf1012000 0xff>;
> > +               reg-shift = <2>;
> > +               interrupts = <33>;
> > +               clock-frequency = <200000000>;
> > +       };
> 
> I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> This is different from the way we define resources in Linux.

I was maintaining form with plat-orion/common.c:66 (0xff)  I'll fix it
to inclusive.

thx,

Jason.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 18:37             ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 18:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason Cooper wrote:
> > +       serial at f1012000 {
> > +               compatible = "ns16550a";
> > +               reg = <0xf1012000 0xff>;
> > +               reg-shift = <2>;
> > +               interrupts = <33>;
> > +               clock-frequency = <200000000>;
> > +       };
> 
> I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> This is different from the way we define resources in Linux.

I was maintaining form with plat-orion/common.c:66 (0xff)  I'll fix it
to inclusive.

thx,

Jason.

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

* Re: [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
  2012-03-07  3:44       ` Jason Cooper
@ 2012-03-07 18:40           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 18:40 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wednesday 07 March 2012, Jason Cooper wrote:
> @@ -504,6 +504,16 @@ static int __init kirkwood_clock_gate(void)
>                 kirkwood_clk_ctrl |= CGC_USB0;
>                 of_node_put(np);
>         }
> +
> +       np = of_find_compatible_node(NULL, NULL, "mrvl,orion-sata");
> +       if (np && of_device_is_available(np)) {
> +               int nr_ports;
> +               kirkwood_clk_ctrl |= CGC_SATA0;
> +               of_property_read_u32(np, "nr-ports", &nr_ports);
> +               if (nr_ports > 1)
> +                       kirkwood_clk_ctrl |= CGC_SATA1;
> +               of_node_put(np);
> +       }
>  #endif
>  
>         /* For SATA: first shutdown the phy */

Is it guaranteed that it's always the first port that gets used if there
is only one? If not, this might turn on the wrong one.

	Arnd

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

* [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
@ 2012-03-07 18:40           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 18:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 07 March 2012, Jason Cooper wrote:
> @@ -504,6 +504,16 @@ static int __init kirkwood_clock_gate(void)
>                 kirkwood_clk_ctrl |= CGC_USB0;
>                 of_node_put(np);
>         }
> +
> +       np = of_find_compatible_node(NULL, NULL, "mrvl,orion-sata");
> +       if (np && of_device_is_available(np)) {
> +               int nr_ports;
> +               kirkwood_clk_ctrl |= CGC_SATA0;
> +               of_property_read_u32(np, "nr-ports", &nr_ports);
> +               if (nr_ports > 1)
> +                       kirkwood_clk_ctrl |= CGC_SATA1;
> +               of_node_put(np);
> +       }
>  #endif
>  
>         /* For SATA: first shutdown the phy */

Is it guaranteed that it's always the first port that gets used if there
is only one? If not, this might turn on the wrong one.

	Arnd

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

* Re: [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
  2012-03-07 18:40           ` Arnd Bergmann
@ 2012-03-07 18:52               ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 18:52 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 06:40:09PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason Cooper wrote:
> > @@ -504,6 +504,16 @@ static int __init kirkwood_clock_gate(void)
> >                 kirkwood_clk_ctrl |= CGC_USB0;
> >                 of_node_put(np);
> >         }
> > +
> > +       np = of_find_compatible_node(NULL, NULL, "mrvl,orion-sata");
> > +       if (np && of_device_is_available(np)) {
> > +               int nr_ports;
> > +               kirkwood_clk_ctrl |= CGC_SATA0;
> > +               of_property_read_u32(np, "nr-ports", &nr_ports);
> > +               if (nr_ports > 1)
> > +                       kirkwood_clk_ctrl |= CGC_SATA1;
> > +               of_node_put(np);
> > +       }
> >  #endif
> >  
> >         /* For SATA: first shutdown the phy */
> 
> Is it guaranteed that it's always the first port that gets used if there
> is only one? If not, this might turn on the wrong one.

This is the same logic as mach-kirkwood/common.c:176

void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
{
        kirkwood_clk_ctrl |= CGC_SATA0;
        if (sata_data->n_ports > 1)
                kirkwood_clk_ctrl |= CGC_SATA1;

        orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA);
}

So, I don't think I'm introducing a regression.

thx,

Jason.

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

* [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
@ 2012-03-07 18:52               ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 18:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 06:40:09PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason Cooper wrote:
> > @@ -504,6 +504,16 @@ static int __init kirkwood_clock_gate(void)
> >                 kirkwood_clk_ctrl |= CGC_USB0;
> >                 of_node_put(np);
> >         }
> > +
> > +       np = of_find_compatible_node(NULL, NULL, "mrvl,orion-sata");
> > +       if (np && of_device_is_available(np)) {
> > +               int nr_ports;
> > +               kirkwood_clk_ctrl |= CGC_SATA0;
> > +               of_property_read_u32(np, "nr-ports", &nr_ports);
> > +               if (nr_ports > 1)
> > +                       kirkwood_clk_ctrl |= CGC_SATA1;
> > +               of_node_put(np);
> > +       }
> >  #endif
> >  
> >         /* For SATA: first shutdown the phy */
> 
> Is it guaranteed that it's always the first port that gets used if there
> is only one? If not, this might turn on the wrong one.

This is the same logic as mach-kirkwood/common.c:176

void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
{
        kirkwood_clk_ctrl |= CGC_SATA0;
        if (sata_data->n_ports > 1)
                kirkwood_clk_ctrl |= CGC_SATA1;

        orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA);
}

So, I don't think I'm introducing a regression.

thx,

Jason.

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

* Re: [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
  2012-03-07 18:52               ` Jason
@ 2012-03-07 19:00                   ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 19:00 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wednesday 07 March 2012, Jason wrote:
> > Is it guaranteed that it's always the first port that gets used if there
> > is only one? If not, this might turn on the wrong one.
> 
> This is the same logic as mach-kirkwood/common.c:176
> 
> void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
> {
>         kirkwood_clk_ctrl |= CGC_SATA0;
>         if (sata_data->n_ports > 1)
>                 kirkwood_clk_ctrl |= CGC_SATA1;
> 
>         orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA);
> }
> 
> So, I don't think I'm introducing a regression.

Ok, good point. I was wondering whether the individual ports should
be modeled in the device tree, but I guess it's not necessary if nobody
needed this so far.

	Arnd

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

* [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
@ 2012-03-07 19:00                   ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 19:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 07 March 2012, Jason wrote:
> > Is it guaranteed that it's always the first port that gets used if there
> > is only one? If not, this might turn on the wrong one.
> 
> This is the same logic as mach-kirkwood/common.c:176
> 
> void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
> {
>         kirkwood_clk_ctrl |= CGC_SATA0;
>         if (sata_data->n_ports > 1)
>                 kirkwood_clk_ctrl |= CGC_SATA1;
> 
>         orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA);
> }
> 
> So, I don't think I'm introducing a regression.

Ok, good point. I was wondering whether the individual ports should
be modeled in the device tree, but I guess it's not necessary if nobody
needed this so far.

	Arnd

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 18:31         ` Arnd Bergmann
@ 2012-03-07 19:27             ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 19:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason Cooper wrote:
> > +       serial@f1012000 {
> > +               compatible = "ns16550a";
> > +               reg = <0xf1012000 0xff>;
> > +               reg-shift = <2>;
> > +               interrupts = <33>;
> > +               clock-frequency = <200000000>;
> > +       };
> 
> I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> This is different from the way we define resources in Linux.

Grrr.  Now I'm getting frustrated.  I'm trying to boot without
earlyprintk.  Evidently, something is wrong with the above, because the
device boots all the way up (blinky lights come on), but I get no
messages after the usual "Uncompressing Linux... done, booting the
kernel."

Here's my most recent attempt:

        serial@f1012000 {
                device_type = "serial";
                compatible = "ns16550a";
                reg = <0xf1012000 0x100>; /*phys addr*/
                virt-reg = <0xfed12000>;  /*virt addr*/
                reg-shift = <2>;
                reg-io-width = <1>;
                interrupts = <33>;
                current-speed = <115200>;
                interrupt-parent = <&intc>;
                clock-frequency = <200000000>;
        };

I've looked at what is done in the powerpc dt's, but, no luck.  When
earlyprintk is enabled, I see no error messages, just:

bootconsole [earlycon0] enabled
debug: skip boot console de-registration.
...
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled

Any pointers?

thx,

Jason.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 19:27             ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason Cooper wrote:
> > +       serial at f1012000 {
> > +               compatible = "ns16550a";
> > +               reg = <0xf1012000 0xff>;
> > +               reg-shift = <2>;
> > +               interrupts = <33>;
> > +               clock-frequency = <200000000>;
> > +       };
> 
> I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> This is different from the way we define resources in Linux.

Grrr.  Now I'm getting frustrated.  I'm trying to boot without
earlyprintk.  Evidently, something is wrong with the above, because the
device boots all the way up (blinky lights come on), but I get no
messages after the usual "Uncompressing Linux... done, booting the
kernel."

Here's my most recent attempt:

        serial at f1012000 {
                device_type = "serial";
                compatible = "ns16550a";
                reg = <0xf1012000 0x100>; /*phys addr*/
                virt-reg = <0xfed12000>;  /*virt addr*/
                reg-shift = <2>;
                reg-io-width = <1>;
                interrupts = <33>;
                current-speed = <115200>;
                interrupt-parent = <&intc>;
                clock-frequency = <200000000>;
        };

I've looked at what is done in the powerpc dt's, but, no luck.  When
earlyprintk is enabled, I see no error messages, just:

bootconsole [earlycon0] enabled
debug: skip boot console de-registration.
...
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled

Any pointers?

thx,

Jason.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 19:27             ` Jason
@ 2012-03-07 20:05                 ` Andrew Lunn
  -1 siblings, 0 replies; 272+ messages in thread
From: Andrew Lunn @ 2012-03-07 20:05 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > +       serial@f1012000 {
> > > +               compatible = "ns16550a";
> > > +               reg = <0xf1012000 0xff>;
> > > +               reg-shift = <2>;
> > > +               interrupts = <33>;
> > > +               clock-frequency = <200000000>;
> > > +       };
> > 
> > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > This is different from the way we define resources in Linux.
> 
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."

Hi Jason

What do you see in /proc/iomem?

You should expect:

f1012000-f10120ff : serial8250.0
  f1012000-f101201f : serial
f1012100-f10121ff : serial8250.1
  f1012100-f101211f : serial

or probably just the first, if your device only has one serial port.

How about /proc/interrupts?

 33:        195  orion_irq  serial


Anything like this in dmesg?

[   17.189397] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[   17.210023] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
[   17.624748] console [ttyS0] enabled
[   17.648555] serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A

Comparing your system to the above might help you track down which
property is wrong.

	 Andrew

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 20:05                 ` Andrew Lunn
  0 siblings, 0 replies; 272+ messages in thread
From: Andrew Lunn @ 2012-03-07 20:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > +       serial at f1012000 {
> > > +               compatible = "ns16550a";
> > > +               reg = <0xf1012000 0xff>;
> > > +               reg-shift = <2>;
> > > +               interrupts = <33>;
> > > +               clock-frequency = <200000000>;
> > > +       };
> > 
> > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > This is different from the way we define resources in Linux.
> 
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."

Hi Jason

What do you see in /proc/iomem?

You should expect:

f1012000-f10120ff : serial8250.0
  f1012000-f101201f : serial
f1012100-f10121ff : serial8250.1
  f1012100-f101211f : serial

or probably just the first, if your device only has one serial port.

How about /proc/interrupts?

 33:        195  orion_irq  serial


Anything like this in dmesg?

[   17.189397] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[   17.210023] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
[   17.624748] console [ttyS0] enabled
[   17.648555] serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A

Comparing your system to the above might help you track down which
property is wrong.

	 Andrew

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 20:05                 ` Andrew Lunn
@ 2012-03-07 20:55                     ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 20:55 UTC (permalink / raw)
  To: Arnd Bergmann, andrew-g2DYL2Zd6BY,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ, michael-QKn5cuLxLXY,
	nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

On Wed, Mar 07, 2012 at 09:05:15PM +0100, Andrew Lunn wrote:
> On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> > On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > > +       serial@f1012000 {
> > > > +               compatible = "ns16550a";
> > > > +               reg = <0xf1012000 0xff>;
> > > > +               reg-shift = <2>;
> > > > +               interrupts = <33>;
> > > > +               clock-frequency = <200000000>;
> > > > +       };
> > > 
> > > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > > This is different from the way we define resources in Linux.
> > 
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> 
> Hi Jason
> 
> What do you see in /proc/iomem?
> 
> You should expect:
> 
> f1012000-f10120ff : serial8250.0
>   f1012000-f101201f : serial
> f1012100-f10121ff : serial8250.1
>   f1012100-f101211f : serial
> 
> or probably just the first, if your device only has one serial port.
> 
> How about /proc/interrupts?
> 
>  33:        195  orion_irq  serial
> 
> 
> Anything like this in dmesg?
> 
> [   17.189397] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled

> [   17.210023] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
> [   17.624748] console [ttyS0] enabled

These two lines ^^^^ are what I'm missing.  Some probe by printk shows
it's getting all the way through tty/serial/8250/8250.c:3263
serial8250_init() okay... then nothing.

> [   17.648555] serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
> 
> Comparing your system to the above might help you track down which
> property is wrong.
> 
> 	 Andrew

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 20:55                     ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 20:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 09:05:15PM +0100, Andrew Lunn wrote:
> On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> > On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > > +       serial at f1012000 {
> > > > +               compatible = "ns16550a";
> > > > +               reg = <0xf1012000 0xff>;
> > > > +               reg-shift = <2>;
> > > > +               interrupts = <33>;
> > > > +               clock-frequency = <200000000>;
> > > > +       };
> > > 
> > > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > > This is different from the way we define resources in Linux.
> > 
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> 
> Hi Jason
> 
> What do you see in /proc/iomem?
> 
> You should expect:
> 
> f1012000-f10120ff : serial8250.0
>   f1012000-f101201f : serial
> f1012100-f10121ff : serial8250.1
>   f1012100-f101211f : serial
> 
> or probably just the first, if your device only has one serial port.
> 
> How about /proc/interrupts?
> 
>  33:        195  orion_irq  serial
> 
> 
> Anything like this in dmesg?
> 
> [   17.189397] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled

> [   17.210023] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
> [   17.624748] console [ttyS0] enabled

These two lines ^^^^ are what I'm missing.  Some probe by printk shows
it's getting all the way through tty/serial/8250/8250.c:3263
serial8250_init() okay... then nothing.

> [   17.648555] serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
> 
> Comparing your system to the above might help you track down which
> property is wrong.
> 
> 	 Andrew

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 19:27             ` Jason
@ 2012-03-07 21:13               ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 21:13 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre, andrew, devicetree-discuss, grant.likely, michael,
	linux-arm-kernel

On Wednesday 07 March 2012, Jason wrote:
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."
> 
> Here's my most recent attempt:
> 
>         serial@f1012000 {
>                 device_type = "serial";
>                 compatible = "ns16550a";
>                 reg = <0xf1012000 0x100>; /*phys addr*/
>                 virt-reg = <0xfed12000>;  /*virt addr*/
>                 reg-shift = <2>;
>                 reg-io-width = <1>;
>                 interrupts = <33>;
>                 current-speed = <115200>;
>                 interrupt-parent = <&intc>;
>                 clock-frequency = <200000000>;
>         };
> 
> I've looked at what is done in the powerpc dt's, but, no luck.  When
> earlyprintk is enabled, I see no error messages, just:
> 
> bootconsole [earlycon0] enabled
> debug: skip boot console de-registration.
> ...
> Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> 
> Any pointers?

My first guess was that clock-frequency is wrong, but it seems that
this one actually is correct, at least it's the same thing that
the platform code sets.

You should never need to pass the virtual address to a device,
most of all because it cannot be known to the device tree at all.
The of_serial driver (you did enable that one in Kconfig, right?)
sets UPF_IOREMAP for this reason, which means membase gets 
overwritten anyway.

You should also not need to set interrupt-parent in the device itself,
as long as it's set in the root node. This one should not hurt though.

Regarting the compatible value, you should check what 
/proc/tty/driver/serial contains when the system is up and running.
If you can log into the system through the network after booting it
up, you can also compare the contents of that file and the 'setserial'
output with what you got before the device tree conversion.

Finally, something could be wrong with the interrupt controller.
AFAICT, you register it through the device tree now, but it's also
getting initialized through kirkwood_init_irq, so the numbers
would all be wrong.

	Arnd

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 21:13               ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-07 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 07 March 2012, Jason wrote:
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."
> 
> Here's my most recent attempt:
> 
>         serial at f1012000 {
>                 device_type = "serial";
>                 compatible = "ns16550a";
>                 reg = <0xf1012000 0x100>; /*phys addr*/
>                 virt-reg = <0xfed12000>;  /*virt addr*/
>                 reg-shift = <2>;
>                 reg-io-width = <1>;
>                 interrupts = <33>;
>                 current-speed = <115200>;
>                 interrupt-parent = <&intc>;
>                 clock-frequency = <200000000>;
>         };
> 
> I've looked at what is done in the powerpc dt's, but, no luck.  When
> earlyprintk is enabled, I see no error messages, just:
> 
> bootconsole [earlycon0] enabled
> debug: skip boot console de-registration.
> ...
> Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> 
> Any pointers?

My first guess was that clock-frequency is wrong, but it seems that
this one actually is correct, at least it's the same thing that
the platform code sets.

You should never need to pass the virtual address to a device,
most of all because it cannot be known to the device tree at all.
The of_serial driver (you did enable that one in Kconfig, right?)
sets UPF_IOREMAP for this reason, which means membase gets 
overwritten anyway.

You should also not need to set interrupt-parent in the device itself,
as long as it's set in the root node. This one should not hurt though.

Regarting the compatible value, you should check what 
/proc/tty/driver/serial contains when the system is up and running.
If you can log into the system through the network after booting it
up, you can also compare the contents of that file and the 'setserial'
output with what you got before the device tree conversion.

Finally, something could be wrong with the interrupt controller.
AFAICT, you register it through the device tree now, but it's also
getting initialized through kirkwood_init_irq, so the numbers
would all be wrong.

	Arnd

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 21:13               ` Arnd Bergmann
@ 2012-03-07 21:29                   ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 21:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason wrote:
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> > 
> > Here's my most recent attempt:
> > 
> >         serial@f1012000 {
> >                 device_type = "serial";
> >                 compatible = "ns16550a";
> >                 reg = <0xf1012000 0x100>; /*phys addr*/
> >                 virt-reg = <0xfed12000>;  /*virt addr*/
> >                 reg-shift = <2>;
> >                 reg-io-width = <1>;
> >                 interrupts = <33>;
> >                 current-speed = <115200>;
> >                 interrupt-parent = <&intc>;
> >                 clock-frequency = <200000000>;
> >         };
> > 
> > I've looked at what is done in the powerpc dt's, but, no luck.  When
> > earlyprintk is enabled, I see no error messages, just:
> > 
> > bootconsole [earlycon0] enabled
> > debug: skip boot console de-registration.
> > ...
> > Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> > 
> > Any pointers?

> The of_serial driver (you did enable that one in Kconfig, right?)

Wow.  I can't believe I missed that.  I now get:

Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled

without earlyprintk.

Thanks, Arnd.

Jason.

PS - the only change from your code is the 0x100.  I'm going to do some
more testing...

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 21:29                   ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-07 21:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason wrote:
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> > 
> > Here's my most recent attempt:
> > 
> >         serial at f1012000 {
> >                 device_type = "serial";
> >                 compatible = "ns16550a";
> >                 reg = <0xf1012000 0x100>; /*phys addr*/
> >                 virt-reg = <0xfed12000>;  /*virt addr*/
> >                 reg-shift = <2>;
> >                 reg-io-width = <1>;
> >                 interrupts = <33>;
> >                 current-speed = <115200>;
> >                 interrupt-parent = <&intc>;
> >                 clock-frequency = <200000000>;
> >         };
> > 
> > I've looked at what is done in the powerpc dt's, but, no luck.  When
> > earlyprintk is enabled, I see no error messages, just:
> > 
> > bootconsole [earlycon0] enabled
> > debug: skip boot console de-registration.
> > ...
> > Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> > 
> > Any pointers?

> The of_serial driver (you did enable that one in Kconfig, right?)

Wow.  I can't believe I missed that.  I now get:

Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled

without earlyprintk.

Thanks, Arnd.

Jason.

PS - the only change from your code is the 0x100.  I'm going to do some
more testing...

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 19:27             ` Jason
@ 2012-03-07 21:47                 ` Michael Walle
  -1 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-07 21:47 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Am Mittwoch 07 März 2012, 20:27:23 schrieb Jason:
> On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > +       serial@f1012000 {
> > > +               compatible = "ns16550a";
> > > +               reg = <0xf1012000 0xff>;
> > > +               reg-shift = <2>;
> > > +               interrupts = <33>;
> > > +               clock-frequency = <200000000>;
> > > +       };
> > 
> > I just noticed that the length here should be inclusive, i.e. 0x100 not
> > 0xff. This is different from the way we define resources in Linux.
> 
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."
> 
> Here's my most recent attempt:
> 
>         serial@f1012000 {
>                 device_type = "serial";
>                 compatible = "ns16550a";
>                 reg = <0xf1012000 0x100>; /*phys addr*/
>                 virt-reg = <0xfed12000>;  /*virt addr*/
>                 reg-shift = <2>;
>                 reg-io-width = <1>;
>                 interrupts = <33>;
>                 current-speed = <115200>;
>                 interrupt-parent = <&intc>;
>                 clock-frequency = <200000000>;
>         };
> 
> I've looked at what is done in the powerpc dt's, but, no luck.  When
> earlyprintk is enabled, I see no error messages, just:
> 
> bootconsole [earlycon0] enabled
> debug: skip boot console de-registration.
> ...
> Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> 
> Any pointers?

dunno if that helps a lot but the following was working for me with my 
linkstation:

        serial0: serial@f1012000 {
                cell-index = <0>;
                device_type = "serial";
                compatible = "ns16550a";
                reg = <0xf1012000 0x20>;
                reg-shift = <2>;
                clock-frequency = <200000000>;
                interrupts = <33>;
        };

-- 
michael

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-07 21:47                 ` Michael Walle
  0 siblings, 0 replies; 272+ messages in thread
From: Michael Walle @ 2012-03-07 21:47 UTC (permalink / raw)
  To: linux-arm-kernel

Am Mittwoch 07 M?rz 2012, 20:27:23 schrieb Jason:
> On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > +       serial at f1012000 {
> > > +               compatible = "ns16550a";
> > > +               reg = <0xf1012000 0xff>;
> > > +               reg-shift = <2>;
> > > +               interrupts = <33>;
> > > +               clock-frequency = <200000000>;
> > > +       };
> > 
> > I just noticed that the length here should be inclusive, i.e. 0x100 not
> > 0xff. This is different from the way we define resources in Linux.
> 
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."
> 
> Here's my most recent attempt:
> 
>         serial at f1012000 {
>                 device_type = "serial";
>                 compatible = "ns16550a";
>                 reg = <0xf1012000 0x100>; /*phys addr*/
>                 virt-reg = <0xfed12000>;  /*virt addr*/
>                 reg-shift = <2>;
>                 reg-io-width = <1>;
>                 interrupts = <33>;
>                 current-speed = <115200>;
>                 interrupt-parent = <&intc>;
>                 clock-frequency = <200000000>;
>         };
> 
> I've looked at what is done in the powerpc dt's, but, no luck.  When
> earlyprintk is enabled, I see no error messages, just:
> 
> bootconsole [earlycon0] enabled
> debug: skip boot console de-registration.
> ...
> Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> 
> Any pointers?

dunno if that helps a lot but the following was working for me with my 
linkstation:

        serial0: serial at f1012000 {
                cell-index = <0>;
                device_type = "serial";
                compatible = "ns16550a";
                reg = <0xf1012000 0x20>;
                reg-shift = <2>;
                clock-frequency = <200000000>;
                interrupts = <33>;
        };

-- 
michael

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 21:13               ` Arnd Bergmann
@ 2012-03-08 16:25                   ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 16:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> Finally, something could be wrong with the interrupt controller.
> AFAICT, you register it through the device tree now, but it's also
> getting initialized through kirkwood_init_irq, so the numbers
> would all be wrong.

Yes, I'm working through this now.  mv_cesa silently fails to come up
if it can't find the interrupt controller via fdt.  So, it needs to get
done.

Right now, I'm looking at how mach-versatile does it (vic_init()) since
it's also an ARM926ej-s...

thx,

Jason.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 16:25                   ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 16:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> Finally, something could be wrong with the interrupt controller.
> AFAICT, you register it through the device tree now, but it's also
> getting initialized through kirkwood_init_irq, so the numbers
> would all be wrong.

Yes, I'm working through this now.  mv_cesa silently fails to come up
if it can't find the interrupt controller via fdt.  So, it needs to get
done.

Right now, I'm looking at how mach-versatile does it (vic_init()) since
it's also an ARM926ej-s...

thx,

Jason.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 16:25                   ` Jason
@ 2012-03-08 17:01                       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-08 17:01 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	Thomas Gleixner,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 08 March 2012, Jason wrote:
> 
> On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > Finally, something could be wrong with the interrupt controller.
> > AFAICT, you register it through the device tree now, but it's also
> > getting initialized through kirkwood_init_irq, so the numbers
> > would all be wrong.
> 
> Yes, I'm working through this now.  mv_cesa silently fails to come up
> if it can't find the interrupt controller via fdt.  So, it needs to get
> done.
> 
> Right now, I'm looking at how mach-versatile does it (vic_init()) since
> it's also an ARM926ej-s...
> 

Ok, sounds good. It's not important whether it's an ARM9 or not btw.
You should look at both anything that defines an "interrupt-controller"
property as an example including Documentation/devicetree/bindings/arm/vic.txt
and Documentation/devicetree/bindings/arm/gic.txt.

(taking Thomas Gleixner on Cc)

Since the orion irq chip is based on irqchip_generic, it would be
perfect to have a generic irqchip binding to go along with
kernel/irq/generic-chip.c. Not sure if anyone has thought about this
before, but it looks like we can completely avoid using
arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
do that.

	Arnd

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 17:01                       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-08 17:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 08 March 2012, Jason wrote:
> 
> On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > Finally, something could be wrong with the interrupt controller.
> > AFAICT, you register it through the device tree now, but it's also
> > getting initialized through kirkwood_init_irq, so the numbers
> > would all be wrong.
> 
> Yes, I'm working through this now.  mv_cesa silently fails to come up
> if it can't find the interrupt controller via fdt.  So, it needs to get
> done.
> 
> Right now, I'm looking at how mach-versatile does it (vic_init()) since
> it's also an ARM926ej-s...
> 

Ok, sounds good. It's not important whether it's an ARM9 or not btw.
You should look at both anything that defines an "interrupt-controller"
property as an example including Documentation/devicetree/bindings/arm/vic.txt
and Documentation/devicetree/bindings/arm/gic.txt.

(taking Thomas Gleixner on Cc)

Since the orion irq chip is based on irqchip_generic, it would be
perfect to have a generic irqchip binding to go along with
kernel/irq/generic-chip.c. Not sure if anyone has thought about this
before, but it looks like we can completely avoid using
arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
do that.

	Arnd

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 17:01                       ` Arnd Bergmann
@ 2012-03-08 17:41                           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-08 17:41 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	Thomas Gleixner,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 08 March 2012, Arnd Bergmann wrote:

> Since the orion irq chip is based on irqchip_generic, it would be
> perfect to have a generic irqchip binding to go along with
> kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> before, but it looks like we can completely avoid using
> arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> do that.
> 

One more thing about the interrupt controller changes: The arm-soc
tree includes Grants "irqchip" branch, and the tegra/soc-drivers
and at91/dt branches are building on top of that. Please have a look
at what they do so you can do the same.

	Arnd

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 17:41                           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-08 17:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 08 March 2012, Arnd Bergmann wrote:

> Since the orion irq chip is based on irqchip_generic, it would be
> perfect to have a generic irqchip binding to go along with
> kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> before, but it looks like we can completely avoid using
> arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> do that.
> 

One more thing about the interrupt controller changes: The arm-soc
tree includes Grants "irqchip" branch, and the tegra/soc-drivers
and at91/dt branches are building on top of that. Please have a look
at what they do so you can do the same.

	Arnd

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 17:01                       ` Arnd Bergmann
@ 2012-03-08 19:27                           ` Thomas Gleixner
  -1 siblings, 0 replies; 272+ messages in thread
From: Thomas Gleixner @ 2012-03-08 19:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY, Jason,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, 8 Mar 2012, Arnd Bergmann wrote:

> On Thursday 08 March 2012, Jason wrote:
> > 
> > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > Finally, something could be wrong with the interrupt controller.
> > > AFAICT, you register it through the device tree now, but it's also
> > > getting initialized through kirkwood_init_irq, so the numbers
> > > would all be wrong.
> > 
> > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > if it can't find the interrupt controller via fdt.  So, it needs to get
> > done.
> > 
> > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > it's also an ARM926ej-s...
> > 
> 
> Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> You should look at both anything that defines an "interrupt-controller"
> property as an example including Documentation/devicetree/bindings/arm/vic.txt
> and Documentation/devicetree/bindings/arm/gic.txt.
> 
> (taking Thomas Gleixner on Cc)
> 
> Since the orion irq chip is based on irqchip_generic, it would be
> perfect to have a generic irqchip binding to go along with
> kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> before, but it looks like we can completely avoid using
> arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> do that.

Right. That should be trivial to implement.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 19:27                           ` Thomas Gleixner
  0 siblings, 0 replies; 272+ messages in thread
From: Thomas Gleixner @ 2012-03-08 19:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 8 Mar 2012, Arnd Bergmann wrote:

> On Thursday 08 March 2012, Jason wrote:
> > 
> > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > Finally, something could be wrong with the interrupt controller.
> > > AFAICT, you register it through the device tree now, but it's also
> > > getting initialized through kirkwood_init_irq, so the numbers
> > > would all be wrong.
> > 
> > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > if it can't find the interrupt controller via fdt.  So, it needs to get
> > done.
> > 
> > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > it's also an ARM926ej-s...
> > 
> 
> Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> You should look at both anything that defines an "interrupt-controller"
> property as an example including Documentation/devicetree/bindings/arm/vic.txt
> and Documentation/devicetree/bindings/arm/gic.txt.
> 
> (taking Thomas Gleixner on Cc)
> 
> Since the orion irq chip is based on irqchip_generic, it would be
> perfect to have a generic irqchip binding to go along with
> kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> before, but it looks like we can completely avoid using
> arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> do that.

Right. That should be trivial to implement.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 19:27                           ` Thomas Gleixner
@ 2012-03-08 19:47                             ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 19:47 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
> On Thu, 8 Mar 2012, Arnd Bergmann wrote:
> 
> > On Thursday 08 March 2012, Jason wrote:
> > > 
> > > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > > Finally, something could be wrong with the interrupt controller.
> > > > AFAICT, you register it through the device tree now, but it's also
> > > > getting initialized through kirkwood_init_irq, so the numbers
> > > > would all be wrong.
> > > 
> > > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > > if it can't find the interrupt controller via fdt.  So, it needs to get
> > > done.
> > > 
> > > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > > it's also an ARM926ej-s...
> > > 
> > 
> > Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> > You should look at both anything that defines an "interrupt-controller"
> > property as an example including Documentation/devicetree/bindings/arm/vic.txt
> > and Documentation/devicetree/bindings/arm/gic.txt.
> > 
> > (taking Thomas Gleixner on Cc)
> > 
> > Since the orion irq chip is based on irqchip_generic, it would be
> > perfect to have a generic irqchip binding to go along with
> > kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> > before, but it looks like we can completely avoid using
> > arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> > do that.
> 
> Right. That should be trivial to implement.

ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?

thx,

Jason.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 19:47                             ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 19:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
> On Thu, 8 Mar 2012, Arnd Bergmann wrote:
> 
> > On Thursday 08 March 2012, Jason wrote:
> > > 
> > > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > > Finally, something could be wrong with the interrupt controller.
> > > > AFAICT, you register it through the device tree now, but it's also
> > > > getting initialized through kirkwood_init_irq, so the numbers
> > > > would all be wrong.
> > > 
> > > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > > if it can't find the interrupt controller via fdt.  So, it needs to get
> > > done.
> > > 
> > > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > > it's also an ARM926ej-s...
> > > 
> > 
> > Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> > You should look at both anything that defines an "interrupt-controller"
> > property as an example including Documentation/devicetree/bindings/arm/vic.txt
> > and Documentation/devicetree/bindings/arm/gic.txt.
> > 
> > (taking Thomas Gleixner on Cc)
> > 
> > Since the orion irq chip is based on irqchip_generic, it would be
> > perfect to have a generic irqchip binding to go along with
> > kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> > before, but it looks like we can completely avoid using
> > arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> > do that.
> 
> Right. That should be trivial to implement.

ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?

thx,

Jason.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 21:13               ` Arnd Bergmann
@ 2012-03-08 21:27                   ` Grant Likely
  -1 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-08 21:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY, Jason,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason wrote:
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> > 
> > Here's my most recent attempt:
> > 
> >         serial@f1012000 {
> >                 device_type = "serial";
> >                 compatible = "ns16550a";
> >                 reg = <0xf1012000 0x100>; /*phys addr*/
> >                 virt-reg = <0xfed12000>;  /*virt addr*/
> >                 reg-shift = <2>;
> >                 reg-io-width = <1>;
> >                 interrupts = <33>;
> >                 current-speed = <115200>;
> >                 interrupt-parent = <&intc>;
> >                 clock-frequency = <200000000>;
> >         };
> > 
> > I've looked at what is done in the powerpc dt's, but, no luck.  When
> > earlyprintk is enabled, I see no error messages, just:
> > 
> > bootconsole [earlycon0] enabled
> > debug: skip boot console de-registration.
> > ...
> > Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> > 
> > Any pointers?
> 
> My first guess was that clock-frequency is wrong, but it seems that
> this one actually is correct, at least it's the same thing that
> the platform code sets.
> 
> You should never need to pass the virtual address to a device,
> most of all because it cannot be known to the device tree at all.
> The of_serial driver (you did enable that one in Kconfig, right?)

Ugh.  Someone really needs to step up and kill the of_serial driver.  All that
stuff belongs in the core 16550 driver.

g.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 21:27                   ` Grant Likely
  0 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-08 21:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> On Wednesday 07 March 2012, Jason wrote:
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> > 
> > Here's my most recent attempt:
> > 
> >         serial at f1012000 {
> >                 device_type = "serial";
> >                 compatible = "ns16550a";
> >                 reg = <0xf1012000 0x100>; /*phys addr*/
> >                 virt-reg = <0xfed12000>;  /*virt addr*/
> >                 reg-shift = <2>;
> >                 reg-io-width = <1>;
> >                 interrupts = <33>;
> >                 current-speed = <115200>;
> >                 interrupt-parent = <&intc>;
> >                 clock-frequency = <200000000>;
> >         };
> > 
> > I've looked at what is done in the powerpc dt's, but, no luck.  When
> > earlyprintk is enabled, I see no error messages, just:
> > 
> > bootconsole [earlycon0] enabled
> > debug: skip boot console de-registration.
> > ...
> > Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
> > 
> > Any pointers?
> 
> My first guess was that clock-frequency is wrong, but it seems that
> this one actually is correct, at least it's the same thing that
> the platform code sets.
> 
> You should never need to pass the virtual address to a device,
> most of all because it cannot be known to the device tree at all.
> The of_serial driver (you did enable that one in Kconfig, right?)

Ugh.  Someone really needs to step up and kill the of_serial driver.  All that
stuff belongs in the core 16550 driver.

g.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-07 19:27             ` Jason
@ 2012-03-08 21:31                 ` Grant Likely
  -1 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-08 21:31 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > +       serial@f1012000 {
> > > +               compatible = "ns16550a";
> > > +               reg = <0xf1012000 0xff>;
> > > +               reg-shift = <2>;
> > > +               interrupts = <33>;
> > > +               clock-frequency = <200000000>;
> > > +       };
> > 
> > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > This is different from the way we define resources in Linux.
> 
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."
> 
> Here's my most recent attempt:
> 

I see that you've resolved your problem, but some comments below on the
device node:

>         serial@f1012000 {
>                 device_type = "serial";

Never use device_type.  It should only ever appear in the memory node, and
I plan to remove it from there too.

>                 compatible = "ns16550a";
>                 reg = <0xf1012000 0x100>; /*phys addr*/
>                 virt-reg = <0xfed12000>;  /*virt addr*/

Don't use virt-reg.  Nothing in the kernel uses it and the kernel will
make it's own decision about virtual address mapping.

>                 reg-shift = <2>;
>                 reg-io-width = <1>;

1 is the default for reg-io-width.  No need to have this property.  It
should only be used if the device requires 32 bit accesses.

>                 interrupts = <33>;
>                 current-speed = <115200>;
>                 interrupt-parent = <&intc>;
>                 clock-frequency = <200000000>;
>         };
> 

g.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 21:31                 ` Grant Likely
  0 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-08 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > +       serial at f1012000 {
> > > +               compatible = "ns16550a";
> > > +               reg = <0xf1012000 0xff>;
> > > +               reg-shift = <2>;
> > > +               interrupts = <33>;
> > > +               clock-frequency = <200000000>;
> > > +       };
> > 
> > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > This is different from the way we define resources in Linux.
> 
> Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> earlyprintk.  Evidently, something is wrong with the above, because the
> device boots all the way up (blinky lights come on), but I get no
> messages after the usual "Uncompressing Linux... done, booting the
> kernel."
> 
> Here's my most recent attempt:
> 

I see that you've resolved your problem, but some comments below on the
device node:

>         serial at f1012000 {
>                 device_type = "serial";

Never use device_type.  It should only ever appear in the memory node, and
I plan to remove it from there too.

>                 compatible = "ns16550a";
>                 reg = <0xf1012000 0x100>; /*phys addr*/
>                 virt-reg = <0xfed12000>;  /*virt addr*/

Don't use virt-reg.  Nothing in the kernel uses it and the kernel will
make it's own decision about virtual address mapping.

>                 reg-shift = <2>;
>                 reg-io-width = <1>;

1 is the default for reg-io-width.  No need to have this property.  It
should only be used if the device requires 32 bit accesses.

>                 interrupts = <33>;
>                 current-speed = <115200>;
>                 interrupt-parent = <&intc>;
>                 clock-frequency = <200000000>;
>         };
> 

g.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 19:47                             ` Jason
@ 2012-03-08 21:32                                 ` Grant Likely
  -1 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-08 21:32 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	Thomas Gleixner,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Mar 08, 2012 at 02:47:25PM -0500, Jason wrote:
> On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
> > On Thu, 8 Mar 2012, Arnd Bergmann wrote:
> > 
> > > On Thursday 08 March 2012, Jason wrote:
> > > > 
> > > > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > > > Finally, something could be wrong with the interrupt controller.
> > > > > AFAICT, you register it through the device tree now, but it's also
> > > > > getting initialized through kirkwood_init_irq, so the numbers
> > > > > would all be wrong.
> > > > 
> > > > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > > > if it can't find the interrupt controller via fdt.  So, it needs to get
> > > > done.
> > > > 
> > > > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > > > it's also an ARM926ej-s...
> > > > 
> > > 
> > > Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> > > You should look at both anything that defines an "interrupt-controller"
> > > property as an example including Documentation/devicetree/bindings/arm/vic.txt
> > > and Documentation/devicetree/bindings/arm/gic.txt.
> > > 
> > > (taking Thomas Gleixner on Cc)
> > > 
> > > Since the orion irq chip is based on irqchip_generic, it would be
> > > perfect to have a generic irqchip binding to go along with
> > > kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> > > before, but it looks like we can completely avoid using
> > > arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> > > do that.
> > 
> > Right. That should be trivial to implement.
> 
> ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?

Rob Herring has done some work in this area.  Please coordinate with him.

g.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 21:32                                 ` Grant Likely
  0 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-08 21:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 08, 2012 at 02:47:25PM -0500, Jason wrote:
> On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
> > On Thu, 8 Mar 2012, Arnd Bergmann wrote:
> > 
> > > On Thursday 08 March 2012, Jason wrote:
> > > > 
> > > > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > > > Finally, something could be wrong with the interrupt controller.
> > > > > AFAICT, you register it through the device tree now, but it's also
> > > > > getting initialized through kirkwood_init_irq, so the numbers
> > > > > would all be wrong.
> > > > 
> > > > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > > > if it can't find the interrupt controller via fdt.  So, it needs to get
> > > > done.
> > > > 
> > > > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > > > it's also an ARM926ej-s...
> > > > 
> > > 
> > > Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> > > You should look at both anything that defines an "interrupt-controller"
> > > property as an example including Documentation/devicetree/bindings/arm/vic.txt
> > > and Documentation/devicetree/bindings/arm/gic.txt.
> > > 
> > > (taking Thomas Gleixner on Cc)
> > > 
> > > Since the orion irq chip is based on irqchip_generic, it would be
> > > perfect to have a generic irqchip binding to go along with
> > > kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> > > before, but it looks like we can completely avoid using
> > > arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> > > do that.
> > 
> > Right. That should be trivial to implement.
> 
> ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?

Rob Herring has done some work in this area.  Please coordinate with him.

g.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 21:32                                 ` Grant Likely
@ 2012-03-08 21:50                                   ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 21:50 UTC (permalink / raw)
  To: Grant Likely, robherring2
  Cc: nicolas.pitre, andrew, Arnd Bergmann, devicetree-discuss,
	michael, Thomas Gleixner, linux-arm-kernel

On Thu, Mar 08, 2012 at 02:32:44PM -0700, Grant Likely wrote:
> On Thu, Mar 08, 2012 at 02:47:25PM -0500, Jason wrote:
> > On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
> > > On Thu, 8 Mar 2012, Arnd Bergmann wrote:
> > > 
> > > > On Thursday 08 March 2012, Jason wrote:
> > > > > 
> > > > > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > > > > Finally, something could be wrong with the interrupt controller.
> > > > > > AFAICT, you register it through the device tree now, but it's also
> > > > > > getting initialized through kirkwood_init_irq, so the numbers
> > > > > > would all be wrong.
> > > > > 
> > > > > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > > > > if it can't find the interrupt controller via fdt.  So, it needs to get
> > > > > done.
> > > > > 
> > > > > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > > > > it's also an ARM926ej-s...
> > > > > 
> > > > 
> > > > Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> > > > You should look at both anything that defines an "interrupt-controller"
> > > > property as an example including Documentation/devicetree/bindings/arm/vic.txt
> > > > and Documentation/devicetree/bindings/arm/gic.txt.
> > > > 
> > > > (taking Thomas Gleixner on Cc)
> > > > 
> > > > Since the orion irq chip is based on irqchip_generic, it would be
> > > > perfect to have a generic irqchip binding to go along with
> > > > kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> > > > before, but it looks like we can completely avoid using
> > > > arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> > > > do that.
> > > 
> > > Right. That should be trivial to implement.
> > 
> > ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?
> 
> Rob Herring has done some work in this area.  Please coordinate with him.

Rob,

I'm attempting to convert mach-kirkwood boards over to devicetree,
starting with the dreamplug.

You can find my stable patches here:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_stable

and the stuff I'm still trying to figure out:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_staging

My next task looks like converting the irq code, since mv_cesa fails
silently without the interrupt-controller specified in the dtb.

The code I'm replacing can be found here:

arch/arm/mach-kirkwood/irq.c
arch/arm/plat-orion/irq.c

This is the first time I've attempted something like this, so any
pointers would be much appreciated.  Also, if there is anything I would
need to deconflict with, please let me know.

thx,

Jason.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 21:50                                   ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 21:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 08, 2012 at 02:32:44PM -0700, Grant Likely wrote:
> On Thu, Mar 08, 2012 at 02:47:25PM -0500, Jason wrote:
> > On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
> > > On Thu, 8 Mar 2012, Arnd Bergmann wrote:
> > > 
> > > > On Thursday 08 March 2012, Jason wrote:
> > > > > 
> > > > > On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
> > > > > > Finally, something could be wrong with the interrupt controller.
> > > > > > AFAICT, you register it through the device tree now, but it's also
> > > > > > getting initialized through kirkwood_init_irq, so the numbers
> > > > > > would all be wrong.
> > > > > 
> > > > > Yes, I'm working through this now.  mv_cesa silently fails to come up
> > > > > if it can't find the interrupt controller via fdt.  So, it needs to get
> > > > > done.
> > > > > 
> > > > > Right now, I'm looking at how mach-versatile does it (vic_init()) since
> > > > > it's also an ARM926ej-s...
> > > > > 
> > > > 
> > > > Ok, sounds good. It's not important whether it's an ARM9 or not btw.
> > > > You should look at both anything that defines an "interrupt-controller"
> > > > property as an example including Documentation/devicetree/bindings/arm/vic.txt
> > > > and Documentation/devicetree/bindings/arm/gic.txt.
> > > > 
> > > > (taking Thomas Gleixner on Cc)
> > > > 
> > > > Since the orion irq chip is based on irqchip_generic, it would be
> > > > perfect to have a generic irqchip binding to go along with
> > > > kernel/irq/generic-chip.c. Not sure if anyone has thought about this
> > > > before, but it looks like we can completely avoid using
> > > > arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
> > > > do that.
> > > 
> > > Right. That should be trivial to implement.
> > 
> > ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?
> 
> Rob Herring has done some work in this area.  Please coordinate with him.

Rob,

I'm attempting to convert mach-kirkwood boards over to devicetree,
starting with the dreamplug.

You can find my stable patches here:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_stable

and the stuff I'm still trying to figure out:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_staging

My next task looks like converting the irq code, since mv_cesa fails
silently without the interrupt-controller specified in the dtb.

The code I'm replacing can be found here:

arch/arm/mach-kirkwood/irq.c
arch/arm/plat-orion/irq.c

This is the first time I've attempted something like this, so any
pointers would be much appreciated.  Also, if there is anything I would
need to deconflict with, please let me know.

thx,

Jason.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 21:31                 ` Grant Likely
@ 2012-03-08 21:55                     ` Jason
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 21:55 UTC (permalink / raw)
  To: Grant Likely
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Mar 08, 2012 at 02:31:39PM -0700, Grant Likely wrote:
> On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> > On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > > +       serial@f1012000 {
> > > > +               compatible = "ns16550a";
> > > > +               reg = <0xf1012000 0xff>;
> > > > +               reg-shift = <2>;
> > > > +               interrupts = <33>;
> > > > +               clock-frequency = <200000000>;
> > > > +       };
> > > 
> > > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > > This is different from the way we define resources in Linux.
> > 
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> > 
> > Here's my most recent attempt:
> > 
> 
> I see that you've resolved your problem, but some comments below on the
> device node:
> 
> >         serial@f1012000 {
> >                 device_type = "serial";
> 
> Never use device_type.  It should only ever appear in the memory node, and
> I plan to remove it from there too.
> 
> >                 compatible = "ns16550a";
> >                 reg = <0xf1012000 0x100>; /*phys addr*/
> >                 virt-reg = <0xfed12000>;  /*virt addr*/
> 
> Don't use virt-reg.  Nothing in the kernel uses it and the kernel will
> make it's own decision about virtual address mapping.
> 
> >                 reg-shift = <2>;
> >                 reg-io-width = <1>;
> 
> 1 is the default for reg-io-width.  No need to have this property.  It
> should only be used if the device requires 32 bit accesses.
> 
> >                 interrupts = <33>;
> >                 current-speed = <115200>;
> >                 interrupt-parent = <&intc>;
> >                 clock-frequency = <200000000>;
> >         };

Thanks, Grant.  I reverted all of those changes once I found the root of
my problem.

thx,

Jason.

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 21:55                     ` Jason
  0 siblings, 0 replies; 272+ messages in thread
From: Jason @ 2012-03-08 21:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 08, 2012 at 02:31:39PM -0700, Grant Likely wrote:
> On Wed, Mar 07, 2012 at 02:27:23PM -0500, Jason wrote:
> > On Wed, Mar 07, 2012 at 06:31:31PM +0000, Arnd Bergmann wrote:
> > > On Wednesday 07 March 2012, Jason Cooper wrote:
> > > > +       serial at f1012000 {
> > > > +               compatible = "ns16550a";
> > > > +               reg = <0xf1012000 0xff>;
> > > > +               reg-shift = <2>;
> > > > +               interrupts = <33>;
> > > > +               clock-frequency = <200000000>;
> > > > +       };
> > > 
> > > I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff.
> > > This is different from the way we define resources in Linux.
> > 
> > Grrr.  Now I'm getting frustrated.  I'm trying to boot without
> > earlyprintk.  Evidently, something is wrong with the above, because the
> > device boots all the way up (blinky lights come on), but I get no
> > messages after the usual "Uncompressing Linux... done, booting the
> > kernel."
> > 
> > Here's my most recent attempt:
> > 
> 
> I see that you've resolved your problem, but some comments below on the
> device node:
> 
> >         serial at f1012000 {
> >                 device_type = "serial";
> 
> Never use device_type.  It should only ever appear in the memory node, and
> I plan to remove it from there too.
> 
> >                 compatible = "ns16550a";
> >                 reg = <0xf1012000 0x100>; /*phys addr*/
> >                 virt-reg = <0xfed12000>;  /*virt addr*/
> 
> Don't use virt-reg.  Nothing in the kernel uses it and the kernel will
> make it's own decision about virtual address mapping.
> 
> >                 reg-shift = <2>;
> >                 reg-io-width = <1>;
> 
> 1 is the default for reg-io-width.  No need to have this property.  It
> should only be used if the device requires 32 bit accesses.
> 
> >                 interrupts = <33>;
> >                 current-speed = <115200>;
> >                 interrupt-parent = <&intc>;
> >                 clock-frequency = <200000000>;
> >         };

Thanks, Grant.  I reverted all of those changes once I found the root of
my problem.

thx,

Jason.

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 21:50                                   ` Jason
@ 2012-03-08 22:22                                     ` Rob Herring
  -1 siblings, 0 replies; 272+ messages in thread
From: Rob Herring @ 2012-03-08 22:22 UTC (permalink / raw)
  To: Jason
  Cc: nicolas.pitre, andrew, Arnd Bergmann, devicetree-discuss,
	Grant Likely, michael, Thomas Gleixner, linux-arm-kernel

On 03/08/2012 03:50 PM, Jason wrote:
> On Thu, Mar 08, 2012 at 02:32:44PM -0700, Grant Likely wrote:
>> On Thu, Mar 08, 2012 at 02:47:25PM -0500, Jason wrote:
>>> On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
>>>> On Thu, 8 Mar 2012, Arnd Bergmann wrote:
>>>>
>>>>> On Thursday 08 March 2012, Jason wrote:
>>>>>>
>>>>>> On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
>>>>>>> Finally, something could be wrong with the interrupt controller.
>>>>>>> AFAICT, you register it through the device tree now, but it's also
>>>>>>> getting initialized through kirkwood_init_irq, so the numbers
>>>>>>> would all be wrong.
>>>>>>
>>>>>> Yes, I'm working through this now.  mv_cesa silently fails to come up
>>>>>> if it can't find the interrupt controller via fdt.  So, it needs to get
>>>>>> done.
>>>>>>
>>>>>> Right now, I'm looking at how mach-versatile does it (vic_init()) since
>>>>>> it's also an ARM926ej-s...
>>>>>>
>>>>>
>>>>> Ok, sounds good. It's not important whether it's an ARM9 or not btw.
>>>>> You should look at both anything that defines an "interrupt-controller"
>>>>> property as an example including Documentation/devicetree/bindings/arm/vic.txt
>>>>> and Documentation/devicetree/bindings/arm/gic.txt.
>>>>>
>>>>> (taking Thomas Gleixner on Cc)
>>>>>
>>>>> Since the orion irq chip is based on irqchip_generic, it would be
>>>>> perfect to have a generic irqchip binding to go along with
>>>>> kernel/irq/generic-chip.c. Not sure if anyone has thought about this
>>>>> before, but it looks like we can completely avoid using
>>>>> arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
>>>>> do that.

A generic irqchip binding is not the right approach. The binding should
still be specific to the controller as the generic irqchip code doesn't
handle everything like dispatching interrupts or know how many blocks of
32 interrupts your controller has.

>>>> Right. That should be trivial to implement.

Yes, since someone else already has (me).

>>>
>>> ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?
>>
>> Rob Herring has done some work in this area.  Please coordinate with him.
> 
> Rob,
> 
> I'm attempting to convert mach-kirkwood boards over to devicetree,
> starting with the dreamplug.
> 
> You can find my stable patches here:
> 
> git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_stable
> 
> and the stuff I'm still trying to figure out:
> 
> git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_staging
> 
> My next task looks like converting the irq code, since mv_cesa fails
> silently without the interrupt-controller specified in the dtb.
> 
> The code I'm replacing can be found here:
> 
> arch/arm/mach-kirkwood/irq.c
> arch/arm/plat-orion/irq.c
> 
> This is the first time I've attempted something like this, so any
> pointers would be much appreciated.  Also, if there is anything I would
> need to deconflict with, please let me know.
> 

Look at my branch here:

git://sources.calxeda.com/kernel/linux.git irqdomain-for-grant

Your .init_irq function should call of_irq_init which will then call an
init function for each controller. Then you need to call
irq_setup_generic_chip_domain to setup the generic irqchip instances.

You also should convert to enabling CONFIG_MULTI_IRQ_HANDLER or I think
a linear domain won't work for you and that's what the generic irqchip
code will use. Also you should enable SPARSE_IRQ, but that is somewhat
independent.

In the DT case, you want to not have any compile time dependencies on
Linux irq numbers. If you're keeping non-DT compatibility, that will
complicate your conversion.

Rob

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 22:22                                     ` Rob Herring
  0 siblings, 0 replies; 272+ messages in thread
From: Rob Herring @ 2012-03-08 22:22 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/08/2012 03:50 PM, Jason wrote:
> On Thu, Mar 08, 2012 at 02:32:44PM -0700, Grant Likely wrote:
>> On Thu, Mar 08, 2012 at 02:47:25PM -0500, Jason wrote:
>>> On Thu, Mar 08, 2012 at 08:27:11PM +0100, Thomas Gleixner wrote:
>>>> On Thu, 8 Mar 2012, Arnd Bergmann wrote:
>>>>
>>>>> On Thursday 08 March 2012, Jason wrote:
>>>>>>
>>>>>> On Wed, Mar 07, 2012 at 09:13:04PM +0000, Arnd Bergmann wrote:
>>>>>>> Finally, something could be wrong with the interrupt controller.
>>>>>>> AFAICT, you register it through the device tree now, but it's also
>>>>>>> getting initialized through kirkwood_init_irq, so the numbers
>>>>>>> would all be wrong.
>>>>>>
>>>>>> Yes, I'm working through this now.  mv_cesa silently fails to come up
>>>>>> if it can't find the interrupt controller via fdt.  So, it needs to get
>>>>>> done.
>>>>>>
>>>>>> Right now, I'm looking at how mach-versatile does it (vic_init()) since
>>>>>> it's also an ARM926ej-s...
>>>>>>
>>>>>
>>>>> Ok, sounds good. It's not important whether it's an ARM9 or not btw.
>>>>> You should look at both anything that defines an "interrupt-controller"
>>>>> property as an example including Documentation/devicetree/bindings/arm/vic.txt
>>>>> and Documentation/devicetree/bindings/arm/gic.txt.
>>>>>
>>>>> (taking Thomas Gleixner on Cc)
>>>>>
>>>>> Since the orion irq chip is based on irqchip_generic, it would be
>>>>> perfect to have a generic irqchip binding to go along with
>>>>> kernel/irq/generic-chip.c. Not sure if anyone has thought about this
>>>>> before, but it looks like we can completely avoid using
>>>>> arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we
>>>>> do that.

A generic irqchip binding is not the right approach. The binding should
still be specific to the controller as the generic irqchip code doesn't
handle everything like dispatching interrupts or know how many blocks of
32 interrupts your controller has.

>>>> Right. That should be trivial to implement.

Yes, since someone else already has (me).

>>>
>>> ok, I'm on it.  kernel/irq/of_generic_irq.c sound good?
>>
>> Rob Herring has done some work in this area.  Please coordinate with him.
> 
> Rob,
> 
> I'm attempting to convert mach-kirkwood boards over to devicetree,
> starting with the dreamplug.
> 
> You can find my stable patches here:
> 
> git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_stable
> 
> and the stuff I'm still trying to figure out:
> 
> git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_staging
> 
> My next task looks like converting the irq code, since mv_cesa fails
> silently without the interrupt-controller specified in the dtb.
> 
> The code I'm replacing can be found here:
> 
> arch/arm/mach-kirkwood/irq.c
> arch/arm/plat-orion/irq.c
> 
> This is the first time I've attempted something like this, so any
> pointers would be much appreciated.  Also, if there is anything I would
> need to deconflict with, please let me know.
> 

Look at my branch here:

git://sources.calxeda.com/kernel/linux.git irqdomain-for-grant

Your .init_irq function should call of_irq_init which will then call an
init function for each controller. Then you need to call
irq_setup_generic_chip_domain to setup the generic irqchip instances.

You also should convert to enabling CONFIG_MULTI_IRQ_HANDLER or I think
a linear domain won't work for you and that's what the generic irqchip
code will use. Also you should enable SPARSE_IRQ, but that is somewhat
independent.

In the DT case, you want to not have any compile time dependencies on
Linux irq numbers. If you're keeping non-DT compatibility, that will
complicate your conversion.

Rob

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

* Re: [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-08 21:27                   ` Grant Likely
@ 2012-03-08 23:14                       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-08 23:14 UTC (permalink / raw)
  To: Grant Likely
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY, Jason,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 08 March 2012, Grant Likely wrote:
> > 
> > My first guess was that clock-frequency is wrong, but it seems that
> > this one actually is correct, at least it's the same thing that
> > the platform code sets.
> > 
> > You should never need to pass the virtual address to a device,
> > most of all because it cannot be known to the device tree at all.
> > The of_serial driver (you did enable that one in Kconfig, right?)
> 
> Ugh.  Someone really needs to step up and kill the of_serial driver.  All that
> stuff belongs in the core 16550 driver.

Well, actually I would argue that nothing belongs into the core 8250 driver.
What we should do though is split the of_serial.c file into the main 8250
portion and put that into drivers/tty/serial/8250/ along with the other
14 bus glue drivers, and put the nwpserial portion into
drivers/tty/serial/nwpserial.c.

I have started a major rework of 8250 some time ago that I need to finish up,
to make the different ways for registering an 8250 device more regular,
and get rid of the more obscure ways we have in the kernel, replacing them
with platform devices or other bus specific 'struct device' versions.

The main intention of that patch series is to confine the ISA/PCI specific
inb/outb accessors in the files that need them so we can actually build
the platform drivers without defining those, but I can take care of
of_serial.c as well -- after all I wrote that file originally.

	Arnd

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

* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-08 23:14                       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-08 23:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 08 March 2012, Grant Likely wrote:
> > 
> > My first guess was that clock-frequency is wrong, but it seems that
> > this one actually is correct, at least it's the same thing that
> > the platform code sets.
> > 
> > You should never need to pass the virtual address to a device,
> > most of all because it cannot be known to the device tree at all.
> > The of_serial driver (you did enable that one in Kconfig, right?)
> 
> Ugh.  Someone really needs to step up and kill the of_serial driver.  All that
> stuff belongs in the core 16550 driver.

Well, actually I would argue that nothing belongs into the core 8250 driver.
What we should do though is split the of_serial.c file into the main 8250
portion and put that into drivers/tty/serial/8250/ along with the other
14 bus glue drivers, and put the nwpserial portion into
drivers/tty/serial/nwpserial.c.

I have started a major rework of 8250 some time ago that I need to finish up,
to make the different ways for registering an 8250 device more regular,
and get rid of the more obscure ways we have in the kernel, replacing them
with platform devices or other bus specific 'struct device' versions.

The main intention of that patch series is to confine the ISA/PCI specific
inb/outb accessors in the files that need them so we can actually build
the platform drivers without defining those, but I can take care of
of_serial.c as well -- after all I wrote that file originally.

	Arnd

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

* Re: [PATCH 01/14] ARM: orion: spi: remove enable_clock_fix which is not used
  2012-03-07  3:44       ` Jason Cooper
@ 2012-03-09  4:33           ` Grant Likely
  -1 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-09  4:33 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	michael-QKn5cuLxLXY,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed,  7 Mar 2012 03:44:42 +0000, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
> 
> Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>

Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>

> ---
>  drivers/spi/spi-orion.c       |    5 -----
>  include/linux/spi/orion_spi.h |    1 -
>  2 files changed, 0 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index 13448c8..e496f79 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
>  
>  	orion_spi = spi_master_get_devdata(spi->master);
>  
> -	/* Fix ac timing if required.   */
> -	if (orion_spi->spi_info->enable_clock_fix)
> -		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
> -				  (1 << 14));
> -
>  	if ((spi->max_speed_hz == 0)
>  			|| (spi->max_speed_hz > orion_spi->max_speed))
>  		spi->max_speed_hz = orion_spi->max_speed;
> diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
> index decf6d8..b4d9fa6 100644
> --- a/include/linux/spi/orion_spi.h
> +++ b/include/linux/spi/orion_spi.h
> @@ -11,7 +11,6 @@
>  
>  struct orion_spi_info {
>  	u32	tclk;		/* no <linux/clk.h> support yet */
> -	u32	enable_clock_fix;
>  };
>  
>  
> -- 
> 1.7.3.4
> 

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies,Ltd.

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

* [PATCH 01/14] ARM: orion: spi: remove enable_clock_fix which is not used
@ 2012-03-09  4:33           ` Grant Likely
  0 siblings, 0 replies; 272+ messages in thread
From: Grant Likely @ 2012-03-09  4:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed,  7 Mar 2012 03:44:42 +0000, Jason Cooper <jason@lakedaemon.net> wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
>  drivers/spi/spi-orion.c       |    5 -----
>  include/linux/spi/orion_spi.h |    1 -
>  2 files changed, 0 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index 13448c8..e496f79 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
>  
>  	orion_spi = spi_master_get_devdata(spi->master);
>  
> -	/* Fix ac timing if required.   */
> -	if (orion_spi->spi_info->enable_clock_fix)
> -		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
> -				  (1 << 14));
> -
>  	if ((spi->max_speed_hz == 0)
>  			|| (spi->max_speed_hz > orion_spi->max_speed))
>  		spi->max_speed_hz = orion_spi->max_speed;
> diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
> index decf6d8..b4d9fa6 100644
> --- a/include/linux/spi/orion_spi.h
> +++ b/include/linux/spi/orion_spi.h
> @@ -11,7 +11,6 @@
>  
>  struct orion_spi_info {
>  	u32	tclk;		/* no <linux/clk.h> support yet */
> -	u32	enable_clock_fix;
>  };
>  
>  
> -- 
> 1.7.3.4
> 

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies,Ltd.

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

* [PATCH 0/7 v4] ARM: kirkwood: fdt: convert kirkwood to fdt
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-13  1:57     ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, olof-nZhT3qVonbNeoWH0uzbU5w
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first three patches are code cleanup from Andrew Lunn.

The rest of the series is the initial conversion to devicetree for kirkwood,
use by dreamplug, and devicetree bindings for drivers that don't use tclk or
pinux.  These should be safe to merge as they won't interfere with the
clk/clkdev work Andrew Lunn is working on.

Overall changes since v3:

	- squashed several fixup patches into the series (use mrvl, use
	  inclusive address sizes)
	- applied Arnd's suggestion for serial ports in kirkwood.dtsi, added my
	  idea of defining serial clock in dts.
	- moved dreamplug_init() out of board-dt.c (into board-dreamplug.c) to
	  facilitate the orderly arrival of new boards with fdt support (Jamie
	  Lentin's boards)
	- moved all non-fdt cleanups to the beginning of the series.
	- removed mv_cesa, mv_sata, and orion-ehci from this series as they
	  depend on intc/dma/clock to work properly
	- removed Ack's and Reviewed-By's on patches with significant changes
		- Grant's Ack remains on the "wdt: use resource" patch as it is
		  a reduced scope version (no fdt bindings), otherwise,
		  identical to code originally Acked.  Please let me know if
		  that's not appropriate.

Overall changes since v2:

	- added Andrew Lunn's cleanup patches
	- reshuffled to more logical order
	- wrapped all struct of_device_id[]'s in #ifdef CONFIG_OF
	- s/marvell,/mrvl,/g
	- added orion-ehci
	- added mv_sata
	- prevent clocks from gating when booting from devicetree

Drivers yet to be converted are:

	mv_cesa:    needs intc in fdt (next on list)
	mv_sata:    needs dma, intc
	orion-ehci: needs dma, intc
	orion-spi:  uses tclk
	orion-wdt:  uses tclk
	mvsdio:     uses tclk
	i2c:        uses freq_m/freq_n, not sure if that should use clk/clkdev
	mv_xor:     haven't figured out howto do shared resources/dma in fdt
	ge0/ge1:    haven't looked at it yet
	nand:       not needed for dreamplug, Jamie Lentin is working on it

Please be aware that this is a complete reshuffle of the whole series and is
based purely against v3.3-rc3.

Interested folks can pull from:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_for_3.4


Andrew Lunn (3):
  ARM: orion: spi: remove enable_clock_fix which is not used
  ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
  ARM: orion: wdt: use resource vice direct access

Jason Cooper (4):
  ARM: kirkwood: add dreamplug (fdt) support.
  ARM: kirkwood: convert uart0 to devicetree.
  ARM: kirkwood: rtc-mv devicetree bindings
  ARM: kirkwood: use devicetree for rtc-mv

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   24 +++++
 arch/arm/boot/dts/kirkwood.dtsi          |   36 +++++++
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    2 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  149 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |   75 +++++++++++++++
 arch/arm/mach-kirkwood/common.c          |   11 +-
 arch/arm/mach-kirkwood/common.h          |   11 ++
 arch/arm/plat-orion/common.c             |    7 +-
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 drivers/rtc/rtc-mv.c                     |    9 ++
 drivers/spi/spi-orion.c                  |    5 -
 drivers/watchdog/orion_wdt.c             |   24 +++--
 include/linux/spi/orion_spi.h            |    1 -
 15 files changed, 348 insertions(+), 23 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 0/7 v4] ARM: kirkwood: fdt: convert kirkwood to fdt
@ 2012-03-13  1:57     ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

This series begins the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first three patches are code cleanup from Andrew Lunn.

The rest of the series is the initial conversion to devicetree for kirkwood,
use by dreamplug, and devicetree bindings for drivers that don't use tclk or
pinux.  These should be safe to merge as they won't interfere with the
clk/clkdev work Andrew Lunn is working on.

Overall changes since v3:

	- squashed several fixup patches into the series (use mrvl, use
	  inclusive address sizes)
	- applied Arnd's suggestion for serial ports in kirkwood.dtsi, added my
	  idea of defining serial clock in dts.
	- moved dreamplug_init() out of board-dt.c (into board-dreamplug.c) to
	  facilitate the orderly arrival of new boards with fdt support (Jamie
	  Lentin's boards)
	- moved all non-fdt cleanups to the beginning of the series.
	- removed mv_cesa, mv_sata, and orion-ehci from this series as they
	  depend on intc/dma/clock to work properly
	- removed Ack's and Reviewed-By's on patches with significant changes
		- Grant's Ack remains on the "wdt: use resource" patch as it is
		  a reduced scope version (no fdt bindings), otherwise,
		  identical to code originally Acked.  Please let me know if
		  that's not appropriate.

Overall changes since v2:

	- added Andrew Lunn's cleanup patches
	- reshuffled to more logical order
	- wrapped all struct of_device_id[]'s in #ifdef CONFIG_OF
	- s/marvell,/mrvl,/g
	- added orion-ehci
	- added mv_sata
	- prevent clocks from gating when booting from devicetree

Drivers yet to be converted are:

	mv_cesa:    needs intc in fdt (next on list)
	mv_sata:    needs dma, intc
	orion-ehci: needs dma, intc
	orion-spi:  uses tclk
	orion-wdt:  uses tclk
	mvsdio:     uses tclk
	i2c:        uses freq_m/freq_n, not sure if that should use clk/clkdev
	mv_xor:     haven't figured out howto do shared resources/dma in fdt
	ge0/ge1:    haven't looked at it yet
	nand:       not needed for dreamplug, Jamie Lentin is working on it

Please be aware that this is a complete reshuffle of the whole series and is
based purely against v3.3-rc3.

Interested folks can pull from:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_for_3.4


Andrew Lunn (3):
  ARM: orion: spi: remove enable_clock_fix which is not used
  ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
  ARM: orion: wdt: use resource vice direct access

Jason Cooper (4):
  ARM: kirkwood: add dreamplug (fdt) support.
  ARM: kirkwood: convert uart0 to devicetree.
  ARM: kirkwood: rtc-mv devicetree bindings
  ARM: kirkwood: use devicetree for rtc-mv

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   24 +++++
 arch/arm/boot/dts/kirkwood.dtsi          |   36 +++++++
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    2 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  149 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |   75 +++++++++++++++
 arch/arm/mach-kirkwood/common.c          |   11 +-
 arch/arm/mach-kirkwood/common.h          |   11 ++
 arch/arm/plat-orion/common.c             |    7 +-
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 drivers/rtc/rtc-mv.c                     |    9 ++
 drivers/spi/spi-orion.c                  |    5 -
 drivers/watchdog/orion_wdt.c             |   24 +++--
 include/linux/spi/orion_spi.h            |    1 -
 15 files changed, 348 insertions(+), 23 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 1/7] ARM: orion: spi: remove enable_clock_fix which is not used
  2012-03-13  1:57     ` Jason Cooper
@ 2012-03-13  1:57   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/spi/spi-orion.c       |    5 -----
 include/linux/spi/orion_spi.h |    1 -
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..e496f79 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
-		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
-				  (1 << 14));
-
 	if ((spi->max_speed_hz == 0)
 			|| (spi->max_speed_hz > orion_spi->max_speed))
 		spi->max_speed_hz = orion_spi->max_speed;
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
index decf6d8..b4d9fa6 100644
--- a/include/linux/spi/orion_spi.h
+++ b/include/linux/spi/orion_spi.h
@@ -11,7 +11,6 @@
 
 struct orion_spi_info {
 	u32	tclk;		/* no <linux/clk.h> support yet */
-	u32	enable_clock_fix;
 };
 
 
-- 
1.7.3.4

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

* [PATCH 1/7] ARM: orion: spi: remove enable_clock_fix which is not used
@ 2012-03-13  1:57   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/spi/spi-orion.c       |    5 -----
 include/linux/spi/orion_spi.h |    1 -
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..e496f79 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
-		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
-				  (1 << 14));
-
 	if ((spi->max_speed_hz == 0)
 			|| (spi->max_speed_hz > orion_spi->max_speed))
 		spi->max_speed_hz = orion_spi->max_speed;
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
index decf6d8..b4d9fa6 100644
--- a/include/linux/spi/orion_spi.h
+++ b/include/linux/spi/orion_spi.h
@@ -11,7 +11,6 @@
 
 struct orion_spi_info {
 	u32	tclk;		/* no <linux/clk.h> support yet */
-	u32	enable_clock_fix;
 };
 
 
-- 
1.7.3.4

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

* [PATCH 2/7] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
  2012-03-13  1:57     ` Jason Cooper
@ 2012-03-13  1:57   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

It is not used anywhere in the sound driver.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c          |    1 -
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index cc15426..eacf7f5 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -449,7 +449,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h
index 885f8ab..d6a55bd 100644
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ b/arch/arm/plat-orion/include/plat/audio.h
@@ -2,7 +2,6 @@
 #define __PLAT_AUDIO_H
 
 struct kirkwood_asoc_platform_data {
-	u32 tclk;
 	int burst;
 };
 #endif
-- 
1.7.3.4

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

* [PATCH 2/7] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
@ 2012-03-13  1:57   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

It is not used anywhere in the sound driver.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c          |    1 -
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index cc15426..eacf7f5 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -449,7 +449,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h
index 885f8ab..d6a55bd 100644
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ b/arch/arm/plat-orion/include/plat/audio.h
@@ -2,7 +2,6 @@
 #define __PLAT_AUDIO_H
 
 struct kirkwood_asoc_platform_data {
-	u32 tclk;
 	int burst;
 };
 #endif
-- 
1.7.3.4

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

* [PATCH 3/7 v2] ARM: orion: wdt: use resource vice direct access
  2012-03-13  1:57     ` Jason Cooper
@ 2012-03-13  1:57       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, olof-nZhT3qVonbNeoWH0uzbU5w
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>

Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
Note: This code is the exact same as that originally Acked by Grant.  I've
simply removed the fdt bindings, as I need to hold off until common clock is
added.  If it's not appropriate to retain his Ack here, please let me know.

 arch/arm/plat-orion/common.c |    7 ++++++-
 drivers/watchdog/orion_wdt.c |   24 +++++++++++++++---------
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index e5a2fde..eadd1cd 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -21,6 +21,7 @@
 #include <plat/orion_wdt.h>
 #include <plat/mv_xor.h>
 #include <plat/ehci-orion.h>
+#include <mach/bridge-regs.h>
 
 /* Fill in the resources structure and link it into the platform
    device structure. There is always a memory region, and nearly
@@ -568,13 +569,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
  ****************************************************************************/
 static struct orion_wdt_platform_data orion_wdt_data;
 
+static struct resource orion_wdt_resource =
+		DEFINE_RES_MEM(TIMER_VIRT_BASE, 0x28);
+
 static struct platform_device orion_wdt_device = {
 	.name		= "orion_wdt",
 	.id		= -1,
 	.dev		= {
 		.platform_data	= &orion_wdt_data,
 	},
-	.num_resources	= 0,
+	.resource	= &orion_wdt_resource,
+	.num_resources	= 1,
 };
 
 void __init orion_wdt_init(unsigned long tclk)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..1368e4c 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -28,9 +28,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +40,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static void __iomem *wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +49,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +61,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +69,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +93,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +103,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,6 +237,7 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct resource *res;
 	int ret;
 
 	if (pdata) {
@@ -245,6 +247,10 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	wdt_reg = ioremap(res->start, resource_size(res));
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
-- 
1.7.3.4

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

* [PATCH 3/7 v2] ARM: orion: wdt: use resource vice direct access
@ 2012-03-13  1:57       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
Note: This code is the exact same as that originally Acked by Grant.  I've
simply removed the fdt bindings, as I need to hold off until common clock is
added.  If it's not appropriate to retain his Ack here, please let me know.

 arch/arm/plat-orion/common.c |    7 ++++++-
 drivers/watchdog/orion_wdt.c |   24 +++++++++++++++---------
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index e5a2fde..eadd1cd 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -21,6 +21,7 @@
 #include <plat/orion_wdt.h>
 #include <plat/mv_xor.h>
 #include <plat/ehci-orion.h>
+#include <mach/bridge-regs.h>
 
 /* Fill in the resources structure and link it into the platform
    device structure. There is always a memory region, and nearly
@@ -568,13 +569,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
  ****************************************************************************/
 static struct orion_wdt_platform_data orion_wdt_data;
 
+static struct resource orion_wdt_resource =
+		DEFINE_RES_MEM(TIMER_VIRT_BASE, 0x28);
+
 static struct platform_device orion_wdt_device = {
 	.name		= "orion_wdt",
 	.id		= -1,
 	.dev		= {
 		.platform_data	= &orion_wdt_data,
 	},
-	.num_resources	= 0,
+	.resource	= &orion_wdt_resource,
+	.num_resources	= 1,
 };
 
 void __init orion_wdt_init(unsigned long tclk)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..1368e4c 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -28,9 +28,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +40,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static void __iomem *wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +49,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +61,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +69,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +93,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +103,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,6 +237,7 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct resource *res;
 	int ret;
 
 	if (pdata) {
@@ -245,6 +247,10 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	wdt_reg = ioremap(res->start, resource_size(res));
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
-- 
1.7.3.4

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

* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
  2012-03-13  1:57     ` Jason Cooper
@ 2012-03-13  1:57       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, olof-nZhT3qVonbNeoWH0uzbU5w
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Next, all drivers not needing common clock (kirkwood_tclk)
or pinmux.  Then, remain drivers as that support hits the tree.

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---

Changes from v3:

* squashed absorbing kirkwood_init() into board-dt.c into this patch
* split dreamplug_init() out of board-dt.c into board-dreamplug.c to facilitate
  other boards coming in during conversion process.
* removed Acked's and Reviewed-By's as code has changed significantly and
  absorbed several other patches.

Changes from v2:

* s/marvell,/mrvl,/g for compatible properties

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   17 ++++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    2 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  151 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |   76 +++++++++++++++
 arch/arm/mach-kirkwood/common.c          |   12 +-
 arch/arm/mach-kirkwood/common.h          |   12 +++
 9 files changed, 286 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..9946d01
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,17 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..702b955
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "mrvl,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell Kirkwood using flattened device tree.
+
+config MACH_DREAMPLUG_DT
+	bool "Marvell DreamPlug (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug (Flattened Device Tree).
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 5dcaa81..e299a95 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,5 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
+obj-$(CONFIG_MACH_DREAMPLUG_DT)		+= board-dreamplug.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
new file mode 100644
index 0000000..3b37315
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..ce008f2
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <mach/bridge-regs.h>
+#include "common.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+static void __init kirkwood_dt_init(void)
+{
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index eacf7f5..ae90f60 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -278,7 +278,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -290,7 +290,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -302,7 +302,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -391,7 +391,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -434,7 +434,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..194daa9 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,18 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+/* board init functions for drivers not converted to fdt */
+void dreamplug_init(void);
+
+/* early init functions not converted to fdt yet */
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
@ 2012-03-13  1:57       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Next, all drivers not needing common clock (kirkwood_tclk)
or pinmux.  Then, remain drivers as that support hits the tree.

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v3:

* squashed absorbing kirkwood_init() into board-dt.c into this patch
* split dreamplug_init() out of board-dt.c into board-dreamplug.c to facilitate
  other boards coming in during conversion process.
* removed Acked's and Reviewed-By's as code has changed significantly and
  absorbed several other patches.

Changes from v2:

* s/marvell,/mrvl,/g for compatible properties

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   17 ++++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    2 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  151 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |   76 +++++++++++++++
 arch/arm/mach-kirkwood/common.c          |   12 +-
 arch/arm/mach-kirkwood/common.h          |   12 +++
 9 files changed, 286 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..9946d01
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,17 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..702b955
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "mrvl,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell Kirkwood using flattened device tree.
+
+config MACH_DREAMPLUG_DT
+	bool "Marvell DreamPlug (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug (Flattened Device Tree).
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 5dcaa81..e299a95 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,5 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
+obj-$(CONFIG_MACH_DREAMPLUG_DT)		+= board-dreamplug.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
new file mode 100644
index 0000000..3b37315
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..ce008f2
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <mach/bridge-regs.h>
+#include "common.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+static void __init kirkwood_dt_init(void)
+{
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index eacf7f5..ae90f60 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -278,7 +278,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -290,7 +290,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -302,7 +302,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -391,7 +391,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -434,7 +434,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..194daa9 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,18 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+/* board init functions for drivers not converted to fdt */
+void dreamplug_init(void);
+
+/* early init functions not converted to fdt yet */
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 5/7 v2] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-13  1:57     ` Jason Cooper
@ 2012-03-13  1:57   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dreamplug.c.

There are two uarts on the kirkwood SoC, all or none of them may be
enabled, and the clock-frequency is board-dependant.  So, enabling and
clock-frequency are left to the board dts.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v1:

* moved on-chip peripherals (uart's here) in kirkwood.dtsi and used ranges to
  simplify addressing
* disable uarts by default as not all boards enable them.  Can be enabled in
  board file
* specify clock-frequency in board file as it is board specific.  of_serial
  prints an error message if it isn't specified (view with earlyprintk)
* removed previous versions Reviewed-By's and Acked-By's as this is
  significantly different from the previous version.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/boot/dts/kirkwood.dtsi          |   26 +++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/board-dreamplug.c |    2 --
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 9946d01..a5376b8 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -14,4 +14,11 @@
 	chosen {
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
+
+	ocp@f1000000 {
+		serial@12000 {
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
+	};
 };
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 702b955..825310b 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,29 @@
 
 / {
 	compatible = "mrvl,kirkwood";
-};
 
+	ocp@f1000000 {
+		compatible = "simple-bus";
+		ranges = <0 0xf1000000 0x1000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		serial@12000 {
+			compatible = "ns16550a";
+			reg = <0x12000 0x100>;
+			reg-shift = <2>;
+			interrupts = <33>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+		serial@12100 {
+			compatible = "ns16550a";
+			reg = <0x12100 0x100>;
+			reg-shift = <2>;
+			interrupts = <34>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+	};
+};
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index 3b37315..3fbfb7d 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -135,8 +135,6 @@ void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* [PATCH 5/7 v2] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-13  1:57   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dreamplug.c.

There are two uarts on the kirkwood SoC, all or none of them may be
enabled, and the clock-frequency is board-dependant.  So, enabling and
clock-frequency are left to the board dts.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v1:

* moved on-chip peripherals (uart's here) in kirkwood.dtsi and used ranges to
  simplify addressing
* disable uarts by default as not all boards enable them.  Can be enabled in
  board file
* specify clock-frequency in board file as it is board specific.  of_serial
  prints an error message if it isn't specified (view with earlyprintk)
* removed previous versions Reviewed-By's and Acked-By's as this is
  significantly different from the previous version.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/boot/dts/kirkwood.dtsi          |   26 +++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/board-dreamplug.c |    2 --
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 9946d01..a5376b8 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -14,4 +14,11 @@
 	chosen {
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
+
+	ocp at f1000000 {
+		serial at 12000 {
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
+	};
 };
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 702b955..825310b 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,29 @@
 
 / {
 	compatible = "mrvl,kirkwood";
-};
 
+	ocp at f1000000 {
+		compatible = "simple-bus";
+		ranges = <0 0xf1000000 0x1000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		serial at 12000 {
+			compatible = "ns16550a";
+			reg = <0x12000 0x100>;
+			reg-shift = <2>;
+			interrupts = <33>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+		serial at 12100 {
+			compatible = "ns16550a";
+			reg = <0x12100 0x100>;
+			reg-shift = <2>;
+			interrupts = <34>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+	};
+};
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index 3b37315..3fbfb7d 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -135,8 +135,6 @@ void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings
  2012-03-13  1:57     ` Jason Cooper
@ 2012-03-13  1:57   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 drivers/rtc/rtc-mv.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..0dd8421 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "mrvl,orion-rtc", },
+	{}
+};
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings
@ 2012-03-13  1:57   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 drivers/rtc/rtc-mv.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..0dd8421 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "mrvl,orion-rtc", },
+	{}
+};
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
  2012-03-13  1:57     ` Jason Cooper
@ 2012-03-13  1:57   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 825310b..3474ef8 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -26,5 +26,11 @@
 			/* set clock-frequency in board dts */
 			status = "disabled";
 		};
+
+		rtc@10300 {
+			compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
+			reg = <0x10300 0x20>;
+			interrupts = <53>;
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index ce008f2..0819240 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -43,7 +43,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index ae90f60..ef45244 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 194daa9..d7063eb 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -57,7 +57,6 @@ void dreamplug_init(void);
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-- 
1.7.3.4

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

* [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
@ 2012-03-13  1:57   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 825310b..3474ef8 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -26,5 +26,11 @@
 			/* set clock-frequency in board dts */
 			status = "disabled";
 		};
+
+		rtc at 10300 {
+			compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
+			reg = <0x10300 0x20>;
+			interrupts = <53>;
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index ce008f2..0819240 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -43,7 +43,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index ae90f60..ef45244 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -162,7 +162,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 194daa9..d7063eb 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -57,7 +57,6 @@ void dreamplug_init(void);
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-- 
1.7.3.4

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

* Re: [PATCH 3/7 v2] ARM: orion: wdt: use resource vice direct access
  2012-03-13  1:57       ` Jason Cooper
@ 2012-03-13  9:54         ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13  9:54 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre, andrew, jm, grant.likely, michael, olof,
	devicetree-discuss, linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* [PATCH 3/7 v2] ARM: orion: wdt: use resource vice direct access
@ 2012-03-13  9:54         ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13  9:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings
  2012-03-13  1:57   ` Jason Cooper
@ 2012-03-13  9:57       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13  9:57 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tuesday 13 March 2012, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> ---
>  drivers/rtc/rtc-mv.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)

Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

It would be nice to have a small patch description here, saying that
this device is trivial to convert to device tree by just adding the
match table.

	Arnd

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

* [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings
@ 2012-03-13  9:57       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13  9:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  drivers/rtc/rtc-mv.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)

Acked-by: Arnd Bergmann <arnd@arndb.de>

It would be nice to have a small patch description here, saying that
this device is trivial to convert to device tree by just adding the
match table.

	Arnd

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

* Re: [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
  2012-03-13  1:57   ` Jason Cooper
@ 2012-03-13  9:58     ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13  9:58 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre, andrew, jm, grant.likely, michael, olof,
	devicetree-discuss, linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  4 files changed, 7 insertions(+), 3 deletions(-)
> 

Acked-by: Arnd Bergmann <arnd@arndb.de>

I think you can just merge this with patch 6, as they are two halves
of the same work.

	Arnd

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

* [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
@ 2012-03-13  9:58     ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13  9:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
>  arch/arm/mach-kirkwood/board-dt.c |    1 -
>  arch/arm/mach-kirkwood/common.c   |    2 +-
>  arch/arm/mach-kirkwood/common.h   |    1 -
>  4 files changed, 7 insertions(+), 3 deletions(-)
> 

Acked-by: Arnd Bergmann <arnd@arndb.de>

I think you can just merge this with patch 6, as they are two halves
of the same work.

	Arnd

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

* Re: [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings
  2012-03-13  1:57   ` Jason Cooper
@ 2012-03-13 10:03       ` Uwe Kleine-König
  -1 siblings, 0 replies; 272+ messages in thread
From: Uwe Kleine-König @ 2012-03-13 10:03 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Mar 13, 2012 at 01:57:48AM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> ---
>  drivers/rtc/rtc-mv.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 768e2ed..0dd8421 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -12,6 +12,7 @@
>  #include <linux/bcd.h>
>  #include <linux/io.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/delay.h>
>  #include <linux/gfp.h>
>  #include <linux/module.h>
> @@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id rtc_mv_of_match_table[] = {
> +	{ .compatible = "mrvl,orion-rtc", },
> +	{}
> +};
> +#endif
I guess it's a matter of taste, but you could use __maybe_unused instead
of #ifdef .. #endif.

Best regards
Uwe

> +
>  static struct platform_driver mv_rtc_driver = {
>  	.remove		= __exit_p(mv_rtc_remove),
>  	.driver		= {
>  		.name	= "rtc-mv",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
>  	},
>  };
>  
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings
@ 2012-03-13 10:03       ` Uwe Kleine-König
  0 siblings, 0 replies; 272+ messages in thread
From: Uwe Kleine-König @ 2012-03-13 10:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 13, 2012 at 01:57:48AM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  drivers/rtc/rtc-mv.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index 768e2ed..0dd8421 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -12,6 +12,7 @@
>  #include <linux/bcd.h>
>  #include <linux/io.h>
>  #include <linux/platform_device.h>
> +#include <linux/of.h>
>  #include <linux/delay.h>
>  #include <linux/gfp.h>
>  #include <linux/module.h>
> @@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_OF
> +static struct of_device_id rtc_mv_of_match_table[] = {
> +	{ .compatible = "mrvl,orion-rtc", },
> +	{}
> +};
> +#endif
I guess it's a matter of taste, but you could use __maybe_unused instead
of #ifdef .. #endif.

Best regards
Uwe

> +
>  static struct platform_driver mv_rtc_driver = {
>  	.remove		= __exit_p(mv_rtc_remove),
>  	.driver		= {
>  		.name	= "rtc-mv",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
>  	},
>  };
>  
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
  2012-03-13  1:57       ` Jason Cooper
@ 2012-03-13 10:10           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13 10:10 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tuesday 13 March 2012, Jason Cooper wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
> 
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support.  First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
> 
> Driver porting will start with the uart (see next patch), and progress
> from there.  Next, all drivers not needing common clock (kirkwood_tclk)
> or pinmux.  Then, remain drivers as that support hits the tree.
> 
> We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
> convert drivers, we can remove the platform call, eg
> kirkwood_rtc_init().  This maintains compatibility with non-fdt
> configurations because they still call kirkwood_init() in common.c.
> 
> As drivers are converted, we will reinstate the 'static' qualifier in
> common.c.
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>

Patches 4 and 5 both look ok, but since I merged the earlier versions
of these into the stable next/board branch of arm-soc.git, you will have
to generate these as incremental patches now, and adapt the changeset
comments accordingly.

One small issue:

> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -44,6 +44,20 @@ config MACH_GURUPLUG
>  	  Say 'Y' here if you want your kernel to support the
>  	  Marvell GuruPlug Reference Board.
>  
> +config ARCH_KIRKWOOD_DT
> +	bool "Marvell Kirkwood Flattened Device Tree"
> +	select USE_OF
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Marvell Kirkwood using flattened device tree.
> +
> +config MACH_DREAMPLUG_DT
> +	bool "Marvell DreamPlug (Flattened Device Tree)"
> +	select ARCH_KIRKWOOD_DT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Marvell DreamPlug (Flattened Device Tree).
> +

You allow ARCH_KIRKWOOD_DT to be enabled without also enabling
dreamplug. That is ok, but

> +
> +	if (of_machine_is_compatible("globalscale,dreamplug"))
> +		dreamplug_init();
> +

you call a function from dreamplug.o in board-dt.o and

> +/* board init functions for drivers not converted to fdt */
> +void dreamplug_init(void);

you have an unconditional forward declaration in the header.

The idiomatic way to deal with this is to replace turn the
declaration into

#ifdef CONFIG_DREAMPLUG_DT
void dreamplug_init(void);
#else
static inline void dreamplug_init(void) {}
#endif

	Arnd

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

* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
@ 2012-03-13 10:10           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
> 
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support.  First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
> 
> Driver porting will start with the uart (see next patch), and progress
> from there.  Next, all drivers not needing common clock (kirkwood_tclk)
> or pinmux.  Then, remain drivers as that support hits the tree.
> 
> We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
> convert drivers, we can remove the platform call, eg
> kirkwood_rtc_init().  This maintains compatibility with non-fdt
> configurations because they still call kirkwood_init() in common.c.
> 
> As drivers are converted, we will reinstate the 'static' qualifier in
> common.c.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

Patches 4 and 5 both look ok, but since I merged the earlier versions
of these into the stable next/board branch of arm-soc.git, you will have
to generate these as incremental patches now, and adapt the changeset
comments accordingly.

One small issue:

> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -44,6 +44,20 @@ config MACH_GURUPLUG
>  	  Say 'Y' here if you want your kernel to support the
>  	  Marvell GuruPlug Reference Board.
>  
> +config ARCH_KIRKWOOD_DT
> +	bool "Marvell Kirkwood Flattened Device Tree"
> +	select USE_OF
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Marvell Kirkwood using flattened device tree.
> +
> +config MACH_DREAMPLUG_DT
> +	bool "Marvell DreamPlug (Flattened Device Tree)"
> +	select ARCH_KIRKWOOD_DT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Marvell DreamPlug (Flattened Device Tree).
> +

You allow ARCH_KIRKWOOD_DT to be enabled without also enabling
dreamplug. That is ok, but

> +
> +	if (of_machine_is_compatible("globalscale,dreamplug"))
> +		dreamplug_init();
> +

you call a function from dreamplug.o in board-dt.o and

> +/* board init functions for drivers not converted to fdt */
> +void dreamplug_init(void);

you have an unconditional forward declaration in the header.

The idiomatic way to deal with this is to replace turn the
declaration into

#ifdef CONFIG_DREAMPLUG_DT
void dreamplug_init(void);
#else
static inline void dreamplug_init(void) {}
#endif

	Arnd

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

* Re: [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
  2012-03-13 10:10           ` Arnd Bergmann
@ 2012-03-13 13:12               ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13 13:12 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Mar 13, 2012 at 10:10:42AM +0000, Arnd Bergmann wrote:
> On Tuesday 13 March 2012, Jason Cooper wrote:
> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> > Then, switched to SPI based NOR flash.
> > 
> > After talking to Arnd Bergman, chose an incremental approach to adding
> > devicetree support.  First, we use the dtb to tell us we are on the
> > dreamplug, then we gradually port over drivers.
> > 
> > Driver porting will start with the uart (see next patch), and progress
> > from there.  Next, all drivers not needing common clock (kirkwood_tclk)
> > or pinmux.  Then, remain drivers as that support hits the tree.
> > 
> > We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
> > convert drivers, we can remove the platform call, eg
> > kirkwood_rtc_init().  This maintains compatibility with non-fdt
> > configurations because they still call kirkwood_init() in common.c.
> > 
> > As drivers are converted, we will reinstate the 'static' qualifier in
> > common.c.
> > 
> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> 
> Patches 4 and 5 both look ok, but since I merged the earlier versions
> of these into the stable next/board branch of arm-soc.git, you will have
> to generate these as incremental patches now, and adapt the changeset
> comments accordingly.

Ok.

> One small issue:
> 
> > --- a/arch/arm/mach-kirkwood/Kconfig
> > +++ b/arch/arm/mach-kirkwood/Kconfig
> > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
> >  	  Say 'Y' here if you want your kernel to support the
> >  	  Marvell GuruPlug Reference Board.
> >  
> > +config ARCH_KIRKWOOD_DT
> > +	bool "Marvell Kirkwood Flattened Device Tree"
> > +	select USE_OF
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Marvell Kirkwood using flattened device tree.
> > +
> > +config MACH_DREAMPLUG_DT
> > +	bool "Marvell DreamPlug (Flattened Device Tree)"
> > +	select ARCH_KIRKWOOD_DT
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Marvell DreamPlug (Flattened Device Tree).
> > +
> 
> You allow ARCH_KIRKWOOD_DT to be enabled without also enabling
> dreamplug. That is ok, but
> 
> > +
> > +	if (of_machine_is_compatible("globalscale,dreamplug"))
> > +		dreamplug_init();
> > +
> 
> you call a function from dreamplug.o in board-dt.o and
> 
> > +/* board init functions for drivers not converted to fdt */
> > +void dreamplug_init(void);
> 
> you have an unconditional forward declaration in the header.
> 
> The idiomatic way to deal with this is to replace turn the
> declaration into
> 
> #ifdef CONFIG_DREAMPLUG_DT
> void dreamplug_init(void);
> #else
> static inline void dreamplug_init(void) {}
> #endif

Will do, thanks.

Jason.

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

* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
@ 2012-03-13 13:12               ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13 13:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 13, 2012 at 10:10:42AM +0000, Arnd Bergmann wrote:
> On Tuesday 13 March 2012, Jason Cooper wrote:
> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> > Then, switched to SPI based NOR flash.
> > 
> > After talking to Arnd Bergman, chose an incremental approach to adding
> > devicetree support.  First, we use the dtb to tell us we are on the
> > dreamplug, then we gradually port over drivers.
> > 
> > Driver porting will start with the uart (see next patch), and progress
> > from there.  Next, all drivers not needing common clock (kirkwood_tclk)
> > or pinmux.  Then, remain drivers as that support hits the tree.
> > 
> > We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
> > convert drivers, we can remove the platform call, eg
> > kirkwood_rtc_init().  This maintains compatibility with non-fdt
> > configurations because they still call kirkwood_init() in common.c.
> > 
> > As drivers are converted, we will reinstate the 'static' qualifier in
> > common.c.
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> 
> Patches 4 and 5 both look ok, but since I merged the earlier versions
> of these into the stable next/board branch of arm-soc.git, you will have
> to generate these as incremental patches now, and adapt the changeset
> comments accordingly.

Ok.

> One small issue:
> 
> > --- a/arch/arm/mach-kirkwood/Kconfig
> > +++ b/arch/arm/mach-kirkwood/Kconfig
> > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
> >  	  Say 'Y' here if you want your kernel to support the
> >  	  Marvell GuruPlug Reference Board.
> >  
> > +config ARCH_KIRKWOOD_DT
> > +	bool "Marvell Kirkwood Flattened Device Tree"
> > +	select USE_OF
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Marvell Kirkwood using flattened device tree.
> > +
> > +config MACH_DREAMPLUG_DT
> > +	bool "Marvell DreamPlug (Flattened Device Tree)"
> > +	select ARCH_KIRKWOOD_DT
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Marvell DreamPlug (Flattened Device Tree).
> > +
> 
> You allow ARCH_KIRKWOOD_DT to be enabled without also enabling
> dreamplug. That is ok, but
> 
> > +
> > +	if (of_machine_is_compatible("globalscale,dreamplug"))
> > +		dreamplug_init();
> > +
> 
> you call a function from dreamplug.o in board-dt.o and
> 
> > +/* board init functions for drivers not converted to fdt */
> > +void dreamplug_init(void);
> 
> you have an unconditional forward declaration in the header.
> 
> The idiomatic way to deal with this is to replace turn the
> declaration into
> 
> #ifdef CONFIG_DREAMPLUG_DT
> void dreamplug_init(void);
> #else
> static inline void dreamplug_init(void) {}
> #endif

Will do, thanks.

Jason.

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

* Re: [PATCH 5/7 v2] ARM: kirkwood: convert uart0 to devicetree.
  2012-03-13  1:57   ` Jason Cooper
@ 2012-03-13 13:18       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13 13:18 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, olof-nZhT3qVonbNeoWH0uzbU5w
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Mar 13, 2012 at 01:57:47AM +0000, Jason Cooper wrote:
> This uart is the primary console for the dreamplug.  Removed
> kirkwood_uart0_init() call from board-dreamplug.c.
> 
> There are two uarts on the kirkwood SoC, all or none of them may be
> enabled, and the clock-frequency is board-dependant.  So, enabling and
> clock-frequency are left to the board dts.
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> ---
> 
> Changes from v1:
> 
> * moved on-chip peripherals (uart's here) in kirkwood.dtsi and used ranges to
>   simplify addressing
> * disable uarts by default as not all boards enable them.  Can be enabled in
>   board file
> * specify clock-frequency in board file as it is board specific.  of_serial
>   prints an error message if it isn't specified (view with earlyprintk)
> * removed previous versions Reviewed-By's and Acked-By's as this is
>   significantly different from the previous version.
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
>  arch/arm/boot/dts/kirkwood.dtsi          |   26 +++++++++++++++++++++++++-
>  arch/arm/mach-kirkwood/board-dreamplug.c |    2 --
>  3 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> index 9946d01..a5376b8 100644
> --- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -14,4 +14,11 @@
>  	chosen {
>  		bootargs = "console=ttyS0,115200n8 earlyprintk";
>  	};
> +
> +	ocp@f1000000 {
> +		serial@12000 {
> +			clock-frequency = <200000000>;
> +			status = "ok";
> +		};
> +	};

While this works on my board (I see console messages without
earlyprintk), I get the following:

Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 0) is a 16550A

Obviously, the interrupt should be 33.  Is this a bug?  Or, do I need to
re-specify all of the attributes when enabling a driver which was
/included/?

This could be an artifact of interrupt-controller not being defined in
the dt, yet.  I'll dig into it more.

thx,

Jason.

>  };
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 702b955..825310b 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,29 @@
>  
>  / {
>  	compatible = "mrvl,kirkwood";
> -};
>  
> +	ocp@f1000000 {
> +		compatible = "simple-bus";
> +		ranges = <0 0xf1000000 0x1000000>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +
> +		serial@12000 {
> +			compatible = "ns16550a";
> +			reg = <0x12000 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <33>;
> +			/* set clock-frequency in board dts */
> +			status = "disabled";
> +		};
> +
> +		serial@12100 {
> +			compatible = "ns16550a";
> +			reg = <0x12100 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <34>;
> +			/* set clock-frequency in board dts */
> +			status = "disabled";
> +		};
> +	};
> +};
> diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
> index 3b37315..3fbfb7d 100644
> --- a/arch/arm/mach-kirkwood/board-dreamplug.c
> +++ b/arch/arm/mach-kirkwood/board-dreamplug.c
> @@ -135,8 +135,6 @@ void __init dreamplug_init(void)
>  	 */
>  	kirkwood_mpp_conf(dreamplug_mpp_config);
>  
> -	kirkwood_uart0_init();
> -
>  	spi_register_board_info(dreamplug_spi_slave_info,
>  				ARRAY_SIZE(dreamplug_spi_slave_info));
>  	kirkwood_spi_init();
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 5/7 v2] ARM: kirkwood: convert uart0 to devicetree.
@ 2012-03-13 13:18       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13 13:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 13, 2012 at 01:57:47AM +0000, Jason Cooper wrote:
> This uart is the primary console for the dreamplug.  Removed
> kirkwood_uart0_init() call from board-dreamplug.c.
> 
> There are two uarts on the kirkwood SoC, all or none of them may be
> enabled, and the clock-frequency is board-dependant.  So, enabling and
> clock-frequency are left to the board dts.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> 
> Changes from v1:
> 
> * moved on-chip peripherals (uart's here) in kirkwood.dtsi and used ranges to
>   simplify addressing
> * disable uarts by default as not all boards enable them.  Can be enabled in
>   board file
> * specify clock-frequency in board file as it is board specific.  of_serial
>   prints an error message if it isn't specified (view with earlyprintk)
> * removed previous versions Reviewed-By's and Acked-By's as this is
>   significantly different from the previous version.
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
>  arch/arm/boot/dts/kirkwood.dtsi          |   26 +++++++++++++++++++++++++-
>  arch/arm/mach-kirkwood/board-dreamplug.c |    2 --
>  3 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> index 9946d01..a5376b8 100644
> --- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -14,4 +14,11 @@
>  	chosen {
>  		bootargs = "console=ttyS0,115200n8 earlyprintk";
>  	};
> +
> +	ocp at f1000000 {
> +		serial at 12000 {
> +			clock-frequency = <200000000>;
> +			status = "ok";
> +		};
> +	};

While this works on my board (I see console messages without
earlyprintk), I get the following:

Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 0) is a 16550A

Obviously, the interrupt should be 33.  Is this a bug?  Or, do I need to
re-specify all of the attributes when enabling a driver which was
/included/?

This could be an artifact of interrupt-controller not being defined in
the dt, yet.  I'll dig into it more.

thx,

Jason.

>  };
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 702b955..825310b 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -2,5 +2,29 @@
>  
>  / {
>  	compatible = "mrvl,kirkwood";
> -};
>  
> +	ocp at f1000000 {
> +		compatible = "simple-bus";
> +		ranges = <0 0xf1000000 0x1000000>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +
> +		serial at 12000 {
> +			compatible = "ns16550a";
> +			reg = <0x12000 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <33>;
> +			/* set clock-frequency in board dts */
> +			status = "disabled";
> +		};
> +
> +		serial at 12100 {
> +			compatible = "ns16550a";
> +			reg = <0x12100 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <34>;
> +			/* set clock-frequency in board dts */
> +			status = "disabled";
> +		};
> +	};
> +};
> diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
> index 3b37315..3fbfb7d 100644
> --- a/arch/arm/mach-kirkwood/board-dreamplug.c
> +++ b/arch/arm/mach-kirkwood/board-dreamplug.c
> @@ -135,8 +135,6 @@ void __init dreamplug_init(void)
>  	 */
>  	kirkwood_mpp_conf(dreamplug_mpp_config);
>  
> -	kirkwood_uart0_init();
> -
>  	spi_register_board_info(dreamplug_spi_slave_info,
>  				ARRAY_SIZE(dreamplug_spi_slave_info));
>  	kirkwood_spi_init();
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
  2012-03-13  9:58     ` Arnd Bergmann
@ 2012-03-13 13:22         ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13 13:22 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Mar 13, 2012 at 09:58:30AM +0000, Arnd Bergmann wrote:
> On Tuesday 13 March 2012, Jason Cooper wrote:
> > 
> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> > ---
> >  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
> >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> >  arch/arm/mach-kirkwood/common.c   |    2 +-
> >  arch/arm/mach-kirkwood/common.h   |    1 -
> >  4 files changed, 7 insertions(+), 3 deletions(-)
> > 
> 
> Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
> 
> I think you can just merge this with patch 6, as they are two halves
> of the same work.

Others working on kirkwood and dt asked me to separate the two to
facilitate integrating with their existing work.  I can undo if you
think it's best.

thx,

Jason.

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

* [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
@ 2012-03-13 13:22         ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-13 13:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 13, 2012 at 09:58:30AM +0000, Arnd Bergmann wrote:
> On Tuesday 13 March 2012, Jason Cooper wrote:
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > ---
> >  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
> >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> >  arch/arm/mach-kirkwood/common.c   |    2 +-
> >  arch/arm/mach-kirkwood/common.h   |    1 -
> >  4 files changed, 7 insertions(+), 3 deletions(-)
> > 
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> I think you can just merge this with patch 6, as they are two halves
> of the same work.

Others working on kirkwood and dt asked me to separate the two to
facilitate integrating with their existing work.  I can undo if you
think it's best.

thx,

Jason.

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

* Re: [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
  2012-03-13 13:22         ` Jason Cooper
@ 2012-03-13 13:44           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13 13:44 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre, andrew, jm, grant.likely, michael, olof,
	devicetree-discuss, linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> On Tue, Mar 13, 2012 at 09:58:30AM +0000, Arnd Bergmann wrote:
> > On Tuesday 13 March 2012, Jason Cooper wrote:
> > > 
> > > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > > ---
> > >  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
> > >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> > >  arch/arm/mach-kirkwood/common.c   |    2 +-
> > >  arch/arm/mach-kirkwood/common.h   |    1 -
> > >  4 files changed, 7 insertions(+), 3 deletions(-)
> > > 
> > 
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > 
> > I think you can just merge this with patch 6, as they are two halves
> > of the same work.
> 
> Others working on kirkwood and dt asked me to separate the two to
> facilitate integrating with their existing work.  I can undo if you
> think it's best.

No, just ignore my comment in that case. If it helps anyone to
split the patches, it's definitely ok to do so, I just didn't
see any reason why you would.

	Arnd

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

* [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
@ 2012-03-13 13:44           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-13 13:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 13 March 2012, Jason Cooper wrote:
> On Tue, Mar 13, 2012 at 09:58:30AM +0000, Arnd Bergmann wrote:
> > On Tuesday 13 March 2012, Jason Cooper wrote:
> > > 
> > > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > > ---
> > >  arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
> > >  arch/arm/mach-kirkwood/board-dt.c |    1 -
> > >  arch/arm/mach-kirkwood/common.c   |    2 +-
> > >  arch/arm/mach-kirkwood/common.h   |    1 -
> > >  4 files changed, 7 insertions(+), 3 deletions(-)
> > > 
> > 
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > 
> > I think you can just merge this with patch 6, as they are two halves
> > of the same work.
> 
> Others working on kirkwood and dt asked me to separate the two to
> facilitate integrating with their existing work.  I can undo if you
> think it's best.

No, just ignore my comment in that case. If it helps anyone to
split the patches, it's definitely ok to do so, I just didn't
see any reason why you would.

	Arnd

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

* [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
  2012-03-01 18:20 ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

This series continues the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first three patches are code cleanup from Andrew Lunn and myself.

The next three patches are cleanup and prep to facilitate adding new boards
during the transition to devicetree.

The next patch moves the uarts into the bus for all kirkwood boards and leaves
enabling them and specifying clock-frequency up to the board file.

The rest of the series is the initial conversion of rtc-mv to devicetree since
it  doesn't use tclk or pinmux.  These should be safe to merge as they won't
interfere with the clk/clkdev work Andrew Lunn is working on.

Overall changes since v4:

	- rebased off of arm-soc/next/boards
	- protected dreamplug_init() in common.h
	- corrected authorship of orion-wdt resource patch to me.

Overall changes since v3:

	- squashed several fixup patches into the series (use mrvl, use
	  inclusive address sizes)
	- applied Arnd's suggestion for serial ports in kirkwood.dtsi, added my
	  idea of defining serial clock in dts.
	- moved dreamplug_init() out of board-dt.c (into board-dreamplug.c) to
	  facilitate the orderly arrival of new boards with fdt support (Jamie
	  Lentin's boards)
	- moved all non-fdt cleanups to the beginning of the series.
	- removed mv_cesa, mv_sata, and orion-ehci from this series as they
	  depend on intc/dma/clock to work properly
	- removed Ack's and Reviewed-By's on patches with significant changes
		- Grant's Ack remains on the "wdt: use resource" patch as it is
		  a reduced scope version (no fdt bindings), otherwise,
		  identical to code originally Acked.  Please let me know if
		  that's not appropriate.

Overall changes since v2:

	- added Andrew Lunn's cleanup patches
	- reshuffled to more logical order
	- wrapped all struct of_device_id[]'s in #ifdef CONFIG_OF
	- s/marvell,/mrvl,/g
	- added orion-ehci
	- added mv_sata
	- prevent clocks from gating when booting from devicetree

Drivers yet to be converted are:

	mv_cesa:    needs intc in fdt (next on list)
	mv_sata:    needs dma, intc
	orion-ehci: needs dma, intc
	orion-spi:  uses tclk
	orion-wdt:  uses tclk
	mvsdio:     uses tclk
	i2c:        uses freq_m/freq_n, not sure if that should use clk/clkdev
	mv_xor:     haven't figured out howto do shared resources/dma in fdt
	ge0/ge1:    haven't looked at it yet
	nand:       not needed for dreamplug, Jamie Lentin is working on it

Please be aware that this is a complete reshuffle of the whole series and is
based purely against arm-soc/next/boards.

Interested folks can pull from:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_for_3.4_v3

Andrew Lunn (2):
  ARM: orion: spi: remove enable_clock_fix which is not used
  ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.

Jason Cooper (7):
  ARM: orion: wdt: use resource vice direct access
  ARM: kirkwood: fdt: use mrvl ticker symbol
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: fdt: facilitate new boards during fdt migration
  ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0
  ARM: kirkwood: rtc-mv devicetree bindings
  ARM: kirkwood: use devicetree for rtc-mv

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   13 +--
 arch/arm/boot/dts/kirkwood.dtsi          |   34 ++++++-
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  152 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |  151 +++++-------------------------
 arch/arm/mach-kirkwood/common.c          |   11 +-
 arch/arm/mach-kirkwood/common.h          |   15 +++
 arch/arm/plat-orion/common.c             |    7 +-
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 drivers/rtc/rtc-mv.c                     |    9 ++
 drivers/spi/spi-orion.c                  |    5 -
 drivers/watchdog/orion_wdt.c             |   24 +++--
 include/linux/spi/orion_spi.h            |    1 -
 13 files changed, 264 insertions(+), 160 deletions(-)
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c

-- 
1.7.3.4

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

* [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

This series continues the process of converting all of the drivers initialized
from kirkwood_init() to devicetree.

The first three patches are code cleanup from Andrew Lunn and myself.

The next three patches are cleanup and prep to facilitate adding new boards
during the transition to devicetree.

The next patch moves the uarts into the bus for all kirkwood boards and leaves
enabling them and specifying clock-frequency up to the board file.

The rest of the series is the initial conversion of rtc-mv to devicetree since
it  doesn't use tclk or pinmux.  These should be safe to merge as they won't
interfere with the clk/clkdev work Andrew Lunn is working on.

Overall changes since v4:

	- rebased off of arm-soc/next/boards
	- protected dreamplug_init() in common.h
	- corrected authorship of orion-wdt resource patch to me.

Overall changes since v3:

	- squashed several fixup patches into the series (use mrvl, use
	  inclusive address sizes)
	- applied Arnd's suggestion for serial ports in kirkwood.dtsi, added my
	  idea of defining serial clock in dts.
	- moved dreamplug_init() out of board-dt.c (into board-dreamplug.c) to
	  facilitate the orderly arrival of new boards with fdt support (Jamie
	  Lentin's boards)
	- moved all non-fdt cleanups to the beginning of the series.
	- removed mv_cesa, mv_sata, and orion-ehci from this series as they
	  depend on intc/dma/clock to work properly
	- removed Ack's and Reviewed-By's on patches with significant changes
		- Grant's Ack remains on the "wdt: use resource" patch as it is
		  a reduced scope version (no fdt bindings), otherwise,
		  identical to code originally Acked.  Please let me know if
		  that's not appropriate.

Overall changes since v2:

	- added Andrew Lunn's cleanup patches
	- reshuffled to more logical order
	- wrapped all struct of_device_id[]'s in #ifdef CONFIG_OF
	- s/marvell,/mrvl,/g
	- added orion-ehci
	- added mv_sata
	- prevent clocks from gating when booting from devicetree

Drivers yet to be converted are:

	mv_cesa:    needs intc in fdt (next on list)
	mv_sata:    needs dma, intc
	orion-ehci: needs dma, intc
	orion-spi:  uses tclk
	orion-wdt:  uses tclk
	mvsdio:     uses tclk
	i2c:        uses freq_m/freq_n, not sure if that should use clk/clkdev
	mv_xor:     haven't figured out howto do shared resources/dma in fdt
	ge0/ge1:    haven't looked at it yet
	nand:       not needed for dreamplug, Jamie Lentin is working on it

Please be aware that this is a complete reshuffle of the whole series and is
based purely against arm-soc/next/boards.

Interested folks can pull from:

git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_for_3.4_v3

Andrew Lunn (2):
  ARM: orion: spi: remove enable_clock_fix which is not used
  ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.

Jason Cooper (7):
  ARM: orion: wdt: use resource vice direct access
  ARM: kirkwood: fdt: use mrvl ticker symbol
  ARM: kirkwood: fdt: absorb kirkwood_init()
  ARM: kirkwood: fdt: facilitate new boards during fdt migration
  ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0
  ARM: kirkwood: rtc-mv devicetree bindings
  ARM: kirkwood: use devicetree for rtc-mv

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   13 +--
 arch/arm/boot/dts/kirkwood.dtsi          |   34 ++++++-
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  152 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |  151 +++++-------------------------
 arch/arm/mach-kirkwood/common.c          |   11 +-
 arch/arm/mach-kirkwood/common.h          |   15 +++
 arch/arm/plat-orion/common.c             |    7 +-
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 drivers/rtc/rtc-mv.c                     |    9 ++
 drivers/spi/spi-orion.c                  |    5 -
 drivers/watchdog/orion_wdt.c             |   24 +++--
 include/linux/spi/orion_spi.h            |    1 -
 13 files changed, 264 insertions(+), 160 deletions(-)
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c

-- 
1.7.3.4

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

* [PATCH 1/9] ARM: orion: spi: remove enable_clock_fix which is not used
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21       ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, olof-nZhT3qVonbNeoWH0uzbU5w
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	Jason Cooper, jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>

Signed-off-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
 drivers/spi/spi-orion.c       |    5 -----
 include/linux/spi/orion_spi.h |    1 -
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..e496f79 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
-		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
-				  (1 << 14));
-
 	if ((spi->max_speed_hz == 0)
 			|| (spi->max_speed_hz > orion_spi->max_speed))
 		spi->max_speed_hz = orion_spi->max_speed;
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
index decf6d8..b4d9fa6 100644
--- a/include/linux/spi/orion_spi.h
+++ b/include/linux/spi/orion_spi.h
@@ -11,7 +11,6 @@
 
 struct orion_spi_info {
 	u32	tclk;		/* no <linux/clk.h> support yet */
-	u32	enable_clock_fix;
 };
 
 
-- 
1.7.3.4

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

* [PATCH 1/9] ARM: orion: spi: remove enable_clock_fix which is not used
@ 2012-03-16  4:21       ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/spi/spi-orion.c       |    5 -----
 include/linux/spi/orion_spi.h |    1 -
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 13448c8..e496f79 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi)
 
 	orion_spi = spi_master_get_devdata(spi->master);
 
-	/* Fix ac timing if required.   */
-	if (orion_spi->spi_info->enable_clock_fix)
-		orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG,
-				  (1 << 14));
-
 	if ((spi->max_speed_hz == 0)
 			|| (spi->max_speed_hz > orion_spi->max_speed))
 		spi->max_speed_hz = orion_spi->max_speed;
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h
index decf6d8..b4d9fa6 100644
--- a/include/linux/spi/orion_spi.h
+++ b/include/linux/spi/orion_spi.h
@@ -11,7 +11,6 @@
 
 struct orion_spi_info {
 	u32	tclk;		/* no <linux/clk.h> support yet */
-	u32	enable_clock_fix;
 };
 
 
-- 
1.7.3.4

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

* [PATCH 2/9] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

It is not used anywhere in the sound driver.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c          |    1 -
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 77d4852..79a9fe7 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -450,7 +450,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h
index 885f8ab..d6a55bd 100644
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ b/arch/arm/plat-orion/include/plat/audio.h
@@ -2,7 +2,6 @@
 #define __PLAT_AUDIO_H
 
 struct kirkwood_asoc_platform_data {
-	u32 tclk;
 	int burst;
 };
 #endif
-- 
1.7.3.4

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

* [PATCH 2/9] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

It is not used anywhere in the sound driver.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/common.c          |    1 -
 arch/arm/plat-orion/include/plat/audio.h |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 77d4852..79a9fe7 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -450,7 +450,6 @@ void __init kirkwood_init(void)
 {
 	printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
 		kirkwood_id(), kirkwood_tclk);
-	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h
index 885f8ab..d6a55bd 100644
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ b/arch/arm/plat-orion/include/plat/audio.h
@@ -2,7 +2,6 @@
 #define __PLAT_AUDIO_H
 
 struct kirkwood_asoc_platform_data {
-	u32 tclk;
 	int burst;
 };
 #endif
-- 
1.7.3.4

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

* [PATCH 3/9 v3] ARM: orion: wdt: use resource vice direct access
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---

Changes from v2:

    - Corrected authorship to myself.  The author was inadvertently changed to
      Andrew Lunn with a wayward 'commit --amend' during a 'rebase -i' to split
      the wdt patch.  Andrew brought it to my attention.  Thanks, Andrew!

Notes from v2:
Note: This code is the exact same as that originally Acked by Grant.  I've
simply removed the fdt bindings, as I need to hold off until common clock is
added.  If it's not appropriate to retain his Ack here, please let me know.

 arch/arm/plat-orion/common.c |    7 ++++++-
 drivers/watchdog/orion_wdt.c |   24 +++++++++++++++---------
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 089899a..74daf5e 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -21,6 +21,7 @@
 #include <plat/orion_wdt.h>
 #include <plat/mv_xor.h>
 #include <plat/ehci-orion.h>
+#include <mach/bridge-regs.h>
 
 /* Fill in the resources structure and link it into the platform
    device structure. There is always a memory region, and nearly
@@ -568,13 +569,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
  ****************************************************************************/
 static struct orion_wdt_platform_data orion_wdt_data;
 
+static struct resource orion_wdt_resource =
+		DEFINE_RES_MEM(TIMER_VIRT_BASE, 0x28);
+
 static struct platform_device orion_wdt_device = {
 	.name		= "orion_wdt",
 	.id		= -1,
 	.dev		= {
 		.platform_data	= &orion_wdt_data,
 	},
-	.num_resources	= 0,
+	.resource	= &orion_wdt_resource,
+	.num_resources	= 1,
 };
 
 void __init orion_wdt_init(unsigned long tclk)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..1368e4c 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -28,9 +28,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +40,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static void __iomem *wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +49,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +61,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +69,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +93,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +103,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,6 +237,7 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct resource *res;
 	int ret;
 
 	if (pdata) {
@@ -245,6 +247,10 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	wdt_reg = ioremap(res->start, resource_size(res));
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
-- 
1.7.3.4

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

* [PATCH 3/9 v3] ARM: orion: wdt: use resource vice direct access
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---

Changes from v2:

    - Corrected authorship to myself.  The author was inadvertently changed to
      Andrew Lunn with a wayward 'commit --amend' during a 'rebase -i' to split
      the wdt patch.  Andrew brought it to my attention.  Thanks, Andrew!

Notes from v2:
Note: This code is the exact same as that originally Acked by Grant.  I've
simply removed the fdt bindings, as I need to hold off until common clock is
added.  If it's not appropriate to retain his Ack here, please let me know.

 arch/arm/plat-orion/common.c |    7 ++++++-
 drivers/watchdog/orion_wdt.c |   24 +++++++++++++++---------
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 089899a..74daf5e 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -21,6 +21,7 @@
 #include <plat/orion_wdt.h>
 #include <plat/mv_xor.h>
 #include <plat/ehci-orion.h>
+#include <mach/bridge-regs.h>
 
 /* Fill in the resources structure and link it into the platform
    device structure. There is always a memory region, and nearly
@@ -568,13 +569,17 @@ void __init orion_spi_1_init(unsigned long mapbase,
  ****************************************************************************/
 static struct orion_wdt_platform_data orion_wdt_data;
 
+static struct resource orion_wdt_resource =
+		DEFINE_RES_MEM(TIMER_VIRT_BASE, 0x28);
+
 static struct platform_device orion_wdt_device = {
 	.name		= "orion_wdt",
 	.id		= -1,
 	.dev		= {
 		.platform_data	= &orion_wdt_data,
 	},
-	.num_resources	= 0,
+	.resource	= &orion_wdt_resource,
+	.num_resources	= 1,
 };
 
 void __init orion_wdt_init(unsigned long tclk)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 4ad78f8..1368e4c 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -28,9 +28,9 @@
 /*
  * Watchdog timer block registers.
  */
-#define TIMER_CTRL		(TIMER_VIRT_BASE + 0x0000)
+#define TIMER_CTRL		0x0000
 #define  WDT_EN			0x0010
-#define WDT_VAL			(TIMER_VIRT_BASE + 0x0024)
+#define WDT_VAL			0x0024
 
 #define WDT_MAX_CYCLE_COUNT	0xffffffff
 #define WDT_IN_USE		0
@@ -40,6 +40,7 @@ static int nowayout = WATCHDOG_NOWAYOUT;
 static int heartbeat = -1;		/* module parameter (seconds) */
 static unsigned int wdt_max_duration;	/* (seconds) */
 static unsigned int wdt_tclk;
+static void __iomem *wdt_reg;
 static unsigned long wdt_status;
 static DEFINE_SPINLOCK(wdt_lock);
 
@@ -48,7 +49,7 @@ static void orion_wdt_ping(void)
 	spin_lock(&wdt_lock);
 
 	/* Reload watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -60,7 +61,7 @@ static void orion_wdt_enable(void)
 	spin_lock(&wdt_lock);
 
 	/* Set watchdog duration */
-	writel(wdt_tclk * heartbeat, WDT_VAL);
+	writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL);
 
 	/* Clear watchdog timer interrupt */
 	reg = readl(BRIDGE_CAUSE);
@@ -68,9 +69,9 @@ static void orion_wdt_enable(void)
 	writel(reg, BRIDGE_CAUSE);
 
 	/* Enable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg |= WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	/* Enable reset on watchdog */
 	reg = readl(RSTOUTn_MASK);
@@ -92,9 +93,9 @@ static void orion_wdt_disable(void)
 	writel(reg, RSTOUTn_MASK);
 
 	/* Disable watchdog timer */
-	reg = readl(TIMER_CTRL);
+	reg = readl(wdt_reg + TIMER_CTRL);
 	reg &= ~WDT_EN;
-	writel(reg, TIMER_CTRL);
+	writel(reg, wdt_reg + TIMER_CTRL);
 
 	spin_unlock(&wdt_lock);
 }
@@ -102,7 +103,7 @@ static void orion_wdt_disable(void)
 static int orion_wdt_get_timeleft(int *time_left)
 {
 	spin_lock(&wdt_lock);
-	*time_left = readl(WDT_VAL) / wdt_tclk;
+	*time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
 	spin_unlock(&wdt_lock);
 	return 0;
 }
@@ -236,6 +237,7 @@ static struct miscdevice orion_wdt_miscdev = {
 static int __devinit orion_wdt_probe(struct platform_device *pdev)
 {
 	struct orion_wdt_platform_data *pdata = pdev->dev.platform_data;
+	struct resource *res;
 	int ret;
 
 	if (pdata) {
@@ -245,6 +247,10 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	wdt_reg = ioremap(res->start, resource_size(res));
+
 	if (orion_wdt_miscdev.parent)
 		return -EBUSY;
 	orion_wdt_miscdev.parent = &pdev->dev;
-- 
1.7.3.4

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

* [PATCH 4/9] ARM: kirkwood: fdt: use mrvl ticker symbol
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Also, use inclusive register size for uart0.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    4 ++--
 arch/arm/boot/dts/kirkwood.dtsi          |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 8a5dff8..333f11b 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Globalscale Technologies Dreamplug";
-	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
 
 	memory {
 		device_type = "memory";
@@ -17,7 +17,7 @@
 
 	serial@f1012000 {
 		compatible = "ns16550a";
-		reg = <0xf1012000 0xff>;
+		reg = <0xf1012000 0x100>;
 		reg-shift = <2>;
 		interrupts = <33>;
 		clock-frequency = <200000000>;
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..702b955 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -1,6 +1,6 @@
 /include/ "skeleton.dtsi"
 
 / {
-	compatible = "marvell,kirkwood";
+	compatible = "mrvl,kirkwood";
 };
 
-- 
1.7.3.4

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

* [PATCH 4/9] ARM: kirkwood: fdt: use mrvl ticker symbol
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

Also, use inclusive register size for uart0.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |    4 ++--
 arch/arm/boot/dts/kirkwood.dtsi          |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 8a5dff8..333f11b 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Globalscale Technologies Dreamplug";
-	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
 
 	memory {
 		device_type = "memory";
@@ -17,7 +17,7 @@
 
 	serial at f1012000 {
 		compatible = "ns16550a";
-		reg = <0xf1012000 0xff>;
+		reg = <0xf1012000 0x100>;
 		reg-shift = <2>;
 		interrupts = <33>;
 		clock-frequency = <200000000>;
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..702b955 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -1,6 +1,6 @@
 /include/ "skeleton.dtsi"
 
 / {
-	compatible = "marvell,kirkwood";
+	compatible = "mrvl,kirkwood";
 };
 
-- 
1.7.3.4

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

* [PATCH 5/9] ARM: kirkwood: fdt: absorb kirkwood_init()
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-dt.c |   29 ++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index fbe6405..9bd35ac 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -155,7 +157,32 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 79a9fe7..04a7eb9 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -279,7 +279,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -291,7 +291,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -303,7 +303,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -392,7 +392,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -435,7 +435,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 5/9] ARM: kirkwood: fdt: absorb kirkwood_init()
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

We need to absorb kirkwood_init() into kirkwood_dt_init() so that as we
convert drivers, we can remove the platform call, eg
kirkwood_rtc_init().  This maintains compatibility with non-fdt
configurations because they still call kirkwood_init() in common.c.

As drivers are converted, we will reinstate the 'static' qualifier in
common.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-dt.c |   29 ++++++++++++++++++++++++++++-
 arch/arm/mach-kirkwood/common.c   |   12 ++++++------
 arch/arm/mach-kirkwood/common.h   |    8 ++++++++
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index fbe6405..9bd35ac 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -29,7 +29,9 @@
 #include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
 #include <plat/mvsdio.h>
 #include "common.h"
 #include "mpp.h"
@@ -155,7 +157,32 @@ static void __init dreamplug_init(void)
 
 static void __init kirkwood_dt_init(void)
 {
-	kirkwood_init();
+	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
+
+	/*
+	 * Disable propagation of mbus errors to the CPU local bus,
+	 * as this causes mbus errors (which can occur for example
+	 * for PCI aborts) to throw CPU aborts, which we're not set
+	 * up to deal with.
+	 */
+	writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+
+	kirkwood_setup_cpu_mbus();
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+	kirkwood_l2_init();
+#endif
+
+	/* internal devices that every board has */
+	kirkwood_rtc_init();
+	kirkwood_wdt_init();
+	kirkwood_xor0_init();
+	kirkwood_xor1_init();
+	kirkwood_crypto_init();
+
+#ifdef CONFIG_KEXEC
+	kexec_reinit = kirkwood_enable_pcie;
+#endif
 
 	if (of_machine_is_compatible("globalscale,dreamplug"))
 		dreamplug_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 79a9fe7..04a7eb9 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-static void __init kirkwood_rtc_init(void)
+void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
@@ -279,7 +279,7 @@ void __init kirkwood_crypto_init(void)
 /*****************************************************************************
  * XOR0
  ****************************************************************************/
-static void __init kirkwood_xor0_init(void)
+void __init kirkwood_xor0_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR0;
 
@@ -291,7 +291,7 @@ static void __init kirkwood_xor0_init(void)
 /*****************************************************************************
  * XOR1
  ****************************************************************************/
-static void __init kirkwood_xor1_init(void)
+void __init kirkwood_xor1_init(void)
 {
 	kirkwood_clk_ctrl |= CGC_XOR1;
 
@@ -303,7 +303,7 @@ static void __init kirkwood_xor1_init(void)
 /*****************************************************************************
  * Watchdog
  ****************************************************************************/
-static void __init kirkwood_wdt_init(void)
+void __init kirkwood_wdt_init(void)
 {
 	orion_wdt_init(kirkwood_tclk);
 }
@@ -392,7 +392,7 @@ void __init kirkwood_audio_init(void)
 /*
  * Identify device ID and revision.
  */
-static char * __init kirkwood_id(void)
+char * __init kirkwood_id(void)
 {
 	u32 dev, rev;
 
@@ -435,7 +435,7 @@ static char * __init kirkwood_id(void)
 	}
 }
 
-static void __init kirkwood_l2_init(void)
+void __init kirkwood_l2_init(void)
 {
 #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
 	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9071a39..c382447 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+char *kirkwood_id(void);
+void kirkwood_l2_init(void);
+void kirkwood_rtc_init(void);
+void kirkwood_wdt_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
+void kirkwood_crypto_init(void);
+
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;
 
-- 
1.7.3.4

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

* [PATCH 6/9 v2] ARM: kirkwood: fdt: facilitate new boards during fdt migration
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Move all dreamplug-specific code out of board-dt.c and into
board-dreamplug.c.  This way new boards that are added during the
conversion to fdt don't clutter up board-dt.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v1:

    - This code was broken out into a separate patch so that it could apply
      cleanly to code already in arm-soc/next/boards
    - protected the declaration of dreamplug_init() in common.h with #ifdef on
      CONFIG_MACH_DREAMPLUG_DT

 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  152 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |  133 +--------------------------
 arch/arm/mach-kirkwood/common.h          |    8 ++
 4 files changed, 162 insertions(+), 132 deletions(-)
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c

diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index acbc5e1..e299a95 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -21,3 +21,4 @@ obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
+obj-$(CONFIG_MACH_DREAMPLUG_DT)		+= board-dreamplug.o
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
new file mode 100644
index 0000000..9854539
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dreamplug.c
+ *
+ * Marvell DreamPlug Reference Board Init for drivers not converted to
+ * flattened device tree yet.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 9bd35ac..975ad01 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -3,7 +3,7 @@
  *
  * arch/arm/mach-kirkwood/board-dt.c
  *
- * Marvell DreamPlug Reference Board Setup
+ * Flattened Device Tree board initialization
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
@@ -12,149 +12,18 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/partitions.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_fdt.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <linux/mtd/physmap.h>
-#include <linux/spi/flash.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/orion_spi.h>
-#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <mach/kirkwood.h>
 #include <mach/bridge-regs.h>
-#include <plat/mvsdio.h>
 #include "common.h"
-#include "mpp.h"
 
 static struct of_device_id kirkwood_dt_match_table[] __initdata = {
 	{ .compatible = "simple-bus", },
 	{ }
 };
 
-struct mtd_partition dreamplug_partitions[] = {
-	{
-		.name	= "u-boot",
-		.size	= SZ_512K,
-		.offset = 0,
-	},
-	{
-		.name	= "u-boot env",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K,
-	},
-	{
-		.name	= "dtb",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K + SZ_512K,
-	},
-};
-
-static const struct flash_platform_data dreamplug_spi_slave_data = {
-	.type		= "mx25l1606e",
-	.name		= "spi_flash",
-	.parts		= dreamplug_partitions,
-	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
-};
-
-static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &dreamplug_spi_slave_data,
-		.irq		= -1,
-		.max_speed_hz	= 50000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv_sata_platform_data dreamplug_sata_data = {
-	.n_ports	= 1,
-};
-
-static struct mvsdio_platform_data dreamplug_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-};
-
-static struct gpio_led dreamplug_led_pins[] = {
-	{
-		.name			= "dreamplug:blue:bluetooth",
-		.gpio			= 47,
-		.active_low		= 1,
-	},
-	{
-		.name			= "dreamplug:green:wifi",
-		.gpio			= 48,
-		.active_low		= 1,
-	},
-	{
-		.name			= "dreamplug:green:wifi_ap",
-		.gpio			= 49,
-		.active_low		= 1,
-	},
-};
-
-static struct gpio_led_platform_data dreamplug_led_data = {
-	.leds		= dreamplug_led_pins,
-	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
-};
-
-static struct platform_device dreamplug_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &dreamplug_led_data,
-	}
-};
-
-static unsigned int dreamplug_mpp_config[] __initdata = {
-	MPP0_SPI_SCn,
-	MPP1_SPI_MOSI,
-	MPP2_SPI_SCK,
-	MPP3_SPI_MISO,
-	MPP47_GPIO,	/* Bluetooth LED */
-	MPP48_GPIO,	/* Wifi LED */
-	MPP49_GPIO,	/* Wifi AP LED */
-	0
-};
-
-static void __init dreamplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_mpp_conf(dreamplug_mpp_config);
-
-	spi_register_board_info(dreamplug_spi_slave_info,
-				ARRAY_SIZE(dreamplug_spi_slave_info));
-	kirkwood_spi_init();
-
-	kirkwood_ehci_init();
-	kirkwood_ge00_init(&dreamplug_ge00_data);
-	kirkwood_ge01_init(&dreamplug_ge01_data);
-	kirkwood_sata_init(&dreamplug_sata_data);
-	kirkwood_sdio_init(&dreamplug_mvsdio_data);
-
-	platform_device_register(&dreamplug_leds);
-}
-
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..4737578 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+/* board init functions for boards not fully converted to fdt */
+#ifdef CONFIG_MACH_DREAMPLUG_DT
+void dreamplug_init(void);
+#else
+static inline void dreamplug_init(void) {};
+#endif
+
+/* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
 void kirkwood_rtc_init(void);
-- 
1.7.3.4

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

* [PATCH 6/9 v2] ARM: kirkwood: fdt: facilitate new boards during fdt migration
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

Move all dreamplug-specific code out of board-dt.c and into
board-dreamplug.c.  This way new boards that are added during the
conversion to fdt don't clutter up board-dt.c.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v1:

    - This code was broken out into a separate patch so that it could apply
      cleanly to code already in arm-soc/next/boards
    - protected the declaration of dreamplug_init() in common.h with #ifdef on
      CONFIG_MACH_DREAMPLUG_DT

 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/board-dreamplug.c |  152 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c        |  133 +--------------------------
 arch/arm/mach-kirkwood/common.h          |    8 ++
 4 files changed, 162 insertions(+), 132 deletions(-)
 create mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c

diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index acbc5e1..e299a95 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -21,3 +21,4 @@ obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
+obj-$(CONFIG_MACH_DREAMPLUG_DT)		+= board-dreamplug.o
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
new file mode 100644
index 0000000..9854539
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dreamplug.c
+ *
+ * Marvell DreamPlug Reference Board Init for drivers not converted to
+ * flattened device tree yet.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <mach/kirkwood.h>
+#include <mach/bridge-regs.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 9bd35ac..975ad01 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -3,7 +3,7 @@
  *
  * arch/arm/mach-kirkwood/board-dt.c
  *
- * Marvell DreamPlug Reference Board Setup
+ * Flattened Device Tree board initialization
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
@@ -12,149 +12,18 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/partitions.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_fdt.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <linux/mtd/physmap.h>
-#include <linux/spi/flash.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/orion_spi.h>
-#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <mach/kirkwood.h>
 #include <mach/bridge-regs.h>
-#include <plat/mvsdio.h>
 #include "common.h"
-#include "mpp.h"
 
 static struct of_device_id kirkwood_dt_match_table[] __initdata = {
 	{ .compatible = "simple-bus", },
 	{ }
 };
 
-struct mtd_partition dreamplug_partitions[] = {
-	{
-		.name	= "u-boot",
-		.size	= SZ_512K,
-		.offset = 0,
-	},
-	{
-		.name	= "u-boot env",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K,
-	},
-	{
-		.name	= "dtb",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K + SZ_512K,
-	},
-};
-
-static const struct flash_platform_data dreamplug_spi_slave_data = {
-	.type		= "mx25l1606e",
-	.name		= "spi_flash",
-	.parts		= dreamplug_partitions,
-	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
-};
-
-static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &dreamplug_spi_slave_data,
-		.irq		= -1,
-		.max_speed_hz	= 50000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv_sata_platform_data dreamplug_sata_data = {
-	.n_ports	= 1,
-};
-
-static struct mvsdio_platform_data dreamplug_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-};
-
-static struct gpio_led dreamplug_led_pins[] = {
-	{
-		.name			= "dreamplug:blue:bluetooth",
-		.gpio			= 47,
-		.active_low		= 1,
-	},
-	{
-		.name			= "dreamplug:green:wifi",
-		.gpio			= 48,
-		.active_low		= 1,
-	},
-	{
-		.name			= "dreamplug:green:wifi_ap",
-		.gpio			= 49,
-		.active_low		= 1,
-	},
-};
-
-static struct gpio_led_platform_data dreamplug_led_data = {
-	.leds		= dreamplug_led_pins,
-	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
-};
-
-static struct platform_device dreamplug_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &dreamplug_led_data,
-	}
-};
-
-static unsigned int dreamplug_mpp_config[] __initdata = {
-	MPP0_SPI_SCn,
-	MPP1_SPI_MOSI,
-	MPP2_SPI_SCK,
-	MPP3_SPI_MISO,
-	MPP47_GPIO,	/* Bluetooth LED */
-	MPP48_GPIO,	/* Wifi LED */
-	MPP49_GPIO,	/* Wifi AP LED */
-	0
-};
-
-static void __init dreamplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_mpp_conf(dreamplug_mpp_config);
-
-	spi_register_board_info(dreamplug_spi_slave_info,
-				ARRAY_SIZE(dreamplug_spi_slave_info));
-	kirkwood_spi_init();
-
-	kirkwood_ehci_init();
-	kirkwood_ge00_init(&dreamplug_ge00_data);
-	kirkwood_ge01_init(&dreamplug_ge01_data);
-	kirkwood_sata_init(&dreamplug_sata_data);
-	kirkwood_sdio_init(&dreamplug_mvsdio_data);
-
-	platform_device_register(&dreamplug_leds);
-}
-
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index c382447..4737578 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev
 void kirkwood_audio_init(void);
 void kirkwood_restart(char, const char *);
 
+/* board init functions for boards not fully converted to fdt */
+#ifdef CONFIG_MACH_DREAMPLUG_DT
+void dreamplug_init(void);
+#else
+static inline void dreamplug_init(void) {};
+#endif
+
+/* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
 void kirkwood_rtc_init(void);
-- 
1.7.3.4

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

* [PATCH 7/9] ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Define both uarts in kirkwood.dtsi as they are common to all kirkwood
SoCs.  Each board may enable all or none of them, so they are disabled
by default.  uart0 is enabled for the dreamplug.

tclk can vary for each board, so we leave it undefined in the kirkwood
dtsi.  Each board can then set it as appropriate when enabling the uart.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   11 +++++------
 arch/arm/boot/dts/kirkwood.dtsi          |   26 +++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 333f11b..a5376b8 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,11 +15,10 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
-	serial@f1012000 {
-		compatible = "ns16550a";
-		reg = <0xf1012000 0x100>;
-		reg-shift = <2>;
-		interrupts = <33>;
-		clock-frequency = <200000000>;
+	ocp@f1000000 {
+		serial@12000 {
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
 	};
 };
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 702b955..825310b 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,29 @@
 
 / {
 	compatible = "mrvl,kirkwood";
-};
 
+	ocp@f1000000 {
+		compatible = "simple-bus";
+		ranges = <0 0xf1000000 0x1000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		serial@12000 {
+			compatible = "ns16550a";
+			reg = <0x12000 0x100>;
+			reg-shift = <2>;
+			interrupts = <33>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+		serial@12100 {
+			compatible = "ns16550a";
+			reg = <0x12100 0x100>;
+			reg-shift = <2>;
+			interrupts = <34>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+	};
+};
-- 
1.7.3.4

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

* [PATCH 7/9] ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

Define both uarts in kirkwood.dtsi as they are common to all kirkwood
SoCs.  Each board may enable all or none of them, so they are disabled
by default.  uart0 is enabled for the dreamplug.

tclk can vary for each board, so we leave it undefined in the kirkwood
dtsi.  Each board can then set it as appropriate when enabling the uart.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   11 +++++------
 arch/arm/boot/dts/kirkwood.dtsi          |   26 +++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 333f11b..a5376b8 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,11 +15,10 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
-	serial at f1012000 {
-		compatible = "ns16550a";
-		reg = <0xf1012000 0x100>;
-		reg-shift = <2>;
-		interrupts = <33>;
-		clock-frequency = <200000000>;
+	ocp at f1000000 {
+		serial at 12000 {
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
 	};
 };
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 702b955..825310b 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,29 @@
 
 / {
 	compatible = "mrvl,kirkwood";
-};
 
+	ocp at f1000000 {
+		compatible = "simple-bus";
+		ranges = <0 0xf1000000 0x1000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		serial at 12000 {
+			compatible = "ns16550a";
+			reg = <0x12000 0x100>;
+			reg-shift = <2>;
+			interrupts = <33>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+		serial at 12100 {
+			compatible = "ns16550a";
+			reg = <0x12100 0x100>;
+			reg-shift = <2>;
+			interrupts = <34>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+	};
+};
-- 
1.7.3.4

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

* [PATCH 8/9 v2] ARM: kirkwood: rtc-mv devicetree bindings
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Trivial conversion to devicetree.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v1:

    - added 'trivial conversion' patch description.

 drivers/rtc/rtc-mv.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..0dd8421 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "mrvl,orion-rtc", },
+	{}
+};
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 8/9 v2] ARM: kirkwood: rtc-mv devicetree bindings
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

Trivial conversion to devicetree.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---

Changes from v1:

    - added 'trivial conversion' patch description.

 drivers/rtc/rtc-mv.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
index 768e2ed..0dd8421 100644
--- a/drivers/rtc/rtc-mv.c
+++ b/drivers/rtc/rtc-mv.c
@@ -12,6 +12,7 @@
 #include <linux/bcd.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id rtc_mv_of_match_table[] = {
+	{ .compatible = "mrvl,orion-rtc", },
+	{}
+};
+#endif
+
 static struct platform_driver mv_rtc_driver = {
 	.remove		= __exit_p(mv_rtc_remove),
 	.driver		= {
 		.name	= "rtc-mv",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(rtc_mv_of_match_table),
 	},
 };
 
-- 
1.7.3.4

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

* [PATCH 9/9] ARM: kirkwood: use devicetree for rtc-mv
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16  4:21   ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: arnd, olof
  Cc: nicolas.pitre, andrew, Jason Cooper, jm, grant.likely, michael,
	devicetree-discuss, linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 825310b..3474ef8 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -26,5 +26,11 @@
 			/* set clock-frequency in board dts */
 			status = "disabled";
 		};
+
+		rtc@10300 {
+			compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
+			reg = <0x10300 0x20>;
+			interrupts = <53>;
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 975ad01..1c672d9 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -43,7 +43,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 04a7eb9..a02cae8 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 4737578..fa8e768 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -61,7 +61,6 @@ static inline void dreamplug_init(void) {};
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-- 
1.7.3.4

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

* [PATCH 9/9] ARM: kirkwood: use devicetree for rtc-mv
@ 2012-03-16  4:21   ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    6 ++++++
 arch/arm/mach-kirkwood/board-dt.c |    1 -
 arch/arm/mach-kirkwood/common.c   |    2 +-
 arch/arm/mach-kirkwood/common.h   |    1 -
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 825310b..3474ef8 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -26,5 +26,11 @@
 			/* set clock-frequency in board dts */
 			status = "disabled";
 		};
+
+		rtc at 10300 {
+			compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc";
+			reg = <0x10300 0x20>;
+			interrupts = <53>;
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 975ad01..1c672d9 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -43,7 +43,6 @@ static void __init kirkwood_dt_init(void)
 #endif
 
 	/* internal devices that every board has */
-	kirkwood_rtc_init();
 	kirkwood_wdt_init();
 	kirkwood_xor0_init();
 	kirkwood_xor1_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 04a7eb9..a02cae8 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
 /*****************************************************************************
  * SoC RTC
  ****************************************************************************/
-void __init kirkwood_rtc_init(void)
+static void __init kirkwood_rtc_init(void)
 {
 	orion_rtc_init(RTC_PHYS_BASE, IRQ_KIRKWOOD_RTC);
 }
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 4737578..fa8e768 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -61,7 +61,6 @@ static inline void dreamplug_init(void) {};
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-void kirkwood_rtc_init(void);
 void kirkwood_wdt_init(void);
 void kirkwood_xor0_init(void);
 void kirkwood_xor1_init(void);
-- 
1.7.3.4

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

* Re: [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
  2012-03-16  4:21   ` Jason Cooper
@ 2012-03-16 20:18       ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-16 20:18 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Friday 16 March 2012, Jason Cooper wrote:
> 
> This series continues the process of converting all of the drivers initialized
> from kirkwood_init() to devicetree.
> 
> The first three patches are code cleanup from Andrew Lunn and myself.
> 
> The next three patches are cleanup and prep to facilitate adding new boards
> during the transition to devicetree.
> 
> The next patch moves the uarts into the bus for all kirkwood boards and leaves
> enabling them and specifying clock-frequency up to the board file.
> 
> The rest of the series is the initial conversion of rtc-mv to devicetree since
> it  doesn't use tclk or pinmux.  These should be safe to merge as they won't
> interfere with the clk/clkdev work Andrew Lunn is working on.
> 
>
> Please be aware that this is a complete reshuffle of the whole series and is
> based purely against arm-soc/next/boards.

Is this a pull request for v3.4 or not? I'm willing to take it and have put
it into next/dt2 for now so it makes it into linux-next. I'm not taking
a newer version for v3.4 any more, so if anyone has concerns over some of
your patches in the series, it all gets removed again and we will have to
postpone them until v3.5.

Note that it would have been better to base your series on top of just
the kirkwood/board branch rather than all of next/boards, but it's not
a big deal.

	Arnd

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

* [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
@ 2012-03-16 20:18       ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-16 20:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 16 March 2012, Jason Cooper wrote:
> 
> This series continues the process of converting all of the drivers initialized
> from kirkwood_init() to devicetree.
> 
> The first three patches are code cleanup from Andrew Lunn and myself.
> 
> The next three patches are cleanup and prep to facilitate adding new boards
> during the transition to devicetree.
> 
> The next patch moves the uarts into the bus for all kirkwood boards and leaves
> enabling them and specifying clock-frequency up to the board file.
> 
> The rest of the series is the initial conversion of rtc-mv to devicetree since
> it  doesn't use tclk or pinmux.  These should be safe to merge as they won't
> interfere with the clk/clkdev work Andrew Lunn is working on.
> 
>
> Please be aware that this is a complete reshuffle of the whole series and is
> based purely against arm-soc/next/boards.

Is this a pull request for v3.4 or not? I'm willing to take it and have put
it into next/dt2 for now so it makes it into linux-next. I'm not taking
a newer version for v3.4 any more, so if anyone has concerns over some of
your patches in the series, it all gets removed again and we will have to
postpone them until v3.5.

Note that it would have been better to base your series on top of just
the kirkwood/board branch rather than all of next/boards, but it's not
a big deal.

	Arnd

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

* Re: [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
  2012-03-16 20:18       ` Arnd Bergmann
@ 2012-03-16 20:28         ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16 20:28 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre, andrew, jm, grant.likely, michael, olof,
	devicetree-discuss, linux-arm-kernel

On Fri, Mar 16, 2012 at 08:18:27PM +0000, Arnd Bergmann wrote:
> On Friday 16 March 2012, Jason Cooper wrote:
> > 
> > This series continues the process of converting all of the drivers initialized
> > from kirkwood_init() to devicetree.
> > 
> > The first three patches are code cleanup from Andrew Lunn and myself.
> > 
> > The next three patches are cleanup and prep to facilitate adding new boards
> > during the transition to devicetree.
> > 
> > The next patch moves the uarts into the bus for all kirkwood boards and leaves
> > enabling them and specifying clock-frequency up to the board file.
> > 
> > The rest of the series is the initial conversion of rtc-mv to devicetree since
> > it  doesn't use tclk or pinmux.  These should be safe to merge as they won't
> > interfere with the clk/clkdev work Andrew Lunn is working on.
> > 
> >
> > Please be aware that this is a complete reshuffle of the whole series and is
> > based purely against arm-soc/next/boards.
> 
> Is this a pull request for v3.4 or not?

I was going to give it a day or two more, and if no one brought up
anything earth-shattering, I was going to submit the pull-request for
this series on Sunday.  I can do it now if you think it's ok.

> I'm willing to take it and have put it into next/dt2 for now so it
> makes it into linux-next. I'm not taking a newer version for v3.4 any
> more, so if anyone has concerns over some of your patches in the
> series, it all gets removed again and we will have to postpone them
> until v3.5.

The problematic patch (sata_mv) has been removed.  So, there should be
no issue.

> Note that it would have been better to base your series on top of just
> the kirkwood/board branch rather than all of next/boards, but it's not
> a big deal.

Ok.

thx,

Jason.

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

* [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
@ 2012-03-16 20:28         ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16 20:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 16, 2012 at 08:18:27PM +0000, Arnd Bergmann wrote:
> On Friday 16 March 2012, Jason Cooper wrote:
> > 
> > This series continues the process of converting all of the drivers initialized
> > from kirkwood_init() to devicetree.
> > 
> > The first three patches are code cleanup from Andrew Lunn and myself.
> > 
> > The next three patches are cleanup and prep to facilitate adding new boards
> > during the transition to devicetree.
> > 
> > The next patch moves the uarts into the bus for all kirkwood boards and leaves
> > enabling them and specifying clock-frequency up to the board file.
> > 
> > The rest of the series is the initial conversion of rtc-mv to devicetree since
> > it  doesn't use tclk or pinmux.  These should be safe to merge as they won't
> > interfere with the clk/clkdev work Andrew Lunn is working on.
> > 
> >
> > Please be aware that this is a complete reshuffle of the whole series and is
> > based purely against arm-soc/next/boards.
> 
> Is this a pull request for v3.4 or not?

I was going to give it a day or two more, and if no one brought up
anything earth-shattering, I was going to submit the pull-request for
this series on Sunday.  I can do it now if you think it's ok.

> I'm willing to take it and have put it into next/dt2 for now so it
> makes it into linux-next. I'm not taking a newer version for v3.4 any
> more, so if anyone has concerns over some of your patches in the
> series, it all gets removed again and we will have to postpone them
> until v3.5.

The problematic patch (sata_mv) has been removed.  So, there should be
no issue.

> Note that it would have been better to base your series on top of just
> the kirkwood/board branch rather than all of next/boards, but it's not
> a big deal.

Ok.

thx,

Jason.

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

* Re: [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
  2012-03-16 20:28         ` Jason Cooper
@ 2012-03-16 20:41           ` Arnd Bergmann
  -1 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-16 20:41 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre, andrew, jm, grant.likely, michael, olof,
	devicetree-discuss, linux-arm-kernel

On Friday 16 March 2012, Jason Cooper wrote:
> I was going to give it a day or two more, and if no one brought up
> anything earth-shattering, I was going to submit the pull-request for
> this series on Sunday.  I can do it now if you think it's ok.

I've already pulled it now, and I'm not going to take any new patches
for v3.4 any more. I expect Linus to open up the merge window
any time now, and he does not like to see patches sent to him
that have not been in linux-next before the merge window opened.

So the deal is that anything that is in now stays in unless someone
reports a serious problem and in that case it gets removed.
Any simple bugs can be fixed by sending follow-up patches of
course.

> > I'm willing to take it and have put it into next/dt2 for now so it
> > makes it into linux-next. I'm not taking a newer version for v3.4 any
> > more, so if anyone has concerns over some of your patches in the
> > series, it all gets removed again and we will have to postpone them
> > until v3.5.
> 
> The problematic patch (sata_mv) has been removed.  So, there should be
> no issue.

Ok, thanks for the confirmation.

	Arnd

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

* [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
@ 2012-03-16 20:41           ` Arnd Bergmann
  0 siblings, 0 replies; 272+ messages in thread
From: Arnd Bergmann @ 2012-03-16 20:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 16 March 2012, Jason Cooper wrote:
> I was going to give it a day or two more, and if no one brought up
> anything earth-shattering, I was going to submit the pull-request for
> this series on Sunday.  I can do it now if you think it's ok.

I've already pulled it now, and I'm not going to take any new patches
for v3.4 any more. I expect Linus to open up the merge window
any time now, and he does not like to see patches sent to him
that have not been in linux-next before the merge window opened.

So the deal is that anything that is in now stays in unless someone
reports a serious problem and in that case it gets removed.
Any simple bugs can be fixed by sending follow-up patches of
course.

> > I'm willing to take it and have put it into next/dt2 for now so it
> > makes it into linux-next. I'm not taking a newer version for v3.4 any
> > more, so if anyone has concerns over some of your patches in the
> > series, it all gets removed again and we will have to postpone them
> > until v3.5.
> 
> The problematic patch (sata_mv) has been removed.  So, there should be
> no issue.

Ok, thanks for the confirmation.

	Arnd

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

* Re: [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
  2012-03-16 20:41           ` Arnd Bergmann
@ 2012-03-16 21:02               ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16 21:02 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, Mar 16, 2012 at 08:41:12PM +0000, Arnd Bergmann wrote:
> On Friday 16 March 2012, Jason Cooper wrote:
> > I was going to give it a day or two more, and if no one brought up
> > anything earth-shattering, I was going to submit the pull-request for
> > this series on Sunday.  I can do it now if you think it's ok.
> 
> I've already pulled it now, and I'm not going to take any new patches
> for v3.4 any more. I expect Linus to open up the merge window
> any time now, and he does not like to see patches sent to him
> that have not been in linux-next before the merge window opened.

Ahhh  That explains some things.

Thanks,

Jason.

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

* [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
@ 2012-03-16 21:02               ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-03-16 21:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 16, 2012 at 08:41:12PM +0000, Arnd Bergmann wrote:
> On Friday 16 March 2012, Jason Cooper wrote:
> > I was going to give it a day or two more, and if no one brought up
> > anything earth-shattering, I was going to submit the pull-request for
> > this series on Sunday.  I can do it now if you think it's ok.
> 
> I've already pulled it now, and I'm not going to take any new patches
> for v3.4 any more. I expect Linus to open up the merge window
> any time now, and he does not like to see patches sent to him
> that have not been in linux-next before the merge window opened.

Ahhh  That explains some things.

Thanks,

Jason.

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

* Re: [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
  2012-03-13  1:57       ` Jason Cooper
@ 2012-04-05 22:07         ` Ian Campbell
  -1 siblings, 0 replies; 272+ messages in thread
From: Ian Campbell @ 2012-04-05 22:07 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre, andrew, arnd, jm, grant.likely, michael, olof,
	devicetree-discuss, linux-arm-kernel

On Tue, 2012-03-13 at 01:57 +0000, Jason Cooper wrote:
> +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") 

This ends up as Machine: in /proc/cpuinfo, which seems to be normal?

Would it be worth trying to dynamically modify the machine string based
on the actual hardware the kernel is running on?

Ian.
-- 
Ian Campbell


Genius is ten percent inspiration and fifty percent capital gains.

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

* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
@ 2012-04-05 22:07         ` Ian Campbell
  0 siblings, 0 replies; 272+ messages in thread
From: Ian Campbell @ 2012-04-05 22:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2012-03-13 at 01:57 +0000, Jason Cooper wrote:
> +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") 

This ends up as Machine: in /proc/cpuinfo, which seems to be normal?

Would it be worth trying to dynamically modify the machine string based
on the actual hardware the kernel is running on?

Ian.
-- 
Ian Campbell


Genius is ten percent inspiration and fifty percent capital gains.

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

* Re: [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
  2012-04-05 22:07         ` Ian Campbell
@ 2012-04-05 22:41             ` Jason Cooper
  -1 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-04-05 22:41 UTC (permalink / raw)
  To: Ian Campbell
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Apr 05, 2012 at 11:07:36PM +0100, Ian Campbell wrote:
> On Tue, 2012-03-13 at 01:57 +0000, Jason Cooper wrote:
> > +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") 
> 
> This ends up as Machine: in /proc/cpuinfo, which seems to be normal?
> 
> Would it be worth trying to dynamically modify the machine string based
> on the actual hardware the kernel is running on?

With CONFIG_PROC_DEVICETREE=y I get the following:

$ cat /proc/device-tree/model
Globalscale Technologies Dreamplug

It seems to me (I have no strong opinion here, just playing devil's
advocate) that /proc/cpuinfo is indeed telling us about the processor
(Marvell Kirkwood ...) Should it really be describing the board?

thx,

Jason.

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

* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
@ 2012-04-05 22:41             ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-04-05 22:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 05, 2012 at 11:07:36PM +0100, Ian Campbell wrote:
> On Tue, 2012-03-13 at 01:57 +0000, Jason Cooper wrote:
> > +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") 
> 
> This ends up as Machine: in /proc/cpuinfo, which seems to be normal?
> 
> Would it be worth trying to dynamically modify the machine string based
> on the actual hardware the kernel is running on?

With CONFIG_PROC_DEVICETREE=y I get the following:

$ cat /proc/device-tree/model
Globalscale Technologies Dreamplug

It seems to me (I have no strong opinion here, just playing devil's
advocate) that /proc/cpuinfo is indeed telling us about the processor
(Marvell Kirkwood ...) Should it really be describing the board?

thx,

Jason.

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

* Re: [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
  2012-04-05 22:41             ` Jason Cooper
@ 2012-04-06  8:52                 ` Ian Campbell
  -1 siblings, 0 replies; 272+ messages in thread
From: Ian Campbell @ 2012-04-06  8:52 UTC (permalink / raw)
  To: Jason Cooper
  Cc: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, andrew-g2DYL2Zd6BY,
	jm-Pj/HzkgeCk7QXOPxS62xeg, Martin Michlmayr, michael-QKn5cuLxLXY,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, 2012-04-05 at 18:41 -0400, Jason Cooper wrote:
> On Thu, Apr 05, 2012 at 11:07:36PM +0100, Ian Campbell wrote:
> > On Tue, 2012-03-13 at 01:57 +0000, Jason Cooper wrote:
> > > +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") 
> > 
> > This ends up as Machine: in /proc/cpuinfo, which seems to be normal?
> > 
> > Would it be worth trying to dynamically modify the machine string based
> > on the actual hardware the kernel is running on?
> 
> With CONFIG_PROC_DEVICETREE=y I get the following:
> 
> $ cat /proc/device-tree/model
> Globalscale Technologies Dreamplug

Yes, I just found that, thanks.

BTW the impetus for my asking was http://bugs.debian.org/667681 against
the flash-kernel tool which uses /proc/cpuinfo to know what magic runes
are required for the particular board it is being run on.

> It seems to me (I have no strong opinion here, just playing devil's
> advocate) that /proc/cpuinfo is indeed telling us about the processor
> (Marvell Kirkwood ...) Should it really be describing the board?

The field is actually called "Hardware:" (not "Machine:" as I said
above). Processor is actually covered separately ("Feroceon 88FR131 rev
1 (v5l)" in this case). I'd expect Hardware: to say something more
specific about the h/w platform, the string from /proc/device-tree/model
is exactly what I think I would have expected.

Ian.

> 
> thx,
> 
> Jason.
> 

-- 
Ian Campbell


Nostalgia isn't what it used to be.

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

* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
@ 2012-04-06  8:52                 ` Ian Campbell
  0 siblings, 0 replies; 272+ messages in thread
From: Ian Campbell @ 2012-04-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2012-04-05 at 18:41 -0400, Jason Cooper wrote:
> On Thu, Apr 05, 2012 at 11:07:36PM +0100, Ian Campbell wrote:
> > On Tue, 2012-03-13 at 01:57 +0000, Jason Cooper wrote:
> > > +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") 
> > 
> > This ends up as Machine: in /proc/cpuinfo, which seems to be normal?
> > 
> > Would it be worth trying to dynamically modify the machine string based
> > on the actual hardware the kernel is running on?
> 
> With CONFIG_PROC_DEVICETREE=y I get the following:
> 
> $ cat /proc/device-tree/model
> Globalscale Technologies Dreamplug

Yes, I just found that, thanks.

BTW the impetus for my asking was http://bugs.debian.org/667681 against
the flash-kernel tool which uses /proc/cpuinfo to know what magic runes
are required for the particular board it is being run on.

> It seems to me (I have no strong opinion here, just playing devil's
> advocate) that /proc/cpuinfo is indeed telling us about the processor
> (Marvell Kirkwood ...) Should it really be describing the board?

The field is actually called "Hardware:" (not "Machine:" as I said
above). Processor is actually covered separately ("Feroceon 88FR131 rev
1 (v5l)" in this case). I'd expect Hardware: to say something more
specific about the h/w platform, the string from /proc/device-tree/model
is exactly what I think I would have expected.

Ian.

> 
> thx,
> 
> Jason.
> 

-- 
Ian Campbell


Nostalgia isn't what it used to be.

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

* dreamplug kernel and uboot code and apparent dreamplug board design change
       [not found]             ` <384286E8-E5C8-4069-9702-8A24C70D799C@gmail.com>
@ 2012-04-16 13:27               ` Jason Cooper
  0 siblings, 0 replies; 272+ messages in thread
From: Jason Cooper @ 2012-04-16 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Apr 15, 2012 at 09:13:13PM -0700, rihoward1 at gmail.com wrote:
> First I would like to say thank you for all the work you have
> performed with DT support for kirkwood and the dreamplug board.

No problem, just scratching an itch.  ;-)

> It seems that recently Globalscale in their wisdom has changed the
> dreamplug board design.  See
> http://www.plugcomputer.org/plugforum/index.php?topic=6098.0

Hmm, once devicetree is in place, it should just be a matter of swapping
out the dtbs.  I wonder if the SPI NOR flash was EOL'd?  If so, this is
a good sign that Globalscale intends to continue producing Dreamplugs.
They wouldn't invest the engineering effort to make the change
otherwise.

> If this is true then some code fix up for the new version may be
> needed including a new machtype.

mach-type isn't necessary.  This is all handled by the devicetree, now.
The most specific model string in the device tree is
"globalscale,dreamplug-003-ds2001".  Is this the same on the new
version?  You can find it on the underside of the dreamplug, first line
"DreamPlug model: XXX".  If it's different, then we'll use that to tell
them apart.

If they unwisely left that the same, I'll gin up a patch to use the
'0901' and '1001' they refer to in the readme.  Based on the forum link,
it looks like the only change is the nand flash.  Are there any other
changes folks are aware of?

Looks like I'll have to take another look at Simon Glass' (I always mess
up the apostrophe in those grammar situations, sorry Simon) fdt support
in u-boot.  That might be the easiest way to solve this there.

thx,

Jason.

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

end of thread, other threads:[~2012-04-16 13:27 UTC | newest]

Thread overview: 272+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
2012-03-01 18:20 ` Jason Cooper
2012-03-01 18:20 ` [PATCH 1/4] ARM: kirkwood: move var setting to correct location Jason Cooper
2012-03-01 18:20   ` Jason Cooper
2012-03-01 18:20 ` [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-01 18:20   ` Jason Cooper
     [not found]   ` <9d9a87361c05b8b85e1ee2cdabb46a365c7abca8.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-02  7:09     ` Grant Likely
2012-03-02  7:09       ` Grant Likely
2012-03-01 18:20 ` [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
2012-03-01 18:20   ` Jason Cooper
     [not found]   ` <2c985a303f3b9b0cfcead25634b7e1db68d34ee3.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-01 19:35     ` Arnd Bergmann
2012-03-01 19:35       ` Arnd Bergmann
     [not found]       ` <201203011935.58503.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-01 21:26         ` Jason
2012-03-01 21:26           ` Jason
2012-03-02  7:19   ` Grant Likely
2012-03-02  7:19     ` Grant Likely
2012-03-02  9:48     ` Arnd Bergmann
2012-03-02  9:48       ` Arnd Bergmann
2012-03-02 16:27     ` Jason
2012-03-02 16:27       ` Jason
2012-03-04 14:59   ` Michael Walle
2012-03-04 14:59     ` Michael Walle
2012-03-04 16:48     ` Arnd Bergmann
2012-03-04 16:48       ` Arnd Bergmann
     [not found]       ` <201203041648.17428.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-04 22:27         ` Jason
2012-03-04 22:27           ` Jason
2012-03-04 23:22           ` Michael Walle
2012-03-04 23:22             ` Michael Walle
2012-03-01 18:20 ` [PATCH 4/4] ARM: kirkwood: convert orion-wdt " Jason Cooper
2012-03-01 18:20   ` Jason Cooper
     [not found]   ` <2f29e88b98b2bcff0c241996e6d7216a60995d2d.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-01 19:48     ` Arnd Bergmann
2012-03-01 19:48       ` Arnd Bergmann
2012-03-02  7:22     ` Grant Likely
2012-03-02  7:22       ` Grant Likely
2012-03-02  9:15   ` Simon Guinot
2012-03-02  9:15     ` Simon Guinot
     [not found]     ` <20120302091510.GC29461-tZfvYpCFA3RN6yImKYG91Q@public.gmane.org>
2012-03-02 14:15       ` Jason
2012-03-02 14:15         ` Jason
     [not found]         ` <20120302141541.GE11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-02 14:56           ` Arnd Bergmann
2012-03-02 14:56             ` Arnd Bergmann
2012-03-02 15:36             ` Jason
2012-03-02 15:36               ` Jason
2012-03-02 16:48               ` Arnd Bergmann
2012-03-02 16:48                 ` Arnd Bergmann
2012-03-02 17:02                 ` Jason
2012-03-02 17:02                   ` Jason
     [not found]                   ` <20120302170252.GJ11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-02 22:36                     ` Andrew Lunn
2012-03-02 22:36                       ` Andrew Lunn
     [not found]                       ` <20120302223629.GA21080-g2DYL2Zd6BY@public.gmane.org>
2012-03-03 22:54                         ` Jason
2012-03-03 22:54                           ` Jason
2012-03-01 19:50 ` [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs " Arnd Bergmann
2012-03-01 19:50   ` Arnd Bergmann
     [not found]   ` <201203011950.51210.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-01 20:01     ` Jason
2012-03-01 20:01       ` Jason
2012-03-01 20:28       ` Arnd Bergmann
2012-03-01 20:28         ` Arnd Bergmann
     [not found]         ` <201203012028.04773.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-01 21:23           ` Jason
2012-03-01 21:23             ` Jason
     [not found]             ` <20120301212353.GC11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-01 22:14               ` Arnd Bergmann
2012-03-01 22:14                 ` Arnd Bergmann
2012-03-02 16:31                 ` Jason
2012-03-02 16:31                   ` Jason
     [not found]                   ` <20120302163121.GI11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-02 16:58                     ` Arnd Bergmann
2012-03-02 16:58                       ` Arnd Bergmann
2012-03-02 17:04                       ` Jason
2012-03-02 17:04                         ` Jason
2012-03-07  3:44 ` [PATCH 0/14 v3] ARM: kirkwood: fdt: convert kirkwood " Jason Cooper
2012-03-07  3:44   ` Jason Cooper
2012-03-07  3:44 ` [PATCH 03/14] ARM: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-03-07  3:44   ` Jason Cooper
     [not found] ` <cover.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-02 17:50   ` [PATCH 0/5 v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
2012-03-02 17:50     ` Jason Cooper
2012-03-02 17:50     ` [PATCH 2/5] ARM: kirkwood: move var setting to correct location Jason Cooper
2012-03-02 17:50       ` Jason Cooper
2012-03-02 17:50     ` [PATCH 3/5 v2] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-02 17:50       ` Jason Cooper
2012-03-02 17:50     ` [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
2012-03-02 17:50       ` Jason Cooper
2012-03-04 15:12       ` Michael Walle
2012-03-04 15:12         ` Michael Walle
2012-03-04 16:50         ` Arnd Bergmann
2012-03-04 16:50           ` Arnd Bergmann
     [not found]           ` <201203041650.52217.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-05  0:17             ` Jason
2012-03-05  0:17               ` Jason
2012-03-02 17:50     ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Jason Cooper
2012-03-02 17:50       ` Jason Cooper
     [not found]       ` <e2fe5e97a83fc753559bbb18d5d111ed01b89034.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-02 18:32         ` Arnd Bergmann
2012-03-02 18:32           ` Arnd Bergmann
     [not found]           ` <201203021832.34901.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-02 19:57             ` Jason
2012-03-02 19:57               ` Jason
     [not found]               ` <20120302195710.GP11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-02 20:02                 ` Arnd Bergmann
2012-03-02 20:02                   ` Arnd Bergmann
2012-03-02 20:00             ` [PULL REQUEST v2] ARM: kirkwood: fdt: convert kirkwood init funcs " Jason
     [not found]               ` <20120302200034.GQ11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-02 20:35                 ` Arnd Bergmann
2012-03-02 20:35                   ` Arnd Bergmann
     [not found]                   ` <201203022035.44672.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-02 21:18                     ` Arnd Bergmann
2012-03-02 21:18                       ` Arnd Bergmann
     [not found]                       ` <201203022118.05796.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-05 18:49                         ` Nicolas Pitre
2012-03-05 18:49                           ` Nicolas Pitre
     [not found]                           ` <alpine.LFD.2.02.1203051344130.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2012-03-05 19:15                             ` Jason
2012-03-05 19:15                               ` Jason
     [not found]                               ` <20120305191546.GK5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-05 20:16                                 ` Arnd Bergmann
2012-03-05 20:16                                   ` Arnd Bergmann
     [not found]                                   ` <201203052016.26949.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-05 20:29                                     ` Jason
2012-03-05 20:29                                       ` Jason
     [not found]                                       ` <20120305202941.GN5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-05 20:43                                         ` Nicolas Pitre
2012-03-05 20:43                                           ` Nicolas Pitre
     [not found]                                           ` <alpine.LFD.2.02.1203051542190.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2012-03-05 21:17                                             ` Jason
2012-03-05 21:17                                               ` Jason
     [not found]                                               ` <20120305211737.GO5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-05 21:27                                                 ` Nicolas Pitre
2012-03-05 21:27                                                   ` Nicolas Pitre
     [not found]                                                   ` <alpine.LFD.2.02.1203051626370.31242-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2012-03-06 14:29                                                     ` Jason
2012-03-06 14:29                                                       ` Jason
2012-03-03 10:08             ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Russell King - ARM Linux
2012-03-03 10:08               ` Russell King - ARM Linux
     [not found]               ` <20120303100853.GK7363-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-03-03 23:05                 ` Jason
2012-03-03 23:05                   ` Jason
     [not found]     ` <cover.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-02 17:50       ` [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi " Jason Cooper
2012-03-02 17:50         ` Jason Cooper
2012-03-04 18:12         ` Michael Walle
2012-03-04 18:12           ` Michael Walle
     [not found]           ` <201203041912.21137.michael-QKn5cuLxLXY@public.gmane.org>
2012-03-04 20:29             ` Arnd Bergmann
2012-03-04 20:29               ` Arnd Bergmann
2012-03-02 17:52       ` [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs " Jason
2012-03-02 17:52         ` Jason
     [not found]         ` <20120302175233.GM11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-02 17:56           ` Jason
2012-03-02 17:56             ` Jason
     [not found]   ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-07  3:44     ` [PATCH 01/14] ARM: orion: spi: remove enable_clock_fix which is not used Jason Cooper
2012-03-07  3:44       ` Jason Cooper
     [not found]       ` <b0fe0cfb7e76a869a8ba7f7344de75eb122e206c.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-09  4:33         ` Grant Likely
2012-03-09  4:33           ` Grant Likely
2012-03-07  3:44     ` [PATCH 02/14] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 04/14] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 05/14] ARM: kirkwood: add interrupt controller to devicetree Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 06/14] ARM: kirkwood: convert uart0 " Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07 18:31       ` Arnd Bergmann
2012-03-07 18:31         ` Arnd Bergmann
     [not found]         ` <201203071831.31738.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-07 18:37           ` Jason
2012-03-07 18:37             ` Jason
2012-03-07 19:27           ` Jason
2012-03-07 19:27             ` Jason
     [not found]             ` <20120307192723.GE5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-07 20:05               ` Andrew Lunn
2012-03-07 20:05                 ` Andrew Lunn
     [not found]                 ` <20120307200515.GC18513-g2DYL2Zd6BY@public.gmane.org>
2012-03-07 20:55                   ` Jason
2012-03-07 20:55                     ` Jason
2012-03-07 21:47               ` Michael Walle
2012-03-07 21:47                 ` Michael Walle
2012-03-08 21:31               ` Grant Likely
2012-03-08 21:31                 ` Grant Likely
     [not found]                 ` <20120308213139.GC16533-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-03-08 21:55                   ` Jason
2012-03-08 21:55                     ` Jason
2012-03-07 21:13             ` Arnd Bergmann
2012-03-07 21:13               ` Arnd Bergmann
     [not found]               ` <201203072113.04369.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-07 21:29                 ` Jason
2012-03-07 21:29                   ` Jason
2012-03-08 16:25                 ` Jason
2012-03-08 16:25                   ` Jason
     [not found]                   ` <20120308162530.GI5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-08 17:01                     ` Arnd Bergmann
2012-03-08 17:01                       ` Arnd Bergmann
     [not found]                       ` <201203081701.01663.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-08 17:41                         ` Arnd Bergmann
2012-03-08 17:41                           ` Arnd Bergmann
2012-03-08 19:27                         ` Thomas Gleixner
2012-03-08 19:27                           ` Thomas Gleixner
2012-03-08 19:47                           ` Jason
2012-03-08 19:47                             ` Jason
     [not found]                             ` <20120308194725.GM5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-08 21:32                               ` Grant Likely
2012-03-08 21:32                                 ` Grant Likely
2012-03-08 21:50                                 ` Jason
2012-03-08 21:50                                   ` Jason
2012-03-08 22:22                                   ` Rob Herring
2012-03-08 22:22                                     ` Rob Herring
2012-03-08 21:27                 ` Grant Likely
2012-03-08 21:27                   ` Grant Likely
     [not found]                   ` <20120308212701.GB16533-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-03-08 23:14                     ` Arnd Bergmann
2012-03-08 23:14                       ` Arnd Bergmann
2012-03-07  3:44     ` [PATCH 07/14] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
2012-03-07  3:44       ` Jason Cooper
     [not found]       ` <146e96ef8a8649767b3beb49ff39a260e75f234a.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-07 18:32         ` Arnd Bergmann
2012-03-07 18:32           ` Arnd Bergmann
2012-03-07  3:44     ` [PATCH 09/14] ARM: kirkwood: mv_cesa devicetree bindings Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 10/14] ARM: kirkwood: mv_cesa devicetree support Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 11/14] ARM: kirkwood: ehci-orion: add device tree binding Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 12/14] ARM: kirkwood: use devicetree for orion-ehci Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 13/14] ARM: kirkwood: sata_mv: add device tree binding Jason Cooper
2012-03-07  3:44       ` Jason Cooper
2012-03-07  3:44     ` [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv Jason Cooper
2012-03-07  3:44       ` Jason Cooper
     [not found]       ` <8503a766f6f75c9acf49abd66d9cdce54807b2b2.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-07 18:40         ` Arnd Bergmann
2012-03-07 18:40           ` Arnd Bergmann
     [not found]           ` <201203071840.09572.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-07 18:52             ` Jason
2012-03-07 18:52               ` Jason
     [not found]               ` <20120307185204.GD5050-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-03-07 19:00                 ` Arnd Bergmann
2012-03-07 19:00                   ` Arnd Bergmann
2012-03-13  1:57   ` [PATCH 0/7 v4] ARM: kirkwood: fdt: convert kirkwood to fdt Jason Cooper
2012-03-13  1:57     ` Jason Cooper
     [not found]   ` <cover.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-13  1:57     ` [PATCH 3/7 v2] ARM: orion: wdt: use resource vice direct access Jason Cooper
2012-03-13  1:57       ` Jason Cooper
2012-03-13  9:54       ` Arnd Bergmann
2012-03-13  9:54         ` Arnd Bergmann
2012-03-13  1:57     ` [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-03-13  1:57       ` Jason Cooper
     [not found]       ` <0032addd7e94c5d4d1a3a0be77fe79bcffee53db.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-13 10:10         ` Arnd Bergmann
2012-03-13 10:10           ` Arnd Bergmann
     [not found]           ` <201203131010.43095.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-13 13:12             ` Jason Cooper
2012-03-13 13:12               ` Jason Cooper
2012-04-05 22:07       ` Ian Campbell
2012-04-05 22:07         ` Ian Campbell
     [not found]         ` <1333663656.12209.62.camel-ztPmHsLffjjnO4AKDKe2m+kiAK3p4hvP@public.gmane.org>
2012-04-05 22:41           ` Jason Cooper
2012-04-05 22:41             ` Jason Cooper
     [not found]             ` <20120405224143.GL817-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-04-06  8:52               ` Ian Campbell
2012-04-06  8:52                 ` Ian Campbell
     [not found]             ` <384286E8-E5C8-4069-9702-8A24C70D799C@gmail.com>
2012-04-16 13:27               ` dreamplug kernel and uboot code and apparent dreamplug board design change Jason Cooper
     [not found]   ` <cover.1331868507.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-16  4:21     ` [PATCH 1/9] ARM: orion: spi: remove enable_clock_fix which is not used Jason Cooper
2012-03-16  4:21       ` Jason Cooper
2012-03-16 20:18     ` [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt Arnd Bergmann
2012-03-16 20:18       ` Arnd Bergmann
2012-03-16 20:28       ` Jason Cooper
2012-03-16 20:28         ` Jason Cooper
2012-03-16 20:41         ` Arnd Bergmann
2012-03-16 20:41           ` Arnd Bergmann
     [not found]           ` <201203162041.12831.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-16 21:02             ` Jason Cooper
2012-03-16 21:02               ` Jason Cooper
2012-03-13  1:57 ` [PATCH 1/7] ARM: orion: spi: remove enable_clock_fix which is not used Jason Cooper
2012-03-13  1:57   ` Jason Cooper
2012-03-13  1:57 ` [PATCH 2/7] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data Jason Cooper
2012-03-13  1:57   ` Jason Cooper
2012-03-13  1:57 ` [PATCH 5/7 v2] ARM: kirkwood: convert uart0 to devicetree Jason Cooper
2012-03-13  1:57   ` Jason Cooper
     [not found]   ` <970083c931bbd5c58be3aa982a66fddc48ceb534.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-13 13:18     ` Jason Cooper
2012-03-13 13:18       ` Jason Cooper
2012-03-13  1:57 ` [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
2012-03-13  1:57   ` Jason Cooper
     [not found]   ` <0b9921e304cb46af9c4fbc8b7b8c8b9ba3d18654.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-13  9:57     ` Arnd Bergmann
2012-03-13  9:57       ` Arnd Bergmann
2012-03-13 10:03     ` Uwe Kleine-König
2012-03-13 10:03       ` Uwe Kleine-König
2012-03-13  1:57 ` [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
2012-03-13  1:57   ` Jason Cooper
2012-03-13  9:58   ` Arnd Bergmann
2012-03-13  9:58     ` Arnd Bergmann
     [not found]     ` <201203130958.31223.arnd-r2nGTMty4D4@public.gmane.org>
2012-03-13 13:22       ` Jason Cooper
2012-03-13 13:22         ` Jason Cooper
2012-03-13 13:44         ` Arnd Bergmann
2012-03-13 13:44           ` Arnd Bergmann
2012-03-16  4:21 ` [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 2/9] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 3/9 v3] ARM: orion: wdt: use resource vice direct access Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 4/9] ARM: kirkwood: fdt: use mrvl ticker symbol Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 5/9] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 6/9 v2] ARM: kirkwood: fdt: facilitate new boards during fdt migration Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 7/9] ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0 Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 8/9 v2] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
2012-03-16  4:21   ` Jason Cooper
2012-03-16  4:21 ` [PATCH 9/9] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
2012-03-16  4:21   ` Jason Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.