ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Subsystems (11)
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
This series begins the process of converting all of the drivers initialized from kirkwood_init() to devicetree.
The first patch cleans up kirkwood_init() by moving a flag setting to it's appropriate location. This will help later when converting the audio driver.
Next, I pull the functionality of kirkwood_init() into kirkwood_dt_init() in board-dt.c This way, as drivers are converted, their init calls can be removed from kirkwood_dt_init() and non-fdt users won't be affected (they call kirkwood_init()).
Last, I converted the two easiest drivers, rtc and wdt. The xor and crypto drivers remain for a later patch series.
Jason Cooper (4):
ARM: kirkwood: move var setting to correct location.
ARM: kirkwood: fdt: absorb kirkwood_init()
ARM: kirkwood: convert rtc-mv to fdt.
ARM: kirkwood: convert orion-wdt to fdt.
arch/arm/boot/dts/kirkwood.dtsi | 12 ++++++++++ arch/arm/mach-kirkwood/board-dt.c | 28 ++++++++++++++++++++++- arch/arm/mach-kirkwood/common.c | 10 ++++---- arch/arm/mach-kirkwood/common.h | 6 +++++ drivers/rtc/rtc-mv.c | 19 ++++++++++++++++ drivers/watchdog/orion_wdt.c | 44 ++++++++++++++++++++++++++---------- 6 files changed, 101 insertions(+), 18 deletions(-)
Signature · 1 line
1.7.3.4
PATCH 1/4 ARM: kirkwood: move var setting to correct location.
This variable should be set within the driver init function that uses it's struct, not in the generic init function.
--- arch/arm/mach-kirkwood/common.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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,
Signature · 1 line
1.7.3.4
PATCH 2/4 ARM: kirkwood: fdt: absorb kirkwood_init()
In reply to Jason CooperWe 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.
--- 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(-)
arch/arm/mach-kirkwood/board-dt.c +29 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +6 -6
@@ -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 );
arch/arm/mach-kirkwood/common.h +8 -0
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*devvoid 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;
Signature · 1 line
1.7.3.4
PATCH 2/4 ARM: kirkwood: fdt: absorb kirkwood_init()
Quoted 30 lines · Jason Cooper
We need to absorb
kirkwood_init()intokirkwood_dt_init()so that as we convert drivers, we can remove the platform call, egkirkwood_rtc_init(). This maintains compatibility with non-fdt configurations because they still callkirkwood_init()incommon.c.As drivers are converted, we will reinstate the 'static' qualifier in
common.c.Signed-off-by Jason Cooper <[email protected]>--- 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(-)arch/arm/mach-kirkwood/board-dt.c +2
-0@@ -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"
arch/arm/mach-kirkwood/board-dt.c static void __init dreamplug_init(void) · line 121
Quoted 6 lines
arch/arm/mach-kirkwood/board-dt.c +2
-1@@ -115,7 +117,33 @@ static void __init dreamplug_init(void)static void __init kirkwood_dt_init (void ) { -kirkwood_init (); +printk (KERN_INFO "Kirkwood: %s, TCLK=%d.\n" , +kirkwood_id (), kirkwood_tclk);
Nit: pr_info()
g.
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
In reply to Jason CooperThe comment at mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed in kirkwood.dtsi.
--- 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(-)
arch/arm/boot/dts/kirkwood.dtsi +6 -0
@@ -2,5 +2,11 @@ / { compatible = "marvell,kirkwood"; + + rtc at f1010300 { + compatible = "marvell,rtc"; + reg = <0xf1010300 0x1f>; + interrupts = <53>; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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 ); }
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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 );
drivers/rtc/rtc-mv.c +19 -0
@@ -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, }, };
Signature · 1 line
1.7.3.4
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
Quoted 20 lines · Jason Cooper
The comment at
mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed inkirkwood.dtsi.drivers/rtc/rtc-mv.c +5
-0@@ -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 ;
drivers/rtc/rtc-mv.c static int __devinit mv_rtc_probe(struct platform_device *pdev) · line 271
Quoted 8 lines
drivers/rtc/rtc-mv.c +2
-0@@ -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
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
Quoted 34 lines · Arnd Bergmann
Quoted 20 lines · Jason Cooper
The comment at
mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed inkirkwood.dtsi.drivers/rtc/rtc-mv.c +5
-0@@ -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 ;drivers/rtc/rtc-mv.c static int __devinit mv_rtc_probe(struct platform_device *pdev) · line 271
Quoted 8 lines
drivers/rtc/rtc-mv.c +2
-0@@ -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.
Quoted 5 lines
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_andmap rather than reading the property directly, but as I said you don't even need to do that for platform devices.
Learning everyday... :-)
thx,
Jason.
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
In reply to Jason CooperQuoted 45 lines · Jason Cooper
The comment at
mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed inkirkwood.dtsi.Signed-off-by Jason Cooper <[email protected]>--- 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(-)arch/arm/boot/dts/kirkwood.dtsi +6
-0@@ -2,5 +2,11 @@ / { compatible = "marvell,kirkwood"; + + rtc at f1010300 { + compatible = "marvell,rtc"; + reg = <0xf1010300 0x1f>; + interrupts = <53>; + }; };arch/arm/mach-kirkwood/board-dt.c +0
-1@@ -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 ();arch/arm/mach-kirkwood/common.c +0
-0
arch/arm/mach-kirkwood/common.c void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, · line 166
Quoted 5 lines
arch/arm/mach-kirkwood/common.c +1
-1@@ -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.
Quoted 31 lines
arch/arm/mach-kirkwood/common.c +0
-0{orion_rtc_init (RTC_PHYS_BASE ,IRQ_KIRKWOOD_RTC ); }arch/arm/mach-kirkwood/common.h +0
-1@@ -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 );drivers/rtc/rtc-mv.c +2
-0@@ -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;
drivers/rtc/rtc-mv.c static int __devinit mv_rtc_probe(struct platform_device *pdev) · line 231
Quoted 10 lines
drivers/rtc/rtc-mv.c +5
-0struct 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.
drivers/rtc/rtc-mv.c static int __devinit mv_rtc_probe(struct platform_device *pdev) · line 268
Quoted 9 lines
drivers/rtc/rtc-mv.c +2
-0if (!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.
Quoted 12 lines
drivers/rtc/rtc-mv.c +5
-0platform_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" , }, + {} +};
drivers/rtc/rtc-mv.c static int __exit mv_rtc_remove(struct platform_device *pdev) · line 320
Quoted 10 lines
drivers/rtc/rtc-mv.c +5
-0+#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.
Quoted 6 lines
drivers/rtc/rtc-mv.c +0
-0}, };Signature · 1 line
1.7.3.4
Signature · 1 line
email sent from notmuch.vim plugin
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
Quoted 12 lines · Grant Likely
arch/arm/mach-kirkwood/common.c void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, · line 166
Quoted 8 lines
arch/arm/mach-kirkwood/common.c +1
-1@@ -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
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
In reply to Grant LikelyQuoted 46 lines · Grant Likely
Quoted 45 lines · Jason Cooper
The comment at
mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed inkirkwood.dtsi.Signed-off-by Jason Cooper <[email protected]>--- 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(-)arch/arm/boot/dts/kirkwood.dtsi +6
-0@@ -2,5 +2,11 @@ / { compatible = "marvell,kirkwood"; + + rtc at f1010300 { + compatible = "marvell,rtc"; + reg = <0xf1010300 0x1f>; + interrupts = <53>; + }; };arch/arm/mach-kirkwood/board-dt.c +0
-1@@ -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 ();arch/arm/mach-kirkwood/common.c +0
-0@@ -163,7 +163,7 @@ void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
Quoted 8 lines
arch/arm/mach-kirkwood/common.c void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, · line 166
Quoted 5 lines
arch/arm/mach-kirkwood/common.c +1
-1/***************************************************************************** * 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?
Quoted 36 lines
Quoted 36 lines
arch/arm/mach-kirkwood/common.c +0
-0{orion_rtc_init (RTC_PHYS_BASE ,IRQ_KIRKWOOD_RTC ); }arch/arm/mach-kirkwood/common.h +0
-1@@ -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 );drivers/rtc/rtc-mv.c +3
-0@@ -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;
Quoted 8 lines
drivers/rtc/rtc-mv.c static int __devinit mv_rtc_probe(struct platform_device *pdev) · line 231
Quoted 5 lines
drivers/rtc/rtc-mv.c +4
-0res =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 theplatform_devicewith mem resources.
fixed in next version.
Quoted 5 lines
Quoted 5 lines
drivers/rtc/rtc-mv.c +0
-0if (!res)return -ENODEV ;@@ -257,6 +264,8 @@ static int __devinit mv_rtc_probe(struct platform_device *pdev)
Quoted 8 lines
drivers/rtc/rtc-mv.c static int __devinit mv_rtc_probe(struct platform_device *pdev) · line 268
Quoted 4 lines
drivers/rtc/rtc-mv.c +2
-0pdata->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.
Quoted 26 lines
Quoted 12 lines
drivers/rtc/rtc-mv.c +5
-0platform_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" , }, + {} +};drivers/rtc/rtc-mv.c static int __exit mv_rtc_remove(struct platform_device *pdev) · line 320
Quoted 10 lines
drivers/rtc/rtc-mv.c +5
-0+#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),
Quoted 1 line
that would get rid of the #else clause above.
fixed across kirkwood patches so far.
Thanks for the review.
Jason.
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
In reply to Jason CooperAm Donnerstag 01 M?rz 2012, 19:20:54 schrieb Jason Cooper:
Quoted 17 lines
The comment at
mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed inkirkwood.dtsi.Signed-off-by Jason Cooper <[email protected]>--- 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(-)(quoted diff) +0
-0
b/arch/arm/boot/dts/kirkwood.dtsiindex 771c6bb..5fb185c 100644
arch/arm/boot/dts/kirkwood.dtsi line 7
Quoted 6 lines
arch/arm/boot/dts/kirkwood.dtsi +3
-0@@ -2,5 +2,11 @@ / { compatible = "marvell,kirkwood"; + + rtc at f1010300 { + compatible = "marvell,rtc";
what about the names used here?
in my older patch series i flagged all converted devices with two compatibility names. Eg:
{ .compatible = "marvell,orion5x-rtc", },
{ .compatible = "marvell,kirkwood-rtc", },
IMHO marvell,rtc is i little too general, i guess marvell won't have only one rtc ;)
Other opinions?
Signature · 1 line
Michael
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
Quoted 10 lines · Michael Walle
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
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · Michael Walle
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 ;)
Quoted 8 lines
Quoted 1 line
Other opinions?
Being specific is certainly good, and it may also be a good idea to list the first one it's compatible with in the device tree source.
So the device tree for a 88F6281 soc could list
compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc", "marvell,orion-rtc";
I'll go ahead and make this style of change throughout. I assume "marvell,88f6281-rtc" would only be for SoC internal devices? eg, the spi driver wouldn't follow that convention. I'll see if I can dig up a part number on it.
Quoted 7 lines
This would give the device driver the option which one to bind to. Anything that has an rtc compatible with the one in orion should list that one, so that the driver only has to list that one if they are truely identical, but if the driver has to get modified later to know the difference between orion and kirkwood rtcs, it can check the more specific value.
Arnd
thx,
Jason.
PATCH 3/4 ARM: kirkwood: convert rtc-mv to fdt.
Am Sonntag 04 M?rz 2012, 23:27:10 schrieb Jason:
Quoted 18 lines · Arnd Bergmann
Quoted 17 lines · Michael Walle
Quoted 10 lines
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
Quoted 7 lines
Quoted 2 lines
compatible = "marvell,88f6281-rtc", "marvell,kirkwood-rtc", "marvell,orion-rtc";I'll go ahead and make this style of change throughout. I assume "marvell,88f6281-rtc" would only be for SoC internal devices? eg, the spi driver wouldn't follow that convention. I'll see if I can dig up a part number on it.
following the filename spi-orion.c i guess it should use 'marvell,orion-spi'.
Signature · 1 line
Michael
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
In reply to Jason CooperConverted 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.
--- 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(-)
arch/arm/boot/dts/kirkwood.dtsi +6 -0
@@ -8,5 +8,11 @@ reg = <0xf1010300 0x1f>; interrupts = <53>; }; + + wdt at fed20300 { + compatible = "marvell,orion-wdt"; + reg = <0xfed20300 0x28>; + clock-frequency = <200000000>; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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); }
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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 );
drivers/watchdog/orion_wdt.c +32 -12
119 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 6 lines · Jason Cooper
static int heartbeat = -1; /* module parameter (seconds) */
static unsigned intwdt_max_duration; /* (seconds) */ static unsigned intwdt_tclk;
+static unsigned intwdt_reg;
static unsigned longwdt_status;
staticDEFINE_SPINLOCK(wdt_lock);
This variable needs to be a 'void __iomem *', not an int.
drivers/watchdog/orion_wdt.c static struct miscdevice orion_wdt_miscdev = { · line 260
Quoted 7 lines
drivers/watchdog/orion_wdt.c +4
-0+ 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
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
In reply to Jason CooperQuoted 62 lines · Jason Cooper
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 <[email protected]>--- 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(-)arch/arm/boot/dts/kirkwood.dtsi +6
-0@@ -8,5 +8,11 @@ reg = <0xf1010300 0x1f>; interrupts = <53>; }; + + wdt at fed20300 { + compatible = "marvell,orion-wdt"; + reg = <0xfed20300 0x28>; + clock-frequency = <200000000>; + }; };arch/arm/mach-kirkwood/board-dt.c +0
-1@@ -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 ();arch/arm/mach-kirkwood/common.c +1
-1@@ -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); }arch/arm/mach-kirkwood/common.h +0
-0
arch/arm/mach-kirkwood/common.h void kirkwood_restart(char, const char *); · line 56
Quoted 4 lines
arch/arm/mach-kirkwood/common.h +0
-1@@ -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.
Quoted 100 lines
arch/arm/mach-kirkwood/common.h +0
-0void kirkwood_xor0_init (void );void kirkwood_xor1_init (void );void kirkwood_crypto_init (void );drivers/watchdog/orion_wdt.c +15
-12@@ -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);
drivers/watchdog/orion_wdt.c static struct miscdevice orion_wdt_miscdev = { · line 257
Quoted 10 lines
drivers/watchdog/orion_wdt.c +7
-0+ +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.
Quoted 20 lines
drivers/watchdog/orion_wdt.c +9
-0if (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),
drivers/watchdog/orion_wdt.c static struct platform_driver orion_wdt_driver = { · line 313
Quoted 4 lines
drivers/watchdog/orion_wdt.c +1
-0@@ -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()
Quoted 6 lines
drivers/watchdog/orion_wdt.c +0
-0}, };Signature · 1 line
1.7.3.4
Signature · 1 line
email sent from notmuch.vim plugin
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
In reply to Jason CooperHi Jason,
Quoted 21 lines · Jason Cooper
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 <[email protected]>--- 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(-)arch/arm/boot/dts/kirkwood.dtsi +0
-0
arch/arm/boot/dts/kirkwood.dtsi line 16
Quoted 9 lines
arch/arm/boot/dts/kirkwood.dtsi +6
-0@@ -8,5 +8,11 @@ reg = <0xf1010300 0x1f>; interrupts = <53>; }; + + wdt at fed20300 { + compatible = "marvell,orion-wdt"; + reg = <0xfed20300 0x28>; + clock-frequency = <200000000>; + };
How this will work for boards using a different clock frequency (TCLK) ? Here, we could have 166MHz for example.
Can this node be updated during the board initialization with a detected TCLK value ?
Or maybe this clock-frequency can reference a TCLK frequency defined in a board specific dts (I don't know if the DT format allow such things) ?
Regards,
Simon
Quoted 181 lines
arch/arm/boot/dts/kirkwood.dtsi +0
-0};arch/arm/mach-kirkwood/board-dt.c +0
-1@@ -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 ();arch/arm/mach-kirkwood/common.c +1
-1@@ -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); }arch/arm/mach-kirkwood/common.h +0
-1@@ -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 );drivers/watchdog/orion_wdt.c +32
-12@@ -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, }, };Signature · 7 lines
1.7.3.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120302/8a34daf6/attachment.sig>
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 37 lines · Simon Guinot
Hi Jason,
Quoted 21 lines · Jason Cooper
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 <[email protected]>--- 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(-)arch/arm/boot/dts/kirkwood.dtsi +0
-0arch/arm/boot/dts/kirkwood.dtsi line 16
Quoted 9 lines
arch/arm/boot/dts/kirkwood.dtsi +6
-0@@ -8,5 +8,11 @@ reg = <0xf1010300 0x1f>; interrupts = <53>; }; + + wdt at fed20300 { + compatible = "marvell,orion-wdt"; + reg = <0xfed20300 0x28>; + clock-frequency = <200000000>; + };How this will work for boards using a different clock frequency (TCLK) ? Here, we could have 166MHz for example.
Quoted 5 lines
Can this node be updated during the board initialization with a detected TCLK value ?
Or maybe this clock-frequency can reference a TCLK frequency defined in a board specific dts (I don't know if the DT format allow such things) ?
Grr... good catch. I originally had this in kirkwood-dreamplug.dts, which is always 200000000. That's not the case in kirkwood.dtsi. What I would like to do, and I haven't had time to look into it (I thought I would tackle it later as a refinement :-( ), is a reference of some sort, eg:
in kirkwood.dtsi:
/ {
compatible = "marvell,kirkwood";
tclk:clock-frequency = <200000000>;
wdt at fed20300 {
compatible = "marvell,orion-wdt";
reg = <0xfed20300 0x28>;
clock-frequency = &tclk;
};
};then, in kirkwood-foobar.dts
/include/ "kirkwood.dtsi"
/ {
model = "foobar";
compatible = "...";
tclk:clock-frequency = <166000000>;
};but I'm not sure if that would work.
In any case, the simplest answer is to set clock-frequency in kirkwood-dreamplug.dts as a root node property, and then each driver that needs tclk, requests the clock-frequency from the root node. Hopefully, Grant can chime in on this one.
Thanks for the review,
Jason.
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 23 lines · Jason
Grr... good catch. I originally had this in
kirkwood-dreamplug.dts, which is always 200000000. That's not the case inkirkwood.dtsi. What I would like to do, and I haven't had time to look into it (I thought I would tackle it later as a refinement :-( ), is a reference of some sort, eg:in
kirkwood.dtsi:/ { compatible = "marvell,kirkwood"; tclk:clock-frequency = <200000000>; wdt at fed20300 { compatible = "marvell,orion-wdt"; reg = <0xfed20300 0x28>; clock-frequency = &tclk; }; };then, in
kirkwood-foobar.dtsinclude "
kirkwood.dtsi"
Quoted 7 lines
/ { model = "foobar"; compatible = "..."; tclk:clock-frequency = <166000000>; };but I'm not sure if that would work.
That would make wdt at fed20300/clock-frequency a phandle pointing to the root property, which is not what we want here.
Quoted 4 lines
In any case, the simplest answer is to set clock-frequency in
kirkwood-dreamplug.dtsas a root node property, and then each driver that needs tclk, requests the clock-frequency from the root node. Hopefully, Grant can chime in on this one.
I think you can just pick a reasonable default value for wdt at fed20300/clock-frequency, and let the board override that by setting it to something else if necessary. I suppose this will also change a bit when kirkwood gets moved over to generic clk support in the future and starts using the clk binding instead of what you do now.
Arnd
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 30 lines · Arnd Bergmann
Quoted 29 lines · Jason
Grr... good catch. I originally had this in
kirkwood-dreamplug.dts, which is always 200000000. That's not the case inkirkwood.dtsi. What I would like to do, and I haven't had time to look into it (I thought I would tackle it later as a refinement :-( ), is a reference of some sort, eg:in
kirkwood.dtsi:/ { compatible = "marvell,kirkwood"; tclk:clock-frequency = <200000000>; wdt at fed20300 { compatible = "marvell,orion-wdt"; reg = <0xfed20300 0x28>; clock-frequency = &tclk; }; };then, in
kirkwood-foobar.dtsinclude "
kirkwood.dtsi"/ { model = "foobar"; compatible = "..."; tclk:clock-frequency = <166000000>; };
Quoted 4 lines
Quoted 1 line
but I'm not sure if that would work.
That would make wdt at fed20300/clock-frequency a phandle pointing to the root property, which is not what we want here.
The 200000000 value is not the actual value used in most drivers [1], but rather the speed of the system clock [2] (hence, my inclination to make it a root property), the drivers have been pulling this number from a global variable [3] and dividing/rounding it as needed for their own needs [1].
Since it's derived from the SoC core [2], it would seem to make sense to have a root "clock-frequency" in the board dts. Am I missing something? Is there a better way to do this?
Quoted 8 lines
Quoted 4 lines
In any case, the simplest answer is to set clock-frequency in
kirkwood-dreamplug.dtsas a root node property, and then each driver that needs tclk, requests the clock-frequency from the root node. Hopefully, Grant can chime in on this one.I think you can just pick a reasonable default value for wdt at fed20300/clock-frequency, and let the board override that by setting it to something else if necessary.
True, for now, I can just set clock-frequency for each device to the exact same value and we'll polish later once we have a better idea of the pattern it's following.
Quoted 3 lines
I suppose this will also change a bit when kirkwood gets moved over to generic clk support in the future and starts using the clk binding instead of what you do now.
Yes, I don't want to over-think it, but I would like to make sure it's in the correct place, since it is a global property of the board.
thanks for the review,
Jason.
[1] drivers/spi/spi-orion.c:110-117,500,501
# 110-117 ### orion_spi_baudrate_set()
tclk_hz = orion_spi->tclk;
/*
* the supported rates are: 4,6,8...30
* round up as we look for equal or less speed
*/
rate = DIV_ROUND_UP(tclk_hz, speed);
rate = roundup(rate, 2);
# 500-501 ### orion_spi_probe()
spi->max_speed = DIV_ROUND_UP(spi->tclk, 4);
spi->min_speed = DIV_ROUND_UP(spi->tclk, 30);#############
[2] arch/arm/mach-kirkwood/common.c:320-332
# 320-332 ###
int kirkwood_tclk;
static int __init kirkwood_find_tclk(void)
{
u32 dev, rev;
kirkwood_pcie_id(&dev, &rev);
if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
return 200000000;
return 166666667;
}#############
[3] arch/arm/mach-kirkwood/common.c:235
# 235 ####### kirkwood_spi_init()
orion_spi_init(SPI_PHYS_BASE, kirkwood_tclk);
#############
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 9 lines · Jason
Quoted 3 lines
That would make wdt at fed20300/clock-frequency a phandle pointing to the root property, which is not what we want here.
The 200000000 value is not the actual value used in most drivers [1], but rather the speed of the system clock [2] (hence, my inclination to make it a root property), the drivers have been pulling this number from a global variable [3] and dividing/rounding it as needed for their own needs [1].
Ah, I see. If you put a "clock-frequency" property into a device node, it should definitely be the frequency used by that device, not the system clock that it is derived from.
Quoted 3 lines
Since it's derived from the SoC core [2], it would seem to make sense to have a root "clock-frequency" in the board dts. Am I missing something? Is there a better way to do this?
The correct solution would be to use the clock binding, but I'm not sure how far we are in making that final or usable.
Quoted 13 lines
Quoted 8 lines
Quoted 4 lines
In any case, the simplest answer is to set clock-frequency in
kirkwood-dreamplug.dtsas a root node property, and then each driver that needs tclk, requests the clock-frequency from the root node. Hopefully, Grant can chime in on this one.I think you can just pick a reasonable default value for wdt at fed20300/clock-frequency, and let the board override that by setting it to something else if necessary.
True, for now, I can just set clock-frequency for each device to the exact same value and we'll polish later once we have a better idea of the pattern it's following.
Quoted 6 lines
Quoted 3 lines
I suppose this will also change a bit when kirkwood gets moved over to generic clk support in the future and starts using the clk binding instead of what you do now.
Yes, I don't want to over-think it, but I would like to make sure it's in the correct place, since it is a global property of the board.
Andrew Lunn said that he has a patch for plat-orion to use the generic clock framework. I think we should look at that before introducing a hack that will have to be removed again very soon.
Kirkwood/orion is probably not a bad platform to add to the initial set of platforms for which we use the common clk infrastructure, so maybe the best way forward for you is to take Andrews patches and build on top of that. It might mean that your follow-on patches get delayed until v3.5 instead of going into v3.4, but the initial code you have in arm-soc is working already and you can work on getting it the clock code right in the initial code.
Arnd
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Jason
Quoted 3 lines
That would make wdt at fed20300/clock-frequency a phandle pointing to the root property, which is not what we want here.
The 200000000 value is not the actual value used in most drivers [1], but rather the speed of the system clock [2] (hence, my inclination to make it a root property), the drivers have been pulling this number from a global variable [3] and dividing/rounding it as needed for their own needs [1].
Quoted 3 lines
Ah, I see. If you put a "clock-frequency" property into a device node, it should definitely be the frequency used by that device, not the system clock that it is derived from.
Whew, glad to know I'm not crazy.
Quoted 24 lines
Quoted 3 lines
Since it's derived from the SoC core [2], it would seem to make sense to have a root "clock-frequency" in the board dts. Am I missing something? Is there a better way to do this?
The correct solution would be to use the clock binding, but I'm not sure how far we are in making that final or usable.
Quoted 17 lines
Quoted 8 lines
Quoted 4 lines
In any case, the simplest answer is to set clock-frequency in
kirkwood-dreamplug.dtsas a root node property, and then each driver that needs tclk, requests the clock-frequency from the root node. Hopefully, Grant can chime in on this one.I think you can just pick a reasonable default value for wdt at fed20300/clock-frequency, and let the board override that by setting it to something else if necessary.
True, for now, I can just set clock-frequency for each device to the exact same value and we'll polish later once we have a better idea of the pattern it's following.
Quoted 3 lines
I suppose this will also change a bit when kirkwood gets moved over to generic clk support in the future and starts using the clk binding instead of what you do now.
Quoted 6 lines
Quoted 2 lines
Yes, I don't want to over-think it, but I would like to make sure it's in the correct place, since it is a global property of the board.
Andrew Lunn said that he has a patch for plat-orion to use the generic clock framework. I think we should look at that before introducing a hack that will have to be removed again very soon.
I asked him for it earlier [1], apparently it's a very invasive patch series which breaks things. I would like to look at it as a reference, even if applying it isn't a good idea.
How about it, Andrew?
Quoted 4 lines
Kirkwood/orion is probably not a bad platform to add to the initial set of platforms for which we use the common clk infrastructure, so maybe the best way forward for you is to take Andrews patches and build on top of that.
Agreed.
Quoted 4 lines
It might mean that your follow-on patches get delayed until v3.5 instead of going into v3.4, but the initial code you have in arm-soc is working already and you can work on getting it the clock code right in the initial code.
In [1] I was trying to setup a stand-in, eg kirkwood_get_clock() and kirkwood_put_clock() that could be replaced once the clock code lands. That way, we're on the right path, but not blocked waiting for the clock code.
thx,
Jason.
Andrew Lunn
maintainerPATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 7 lines
Quoted 3 lines
Andrew Lunn said that he has a patch for plat-orion to use the generic clock framework. I think we should look at that before introducing a hack that will have to be removed again very soon.
I asked him for it earlier [1], apparently it's a very invasive patch series which breaks things. I would like to look at it as a reference, even if applying it isn't a good idea.
I did not say it breaks things. I said i have a habit of breaking orion5x, because i cannot test it.
I will send the patches as RFC on Sunday. I'm traveling at the moment.
Andrew
PATCH 4/4 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 10 lines · Andrew Lunn
Quoted 7 lines
Quoted 3 lines
Andrew Lunn said that he has a patch for plat-orion to use the generic clock framework. I think we should look at that before introducing a hack that will have to be removed again very soon.
I asked him for it earlier [1], apparently it's a very invasive patch series which breaks things. I would like to look at it as a reference, even if applying it isn't a good idea.
I did not say it breaks things. I said i have a habit of breaking orion5x, because i cannot test it.
Wow, you're right, I was way off. I must not have read that over before sending. My mistake.
Quoted 1 line
I will send the patches as RFC on Sunday. I'm traveling at the moment.
Awesome, thanks.
Jason.
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
In reply to Jason CooperQuoted 6 lines · Jason Cooper
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.
Quoted 7 lines
Next, I pull the functionality of
kirkwood_init()intokirkwood_dt_init()inboard-dt.cThis way, as drivers are converted, their init calls can be removed fromkirkwood_dt_init()and non-fdt users won't be affected (they callkirkwood_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
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Quoted 15 lines · Arnd Bergmann
Quoted 6 lines · Jason Cooper
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.Quoted 7 lines
Next, I pull the functionality of
kirkwood_init()intokirkwood_dt_init()inboard-dt.cThis way, as drivers are converted, their init calls can be removed fromkirkwood_dt_init()and non-fdt users won't be affected (they callkirkwood_init()).Last, I converted the two easiest drivers, rtc and wdt. The xor and crypto drivers remain for a later patch series.
Quoted 7 lines
Hi Jason,
Nice patch series! I've commented on a few details that need improving, but it seems you're making good progress overall. Note that in other platforms, we typically focus on converting all the devices outside of the soc first, because that lets us get away from board files faster, but there is nothing wrong in principle in converting the devices on the soc as well.
Thanks for the feedback. I'll redo this series and resubmit. Did you catch my patch from yesterday?
[PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
thx,
Jason.
[1] http://www.spinics.net/lists/arm-kernel/msg161975.html
Quoted 7 lines
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Quoted 4 lines · Jason
Thanks for the feedback. I'll redo this series and resubmit. Did you catch my patch from yesterday?
[PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
Yes, I saw that. It looks good and I was just waiting if other people have comments on it. Maybe you can put it into the same git tree as these ones when they are ready and you send a pull request.
Arnd
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Quoted 9 lines · Arnd Bergmann
Quoted 4 lines · Jason
Thanks for the feedback. I'll redo this series and resubmit. Did you catch my patch from yesterday?
[PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
Yes, I saw that. It looks good and I was just waiting if other people have comments on it. Maybe you can put it into the same git tree as these ones when they are ready and you send a pull request.
Okay, I have a local branch, 'dreamplug_dt' based at v3.3-rc3. It includes the two patches you've already merged into your tree:
c9780e7 ARM: kirkwood: add dreamplug (fdt) support. dbc3c26 ARM: kirkwood: convert uart0 to devicetree.
Plus the spi/flash/partitions, and the most recent series.
Can I just do:
git push linux-kirkwood dreamplug_dt:kirkwood_dt
Then, issue a pull request for
git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt
and reference the first uncommitted patch?
Most of the googlings for 'pull request' yield github's "click the button", yuck.
Also, is there an equivalent to 'git format-patch/send-email' for pull requests? The pull requests I've looked at seem awfully consistent in formatting.
thx,
Jason.
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Quoted 21 lines · Jason
Quoted 9 lines · Arnd Bergmann
Quoted 4 lines · Jason
Thanks for the feedback. I'll redo this series and resubmit. Did you catch my patch from yesterday?
[PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
Yes, I saw that. It looks good and I was just waiting if other people have comments on it. Maybe you can put it into the same git tree as these ones when they are ready and you send a pull request.
Okay, I have a local branch, '
dreamplug_dt' based at v3.3-rc3. It includes the two patches you've already merged into your tree:c9780e7 ARM: kirkwood: add dreamplug (fdt) support. dbc3c26 ARM: kirkwood: convert uart0 to devicetree.
Plus the spi/flash/partitions, and the most recent series.
Can I just do:
Quoted 7 lines
git push linux-kirkwood dreamplug_dt:kirkwood_dt
Then, issue a pull request for
git://git.infradead.org/users/jcooper/linux-kirkwood.gitkirkwood_dtand reference the first uncommitted patch?
I have other commit IDs for the two patches that I took from your emails, so you should rebase the other patches on top of the version that I have in the arm-soc/kirkwood/board branch, otherwise we end up with duplicate commits my tree when I pull them again.
Quoted 6 lines
Most of the googlings for 'pull request' yield github's "click the button", yuck.
Also, is there an equivalent to 'git format-patch/send-email' for pull requests? The pull requests I've looked at seem awfully consistent in formatting.
It's "git request-pull".
Arnd
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Quoted 26 lines · Arnd Bergmann
Quoted 25 lines · Jason
Quoted 9 lines · Arnd Bergmann
Quoted 4 lines · Jason
Thanks for the feedback. I'll redo this series and resubmit. Did you catch my patch from yesterday?
[PATCH v3] ARM: kirkwood: covert orion-spi to fdt. [1]
Yes, I saw that. It looks good and I was just waiting if other people have comments on it. Maybe you can put it into the same git tree as these ones when they are ready and you send a pull request.
Okay, I have a local branch, '
dreamplug_dt' based at v3.3-rc3. It includes the two patches you've already merged into your tree:c9780e7 ARM: kirkwood: add dreamplug (fdt) support. dbc3c26 ARM: kirkwood: convert uart0 to devicetree.
Plus the spi/flash/partitions, and the most recent series.
Can I just do:
git push linux-kirkwood dreamplug_dt:kirkwood_dt
Then, issue a pull request for
Quoted 8 lines
Quoted 3 lines
git://git.infradead.org/users/jcooper/linux-kirkwood.gitkirkwood_dtand reference the first uncommitted patch?
I have other commit IDs for the two patches that I took from your emails, so you should rebase the other patches on top of the version that I have in the arm-soc/kirkwood/board branch, otherwise we end up with duplicate commits my tree when I pull them again.
Got it, I cherry-picked the series over and incorporated Grant's suggestions.
Quoted 8 lines
Quoted 6 lines
Most of the googlings for 'pull request' yield github's "click the button", yuck.
Also, is there an equivalent to 'git format-patch/send-email' for pull requests? The pull requests I've looked at seem awfully consistent in formatting.
It's "git request-pull".
Of course it is. :-) duh. Thanks. I'm pushing to my tree now. I'll probably submit the series attached to the pull request just so it's easy to review and easy to pull (hopefully).
Thanks for all the help.
Jason.
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Quoted 9 lines · Jason
Quoted 5 lines
I have other commit IDs for the two patches that I took from your emails, so you should rebase the other patches on top of the version that I have in the arm-soc/kirkwood/board branch, otherwise we end up with duplicate commits my tree when I pull them again.
Got it, I cherry-picked the series over and incorporated Grant's suggestions.
Just making sure you know about this one:
git rebase -i --onto arm-soc/kirkwood/board torvalds/master
The '-i' lets you pick which ones you want to move over, then it applies all patches from the current branch that are not on torvalds/master on top of the last commit from arm-soc/kirkwood/board.
If you don't know it yet, I suggest you play with this for an hour or so that will be very well invested time. If you knew this, then nevermind.
Arnd
cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
Quoted 13 lines · Arnd Bergmann
Quoted 9 lines · Jason
Quoted 5 lines
I have other commit IDs for the two patches that I took from your emails, so you should rebase the other patches on top of the version that I have in the arm-soc/kirkwood/board branch, otherwise we end up with duplicate commits my tree when I pull them again.
Got it, I cherry-picked the series over and incorporated Grant's suggestions.
Just making sure you know about this one:
Quoted 8 lines
git rebase -i --onto arm-soc/kirkwood/board torvalds/master
The '-i' lets you pick which ones you want to move over, then it applies all patches from the current branch that are not on torvalds/master on top of the last commit from arm-soc/kirkwood/board.
If you don't know it yet, I suggest you play with this for an hour or so that will be very well invested time. If you knew this, then nevermind.
I use the daylights out of git rebase -i, but hadn't made use of --onto yet. Thanks for the tip.
thx,
Jason.
v2 cover ARM: kirkwood: fdt: convert kirkwood init funcs to fdt
In reply to Jason CooperThis 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(-)
Signature · 1 line
1.7.3.4
PATCH v2 1/5 ARM: kirkwood: covert orion-spi to fdt.
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.
---
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(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +34 -0
@@ -22,4 +22,38 @@ interrupts = <33>; clock-frequency = <200000000>; }; + + spi at f1010600 { + #address-cells = <1>; + #size-cells = <0>; + + compatible = "marvell,orion-spi"; + reg = <0xf1010600 0x1ff>; + clock-frequency = <200000000>; + + flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + + compatible = "macronix,mx25l1606e", "jedec-flash"; + + spi-max-frequency = <50000000>; + reg = <0>; + + partition at 0 { + label = "U-Boot"; + reg = <0x0 0x100000>; + }; + + partition at 100000 { + label = "U-Boot Environment"; + reg = <0x100000 0x080000>; + }; + + partition at 180000 { + label = "Flattened Device Tree"; + reg = <0x180000 0x080000>; + }; + }; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -40
@@ -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);
arch/arm/mach-kirkwood/common.c +11 -0
@@ -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 ));
drivers/spi/spi-orion.c +33 -4
@@ -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), };
Signature · 1 line
1.7.3.4
PATCH v2 1/5 ARM: kirkwood: covert orion-spi to fdt.
Am Freitag 02 M?rz 2012, 18:50:18 schrieb Jason Cooper:
Quoted 143 lines
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 <[email protected]>---
Changes from v1:
- used
of_match_ptr()as suggested by Grant Likelyarch/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(-)
(quoted diff) +0
-0
b/arch/arm/boot/dts/kirkwood-dreamplug.dtsindex 8a5dff8..bdf2ddc 100644arch/arm/boot/dts/kirkwood-dreamplug.dts +34
-0@@ -22,4 +22,38 @@ interrupts = <33>; clock-frequency = <200000000>; }; + + spi at f1010600 { + #address-cells = <1>; + #size-cells = <0>; + + compatible = "marvell,orion-spi"; + reg = <0xf1010600 0x1ff>; + clock-frequency = <200000000>; + + flash at 0 { + #address-cells = <1>; + #size-cells = <1>; + + compatible = "macronix,mx25l1606e", "jedec-flash"; + + spi-max-frequency = <50000000>; + reg = <0>; + + partition at 0 { + label = "U-Boot"; + reg = <0x0 0x100000>; + }; + + partition at 100000 { + label = "U-Boot Environment"; + reg = <0x100000 0x080000>; + }; + + partition at 180000 { + label = "Flattened Device Tree"; + reg = <0x180000 0x080000>; + }; + }; + }; };(quoted diff) +0
-0
b/arch/arm/mach-kirkwood/board-dt.cindex fbe6405..4960e63 100644arch/arm/mach-kirkwood/board-dt.c +0
-40@@ -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);(quoted diff) +0
-0
b/arch/arm/mach-kirkwood/common.cindex cc15426..357fcde 100644arch/arm/mach-kirkwood/common.c +4
-0@@ -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" );
arch/arm/mach-kirkwood/common.c static int __init kirkwood_clock_gate(void) · line 534
Quoted 7 lines
arch/arm/mach-kirkwood/common.c +4
-0@@ -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")))
Quoted 58 lines
arch/arm/mach-kirkwood/common.c +3
-0+ 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 ));drivers/spi/spi-orion.c +4
-1@@ -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;/* drivers/spi/spi-orion.c +2
-1* 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;
drivers/spi/spi-orion.c static int __init orion_spi_probe(struct · line 495
Quoted 10 lines
drivers/spi/spi-orion.c +8
-2- 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?
Quoted 16 lines
drivers/spi/spi-orion.c +12
-0+ 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 ) {
drivers/spi/spi-orion.c static int __exit orion_spi_remove(struct · line 566
Quoted 4 lines
drivers/spi/spi-orion.c +0
-0@@ -541,10 +563,17 @@ static int __exit orion_spi_remove(struct platform_device *pdev) MODULE_ALIAS("platform:" DRIVER_NAME);
#ifdef CONFIG_OF
drivers/spi/spi-orion.c static int __exit orion_spi_remove(struct platform_device *pdev) · line 570
Quoted 5 lines
drivers/spi/spi-orion.c +5
-0+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
Quoted 8 lines
drivers/spi/spi-orion.c +1
-0static 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), };
Signature · 1 line
Michael
PATCH v2 1/5 ARM: kirkwood: covert orion-spi to fdt.
Quoted 4 lines · Michael Walle
Quoted 4 lines
drivers/spi/spi-orion.c +0
-0@@ -481,8 +485,26 @@ static int __init orion_spi_probe(struct platform_device *pdev) spi->master = master; spi->spi_info = spi_info;
Quoted 13 lines
drivers/spi/spi-orion.c static int __init orion_spi_probe(struct platform_device *pdev) · line 495
Quoted 10 lines
drivers/spi/spi-orion.c +8
-2- 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_u32instead? and report a more meaningful error message, eg no valid clock-frequency property in the OF case?
I suggested this version, because it keeps the code very simple. Checking the return value would of course be correct, but I don't think we need any extra information here: there are only a few ways how this can go wrong and it will be pretty obvious from the device tree when you see the message.
Arnd
PATCH v2 2/5 ARM: kirkwood: move var setting to correct location.
In reply to Jason CooperThis variable should be set within the driver init function that uses it's struct, not in the generic init function.
--- arch/arm/mach-kirkwood/common.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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,
Signature · 1 line
1.7.3.4
PATCH v2 3/5 ARM: kirkwood: fdt: absorb kirkwood_init()
In reply to Jason CooperWe 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.
---
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(-)
arch/arm/mach-kirkwood/board-dt.c +28 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +6 -6
@@ -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 );
arch/arm/mach-kirkwood/common.h +8 -0
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*devvoid 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;
Signature · 1 line
1.7.3.4
PATCH v2 4/5 ARM: kirkwood: convert rtc-mv to fdt.
In reply to Jason CooperThe comment at mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed in kirkwood.dtsi.
---
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(-)
arch/arm/boot/dts/kirkwood.dtsi +6 -0
@@ -2,5 +2,11 @@ / { compatible = "marvell,kirkwood"; + + rtc at f1010300 { + compatible = "marvell,rtc"; + reg = <0xf1010300 0x1f>; + interrupts = <53>; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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 ); }
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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 );
drivers/rtc/rtc-mv.c +7 -0
@@ -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), }, };
Signature · 1 line
1.7.3.4
PATCH v2 4/5 ARM: kirkwood: convert rtc-mv to fdt.
Am Freitag 02 M?rz 2012, 18:50:21 schrieb Jason Cooper:
Quoted 86 lines
The comment at
mach-kirkwood/common.c:469, says this device is in every kirkwood board. So, it is placed inkirkwood.dtsi.Signed-off-by Jason Cooper <[email protected]>---
Changes since v1:
- removed unnecessary of_*() code from
_probe()
- useof_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(-)(quoted diff) +0
-0
b/arch/arm/boot/dts/kirkwood.dtsiindex 771c6bb..5fb185c 100644arch/arm/boot/dts/kirkwood.dtsi +6
-0@@ -2,5 +2,11 @@ / { compatible = "marvell,kirkwood"; + + rtc at f1010300 { + compatible = "marvell,rtc"; + reg = <0xf1010300 0x1f>; + interrupts = <53>; + }; };(quoted diff) +0
-0
b/arch/arm/mach-kirkwood/board-dt.cindex 2a45656..6e18338 100644arch/arm/mach-kirkwood/board-dt.c +0
-1@@ -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 ();(quoted diff) +0
-0
b/arch/arm/mach-kirkwood/common.cindex 167b6c8..0c0375f 100644arch/arm/mach-kirkwood/common.c +1
-0@@ -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 ); }(quoted diff) +0
-0
b/arch/arm/mach-kirkwood/common.hindex c382447..ca08826 100644arch/arm/mach-kirkwood/common.h +0
-1@@ -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 );drivers/rtc/rtc-mv.c +1
-0@@ -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>
drivers/rtc/rtc-mv.c static int __exit mv_rtc_remove(struct · line 302
Quoted 8 lines
drivers/rtc/rtc-mv.c +5
-0@@ -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?
Quoted 8 lines
drivers/rtc/rtc-mv.c +1
-0static 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), }, };
Signature · 1 line
Michael
PATCH v2 4/5 ARM: kirkwood: convert rtc-mv to fdt.
Quoted 11 lines · Michael Walle
drivers/rtc/rtc-mv.c static int __exit mv_rtc_remove(struct · line 302
Quoted 9 lines
drivers/rtc/rtc-mv.c +5
-0@@ -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_OFmissing 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
PATCH v2 4/5 ARM: kirkwood: convert rtc-mv to fdt.
Quoted 13 lines · Arnd Bergmann
Quoted 11 lines · Michael Walle
drivers/rtc/rtc-mv.c static int __exit mv_rtc_remove(struct · line 302
Quoted 9 lines
drivers/rtc/rtc-mv.c +5
-0@@ -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_OFmissing to prevent compiler warnings?
Quoted 5 lines
Yes, I guess so. I keep thinking that an
__unusedattribute would actually be more helpful here because it lets the compiler automatically discard the symbol when it's not used, but we still get potential compiler errors and warnings if something inside of the unused data is broken.
Hmmm, in the process of responding, I looked up Grant's original email
[1] to show justification. However, rereading it shows I was overzealous in my desire to remove #ifdef's. :-P Grant only said adding of_match_ptr() would remove the #else portion of my original code:
#ifdef CONFIG_OF
...
#else
#define rtc_mv_of_match_table = NULL;
#endif
I'll restore the #ifdef/#endif across the kirkwood code I've changed so far, without the #else. __unused shouldn't be necessary, then.
Thanks for the review, Michael.
thx,
Jason.
PATCH v2 5/5 ARM: kirkwood: convert orion-wdt to fdt.
In reply to Jason CooperConverted 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.
---
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(-)
arch/arm/boot/dts/kirkwood.dtsi +6 -0
@@ -8,5 +8,11 @@ reg = <0xf1010300 0x1f>; interrupts = <53>; }; + + wdt at fed20300 { + compatible = "marvell,orion-wdt"; + reg = <0xfed20300 0x28>; + clock-frequency = <200000000>; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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); }
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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 );
drivers/watchdog/orion_wdt.c +36 -12
123 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v2 5/5 ARM: kirkwood: convert orion-wdt to fdt.
Review
Quoted 10 lines · Jason Cooper
(quoted diff) +10
-0+ wdt_reg = (void __iomem *)TIMER_VIRT_BASE; + + ret = of_address_to_resource(np, 0, &res); + if (ret) { + printk(KERN_ERR "invalid address\n"); + return ret; + } + + wdt_reg = ioremap(res.start, res.end - res.start); +
This will break non-dt uses because you overwrite the wdt_reg value.
As I commented before, I think the best approach would be to provide a hardcoded resource for the device in the legacy case and just use platform_get_resource() to get the resource and ioremap it in either case.
of_address_to_resource() works only for the DT case, while platform_get_resource() works in either case.
You need to add something like
8<---
arch/arm/plat-orion/common.c +5 -1
@@ -568,13 +568,17 @@ void __init orion_spi_1_init(unsigned long mapbase,****************************************************************************/ static struct orion_wdt_platform_data orion_wdt_data; +static struct resource orion_wdt_resource = +DEFINE_RES_MEM (TIMER_PHYS_BASE ,0x28 ); +static struct platform_device orion_wdt_device = { .name ="orion_wdt" , .id =-1 , .dev = { .platform_data = &orion_wdt_data, }, - .num_resources =0 , + .resources = &orion_wdt_resource, + .num_resources =1 , };void __init orion_wdt_init (unsigned long tclk)
---->8
and an appropriate definition for TIMER_PHYS_BASE.
Arnd
PATCH v2 5/5 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 13 lines · Arnd Bergmann
Review
Quoted 10 lines · Jason Cooper
(quoted diff) +10
-0+ wdt_reg = (void __iomem *)TIMER_VIRT_BASE; + + ret = of_address_to_resource(np, 0, &res); + if (ret) { + printk(KERN_ERR "invalid address\n"); + return ret; + } + + wdt_reg = ioremap(res.start, res.end - res.start); +This will break non-dt uses because you overwrite the
wdt_regvalue.
I thought for non-dt configurations of_.*() zeroed out. No problem, I must've misunderstood something from earlier.
Quoted 4 lines
As I commented before, I think the best approach would be to provide a hardcoded resource for the device in the legacy case and just use
platform_get_resource()to get the resource and ioremap it in either case.
Sorry, my denseness got in the way. When you said hardcoded, I thought you meant #define TIMER_VIRT_BASE .
Quoted 4 lines
of_address_to_resource()works only for the DT case, whileplatform_get_resource()works in either case.You need to add something like
Ahh... now *that* makes sense.
Quoted 26 lines
8<---
arch/arm/plat-orion/common.c +5
-2@@ -568,13 +568,17 @@ void __init orion_spi_1_init(unsigned long mapbase,****************************************************************************/ static struct orion_wdt_platform_data orion_wdt_data; +static struct resource orion_wdt_resource = +DEFINE_RES_MEM (TIMER_PHYS_BASE ,0x28 ); +static struct platform_device orion_wdt_device = { .name ="orion_wdt" , .id =-1 , .dev = { .platform_data = &orion_wdt_data, }, - .num_resources =0 , + .resources = &orion_wdt_resource, + .num_resources =1 , };void __init orion_wdt_init (unsigned long tclk) ---->8
Quoted 1 line
and an appropriate definition for
TIMER_PHYS_BASE.
thx,
Jason.
PATCH v2 5/5 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 9 lines · Jason
Quoted 4 lines · Arnd Bergmann
As I commented before, I think the best approach would be to provide a hardcoded resource for the device in the legacy case and just use
platform_get_resource()to get the resource and ioremap it in either case.Sorry, my denseness got in the way. When you said hardcoded, I thought you meant #define
TIMER_VIRT_BASE.
Using TIMER_VIRT_BASE wouldn't be all that wrong either, but I think it's better to use the same code path in both ways. Using a resource also has the nice side-effect of allowing us to build a multiplatform kernel for anything that uses orion-wdt but has different constants for TIMER_VIRT_BASE.
Arnd
A message that is not in the archive (sent off-list or not yet received): [email protected]
The following changes since commit 759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34:
ARM: kirkwood: convert uart0 to devicetree. (2012-02-27 16:21:44 +0000)
are available in the git repository at:
git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_test
Jason Cooper (5):
ARM: kirkwood: covert orion-spi to fdt.
ARM: kirkwood: move var setting to correct location.
ARM: kirkwood: fdt: absorb kirkwood_init()
ARM: kirkwood: convert rtc-mv to fdt.
ARM: kirkwood: convert orion-wdt to fdt.
arch/arm/boot/dts/kirkwood-dreamplug.dts | 34 +++++++++++++++ arch/arm/boot/dts/kirkwood.dtsi | 12 +++++ arch/arm/mach-kirkwood/board-dt.c | 67 +++++++++++------------------ arch/arm/mach-kirkwood/common.c | 21 +++++++-- arch/arm/mach-kirkwood/common.h | 6 +++ arch/arm/plat-orion/common.c | 7 +++- drivers/rtc/rtc-mv.c | 7 +++ drivers/spi/spi-orion.c | 37 +++++++++++++++-- drivers/watchdog/orion_wdt.c | 46 +++++++++++++++----- 9 files changed, 174 insertions(+), 63 deletions(-)
Arnd Bergmann
AppliedQuoted 7 lines · Jason
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.gitkirkwood_dt_test
Applied to next/dt branch.
Thanks,
Arnd
Quoted 10 lines · Arnd Bergmann
Quoted 7 lines · Jason
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.gitkirkwood_dt_testApplied to next/dt branch.
On second thought, I should probably wait for the maintainer to comment as well ;-)
Nico, does this look ok to you?
Arnd
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Jason
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.gitkirkwood_dt_test
Quoted 6 lines
Quoted 1 line
Applied to next/dt branch.
On second thought, I should probably wait for the maintainer to comment as well ;-)
Nico, does this look ok to you?
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see kirkwood_find_tclk().
Nicolas
Quoted 14 lines · Nicolas Pitre
Quoted 12 lines · Arnd Bergmann
Quoted 10 lines · Arnd Bergmann
Quoted 7 lines · Jason
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.gitkirkwood_dt_testApplied to next/dt branch.
Quoted 8 lines
Quoted 4 lines
On second thought, I should probably wait for the maintainer to comment as well ;-)
Nico, does this look ok to you?
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see
kirkwood_find_tclk().
So, should I EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it?
One alternate idea I had was to have kirkwood-dreamplug.dts root hold
tclk: clock-frequency = <200000000>;
and then have the drivers ask for it. afaict, tclk is constant per board.
I'm fine with either way, but I'd rather have it in the dt.
thx,
Jason.
Quoted 7 lines · Jason
Quoted 4 lines
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see
kirkwood_find_tclk().So, should I
EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it?
If the drivers want to use it, I think it has to be orion_find_tclk for drivers that are shared between multiple plat-orion platforms.
Quoted 8 lines
One alternate idea I had was to have
kirkwood-dreamplug.dtsroot holdtclk: clock-frequency = <200000000>;
and then have the drivers ask for it. afaict, tclk is constant per board.
I'm fine with either way, but I'd rather have it in the dt.
IMHO it's best to leave any such hacks out of the device tree for now, until we have the proper clk bindings in place for kirkwood, and then we can just use those.
Arnd
Quoted 11 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see
kirkwood_find_tclk().So, should I
EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it?If the drivers want to use it, I think it has to be
orion_find_tclkfor drivers that are shared between multiple plat-orion platforms.
That's pretty much all of them :-)
I'll rename it and move it to plat-orion/common.c. This'll be fun.
Quoted 4 lines
Quoted 4 lines
One alternate idea I had was to have
kirkwood-dreamplug.dtsroot holdtclk: clock-frequency = <200000000>;
Quoted 8 lines
Quoted 4 lines
and then have the drivers ask for it. afaict, tclk is constant per board.
I'm fine with either way, but I'd rather have it in the dt.
IMHO it's best to leave any such hacks out of the device tree for now, until we have the proper clk bindings in place for kirkwood, and then we can just use those.
Ok.
thx,
Jason.
Quoted 10 lines · Jason
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see
kirkwood_find_tclk().So, should I
EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it?
Quoted 6 lines
Quoted 2 lines
If the drivers want to use it, I think it has to be
orion_find_tclkfor drivers that are shared between multiple plat-orion platforms.That's pretty much all of them :-)
I'll rename it and move it to
plat-orion/common.c. This'll be fun.
No no... This is not a function which is generic at all. The _result_ i.e. core clock frequency value is a generic thing, not the method to determine it.
Nicolas
Quoted 15 lines · Nicolas Pitre
Quoted 13 lines · Jason
Quoted 11 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see
kirkwood_find_tclk().So, should I
EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it?If the drivers want to use it, I think it has to be
orion_find_tclkfor drivers that are shared between multiple plat-orion platforms.
Quoted 7 lines
Quoted 3 lines
That's pretty much all of them :-)
I'll rename it and move it to
plat-orion/common.c. This'll be fun.No no... This is not a function which is generic at all. The _result_ i.e. core clock frequency value is a generic thing, not the method to determine it.
How about this? Export a global variable, orion_tclk, and a function to read it. Then, make sure each sub arch sets the global. Does this sound viable until common clk lands?
thx,
Jason.
btw - when I received your email I was in the middle of convincing myself that I could hack together a common orion_find_tclk(). It was rapidly becoming a bad idea. :-)
Quoted 20 lines · Jason
Quoted 19 lines · Nicolas Pitre
Quoted 16 lines · Jason
Quoted 11 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see
kirkwood_find_tclk().So, should I
EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it?If the drivers want to use it, I think it has to be
orion_find_tclkfor drivers that are shared between multiple plat-orion platforms.That's pretty much all of them :-)
I'll rename it and move it to
plat-orion/common.c. This'll be fun.
Quoted 7 lines
Quoted 3 lines
No no... This is not a function which is generic at all. The _result_ i.e. core clock frequency value is a generic thing, not the method to determine it.
How about this? Export a global variable,
orion_tclk, and a function to read it. Then, make sure each sub arch sets the global. Does this sound viable until common clk lands?
Yep, looks fine.
Nicolas
Quoted 26 lines · Nicolas Pitre
Quoted 24 lines · Jason
Quoted 22 lines · Nicolas Pitre
Quoted 10 lines · Jason
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines
The clock frequency part being hardcoded to 200000 in the common .dtsi file looks wrong. The clock may differ, and it used to (and should) be probed at run time, please see
kirkwood_find_tclk().So, should I
EXPORT_SYMBOL_GPL(kirkwood_find_tclk); and have each driver call it?Quoted 6 lines
Quoted 2 lines
If the drivers want to use it, I think it has to be
orion_find_tclkfor drivers that are shared between multiple plat-orion platforms.That's pretty much all of them :-)
I'll rename it and move it to
plat-orion/common.c. This'll be fun.No no... This is not a function which is generic at all. The _result_ i.e. core clock frequency value is a generic thing, not the method to determine it.
Quoted 5 lines
Quoted 3 lines
How about this? Export a global variable,
orion_tclk, and a function to read it. Then, make sure each sub arch sets the global. Does this sound viable until common clk lands?Yep, looks fine.
I just got a first look at Andrew's patches for using the generic clk across plat/orion. There's a lot of good stuff in there. I'll start building my series on top of his (and obviously Mike's clk series).
thx,
Jason.
PATCH v2 5/5 ARM: kirkwood: convert orion-wdt to fdt.
In reply to Arnd BergmannQuoted 13 lines · Arnd Bergmann
Review
Quoted 10 lines · Jason Cooper
(quoted diff) +10
-0+ wdt_reg = (void __iomem *)TIMER_VIRT_BASE; + + ret = of_address_to_resource(np, 0, &res); + if (ret) { + printk(KERN_ERR "invalid address\n"); + return ret; + } + + wdt_reg = ioremap(res.start, res.end - res.start); +This will break non-dt uses because you overwrite the
wdt_regvalue.
Don't also forget that "res.end - res.start" is also not correct, and resource_size() should be used to prevent that kind of error.
PATCH v2 5/5 ARM: kirkwood: convert orion-wdt to fdt.
Quoted 15 lines · Russell King - ARM Linux
Quoted 13 lines · Arnd Bergmann
Review
Quoted 10 lines · Jason Cooper
(quoted diff) +10
-0+ wdt_reg = (void __iomem *)TIMER_VIRT_BASE; + + ret = of_address_to_resource(np, 0, &res); + if (ret) { + printk(KERN_ERR "invalid address\n"); + return ret; + } + + wdt_reg = ioremap(res.start, res.end - res.start); +This will break non-dt uses because you overwrite the
wdt_regvalue.
Quoted 2 lines
Don't also forget that "res.end - res.start" is also not correct, and
resource_size()should be used to prevent that kind of error.
Russell, thanks for the review. I'll redo this one and resubmit my pull-request to Arnd. I assume that we don't won't this to be a separate patch as a future bisect could land inbetween this patch and the fix.
Sorry for the extra work Arnd.
thx,
Jason.
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(-)
Oops, forgot to remove the Re:...
Quoted 28 lines · Jason
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.gitkirkwood_dt_testJason Cooper (5):
ARM: kirkwood: covert orion-spi to fdt.
ARM: kirkwood: move var setting to correct location.
ARM: kirkwood: fdt: absorbkirkwood_init()
ARM: kirkwood: convert rtc-mv to fdt.
ARM: kirkwood: convert orion-wdt to fdt.arch/arm/boot/dts/kirkwood-dreamplug.dts | 34 +++++++++++++++ arch/arm/boot/dts/kirkwood.dtsi | 12 +++++ arch/arm/mach-kirkwood/board-dt.c | 67 +++++++++++------------------ arch/arm/mach-kirkwood/common.c | 21 +++++++-- arch/arm/mach-kirkwood/common.h | 6 +++ drivers/rtc/rtc-mv.c | 7 +++ drivers/spi/spi-orion.c | 37 +++++++++++++++-- drivers/watchdog/orion_wdt.c | 48 ++++++++++++++++----- 8 files changed, 170 insertions(+), 62 deletions(-)_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
v3 cover ARM: kirkwood: fdt: convert kirkwood to fdt
In reply to Jason CooperThis 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
Signature · 1 line
1.7.3.4
PATCH v3 1/14 ARM: orion: spi: remove enable_clock_fix which is not used
From: Andrew Lunn <[email protected]>
--- drivers/spi/spi-orion.c | 5 ----- include/linux/spi/orion_spi.h | 1 - 2 files changed, 0 insertions(+), 6 deletions(-)
drivers/spi/spi-orion.c +0 -5
@@ -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;
include/linux/spi/orion_spi.h +0 -1
@@ -11,7 +11,6 @@struct orion_spi_info {u32 tclk;/* no <linux/clk.h> support yet */ -u32 enable_clock_fix; };
Signature · 1 line
1.7.3.4
PATCH 1/14 ARM: orion: spi: remove enable_clock_fix which is not used
Quoted 4 lines · Jason Cooper
From: Andrew Lunn <[email protected]>
Signed-off-by Andrew Lunn <[email protected]>Signed-off-by Jason Cooper <[email protected]>
Quoted 36 lines
--- drivers/spi/spi-orion.c | 5 ----- include/linux/spi/orion_spi.h | 1 - 2 files changed, 0 insertions(+), 6 deletions(-)drivers/spi/spi-orion.c +0
-5@@ -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;include/linux/spi/orion_spi.h +0
-1@@ -11,7 +11,6 @@struct orion_spi_info {u32 tclk;/* no <linux/clk.h> support yet */ -u32 enable_clock_fix; };Signature · 1 line
1.7.3.4
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies,Ltd.
PATCH v3 2/14 ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
In reply to Jason CooperFrom: Andrew Lunn <[email protected]>
It is not used anywhere in the sound driver.
--- arch/arm/mach-kirkwood/common.c | 1 - arch/arm/plat-orion/include/plat/audio.h | 1 - 2 files changed, 0 insertions(+), 2 deletions(-)
arch/arm/mach-kirkwood/common.c +0 -1
@@ -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,
arch/arm/plat-orion/include/plat/audio.h +0 -1
@@ -2,7 +2,6 @@#define __PLAT_AUDIO_Hstruct kirkwood_asoc_platform_data { -u32 tclk;int burst; };#endif
Signature · 1 line
1.7.3.4
PATCH v3 3/14 ARM: kirkwood: add dreamplug (fdt) support.
In reply to Jason CooperInitially, 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.
---
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
arch/arm/boot/dts/kirkwood-dreamplug.dts new file +18 -0
@@ -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"; + }; + +};
arch/arm/boot/dts/kirkwood.dtsi new file +6 -0
@@ -0,0 +1,6 @@ +/include/ "skeleton.dtsi" + +/ { + compatible = "mrvl,kirkwood"; +}; +
arch/arm/mach-kirkwood/Kconfig +14 -0
@@ -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
arch/arm/mach-kirkwood/Makefile +1 -0
@@ -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
arch/arm/mach-kirkwood/Makefile.boot +2 -0
@@ -1,3 +1,5 @@ zreladdr-y += 0x00008000 params_phys-y := 0x00000100 initrd_phys-y := 0x00800000 + +dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
arch/arm/mach-kirkwood/board-dt.c new file +182 -0
182 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v3 4/14 ARM: kirkwood: fdt: absorb kirkwood_init()
In reply to Jason CooperWe 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.
--- 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(-)
arch/arm/mach-kirkwood/board-dt.c +28 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +6 -6
@@ -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 );
arch/arm/mach-kirkwood/common.h +8 -0
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*devvoid 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;
Signature · 1 line
1.7.3.4
PATCH v3 5/14 ARM: kirkwood: add interrupt controller to devicetree.
In reply to Jason CooperBased 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.
--- arch/arm/boot/dts/kirkwood.dtsi | 9 ++++++++- arch/arm/mach-kirkwood/board-dt.c | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletions(-)
arch/arm/boot/dts/kirkwood.dtsi +8 -1
@@ -2,5 +2,12 @@ / { compatible = "mrvl,kirkwood"; -}; + interrupt-parent = <&intc>; + intc: interrupt-controller at fed20200 { + compatible = "mrvl,orion-intc"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0xfed20200 0x20>; + }; +};
arch/arm/mach-kirkwood/board-dt.c +7 -0
@@ -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 ();
Signature · 1 line
1.7.3.4
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to Jason CooperThis uart is the primary console for the dreamplug. Removed kirkwood_uart0_init() call from board-dt.c.
--- arch/arm/boot/dts/kirkwood-dreamplug.dts | 7 +++++++ arch/arm/mach-kirkwood/board-dt.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +7 -0
@@ -15,4 +15,11 @@ bootargs = "console=ttyS0,115200n8 earlyprintk"; }; + serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -2
@@ -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 ();
Signature · 1 line
1.7.3.4
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
arch/arm/boot/dts/kirkwood-dreamplug.dts line 24
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };
I just noticed that the length here should be inclusive, i.e. 0x100 not 0xff. This is different from the way we define resources in Linux.
Arnd
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 11 lines · Arnd Bergmann
arch/arm/boot/dts/kirkwood-dreamplug.dts line 24
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };I just noticed that the length here should be inclusive, i.e.
0x100not0xff. This is different from the way we define resources in Linux.
I was maintaining form with plat-orion/common.c:66 (0xff) I'll fix it to inclusive.
thx,
Jason.
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to Arnd BergmannQuoted 11 lines · Arnd Bergmann
arch/arm/boot/dts/kirkwood-dreamplug.dts line 24
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };I just noticed that the length here should be inclusive, i.e.
0x100not0xff. This is different from the way we define resources in Linux.
Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Here's my most recent attempt:
serial at f1012000 {
device_type = "serial";
compatible = "ns16550a";
reg = <0xf1012000 0x100>; /*phys addr*/
virt-reg = <0xfed12000>; /*virt addr*/
reg-shift = <2>;
reg-io-width = <1>;
interrupts = <33>;
current-speed = <115200>;
interrupt-parent = <&intc>;
clock-frequency = <200000000>;
};I've looked at what is done in the powerpc dt's, but, no luck. When earlyprintk is enabled, I see no error messages, just:
bootconsole [earlycon0] enabled
debug: skip boot console de-registration.
...
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
Any pointers?
thx,
Jason.
Andrew Lunn
maintainerPATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 10 lines · Jason
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };
Quoted 8 lines
Quoted 2 lines
I just noticed that the length here should be inclusive, i.e.
0x100not0xff. This is different from the way we define resources in Linux.Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Hi Jason
What do you see in /proc/iomem?
You should expect:
f1012000-f10120ff : serial8250.0
f1012000-f101201f : serial
f1012100-f10121ff : serial8250.1
f1012100-f101211f : serial
or probably just the first, if your device only has one serial port.
How about /proc/interrupts?
33: 195 orion_irq serial
Anything like this in dmesg?
[ 17.189397] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled [ 17.210023] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A [ 17.624748] console [ttyS0] enabled [ 17.648555] serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
Comparing your system to the above might help you track down which property is wrong.
Andrew
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 38 lines · Andrew Lunn
Quoted 10 lines · Jason
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };Quoted 8 lines
Quoted 2 lines
I just noticed that the length here should be inclusive, i.e.
0x100not0xff. This is different from the way we define resources in Linux.Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Hi Jason
What do you see in
/proc/iomem?You should expect:
f1012000-f10120ff : serial8250.0
f1012000-f101201f : serial
f1012100-f10121ff : serial8250.1
f1012100-f101211f : serialor probably just the first, if your device only has one serial port.
How about
/proc/interrupts?33: 195
orion_irqserial
Quoted 6 lines
Anything like this in dmesg?
[ 17.189397] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled[ 17.210023] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A [ 17.624748] console [ttyS0] enabled
These two lines ^^^^ are what I'm missing. Some probe by printk shows it's getting all the way through tty/serial/8250/8250.c:3263 serial8250_init() okay... then nothing.
Quoted 6 lines
[ 17.648555] serial8250.1: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550AComparing your system to the above might help you track down which property is wrong.
Andrew
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to JasonQuoted 24 lines · Jason
Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Here's my most recent attempt:
serial at f1012000 { device_type = "serial"; compatible = "ns16550a"; reg = <0xf1012000 0x100>; /*phys addr*/ virt-reg = <0xfed12000>; /*virt addr*/ reg-shift = <2>; reg-io-width = <1>; interrupts = <33>; current-speed = <115200>; interrupt-parent = <&intc>; clock-frequency = <200000000>; };I've looked at what is done in the powerpc dt's, but, no luck. When earlyprintk is enabled, I see no error messages, just:
Quoted 6 lines
bootconsole [earlycon0] enabled
debug: skip boot console de-registration.
...
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabledAny pointers?
My first guess was that clock-frequency is wrong, but it seems that this one actually is correct, at least it's the same thing that the platform code sets.
You should never need to pass the virtual address to a device, most of all because it cannot be known to the device tree at all. The of_serial driver (you did enable that one in Kconfig, right?) sets UPF_IOREMAP for this reason, which means membase gets overwritten anyway.
You should also not need to set interrupt-parent in the device itself, as long as it's set in the root node. This one should not hurt though.
Regarting the compatible value, you should check what /proc/tty/driver/serial contains when the system is up and running. If you can log into the system through the network after booting it up, you can also compare the contents of that file and the 'setserial' output with what you got before the device tree conversion.
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through kirkwood_init_irq, so the numbers would all be wrong.
Arnd
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 25 lines · Arnd Bergmann
Quoted 24 lines · Jason
Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Here's my most recent attempt:
serial at f1012000 { device_type = "serial"; compatible = "ns16550a"; reg = <0xf1012000 0x100>; /*phys addr*/ virt-reg = <0xfed12000>; /*virt addr*/ reg-shift = <2>; reg-io-width = <1>; interrupts = <33>; current-speed = <115200>; interrupt-parent = <&intc>; clock-frequency = <200000000>; };I've looked at what is done in the powerpc dt's, but, no luck. When earlyprintk is enabled, I see no error messages, just:
Quoted 8 lines
Quoted 6 lines
bootconsole [earlycon0] enabled
debug: skip boot console de-registration.
...
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabledAny pointers?
The
of_serialdriver (you did enable that one inKconfig, right?)
Wow. I can't believe I missed that. I now get:
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A console [ttyS0] enabled
without earlyprintk.
Thanks, Arnd.
Jason.
PS - the only change from your code is the 0x100. I'm going to do some more testing...
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to Arnd BergmannQuoted 4 lines · Arnd Bergmann
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through
kirkwood_init_irq, so the numbers would all be wrong.
Yes, I'm working through this now. mv_cesa silently fails to come up if it can't find the interrupt controller via fdt. So, it needs to get done.
Right now, I'm looking at how mach-versatile does it (vic_init()) since it's also an ARM926ej-s...
thx,
Jason.
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 7 lines · Jason
Quoted 4 lines · Arnd Bergmann
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through
kirkwood_init_irq, so the numbers would all be wrong.
Quoted 7 lines
Yes, I'm working through this now.
mv_cesasilently fails to come up if it can't find the interrupt controller via fdt. So, it needs to get done.Right now, I'm looking at how mach-versatile does it (
vic_init()) since it's also an ARM926ej-s...
Ok, sounds good. It's not important whether it's an ARM9 or not btw. You should look at both anything that defines an "interrupt-controller" property as an example including Documentation/devicetree/bindings/arm/vic.txt and Documentation/devicetree/bindings/arm/gic.txt.
(taking Thomas Gleixner on Cc)
Since the orion irq chip is based on irqchip_generic, it would be perfect to have a generic irqchip binding to go along with kernel/irq/generic-chip.c. Not sure if anyone has thought about this before, but it looks like we can completely avoid using arch/arm/plat-orion/irq.c and arch/arm/mach-kirkwood/irq.c if we do that.
Arnd
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 7 lines · Arnd Bergmann
Since the orion irq chip is based on
irqchip_generic, it would be perfect to have a generic irqchip binding to go along withkernel/irq/generic-chip.c. Not sure if anyone has thought about this before, but it looks like we can completely avoid usingarch/arm/plat-orion/irq.candarch/arm/mach-kirkwood/irq.cif we do that.
One more thing about the interrupt controller changes: The arm-soc tree includes Grants "irqchip" branch, and the tegra/soc-drivers and at91/dt branches are building on top of that. Please have a look at what they do so you can do the same.
Arnd
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to Arnd BergmannQuoted 21 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines · Arnd Bergmann
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through
kirkwood_init_irq, so the numbers would all be wrong.Quoted 7 lines
Yes, I'm working through this now.
mv_cesasilently fails to come up if it can't find the interrupt controller via fdt. So, it needs to get done.Right now, I'm looking at how mach-versatile does it (
vic_init()) since it's also an ARM926ej-s...Ok, sounds good. It's not important whether it's an ARM9 or not btw. You should look at both anything that defines an "interrupt-controller" property as an example including
Documentation/devicetree/bindings/arm/vic.txtandDocumentation/devicetree/bindings/arm/gic.txt.
Quoted 8 lines
(taking Thomas Gleixner on Cc)
Since the orion irq chip is based on
irqchip_generic, it would be perfect to have a generic irqchip binding to go along withkernel/irq/generic-chip.c. Not sure if anyone has thought about this before, but it looks like we can completely avoid usingarch/arm/plat-orion/irq.candarch/arm/mach-kirkwood/irq.cif we do that.
Right. That should be trivial to implement.
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 25 lines · Thomas Gleixner
Quoted 23 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines · Arnd Bergmann
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through
kirkwood_init_irq, so the numbers would all be wrong.Quoted 7 lines
Yes, I'm working through this now.
mv_cesasilently fails to come up if it can't find the interrupt controller via fdt. So, it needs to get done.Right now, I'm looking at how mach-versatile does it (
vic_init()) since it's also an ARM926ej-s...Ok, sounds good. It's not important whether it's an ARM9 or not btw. You should look at both anything that defines an "interrupt-controller" property as an example including
Documentation/devicetree/bindings/arm/vic.txtandDocumentation/devicetree/bindings/arm/gic.txt.(taking Thomas Gleixner on Cc)
Quoted 8 lines
Quoted 6 lines
Since the orion irq chip is based on
irqchip_generic, it would be perfect to have a generic irqchip binding to go along withkernel/irq/generic-chip.c. Not sure if anyone has thought about this before, but it looks like we can completely avoid usingarch/arm/plat-orion/irq.candarch/arm/mach-kirkwood/irq.cif we do that.Right. That should be trivial to implement.
ok, I'm on it. kernel/irq/of_generic_irq.c sound good?
thx,
Jason.
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 33 lines · Jason
Quoted 32 lines · Thomas Gleixner
Quoted 29 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines · Arnd Bergmann
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through
kirkwood_init_irq, so the numbers would all be wrong.Quoted 7 lines
Yes, I'm working through this now.
mv_cesasilently fails to come up if it can't find the interrupt controller via fdt. So, it needs to get done.Right now, I'm looking at how mach-versatile does it (
vic_init()) since it's also an ARM926ej-s...Ok, sounds good. It's not important whether it's an ARM9 or not btw. You should look at both anything that defines an "interrupt-controller" property as an example including
Documentation/devicetree/bindings/arm/vic.txtandDocumentation/devicetree/bindings/arm/gic.txt.(taking Thomas Gleixner on Cc)
Since the orion irq chip is based on
irqchip_generic, it would be perfect to have a generic irqchip binding to go along withkernel/irq/generic-chip.c. Not sure if anyone has thought about this before, but it looks like we can completely avoid usingarch/arm/plat-orion/irq.candarch/arm/mach-kirkwood/irq.cif we do that.
Quoted 3 lines
Quoted 1 line
Right. That should be trivial to implement.
ok, I'm on it.
kernel/irq/of_generic_irq.csound good?
Rob Herring has done some work in this area. Please coordinate with him.
g.
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 34 lines · Grant Likely
Quoted 33 lines · Jason
Quoted 32 lines · Thomas Gleixner
Quoted 29 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines · Arnd Bergmann
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through
kirkwood_init_irq, so the numbers would all be wrong.Quoted 7 lines
Yes, I'm working through this now.
mv_cesasilently fails to come up if it can't find the interrupt controller via fdt. So, it needs to get done.Right now, I'm looking at how mach-versatile does it (
vic_init()) since it's also an ARM926ej-s...Ok, sounds good. It's not important whether it's an ARM9 or not btw. You should look at both anything that defines an "interrupt-controller" property as an example including
Documentation/devicetree/bindings/arm/vic.txtandDocumentation/devicetree/bindings/arm/gic.txt.(taking Thomas Gleixner on Cc)
Since the orion irq chip is based on
irqchip_generic, it would be perfect to have a generic irqchip binding to go along withkernel/irq/generic-chip.c. Not sure if anyone has thought about this before, but it looks like we can completely avoid usingarch/arm/plat-orion/irq.candarch/arm/mach-kirkwood/irq.cif we do that.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Right. That should be trivial to implement.
ok, I'm on it.
kernel/irq/of_generic_irq.csound good?Rob Herring has done some work in this area. Please coordinate with him.
Rob,
I'm attempting to convert mach-kirkwood boards over to devicetree, starting with the dreamplug.
You can find my stable patches here:
git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_stable
and the stuff I'm still trying to figure out:
git://git.infradead.org/users/jcooper/linux-kirkwood.git kirkwood_dt_staging
My next task looks like converting the irq code, since mv_cesa fails silently without the interrupt-controller specified in the dtb.
The code I'm replacing can be found here:
arch/arm/mach-kirkwood/irq.carch/arm/plat-orion/irq.c
This is the first time I've attempted something like this, so any pointers would be much appreciated. Also, if there is anything I would need to deconflict with, please let me know.
thx,
Jason.
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 26 lines · Jason
Quoted 25 lines · Grant Likely
Quoted 24 lines · Jason
Quoted 23 lines · Thomas Gleixner
Quoted 21 lines · Arnd Bergmann
Quoted 7 lines · Jason
Quoted 4 lines · Arnd Bergmann
Finally, something could be wrong with the interrupt controller. AFAICT, you register it through the device tree now, but it's also getting initialized through
kirkwood_init_irq, so the numbers would all be wrong.Quoted 7 lines
Yes, I'm working through this now.
mv_cesasilently fails to come up if it can't find the interrupt controller via fdt. So, it needs to get done.Right now, I'm looking at how mach-versatile does it (
vic_init()) since it's also an ARM926ej-s...Ok, sounds good. It's not important whether it's an ARM9 or not btw. You should look at both anything that defines an "interrupt-controller" property as an example including
Documentation/devicetree/bindings/arm/vic.txtandDocumentation/devicetree/bindings/arm/gic.txt.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
(taking Thomas Gleixner on Cc)
Since the orion irq chip is based on
irqchip_generic, it would be perfect to have a generic irqchip binding to go along withkernel/irq/generic-chip.c. Not sure if anyone has thought about this before, but it looks like we can completely avoid usingarch/arm/plat-orion/irq.candarch/arm/mach-kirkwood/irq.cif we do that.
A generic irqchip binding is not the right approach. The binding should still be specific to the controller as the generic irqchip code doesn't handle everything like dispatching interrupts or know how many blocks of 32 interrupts your controller has.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Right. That should be trivial to implement.
Yes, since someone else already has (me).
Quoted 21 lines
Quoted 4 lines
Quoted 2 lines
ok, I'm on it.
kernel/irq/of_generic_irq.csound good?Rob Herring has done some work in this area. Please coordinate with him.
Rob,
I'm attempting to convert mach-kirkwood boards over to devicetree, starting with the dreamplug.
You can find my stable patches here:
git://git.infradead.org/users/jcooper/linux-kirkwood.gitkirkwood_dt_stableand the stuff I'm still trying to figure out:
git://git.infradead.org/users/jcooper/linux-kirkwood.gitkirkwood_dt_stagingMy next task looks like converting the irq code, since
mv_cesafails silently without the interrupt-controller specified in the dtb.
Quoted 9 lines
The code I'm replacing can be found here:
arch/arm/mach-kirkwood/irq.carch/arm/plat-orion/irq.cThis is the first time I've attempted something like this, so any pointers would be much appreciated. Also, if there is anything I would need to deconflict with, please let me know.
Look at my branch here:
git://sources.calxeda.com/kernel/linux.git irqdomain-for-grant
Your .init_irq function should call of_irq_init which will then call an init function for each controller. Then you need to call irq_setup_generic_chip_domain to setup the generic irqchip instances.
You also should convert to enabling CONFIG_MULTI_IRQ_HANDLER or I think a linear domain won't work for you and that's what the generic irqchip code will use. Also you should enable SPARSE_IRQ, but that is somewhat independent.
In the DT case, you want to not have any compile time dependencies on Linux irq numbers. If you're keeping non-DT compatibility, that will complicate your conversion.
Rob
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to Arnd BergmannQuoted 32 lines · Arnd Bergmann
Quoted 24 lines · Jason
Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Here's my most recent attempt:
serial at f1012000 { device_type = "serial"; compatible = "ns16550a"; reg = <0xf1012000 0x100>; /*phys addr*/ virt-reg = <0xfed12000>; /*virt addr*/ reg-shift = <2>; reg-io-width = <1>; interrupts = <33>; current-speed = <115200>; interrupt-parent = <&intc>; clock-frequency = <200000000>; };I've looked at what is done in the powerpc dt's, but, no luck. When earlyprintk is enabled, I see no error messages, just:
Quoted 6 lines
bootconsole [earlycon0] enabled
debug: skip boot console de-registration.
...
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabledAny pointers?
Quoted 7 lines
My first guess was that clock-frequency is wrong, but it seems that this one actually is correct, at least it's the same thing that the platform code sets.
You should never need to pass the virtual address to a device, most of all because it cannot be known to the device tree at all. The
of_serialdriver (you did enable that one inKconfig, right?)
Ugh. Someone really needs to step up and kill the of_serial driver. All that stuff belongs in the core 16550 driver.
g.
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 11 lines · Grant Likely
Quoted 8 lines
My first guess was that clock-frequency is wrong, but it seems that this one actually is correct, at least it's the same thing that the platform code sets.
You should never need to pass the virtual address to a device, most of all because it cannot be known to the device tree at all. The
of_serialdriver (you did enable that one inKconfig, right?)Ugh. Someone really needs to step up and kill the
of_serialdriver. All that stuff belongs in the core 16550 driver.
Well, actually I would argue that nothing belongs into the core 8250 driver. What we should do though is split the of_serial.c file into the main 8250 portion and put that into drivers/tty/serial/8250/ along with the other 14 bus glue drivers, and put the nwpserial portion into drivers/tty/serial/nwpserial.c.
I have started a major rework of 8250 some time ago that I need to finish up, to make the different ways for registering an 8250 device more regular, and get rid of the more obscure ways we have in the kernel, replacing them with platform devices or other bus specific 'struct device' versions.
The main intention of that patch series is to confine the ISA/PCI specific inb/outb accessors in the files that need them so we can actually build the platform drivers without defining those, but I can take care of of_serial.c as well -- after all I wrote that file originally.
Arnd
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to JasonAm Mittwoch 07 M?rz 2012, 20:27:23 schrieb Jason:
Quoted 37 lines · Arnd Bergmann
Quoted 11 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts line 24
Quoted 7 lines
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };I just noticed that the length here should be inclusive, i.e.
0x100not0xff. This is different from the way we define resources in Linux.Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Here's my most recent attempt:
serial at f1012000 { device_type = "serial"; compatible = "ns16550a"; reg = <0xf1012000 0x100>; /*phys addr*/ virt-reg = <0xfed12000>; /*virt addr*/ reg-shift = <2>; reg-io-width = <1>; interrupts = <33>; current-speed = <115200>; interrupt-parent = <&intc>; clock-frequency = <200000000>; };I've looked at what is done in the powerpc dt's, but, no luck. When earlyprintk is enabled, I see no error messages, just:
Quoted 6 lines
bootconsole [earlycon0] enabled
debug: skip boot console de-registration.
...
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabledAny pointers?
dunno if that helps a lot but the following was working for me with my linkstation:
serial0: serial at f1012000 {
cell-index = <0>;
device_type = "serial";
compatible = "ns16550a";
reg = <0xf1012000 0x20>;
reg-shift = <2>;
clock-frequency = <200000000>;
interrupts = <33>;
};Signature · 1 line
michael
PATCH 6/14 ARM: kirkwood: convert uart0 to devicetree.
In reply to JasonQuoted 13 lines · Jason
Quoted 11 lines · Arnd Bergmann
arch/arm/boot/dts/kirkwood-dreamplug.dts line 24
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };I just noticed that the length here should be inclusive, i.e.
0x100not0xff. This is different from the way we define resources in Linux.
Quoted 8 lines
Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Here's my most recent attempt:
I see that you've resolved your problem, but some comments below on the device node:
Quoted 2 lines
serial at f1012000 {
device_type = "serial";Never use device_type. It should only ever appear in the memory node, and I plan to remove it from there too.
Quoted 3 lines
compatible = "ns16550a";
reg = <0xf1012000 0x100>; /*phys addr*/
virt-reg = <0xfed12000>; /*virt addr*/Don't use virt-reg. Nothing in the kernel uses it and the kernel will make it's own decision about virtual address mapping.
Quoted 2 lines
reg-shift = <2>;
reg-io-width = <1>;1 is the default for reg-io-width. No need to have this property. It should only be used if the device requires 32 bit accesses.
Quoted 6 lines
interrupts = <33>;
current-speed = <115200>;
interrupt-parent = <&intc>;
clock-frequency = <200000000>;
};g.
PATCH v3 6/14 ARM: kirkwood: convert uart0 to devicetree.
Quoted 36 lines · Grant Likely
Quoted 13 lines · Jason
Quoted 11 lines · Arnd Bergmann
arch/arm/boot/dts/kirkwood-dreamplug.dts line 24
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0+ serial at f1012000 { + compatible = "ns16550a"; + reg = <0xf1012000 0xff>; + reg-shift = <2>; + interrupts = <33>; + clock-frequency = <200000000>; + };I just noticed that the length here should be inclusive, i.e.
0x100not0xff. This is different from the way we define resources in Linux.Quoted 8 lines
Grrr. Now I'm getting frustrated. I'm trying to boot without earlyprintk. Evidently, something is wrong with the above, because the device boots all the way up (blinky lights come on), but I get no messages after the usual "Uncompressing Linux... done, booting the kernel."
Here's my most recent attempt:
I see that you've resolved your problem, but some comments below on the device node:
Quoted 2 lines
serial at f1012000 { device_type = "serial";Never use
device_type. It should only ever appear in the memory node, and I plan to remove it from there too.Quoted 3 lines
compatible = "ns16550a"; reg = <0xf1012000 0x100>; /*phys addr*/ virt-reg = <0xfed12000>; /*virt addr*/
Quoted 14 lines
Don't use virt-reg. Nothing in the kernel uses it and the kernel will make it's own decision about virtual address mapping.
Quoted 2 lines
reg-shift = <2>; reg-io-width = <1>;1 is the default for reg-io-width. No need to have this property. It should only be used if the device requires 32 bit accesses.
Quoted 5 lines
interrupts = <33>; current-speed = <115200>; interrupt-parent = <&intc>; clock-frequency = <200000000>; };
Thanks, Grant. I reverted all of those changes once I found the root of my problem.
thx,
Jason.
PATCH v3 7/14 ARM: kirkwood: rtc-mv devicetree bindings
In reply to Jason Cooper---
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(-)
drivers/rtc/rtc-mv.c +9 -0
@@ -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), }, };
Signature · 1 line
1.7.3.4
PATCH v3 8/14 ARM: kirkwood: use devicetree for rtc-mv
In reply to Jason Cooper---
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(-)
arch/arm/boot/dts/kirkwood.dtsi +6 -0
@@ -10,4 +10,10 @@ #interrupt-cells = <1>; reg = <0xfed20200 0x20>; }; + + rtc at f1010300 { + compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc"; + reg = <0xf1010300 0x1f>; + interrupts = <53>; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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 ); }
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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 );
Signature · 1 line
1.7.3.4
PATCH 8/14 ARM: kirkwood: use devicetree for rtc-mv
arch/arm/boot/dts/kirkwood.dtsi line 19
Quoted 7 lines · Jason Cooper
arch/arm/boot/dts/kirkwood.dtsi +6
-0+ + rtc at f1010300 { + compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc"; + reg = <0xf1010300 0x1f>; + interrupts = <53>; + }; };
Same as with the uart, this length should be 0x20 instead of 0x1f.
Arnd
PATCH v3 9/14 ARM: kirkwood: mv_cesa devicetree bindings
In reply to Jason CooperFrom: Michael Walle <[email protected]>
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.
---
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
Documentation/devicetree/bindings/crypto/mv_cesa.txt new file +18 -0
@@ -0,0 +1,18 @@ +Marvell Cryptographic Engines And Security Accelerator + +Required properties: +- compatible : should be "mrvl,orion-crypto" +- reg : base physical address of the engine and length of memory mapped + region, followed by base physical address of sram and its memory + length +- interrupts : interrupt number + +Examples: + +crypto at f1030000 { + compatible = "mrvl,orion-crypto"; + reg = <0xf1030000 0x10000 + 0xf5000000 0x800>; /* sram */ + interrupts = <22>; +}; +
drivers/crypto/mv_cesa.c +13 -0
@@ -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" );
Signature · 1 line
1.7.3.4
PATCH v3 10/14 ARM: kirkwood: mv_cesa devicetree support.
In reply to Jason CooperBased on work by Michael Walle (commit a952154).
Used the crypto portion of the patch, integrated with board-dt.c
---
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(-)
arch/arm/boot/dts/kirkwood.dtsi +7 -0
@@ -16,4 +16,11 @@ reg = <0xf1010300 0x1f>; interrupts = <53>; }; + + crypto at f1030000 { + compatible = "mrvl,kirkwood-crypto", "mrvl,orion-crypto"; + reg = <0xf1030000 0x10000>, + <0xf5000000 0x800>; + interrupts = <22>; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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;
arch/arm/mach-kirkwood/common.c +13 -1
@@ -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 */
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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;
Signature · 1 line
1.7.3.4
PATCH v3 11/14 ARM: kirkwood: ehci-orion: add device tree binding
In reply to Jason CooperFrom: Michael Walle <[email protected]>
--- .../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
Documentation/devicetree/bindings/usb/ehci-orion.txt new file +5 -0
@@ -0,0 +1,5 @@ +Marvell Orion SoC USB controller + +Required properties : + - compatible : should be "mrvl,orion-ehci". + - phy_version : should be "orion".
drivers/usb/host/ehci-orion.c +48 -2
82 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH v3 12/14 ARM: kirkwood: use devicetree for orion-ehci
In reply to Jason CooperOriginal devicetree node from Michael Walle, changed to use 'mrvl,orion-ehci' for compatible property.
--- 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(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +7 -0
@@ -22,4 +22,11 @@ interrupts = <33>; clock-frequency = <200000000>; }; + + ehci at f1050000 { + compatible = "mrvl,orion-ehci"; + reg = <0xf1050000 0x1000>; + interrupts = <19>; + phy-version = "orion"; + }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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);
arch/arm/mach-kirkwood/common.c +6 -0
@@ -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 */
Signature · 1 line
1.7.3.4
PATCH v3 13/14 ARM: kirkwood: sata_mv: add device tree binding
In reply to Jason CooperFrom: Michael Walle <[email protected]>
Based on devicetree work by Michael Walle. Changed compatible property to "mrvl,orion-sata", simplified retrieving nr_ports from fdt.
--- drivers/ata/sata_mv.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-)
drivers/ata/sata_mv.c +16 -2
@@ -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), }, };
Signature · 1 line
1.7.3.4
PATCH v3 14/14 ARM: kirkwood: use devicetree to init sata_mv
In reply to Jason CooperBased on devicetree work by Michael Walle. Changed compatible property to "mrvl,orion-sata".
--- 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(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +7 -0
@@ -23,6 +23,13 @@ clock-frequency = <200000000>; }; + sata at f1080000 { + compatible = "mrvl,orion-sata"; + reg = <0xf1080000 0x5000>; + interrupts = <21>; + nr-ports = <1>; + }; + ehci at f1050000 { compatible = "mrvl,orion-ehci"; reg = <0xf1050000 0x1000>;
arch/arm/mach-kirkwood/board-dt.c +0 -5
@@ -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);
arch/arm/mach-kirkwood/common.c +10 -0
@@ -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 */
Signature · 1 line
1.7.3.4
PATCH 14/14 ARM: kirkwood: use devicetree to init sata_mv
Quoted 7 lines · Jason Cooper
arch/arm/mach-kirkwood/common.c +3
-0@@ -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)) {
arch/arm/mach-kirkwood/common.c static int __init kirkwood_clock_gate(void) · line 519
Quoted 10 lines
arch/arm/mach-kirkwood/common.c +7
-0+int nr_ports; + kirkwood_clk_ctrl |=CGC_SATA0 ; +of_property_read_u32 (np,"nr-ports" , &nr_ports); +if (nr_ports >1 ) + kirkwood_clk_ctrl |=CGC_SATA1 ; + of_node_put(np); + }#endif /* For SATA: first shutdown the phy */
Is it guaranteed that it's always the first port that gets used if there is only one? If not, this might turn on the wrong one.
Arnd
PATCH v3 14/14 ARM: kirkwood: use devicetree to init sata_mv
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · Jason Cooper
arch/arm/mach-kirkwood/common.c +10
-0@@ -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
Quoted 4 lines
arch/arm/mach-kirkwood/common.c static int __init kirkwood_clock_gate(void) · line 519
Quoted 1 line
arch/arm/mach-kirkwood/common.c +0
-0/* For SATA: first shutdown the phy */ Is it guaranteed that it's always the first port that gets used if there is only one? If not, this might turn on the wrong one.
This is the same logic as mach-kirkwood/common.c:176
void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
{
kirkwood_clk_ctrl |= CGC_SATA0;
if (sata_data->n_ports > 1)
kirkwood_clk_ctrl |= CGC_SATA1;
orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA);
}So, I don't think I'm introducing a regression.
thx,
Jason.
PATCH 14/14 ARM: kirkwood: use devicetree to init sata_mv
Quoted 14 lines · Jason
Quoted 2 lines
Is it guaranteed that it's always the first port that gets used if there is only one? If not, this might turn on the wrong one.
This is the same logic as
mach-kirkwood/common.c:176void
__initkirkwood_sata_init(struct mv_sata_platform_data *sata_data){ kirkwood_clk_ctrl |= CGC_SATA0; if (sata_data->n_ports > 1) kirkwood_clk_ctrl |= CGC_SATA1; orion_sata_init(sata_data, SATA_PHYS_BASE, IRQ_KIRKWOOD_SATA); }
Quoted 1 line
So, I don't think I'm introducing a regression.
Ok, good point. I was wondering whether the individual ports should be modeled in the device tree, but I guess it's not necessary if nobody needed this so far.
Arnd
v4 cover ARM: kirkwood: fdt: convert kirkwood to fdt
In reply to Jason CooperThis 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
Signature · 1 line
1.7.3.4
PATCH v4 1/7 ARM: orion: spi: remove enable_clock_fix which is not used
From: Andrew Lunn <[email protected]>
--- drivers/spi/spi-orion.c | 5 ----- include/linux/spi/orion_spi.h | 1 - 2 files changed, 0 insertions(+), 6 deletions(-)
drivers/spi/spi-orion.c +0 -5
@@ -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;
include/linux/spi/orion_spi.h +0 -1
@@ -11,7 +11,6 @@struct orion_spi_info {u32 tclk;/* no <linux/clk.h> support yet */ -u32 enable_clock_fix; };
Signature · 1 line
1.7.3.4
PATCH v4 2/7 ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
In reply to Jason CooperFrom: Andrew Lunn <[email protected]>
It is not used anywhere in the sound driver.
--- arch/arm/mach-kirkwood/common.c | 1 - arch/arm/plat-orion/include/plat/audio.h | 1 - 2 files changed, 0 insertions(+), 2 deletions(-)
arch/arm/mach-kirkwood/common.c +0 -1
@@ -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,
arch/arm/plat-orion/include/plat/audio.h +0 -1
@@ -2,7 +2,6 @@#define __PLAT_AUDIO_Hstruct kirkwood_asoc_platform_data { -u32 tclk;int burst; };#endif
Signature · 1 line
1.7.3.4
PATCH v2 3/7 ARM: orion: wdt: use resource vice direct access
In reply to Jason CooperFrom: Andrew Lunn <[email protected]>
---
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(-)
arch/arm/plat-orion/common.c +6 -1
@@ -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)
drivers/watchdog/orion_wdt.c +15 -9
@@ -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;
Signature · 1 line
1.7.3.4
PATCH v2 3/7 ARM: orion: wdt: use resource vice direct access
Quoted 5 lines · Jason Cooper
From: Andrew Lunn <[email protected]>
Signed-off-by Andrew Lunn <[email protected]>Signed-off-by Jason Cooper <[email protected]>Acked-by Grant Likely <[email protected]>
PATCH v4 4/7 ARM: kirkwood: add dreamplug (fdt) support.
In reply to Jason CooperInitially, 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.
---
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
arch/arm/boot/dts/kirkwood-dreamplug.dts new file +17 -0
@@ -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"; + }; +};
arch/arm/boot/dts/kirkwood.dtsi new file +6 -0
@@ -0,0 +1,6 @@ +/include/ "skeleton.dtsi" + +/ { + compatible = "mrvl,kirkwood"; +}; +
arch/arm/mach-kirkwood/Kconfig +14 -0
@@ -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
arch/arm/mach-kirkwood/Makefile +2 -0
@@ -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
arch/arm/mach-kirkwood/Makefile.boot +2 -0
@@ -1,3 +1,5 @@ zreladdr-y += 0x00008000 params_phys-y := 0x00000100 initrd_phys-y := 0x00800000 + +dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
arch/arm/mach-kirkwood/board-dreamplug.c new file +151 -0
151 lines not on this page · raw message
arch/arm/mach-kirkwood/board-dt.c new file +76 -0
76 lines not on this page · raw message
arch/arm/mach-kirkwood/common.c +6 -6
@@ -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 );
arch/arm/mach-kirkwood/common.h +12 -0
@@ -51,6 +51,18 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*devvoid 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;
Signature · 1 line
1.7.3.4
PATCH v4 4/7 ARM: kirkwood: add dreamplug (fdt) support.
Quoted 16 lines · Jason Cooper
Initially, copied
guruplug-setup.cand 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()intokirkwood_dt_init()so that as we convert drivers, we can remove the platform call, egkirkwood_rtc_init(). This maintains compatibility with non-fdt configurations because they still callkirkwood_init()incommon.c.
Quoted 4 lines
As drivers are converted, we will reinstate the 'static' qualifier in
common.c.Signed-off-by Jason Cooper <[email protected]>
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:
Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +4
-0@@ -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
arch/arm/mach-kirkwood/Kconfig config MACH_GURUPLUG · line 60
Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10
-0+ 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
arch/arm/mach-kirkwood/Kconfig config MACH_GURUPLUG
Quoted 4 lines
arch/arm/mach-kirkwood/Kconfig +4
-0+ + if (of_machine_is_compatible("globalscale,dreamplug")) + dreamplug_init(); +
you call a function from dreamplug.o in board-dt.o and
arch/arm/mach-kirkwood/Kconfig
Quoted 2 lines
arch/arm/mach-kirkwood/Kconfig +2
-0+/* 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
PATCH v4 4/7 ARM: kirkwood: add dreamplug (fdt) support.
Quoted 20 lines · Arnd Bergmann
Quoted 19 lines · Jason Cooper
Initially, copied
guruplug-setup.cand 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()intokirkwood_dt_init()so that as we convert drivers, we can remove the platform call, egkirkwood_rtc_init(). This maintains compatibility with non-fdt configurations because they still callkirkwood_init()incommon.c.As drivers are converted, we will reinstate the 'static' qualifier in
common.c.
Quoted 6 lines
Quoted 1 line
Signed-off-by Jason Cooper <[email protected]>Patches 4 and 5 both look ok, but since I merged the earlier versions of these into the stable next/board branch of arm-soc.git, you will have to generate these as incremental patches now, and adapt the changeset comments accordingly.
Ok.
Quoted 38 lines
One small issue:
Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +4
-0@@ -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 + helparch/arm/mach-kirkwood/Kconfig config MACH_GURUPLUG · line 60
Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10
-0+ 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_DTto be enabled without also enabling dreamplug. That is ok, butarch/arm/mach-kirkwood/Kconfig config MACH_GURUPLUG
Quoted 4 lines
arch/arm/mach-kirkwood/Kconfig +4
-0+ + if (of_machine_is_compatible("globalscale,dreamplug")) + dreamplug_init(); +you call a function from dreamplug.o in board-dt.o and
arch/arm/mach-kirkwood/Kconfig
Quoted 2 lines
arch/arm/mach-kirkwood/Kconfig +2
-0+/* board init functions for drivers not converted to fdt */ +void dreamplug_init(void);you have an unconditional forward declaration in the header.
Quoted 8 lines
The idiomatic way to deal with this is to replace turn the declaration into
#ifdef
CONFIG_DREAMPLUG_DT
voiddreamplug_init(void);
#else
static inline voiddreamplug_init(void){}
#endif
Will do, thanks.
Jason.
PATCH v4 4/7 ARM: kirkwood: add dreamplug (fdt) support.
In reply to Jason CooperQuoted 1 line · Jason Cooper
+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.
Signature · 4 lines
Ian Campbell Genius is ten percent inspiration and fifty percent capital gains.
PATCH v4 4/7 ARM: kirkwood: add dreamplug (fdt) support.
Quoted 7 lines · Ian Campbell
Quoted 1 line · Jason Cooper
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
This ends up as Machine: in
/proc/cpuinfo, which seems to be normal?Would it be worth trying to dynamically modify the machine string based on the actual hardware the kernel is running on?
With CONFIG_PROC_DEVICETREE=y I get the following:
$ cat /proc/device-tree/model Globalscale Technologies Dreamplug
It seems to me (I have no strong opinion here, just playing devil's advocate) that /proc/cpuinfo is indeed telling us about the processor (Marvell Kirkwood ...) Should it really be describing the board?
thx,
Jason.
PATCH v4 4/7 ARM: kirkwood: add dreamplug (fdt) support.
Quoted 6 lines · Jason Cooper
Quoted 5 lines · Ian Campbell
Quoted 1 line · Jason Cooper
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
This ends up as Machine: in
/proc/cpuinfo, which seems to be normal?
Quoted 7 lines
Quoted 2 lines
Would it be worth trying to dynamically modify the machine string based on the actual hardware the kernel is running on?
With
CONFIG_PROC_DEVICETREE=yI get the following:$ cat /proc/device-tree/model Globalscale Technologies Dreamplug
Yes, I just found that, thanks.
BTW the impetus for my asking was http://bugs.debian.org/667681 against the flash-kernel tool which uses /proc/cpuinfo to know what magic runes are required for the particular board it is being run on.
Quoted 3 lines
It seems to me (I have no strong opinion here, just playing devil's advocate) that
/proc/cpuinfois indeed telling us about the processor (Marvell Kirkwood ...) Should it really be describing the board?
The field is actually called "Hardware:" (not "Machine:" as I said above). Processor is actually covered separately ("Feroceon 88FR131 rev 1 (v5l)" in this case). I'd expect Hardware: to say something more specific about the h/w platform, the string from /proc/device-tree/model is exactly what I think I would have expected.
Ian.
Quoted 5 lines
thx,
Jason.
Signature · 4 lines
Ian Campbell Nostalgia isn't what it used to be.
A message that is not in the archive (sent off-list or not yet received): [email protected]
dreamplug kernel and uboot code and apparent dreamplug board design change
Quoted 2 lines · On Sun, Apr 15, 2012 at 09:13:13PM -0700, rihoward1 at gmail.com wrote:
First I would like to say thank you for all the work you have performed with DT support for kirkwood and the dreamplug board.
No problem, just scratching an itch. ;-)
Quoted 3 lines
It seems that recently Globalscale in their wisdom has changed the dreamplug board design. See
http://www.plugcomputer.org/plugforum/index.php?topic=6098.0
Hmm, once devicetree is in place, it should just be a matter of swapping out the dtbs. I wonder if the SPI NOR flash was EOL'd? If so, this is a good sign that Globalscale intends to continue producing Dreamplugs. They wouldn't invest the engineering effort to make the change otherwise.
Quoted 2 lines
If this is true then some code fix up for the new version may be needed including a new machtype.
mach-type isn't necessary. This is all handled by the devicetree, now. The most specific model string in the device tree is "globalscale,dreamplug-003-ds2001". Is this the same on the new version? You can find it on the underside of the dreamplug, first line "DreamPlug model: XXX". If it's different, then we'll use that to tell them apart.
If they unwisely left that the same, I'll gin up a patch to use the '0901' and '1001' they refer to in the readme. Based on the forum link, it looks like the only change is the nand flash. Are there any other changes folks are aware of?
Looks like I'll have to take another look at Simon Glass' (I always mess up the apostrophe in those grammar situations, sorry Simon) fdt support in u-boot. That might be the easiest way to solve this there.
thx,
Jason.
PATCH v2 5/7 ARM: kirkwood: convert uart0 to devicetree.
In reply to Jason CooperThis 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.
---
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(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +7 -0
@@ -14,4 +14,11 @@ chosen { bootargs = "console=ttyS0,115200n8 earlyprintk"; }; + + ocp at f1000000 { + serial at 12000 { + clock-frequency = <200000000>; + status = "ok"; + }; + }; };
arch/arm/boot/dts/kirkwood.dtsi +25 -1
@@ -2,5 +2,29 @@ / { compatible = "mrvl,kirkwood"; -}; + ocp at f1000000 { + compatible = "simple-bus"; + ranges = <0 0xf1000000 0x1000000>; + #address-cells = <1>; + #size-cells = <1>; + + serial at 12000 { + compatible = "ns16550a"; + reg = <0x12000 0x100>; + reg-shift = <2>; + interrupts = <33>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + + serial at 12100 { + compatible = "ns16550a"; + reg = <0x12100 0x100>; + reg-shift = <2>; + interrupts = <34>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + }; +};
arch/arm/mach-kirkwood/board-dreamplug.c +0 -2
@@ -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 ();
Signature · 1 line
1.7.3.4
PATCH v2 5/7 ARM: kirkwood: convert uart0 to devicetree.
Quoted 31 lines · Jason Cooper
This uart is the primary console for the dreamplug. Removed
kirkwood_uart0_init()call fromboard-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 <[email protected]>---
Changes from v1:
* moved on-chip peripherals (uart's here) in
kirkwood.dtsiand 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_serialprints 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(-)arch/arm/boot/dts/kirkwood-dreamplug.dts +0
-0
arch/arm/boot/dts/kirkwood-dreamplug.dts line 23
Quoted 10 lines
arch/arm/boot/dts/kirkwood-dreamplug.dts +7
-0@@ -14,4 +14,11 @@ chosen { bootargs = "console=ttyS0,115200n8 earlyprintk"; }; + + ocp at f1000000 { + serial at 12000 { + clock-frequency = <200000000>; + status = "ok"; + }; + };
While this works on my board (I see console messages without earlyprintk), I get the following:
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 0) is a 16550A
Obviously, the interrupt should be 33. Is this a bug? Or, do I need to re-specify all of the attributes when enabling a driver which was /included/?
This could be an artifact of interrupt-controller not being defined in the dt, yet. I'll dig into it more.
thx,
Jason.
Quoted 57 lines
arch/arm/boot/dts/kirkwood-dreamplug.dts +0
-0};arch/arm/boot/dts/kirkwood.dtsi +25
-1@@ -2,5 +2,29 @@ / { compatible = "mrvl,kirkwood"; -}; + ocp at f1000000 { + compatible = "simple-bus"; + ranges = <0 0xf1000000 0x1000000>; + #address-cells = <1>; + #size-cells = <1>; + + serial at 12000 { + compatible = "ns16550a"; + reg = <0x12000 0x100>; + reg-shift = <2>; + interrupts = <33>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + + serial at 12100 { + compatible = "ns16550a"; + reg = <0x12100 0x100>; + reg-shift = <2>; + interrupts = <34>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + }; +};arch/arm/mach-kirkwood/board-dreamplug.c +0
-2@@ -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 ();Signature · 7 lines
1.7.3.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 6/7 ARM: kirkwood: rtc-mv devicetree bindings
In reply to Jason Cooper--- drivers/rtc/rtc-mv.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/rtc/rtc-mv.c +9 -0
@@ -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), }, };
Signature · 1 line
1.7.3.4
PATCH 6/7 ARM: kirkwood: rtc-mv devicetree bindings
Quoted 4 lines · Jason Cooper
Signed-off-by Jason Cooper <[email protected]>--- drivers/rtc/rtc-mv.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
It would be nice to have a small patch description here, saying that this device is trivial to convert to device tree by just adding the match table.
Arnd
PATCH 6/7 ARM: kirkwood: rtc-mv devicetree bindings
In reply to Jason CooperQuoted 18 lines · Jason Cooper
Signed-off-by Jason Cooper <[email protected]>--- drivers/rtc/rtc-mv.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)drivers/rtc/rtc-mv.c +1
-0@@ -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>
drivers/rtc/rtc-mv.c static int __exit mv_rtc_remove(struct platform_device *pdev) · line 303
Quoted 9 lines
drivers/rtc/rtc-mv.c +6
-0@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)return 0 ; } +#ifdef CONFIG_OF +static struct of_device_id rtc_mv_of_match_table[] = { + { .compatible ="mrvl,orion-rtc" , }, + {} +}; +#endif
I guess it's a matter of taste, but you could use __maybe_unused instead of #ifdef .. #endif.
Best regards
Uwe
Quoted 19 lines
drivers/rtc/rtc-mv.c +2
-0+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), }, };Signature · 7 lines
1.7.3.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH v4 7/7 ARM: kirkwood: use devicetree for rtc-mv
In reply to Jason Cooper--- 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(-)
arch/arm/boot/dts/kirkwood.dtsi +6 -0
@@ -26,5 +26,11 @@ /* set clock-frequency in board dts */ status = "disabled"; }; + + rtc at 10300 { + compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc"; + reg = <0x10300 0x20>; + interrupts = <53>; + }; }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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 ); }
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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 );
Signature · 1 line
1.7.3.4
PATCH 7/7 ARM: kirkwood: use devicetree for rtc-mv
Quoted 9 lines · Jason Cooper
Signed-off-by Jason Cooper <[email protected]>--- 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(-)
I think you can just merge this with patch 6, as they are two halves of the same work.
Arnd
PATCH v4 7/7 ARM: kirkwood: use devicetree for rtc-mv
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Jason Cooper
Signed-off-by Jason Cooper <[email protected]>--- 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(-)
Quoted 4 lines
Acked-by Arnd Bergmann <[email protected]>I think you can just merge this with patch 6, as they are two halves of the same work.
Others working on kirkwood and dt asked me to separate the two to facilitate integrating with their existing work. I can undo if you think it's best.
thx,
Jason.
PATCH 7/7 ARM: kirkwood: use devicetree for rtc-mv
Quoted 12 lines · Jason Cooper
Quoted 11 lines · Arnd Bergmann
Quoted 9 lines · Jason Cooper
Signed-off-by Jason Cooper <[email protected]>--- 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(-)
Quoted 8 lines
Quoted 4 lines
Acked-by Arnd Bergmann <[email protected]>I think you can just merge this with patch 6, as they are two halves of the same work.
Others working on kirkwood and dt asked me to separate the two to facilitate integrating with their existing work. I can undo if you think it's best.
No, just ignore my comment in that case. If it helps anyone to split the patches, it's definitely ok to do so, I just didn't see any reason why you would.
Arnd
v5 cover ARM: kirkwood: fdt: convert kirkwood to fdt
In reply to Jason CooperThis 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
Signature · 1 line
1.7.3.4
PATCH v5 1/9 ARM: orion: spi: remove enable_clock_fix which is not used
From: Andrew Lunn <[email protected]>
--- drivers/spi/spi-orion.c | 5 ----- include/linux/spi/orion_spi.h | 1 - 2 files changed, 0 insertions(+), 6 deletions(-)
drivers/spi/spi-orion.c +0 -5
@@ -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;
include/linux/spi/orion_spi.h +0 -1
@@ -11,7 +11,6 @@struct orion_spi_info {u32 tclk;/* no <linux/clk.h> support yet */ -u32 enable_clock_fix; };
Signature · 1 line
1.7.3.4
PATCH v5 2/9 ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
In reply to Jason CooperFrom: Andrew Lunn <[email protected]>
It is not used anywhere in the sound driver.
--- arch/arm/mach-kirkwood/common.c | 1 - arch/arm/plat-orion/include/plat/audio.h | 1 - 2 files changed, 0 insertions(+), 2 deletions(-)
arch/arm/mach-kirkwood/common.c +0 -1
@@ -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,
arch/arm/plat-orion/include/plat/audio.h +0 -1
@@ -2,7 +2,6 @@#define __PLAT_AUDIO_Hstruct kirkwood_asoc_platform_data { -u32 tclk;int burst; };#endif
Signature · 1 line
1.7.3.4
PATCH v3 3/9 ARM: orion: wdt: use resource vice direct access
In reply to Jason Cooper---
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(-)
arch/arm/plat-orion/common.c +6 -1
@@ -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)
drivers/watchdog/orion_wdt.c +15 -9
@@ -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;
Signature · 1 line
1.7.3.4
PATCH v5 4/9 ARM: kirkwood: fdt: use mrvl ticker symbol
In reply to Jason CooperAlso, use inclusive register size for uart0.
--- arch/arm/boot/dts/kirkwood-dreamplug.dts | 4 ++-- arch/arm/boot/dts/kirkwood.dtsi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +2 -2
@@ -4,7 +4,7 @@ / { model = "Globalscale Technologies Dreamplug"; - compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood"; memory { device_type = "memory";
@@ -17,7 +17,7 @@ serial at f1012000 { compatible = "ns16550a"; - reg = <0xf1012000 0xff>; + reg = <0xf1012000 0x100>; reg-shift = <2>; interrupts = <33>; clock-frequency = <200000000>;
arch/arm/boot/dts/kirkwood.dtsi +1 -1
@@ -1,6 +1,6 @@ /include/ "skeleton.dtsi" / { - compatible = "marvell,kirkwood"; + compatible = "mrvl,kirkwood"; };
Signature · 1 line
1.7.3.4
PATCH v5 5/9 ARM: kirkwood: fdt: absorb kirkwood_init()
In reply to Jason CooperWe 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.
--- 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(-)
arch/arm/mach-kirkwood/board-dt.c +28 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +6 -6
@@ -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 );
arch/arm/mach-kirkwood/common.h +8 -0
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*devvoid 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;
Signature · 1 line
1.7.3.4
PATCH v2 6/9 ARM: kirkwood: fdt: facilitate new boards during fdt migration
In reply to Jason CooperMove 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.
---
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
arch/arm/mach-kirkwood/Makefile +1 -0
@@ -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
arch/arm/mach-kirkwood/board-dreamplug.c new file +152 -0
152 lines not on this page · raw message
arch/arm/mach-kirkwood/board-dt.c +1 -132
157 lines not on this page · raw message
arch/arm/mach-kirkwood/common.h +8 -0
@@ -51,6 +51,14 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*devvoid 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 );
Signature · 1 line
1.7.3.4
PATCH v5 7/9 ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0
In reply to Jason CooperDefine 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.
--- arch/arm/boot/dts/kirkwood-dreamplug.dts | 11 +++++------ arch/arm/boot/dts/kirkwood.dtsi | 26 +++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 7 deletions(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +5 -6
@@ -15,11 +15,10 @@ bootargs = "console=ttyS0,115200n8 earlyprintk"; }; - serial at f1012000 { - compatible = "ns16550a"; - reg = <0xf1012000 0x100>; - reg-shift = <2>; - interrupts = <33>; - clock-frequency = <200000000>; + ocp at f1000000 { + serial at 12000 { + clock-frequency = <200000000>; + status = "ok"; + }; }; };
arch/arm/boot/dts/kirkwood.dtsi +25 -1
@@ -2,5 +2,29 @@ / { compatible = "mrvl,kirkwood"; -}; + ocp at f1000000 { + compatible = "simple-bus"; + ranges = <0 0xf1000000 0x1000000>; + #address-cells = <1>; + #size-cells = <1>; + + serial at 12000 { + compatible = "ns16550a"; + reg = <0x12000 0x100>; + reg-shift = <2>; + interrupts = <33>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + + serial at 12100 { + compatible = "ns16550a"; + reg = <0x12100 0x100>; + reg-shift = <2>; + interrupts = <34>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + }; +};
Signature · 1 line
1.7.3.4
PATCH v2 8/9 ARM: kirkwood: rtc-mv devicetree bindings
In reply to Jason CooperTrivial conversion to devicetree.
---
Changes from v1:
- added 'trivial conversion' patch description.
drivers/rtc/rtc-mv.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/rtc/rtc-mv.c +9 -0
@@ -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), }, };
Signature · 1 line
1.7.3.4
PATCH v5 9/9 ARM: kirkwood: use devicetree for rtc-mv
In reply to Jason Cooper--- 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(-)
arch/arm/boot/dts/kirkwood.dtsi +6 -0
@@ -26,5 +26,11 @@ /* set clock-frequency in board dts */ status = "disabled"; }; + + rtc at 10300 { + compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc"; + reg = <0x10300 0x20>; + interrupts = <53>; + }; }; };
arch/arm/mach-kirkwood/board-dt.c +0 -1
@@ -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 ();
arch/arm/mach-kirkwood/common.c +1 -1
@@ -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 ); }
arch/arm/mach-kirkwood/common.h +0 -1
@@ -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 );
Signature · 1 line
1.7.3.4
v5 cover ARM: kirkwood: fdt: convert kirkwood to fdt
In reply to Jason CooperQuoted 12 lines · Jason Cooper
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.
Quoted 7 lines
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
v5 cover ARM: kirkwood: fdt: convert kirkwood to fdt
Quoted 18 lines · Arnd Bergmann
Quoted 17 lines · Jason Cooper
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.
Quoted 4 lines
Quoted 2 lines
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.
Quoted 5 lines
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.
Quoted 3 lines
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.
v5 cover ARM: kirkwood: fdt: convert kirkwood to fdt
Quoted 3 lines · Jason Cooper
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.
Quoted 8 lines
Quoted 5 lines
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
v5 cover ARM: kirkwood: fdt: convert kirkwood to fdt
Quoted 9 lines · Arnd Bergmann
Quoted 3 lines · Jason Cooper
I was going to give it a day or two more, and if no one brought up anything earth-shattering, I was going to submit the pull-request for this series on Sunday. I can do it now if you think it's ok.
I've already pulled it now, and I'm not going to take any new patches for v3.4 any more. I expect Linus to open up the merge window any time now, and he does not like to see patches sent to him that have not been in linux-next before the merge window opened.
Ahhh That explains some things.
Thanks,
Jason.