* [PATCH 1/4] ARM: kirkwood: move var setting to correct location.
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 2/4] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
` (20 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init()
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt 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
[not found] ` <9d9a87361c05b8b85e1ee2cdabb46a365c7abca8.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-01 18:20 ` [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
` (19 subsequent siblings)
21 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt 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 ` [PATCH 2/4] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
@ 2012-03-01 18:20 ` Jason Cooper
[not found] ` <2c985a303f3b9b0cfcead25634b7e1db68d34ee3.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (2 more replies)
2012-03-01 18:20 ` [PATCH 4/4] ARM: kirkwood: convert orion-wdt " Jason Cooper
` (18 subsequent siblings)
21 siblings, 3 replies; 136+ 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] 136+ messages in thread
[parent not found: <2c985a303f3b9b0cfcead25634b7e1db68d34ee3.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
[not found] ` <2c985a303f3b9b0cfcead25634b7e1db68d34ee3.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-01 19:35 ` Arnd Bergmann
[not found] ` <201203011935.58503.arnd-r2nGTMty4D4@public.gmane.org>
0 siblings, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
2012-03-01 18:20 ` [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
[not found] ` <2c985a303f3b9b0cfcead25634b7e1db68d34ee3.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-02 7:19 ` Grant Likely
2012-03-02 9:48 ` Arnd Bergmann
2012-03-02 16:27 ` Jason
2012-03-04 14:59 ` Michael Walle
2 siblings, 2 replies; 136+ 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] 136+ 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
2012-03-02 16:27 ` Jason
1 sibling, 0 replies; 136+ 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] 136+ 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
@ 2012-03-02 16:27 ` Jason
1 sibling, 0 replies; 136+ 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] 136+ messages in thread
* Re: [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt.
2012-03-01 18:20 ` [PATCH 3/4] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
[not found] ` <2c985a303f3b9b0cfcead25634b7e1db68d34ee3.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-02 7:19 ` Grant Likely
@ 2012-03-04 14:59 ` Michael Walle
2012-03-04 16:48 ` Arnd Bergmann
2 siblings, 1 reply; 136+ 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] 136+ 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
[not found] ` <201203041648.17428.arnd-r2nGTMty4D4@public.gmane.org>
0 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (2 preceding siblings ...)
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] ` <2f29e88b98b2bcff0c241996e6d7216a60995d2d.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-02 9:15 ` Simon Guinot
2012-03-01 19:50 ` [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs " Arnd Bergmann
` (17 subsequent siblings)
21 siblings, 2 replies; 136+ 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] 136+ messages in thread
[parent not found: <2f29e88b98b2bcff0c241996e6d7216a60995d2d.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
[not found] ` <2f29e88b98b2bcff0c241996e6d7216a60995d2d.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-01 19:48 ` Arnd Bergmann
2012-03-02 7:22 ` Grant Likely
1 sibling, 0 replies; 136+ 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] 136+ messages in thread
* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
[not found] ` <2f29e88b98b2bcff0c241996e6d7216a60995d2d.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-01 19:48 ` Arnd Bergmann
@ 2012-03-02 7:22 ` Grant Likely
1 sibling, 0 replies; 136+ 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] 136+ messages in thread
* Re: [PATCH 4/4] ARM: kirkwood: convert orion-wdt to fdt.
2012-03-01 18:20 ` [PATCH 4/4] ARM: kirkwood: convert orion-wdt " Jason Cooper
[not found] ` <2f29e88b98b2bcff0c241996e6d7216a60995d2d.1330625878.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-02 9:15 ` Simon Guinot
[not found] ` <20120302091510.GC29461-tZfvYpCFA3RN6yImKYG91Q@public.gmane.org>
1 sibling, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (3 preceding siblings ...)
2012-03-01 18:20 ` [PATCH 4/4] ARM: kirkwood: convert orion-wdt " Jason Cooper
@ 2012-03-01 19:50 ` Arnd Bergmann
[not found] ` <201203011950.51210.arnd-r2nGTMty4D4@public.gmane.org>
[not found] ` <cover.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (16 subsequent siblings)
21 siblings, 1 reply; 136+ 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] 136+ messages in thread
[parent not found: <cover.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* [PATCH 0/5 v2] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
[not found] ` <cover.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-02 17:50 ` Jason Cooper
[not found] ` <cover.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (4 more replies)
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (3 subsequent siblings)
4 siblings, 5 replies; 136+ 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] 136+ messages in thread
[parent not found: <cover.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
[not found] ` <cover.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-02 17:50 ` Jason Cooper
2012-03-04 18:12 ` Michael Walle
2012-03-02 17:52 ` [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs " Jason
1 sibling, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi to fdt.
2012-03-02 17:50 ` [PATCH 1/5 v2] ARM: kirkwood: covert orion-spi " Jason Cooper
@ 2012-03-04 18:12 ` Michael Walle
[not found] ` <201203041912.21137.michael-QKn5cuLxLXY@public.gmane.org>
0 siblings, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PULL REQUEST] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
[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:52 ` Jason
[not found] ` <20120302175233.GM11986-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
1 sibling, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 2/5] ARM: kirkwood: move var setting to correct location.
2012-03-02 17:50 ` [PATCH 0/5 v2] " Jason Cooper
[not found] ` <cover.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-02 17:50 ` Jason Cooper
2012-03-02 17:50 ` [PATCH 3/5 v2] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
` (2 subsequent siblings)
4 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 3/5 v2] ARM: kirkwood: fdt: absorb kirkwood_init()
2012-03-02 17:50 ` [PATCH 0/5 v2] " Jason Cooper
[not found] ` <cover.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
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 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
2012-03-02 17:50 ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Jason Cooper
4 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
2012-03-02 17:50 ` [PATCH 0/5 v2] " Jason Cooper
` (2 preceding siblings ...)
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-04 15:12 ` Michael Walle
2012-03-02 17:50 ` [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt " Jason Cooper
4 siblings, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt.
2012-03-02 17:50 ` [PATCH 4/5 v2] ARM: kirkwood: convert rtc-mv to fdt Jason Cooper
@ 2012-03-04 15:12 ` Michael Walle
2012-03-04 16:50 ` Arnd Bergmann
0 siblings, 1 reply; 136+ 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] 136+ 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
[not found] ` <201203041650.52217.arnd-r2nGTMty4D4@public.gmane.org>
0 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 5/5 v2] ARM: kirkwood: convert orion-wdt to fdt.
2012-03-02 17:50 ` [PATCH 0/5 v2] " Jason Cooper
` (3 preceding siblings ...)
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
[not found] ` <e2fe5e97a83fc753559bbb18d5d111ed01b89034.1330709314.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
4 siblings, 1 reply; 136+ 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] 136+ messages in thread
[parent not found: <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* [PATCH 01/14] ARM: orion: spi: remove enable_clock_fix which is not used
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-07 3:44 ` Jason Cooper
[not found] ` <b0fe0cfb7e76a869a8ba7f7344de75eb122e206c.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-07 3:44 ` [PATCH 02/14] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data Jason Cooper
` (11 subsequent siblings)
12 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 02/14] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
[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
2012-03-07 3:44 ` [PATCH 04/14] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
` (10 subsequent siblings)
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 04/14] ARM: kirkwood: fdt: absorb kirkwood_init()
[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 ` [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 05/14] ARM: kirkwood: add interrupt controller to devicetree Jason Cooper
` (9 subsequent siblings)
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 05/14] ARM: kirkwood: add interrupt controller to devicetree.
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (2 preceding siblings ...)
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 06/14] ARM: kirkwood: convert uart0 " Jason Cooper
` (8 subsequent siblings)
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 06/14] ARM: kirkwood: convert uart0 to devicetree.
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (3 preceding siblings ...)
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 18:31 ` Arnd Bergmann
2012-03-07 3:44 ` [PATCH 07/14] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
` (7 subsequent siblings)
12 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 07/14] ARM: kirkwood: rtc-mv devicetree bindings
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (4 preceding siblings ...)
2012-03-07 3:44 ` [PATCH 06/14] ARM: kirkwood: convert uart0 " 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
` (6 subsequent siblings)
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (5 preceding siblings ...)
2012-03-07 3:44 ` [PATCH 07/14] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
@ 2012-03-07 3:44 ` Jason Cooper
[not found] ` <146e96ef8a8649767b3beb49ff39a260e75f234a.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-07 3:44 ` [PATCH 09/14] ARM: kirkwood: mv_cesa devicetree bindings Jason Cooper
` (5 subsequent siblings)
12 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 09/14] ARM: kirkwood: mv_cesa devicetree bindings
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (6 preceding siblings ...)
2012-03-07 3:44 ` [PATCH 08/14] ARM: kirkwood: use devicetree for rtc-mv 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
` (4 subsequent siblings)
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 10/14] ARM: kirkwood: mv_cesa devicetree support.
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (7 preceding siblings ...)
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 11/14] ARM: kirkwood: ehci-orion: add device tree binding Jason Cooper
` (3 subsequent siblings)
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 11/14] ARM: kirkwood: ehci-orion: add device tree binding
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (8 preceding siblings ...)
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 12/14] ARM: kirkwood: use devicetree for orion-ehci Jason Cooper
` (2 subsequent siblings)
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 12/14] ARM: kirkwood: use devicetree for orion-ehci
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (9 preceding siblings ...)
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 13/14] ARM: kirkwood: sata_mv: add device tree binding Jason Cooper
2012-03-07 3:44 ` [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv Jason Cooper
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 13/14] ARM: kirkwood: sata_mv: add device tree binding
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (10 preceding siblings ...)
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 14/14] ARM: kirkwood: use devicetree to init sata_mv Jason Cooper
12 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 14/14] ARM: kirkwood: use devicetree to init sata_mv
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
` (11 preceding siblings ...)
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
[not found] ` <8503a766f6f75c9acf49abd66d9cdce54807b2b2.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
12 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 0/7 v4] ARM: kirkwood: fdt: convert kirkwood to fdt
[not found] ` <cover.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-02 17:50 ` [PATCH 0/5 v2] " Jason Cooper
[not found] ` <cover.1331090356.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-13 1:57 ` Jason Cooper
[not found] ` <cover.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
[not found] ` <cover.1331868507.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
4 siblings, 0 replies; 136+ 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] 136+ messages in thread
[parent not found: <cover.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* [PATCH 3/7 v2] ARM: orion: wdt: use resource vice direct access
[not found] ` <cover.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-13 1:57 ` Jason Cooper
2012-03-13 9:54 ` Arnd Bergmann
2012-03-13 1:57 ` [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support Jason Cooper
1 sibling, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
[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
[not found] ` <0032addd7e94c5d4d1a3a0be77fe79bcffee53db.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-04-05 22:07 ` Ian Campbell
1 sibling, 2 replies; 136+ 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] 136+ messages in thread
[parent not found: <0032addd7e94c5d4d1a3a0be77fe79bcffee53db.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* Re: [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
[not found] ` <0032addd7e94c5d4d1a3a0be77fe79bcffee53db.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-13 10:10 ` Arnd Bergmann
[not found] ` <201203131010.43095.arnd-r2nGTMty4D4@public.gmane.org>
0 siblings, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support.
2012-03-13 1:57 ` [PATCH 4/7 v4] ARM: kirkwood: add dreamplug (fdt) support Jason Cooper
[not found] ` <0032addd7e94c5d4d1a3a0be77fe79bcffee53db.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-04-05 22:07 ` Ian Campbell
[not found] ` <1333663656.12209.62.camel-ztPmHsLffjjnO4AKDKe2m+kiAK3p4hvP@public.gmane.org>
1 sibling, 1 reply; 136+ 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] 136+ messages in thread
[parent not found: <cover.1331868507.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>]
* [PATCH 1/9] ARM: orion: spi: remove enable_clock_fix which is not used
[not found] ` <cover.1331868507.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 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
1 sibling, 0 replies; 136+ 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] 136+ messages in thread
* Re: [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
[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 20:18 ` Arnd Bergmann
2012-03-16 20:28 ` Jason Cooper
1 sibling, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
2012-03-16 20:18 ` [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt Arnd Bergmann
@ 2012-03-16 20:28 ` Jason Cooper
2012-03-16 20:41 ` Arnd Bergmann
0 siblings, 1 reply; 136+ 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] 136+ 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
[not found] ` <201203162041.12831.arnd-r2nGTMty4D4@public.gmane.org>
0 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 0/14 v3] ARM: kirkwood: fdt: convert kirkwood to fdt
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (5 preceding siblings ...)
[not found] ` <cover.1330625877.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
@ 2012-03-07 3:44 ` Jason Cooper
2012-03-07 3:44 ` [PATCH 03/14] ARM: kirkwood: add dreamplug (fdt) support Jason Cooper
` (14 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 03/14] ARM: kirkwood: add dreamplug (fdt) support.
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (6 preceding siblings ...)
2012-03-07 3:44 ` [PATCH 0/14 v3] " Jason Cooper
@ 2012-03-07 3:44 ` Jason Cooper
2012-03-13 1:57 ` [PATCH 1/7] ARM: orion: spi: remove enable_clock_fix which is not used Jason Cooper
` (13 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 1/7] ARM: orion: spi: remove enable_clock_fix which is not used
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (7 preceding siblings ...)
2012-03-07 3:44 ` [PATCH 03/14] ARM: kirkwood: add dreamplug (fdt) support 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
` (12 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 2/7] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (8 preceding siblings ...)
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 5/7 v2] ARM: kirkwood: convert uart0 to devicetree Jason Cooper
` (11 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 5/7 v2] ARM: kirkwood: convert uart0 to devicetree.
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (9 preceding siblings ...)
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
[not found] ` <970083c931bbd5c58be3aa982a66fddc48ceb534.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-13 1:57 ` [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
` (10 subsequent siblings)
21 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (10 preceding siblings ...)
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] ` <0b9921e304cb46af9c4fbc8b7b8c8b9ba3d18654.1331601448.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-03-13 1:57 ` [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
` (9 subsequent siblings)
21 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (11 preceding siblings ...)
2012-03-13 1:57 ` [PATCH 6/7] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
@ 2012-03-13 1:57 ` Jason Cooper
2012-03-13 9:58 ` Arnd Bergmann
2012-03-16 4:21 ` [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt Jason Cooper
` (8 subsequent siblings)
21 siblings, 1 reply; 136+ 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] 136+ messages in thread
* Re: [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv
2012-03-13 1:57 ` [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
@ 2012-03-13 9:58 ` Arnd Bergmann
[not found] ` <201203130958.31223.arnd-r2nGTMty4D4@public.gmane.org>
0 siblings, 1 reply; 136+ 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] 136+ messages in thread
* [PATCH 0/9 v5] ARM: kirkwood: fdt: convert kirkwood to fdt
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (12 preceding siblings ...)
2012-03-13 1:57 ` [PATCH 7/7] ARM: kirkwood: use devicetree for rtc-mv 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
` (7 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 2/9] ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (13 preceding siblings ...)
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 3/9 v3] ARM: orion: wdt: use resource vice direct access Jason Cooper
` (6 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 3/9 v3] ARM: orion: wdt: use resource vice direct access
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (14 preceding siblings ...)
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 4/9] ARM: kirkwood: fdt: use mrvl ticker symbol Jason Cooper
` (5 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 4/9] ARM: kirkwood: fdt: use mrvl ticker symbol
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (15 preceding siblings ...)
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 5/9] ARM: kirkwood: fdt: absorb kirkwood_init() Jason Cooper
` (4 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 5/9] ARM: kirkwood: fdt: absorb kirkwood_init()
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (16 preceding siblings ...)
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 6/9 v2] ARM: kirkwood: fdt: facilitate new boards during fdt migration Jason Cooper
` (3 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 6/9 v2] ARM: kirkwood: fdt: facilitate new boards during fdt migration
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (17 preceding siblings ...)
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 7/9] ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0 Jason Cooper
` (2 subsequent siblings)
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 7/9] ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (18 preceding siblings ...)
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 8/9 v2] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
2012-03-16 4:21 ` [PATCH 9/9] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 8/9 v2] ARM: kirkwood: rtc-mv devicetree bindings
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (19 preceding siblings ...)
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 9/9] ARM: kirkwood: use devicetree for rtc-mv Jason Cooper
21 siblings, 0 replies; 136+ 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] 136+ messages in thread
* [PATCH 9/9] ARM: kirkwood: use devicetree for rtc-mv
2012-03-01 18:20 [PATCH 0/4] ARM: kirkwood: fdt: convert kirkwood init funcs to fdt Jason Cooper
` (20 preceding siblings ...)
2012-03-16 4:21 ` [PATCH 8/9 v2] ARM: kirkwood: rtc-mv devicetree bindings Jason Cooper
@ 2012-03-16 4:21 ` Jason Cooper
21 siblings, 0 replies; 136+ 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] 136+ messages in thread