Another round of Device Tree enablement for Snowball
Subsystems (11)
v2 cover Another round of Device Tree enablement for Snowball
This patch-set enables the following devices:
- External bus for Ethernet chip
- SMSC9115 Ethernet chip
- DB8500 PRCMU
- DB8500 PRCMU Timer (Clocksource)
... and provides the following functionality:
- Nomadik GPIO controller irqdomain support
... and fixes the following bugs:
- Attempt to free a non-existent IRQ in SMSC911x
- Attempt to probe non-existent devices on Snowball
.../devicetree/bindings/gpio/gpio-nmk.txt | 2 + arch/arm/boot/dts/db8500.dtsi | 39 ++++++++++++++++++- arch/arm/boot/dts/snowball.dts | 40 ++++++++++---------- arch/arm/mach-ux500/board-mop500.c | 38 ++++++++++++------- arch/arm/mach-ux500/board-mop500.h | 3 + arch/arm/mach-ux500/cpu-db8500.c | 33 ++++++++++++++++ arch/arm/mach-ux500/cpu.c | 1 + arch/arm/mach-ux500/timer.c | 24 ++++++++++++ drivers/gpio/gpio-nomadik.c | 40 ++++++++++++++++++- drivers/mfd/db8500-prcmu.c | 10 ++++- drivers/mmc/host/mmci.c | 5 +- drivers/net/ethernet/smsc/smsc911x.c | 3 +- 12 files changed, 192 insertions(+), 46 deletions(-)
PATCH 1/15 ARM: ux500: Enable the external bus with Device Tree
To allow for proper initialisation of the SMSC9115 Ethernet chip and other devices which may be connected to the 'external bus', Device Tree must first enable and traverse though it. This patch enables the 'external bus' which will facilitate further initialisation of its suborantate DT nodes.
--- arch/arm/mach-ux500/board-mop500.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/board-mop500.c +2 -1
@@ -767,9 +767,10 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { {}, }; -static const struct of_device_id u8500_soc_node[] = { +static const struct of_device_id u8500_local_bus_nodes[] = {/* only create devices below soc node */ { .compatible ="stericsson,db8500" , }, + { .compatible ="simple-bus" }, { }, };
Signature · 1 line
1.7.9.1
PATCH 1/15 ARM: ux500: Enable the external bus with Device Tree
Quoted 7 lines · Lee Jones
To allow for proper initialisation of the SMSC9115 Ethernet chip and other devices which may be connected to the 'external bus', Device Tree must first enable and traverse though it. This patch enables the 'external bus' which will facilitate further initialisation of its suborantate DT nodes.
Signed-off-by Lee Jones <[email protected]>
Thanks for fixing it up!
Applied.
Yours,
Linus Walleij
PATCH 2/15 drivers/gpio: gpio-nomadik: Add support for irqdomains
In reply to Lee JonesAdd irq domain support to the gpio-nomadik GPIO driver. This enables its users to support dynamic IRQ assignment, which is requried by Device Tree.
--- arch/arm/mach-ux500/cpu.c | 12 +++++ drivers/gpio/gpio-nomadik.c | 106 +++++++++++++++++++++++------------------- 2 files changed, 70 insertions(+), 48 deletions(-)
arch/arm/mach-ux500/cpu.c +12 -0
@@ -30,6 +30,18 @@void __iomem *_PRCMU_BASE; +/* +* FIXME: Should we set up the GPIO domain here? +* +* The problem is that we cannot put the interrupt resources into the platform +* device until the irqdomain has been added. Right now, we set the GIC interrupt +* domain from init_irq(), then load the gpio driver from +* core_initcall(nmk_gpio_init) and add the platform devices from +* arch_initcall(customize_machine). +* +* This feels fragile because it depends on the gpio device getting probed +* _before_ any device uses the gpio interrupts. +*/ static const struct of_device_id ux500_dt_irq_match[] = { { .compatible ="arm,cortex-a9-gic" , .data = gic_of_init, }, {},
drivers/gpio/gpio-nomadik.c +58 -48
302 lines not on this page · raw message
Signature · 1 line
1.7.9.1
Linus Walleij
AppliedPATCH 2/15 drivers/gpio: gpio-nomadik: Add support for irqdomains
Quoted 5 lines · Lee Jones
Add irq domain support to the gpio-nomadik GPIO driver. This enables its users to support dynamic IRQ assignment, which is requried by Device Tree.
Signed-off-by Lee Jones <[email protected]>
Hey, it works!
Applied to my gpio-and-pin ux500 branch.
Note to Grant: I'm shepherding the ux500 GPIO patches for funneling through the ARM SoC tree.
Yours,
Linus Walleij
PATCH 2/15 drivers/gpio: gpio-nomadik: Add support for irqdomains
Quoted 6 lines · Linus Walleij
Quoted 4 lines · Lee Jones
Add irq domain support to the gpio-nomadik GPIO driver. This enables its users to support dynamic IRQ assignment, which is requried by Device Tree.
Quoted 8 lines
Quoted 1 line
Signed-off-by Lee Jones <[email protected]>Hey, it works!
Applied to my gpio-and-pin ux500 branch.
Note to Grant: I'm shepherding the ux500 GPIO patches for funneling through the ARM SoC tree.
Okay, I'll happily ignore the ux500 patches then. :-)
g.
PATCH 3/15 ARM: ux500: Use correct format for dynamic IRQ assignment
In reply to Lee JonesThis patch applies the correct format requested by the irq domain. For chained IRQs which use GPIO lines as IRQs, we stipulate that a two cell request is required. The first cell contains the requested IRQ and the second can contain flags pertaining to edge detection and level sensitive values. The zeroth cell specifies the GPIO controller by use of a phandle.
--- arch/arm/boot/dts/db8500.dtsi | 22 ++++++++++++++++++++-- arch/arm/boot/dts/snowball.dts | 20 +++++++++----------- 2 files changed, 29 insertions(+), 13 deletions(-)
arch/arm/boot/dts/db8500.dtsi +20 -2
@@ -24,7 +24,6 @@ #interrupt-cells = <3>; #address-cells = <1>; interrupt-controller; - interrupt-parent; reg = <0xa0411000 0x1000>, <0xa0410100 0x100>; };
@@ -59,6 +58,8 @@ "st,nomadik-gpio"; reg = <0x8012e000 0x80>; interrupts = <0 119 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -70,6 +71,8 @@ "st,nomadik-gpio"; reg = <0x8012e080 0x80>; interrupts = <0 120 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -81,6 +84,8 @@ "st,nomadik-gpio"; reg = <0x8000e000 0x80>; interrupts = <0 121 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -92,6 +97,8 @@ "st,nomadik-gpio"; reg = <0x8000e080 0x80>; interrupts = <0 122 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -103,6 +110,8 @@ "st,nomadik-gpio"; reg = <0x8000e100 0x80>; interrupts = <0 123 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -114,6 +123,8 @@ "st,nomadik-gpio"; reg = <0x8000e180 0x80>; interrupts = <0 124 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -125,6 +136,8 @@ "st,nomadik-gpio"; reg = <0x8011e000 0x80>; interrupts = <0 125 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -136,6 +149,8 @@ "st,nomadik-gpio"; reg = <0x8011e080 0x80>; interrupts = <0 126 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -147,6 +162,8 @@ "st,nomadik-gpio"; reg = <0xa03fe000 0x80>; interrupts = <0 127 0x4>; + interrupt-controller; + #interrupt-cells = <2>; supports-sleepmode; gpio-controller; #gpio-cells = <2>;
@@ -230,7 +247,8 @@ status = "disabled"; // Add one of these for each child device - cs-gpios = <&gpio0 31 &gpio4 14 &gpio4 16 &gpio6 22 &gpio7 0>; + cs-gpios = <&gpio0 31 0x4 &gpio4 14 0x4 &gpio4 16 0x4 + &gpio6 22 0x4 &gpio7 0 0x4>; };
arch/arm/boot/dts/snowball.dts +9 -11
@@ -30,35 +30,35 @@ wakeup = <1>; linux,code = <2>; label = "userpb"; - gpios = <&gpio1 0 0>; + gpios = <&gpio1 0 0x4>; }; button at 2 { debounce_interval = <50>; wakeup = <1>; linux,code = <3>; label = "extkb1"; - gpios = <&gpio4 23 0>; + gpios = <&gpio4 23 0x4>; }; button at 3 { debounce_interval = <50>; wakeup = <1>; linux,code = <4>; label = "extkb2"; - gpios = <&gpio4 24 0>; + gpios = <&gpio4 24 0x4>; }; button at 4 { debounce_interval = <50>; wakeup = <1>; linux,code = <5>; label = "extkb3"; - gpios = <&gpio5 1 0>; + gpios = <&gpio5 1 0x4>; }; button at 5 { debounce_interval = <50>; wakeup = <1>; linux,code = <6>; label = "extkb4"; - gpios = <&gpio5 2 0>; + gpios = <&gpio5 2 0x4>; }; };
@@ -66,12 +66,11 @@ compatible = "gpio-leds"; used-led { label = "user_led"; - gpios = <&gpio4 14>; + gpios = <&gpio4 14 0x4>; }; }; soc-u9500 { - external-bus at 50000000 { compatible = "simple-bus"; reg = <0x50000000 0x10000000>;
@@ -82,7 +81,7 @@ ethernet at 50000000 { compatible = "smsc,9111"; reg = <0x50000000 0x10000>; - interrupts = <12>; + interrupts = <12 0x4>; interrupt-parent = <&gpio4>; }; };
@@ -94,8 +93,7 @@ bus-width = <8>; mmc-cap-mmc-highspeed; - #gpio-cells = <1>; - cd-gpios = <&gpio6 26>; // 218 + cd-gpios = <&gpio6 26 0x4>; // 218 cd-inverted; status = "okay";
@@ -127,7 +125,7 @@ tc3589x at 42 { //compatible = "tc3589x"; reg = <0x42>; - interrupts = <25>; + gpios = <&gpio6 25 0x4>; interrupt-parent = <&gpio6>; }; tps61052 at 33 {
Signature · 1 line
1.7.9.1
PATCH 3/15 ARM: ux500: Use correct format for dynamic IRQ assignment
Quoted 7 lines · Lee Jones
This patch applies the correct format requested by the irq domain. For chained IRQs which use GPIO lines as IRQs, we stipulate that a two cell request is required. The first cell contains the requested IRQ and the second can contain flags pertaining to edge detection and level sensitive values. The zeroth cell specifies the GPIO controller by use of a phandle.
Quoted 5 lines
Signed-off-by Lee Jones <[email protected]>---
?arch/arm/boot/dts/db8500.dtsi ?| ? 22 ++++++++++++++++++++-- ?arch/arm/boot/dts/snowball.dts | ? 20 +++++++++----------- ?2 files changed, 29 insertions(+), 13 deletions(-)
So I created a separate ux500-devicetree branch and split off the changes under arch/arm/boot/dts/* here. For example I have split the patch:
"drivers/gpio: gpio-nomadik: Apply Device Tree bindings"
Into one changing code and one changing the device tree itself. Else this won't be possible to keep separate topic branches, and we want that.
Then applied this on top.
I hope you're OK with this?
Yours,
Linus Walleij
PATCH 3/15 ARM: ux500: Use correct format for dynamic IRQ assignment
Quoted 20 lines · Linus Walleij
Quoted 7 lines · Lee Jones
This patch applies the correct format requested by the irq domain. For chained IRQs which use GPIO lines as IRQs, we stipulate that a two cell request is required. The first cell contains the requested IRQ and the second can contain flags pertaining to edge detection and level sensitive values. The zeroth cell specifies the GPIO controller by use of a phandle.
Quoted 5 lines
Signed-off-by Lee Jones<[email protected]>--- arch/arm/boot/dts/db8500.dtsi | 22 ++++++++++++++++++++-- arch/arm/boot/dts/snowball.dts | 20 +++++++++----------- 2 files changed, 29 insertions(+), 13 deletions(-)So I created a separate ux500-devicetree branch and split off the changes under
arch/arm/boot/dts/*here. For example I have split the patch:
"drivers/gpio: gpio-nomadik: Apply Device Tree bindings"
Quoted 7 lines
Into one changing code and one changing the device tree itself. Else this won't be possible to keep separate topic branches, and we want that.
Then applied this on top.
I hope you're OK with this?
Yes, of course, thanks.
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 4/15 drivers/net: Do not free an IRQ if its request failed
In reply to Lee JonesRefrain from attempting to free an interrupt line if the request fails and hence, there is no IRQ to free.
--- drivers/net/ethernet/smsc/smsc911x.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/ethernet/smsc/smsc911x.c +1 -2
@@ -2382,7 +2382,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)SET_NETDEV_DEV (dev, &pdev->dev); pdata =netdev_priv (dev); - dev->irq = irq_res->start; irq_flags = irq_res->flags &IRQF_TRIGGER_MASK ; pdata->ioaddr =ioremap_nocache (res->start, res_size);
@@ -2446,7 +2445,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)if (retval) {SMSC_WARN (pdata, probe,"Unable to claim requested irq: %d" , dev->irq); - goto out_free_irq; + goto out_disable_resources; } retval =register_netdev (dev);
Signature · 1 line
1.7.9.1
Re: [PATCH 04/15] drivers/net: Do not free an IRQ if its request failed
Quoted 22 lines · Lee Jones
Refrain from attempting to free an interrupt line if the request fails and hence, there is no IRQ to free.
CC netdev at vger.kernel.orgSigned-off-by Lee Jones<[email protected]>--- drivers/net/ethernet/smsc/smsc911x.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)drivers/net/ethernet/smsc/smsc911x.c +0
-1@@ -2382,7 +2382,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)SET_NETDEV_DEV (dev,&pdev->dev); pdata =netdev_priv (dev); - dev->irq = irq_res->start; irq_flags = irq_res->flags&IRQF_TRIGGER_MASK ; pdata->ioaddr =ioremap_nocache (res->start, res_size);
drivers/net/ethernet/smsc/smsc911x.c static int __devinit smsc911x_drv_probe(struct platform_device *pdev) · line 2451
Quoted 8 lines
drivers/net/ethernet/smsc/smsc911x.c +1
-1@@ -2446,7 +2445,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)if (retval) {SMSC_WARN (pdata, probe,"Unable to claim requested irq: %d" , dev->irq); - goto out_free_irq; + goto out_disable_resources; } retval =register_netdev (dev);
Anything on this from the Net guys?
Kind regards,
Lee
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH 04/15] drivers/net: Do not free an IRQ if its request failed
Quoted 10 lines · Lee Jones
Quoted 5 lines · Lee Jones
- ? ? ? ? ? ? ? goto
out_free_irq;
+ ? ? ? ? ? ? ? gotoout_disable_resources;
? ? ? ?}? ? ? ?retval =
register_netdev(dev);Anything on this from the Net guys?
This was merged for 3.4-rc5, check:
https://lkml.org/lkml/2012/4/29/2
Linus Walleij
Re: [PATCH 04/15] drivers/net: Do not free an IRQ if its request failed
Quoted 7 lines · Linus Walleij
Quoted 6 lines · Lee Jones
Quoted 4 lines · Lee Jones
drivers/net/ethernet/smsc/smsc911x.c +1
-1- goto out_free_irq; + goto out_disable_resources; }
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
retval = register_netdev(dev);Anything on this from the Net guys?
This was merged for 3.4-rc5, check:
https://lkml.org/lkml/2012/4/29/2
I actually found that out a few hours ago by accident.
Thanks for letting me know though.
Kind regards,
Lee
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 5/15 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement
In reply to Lee JonesDuring Device Tree enablement it is necessary to remove snowball_<device>* platform_data segments one at at time, as and when particular devices are DT enabled. This patch provides a temporary solution. Once this new struct is empty it will be removed again.
--- arch/arm/mach-ux500/board-mop500.c | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-)
arch/arm/mach-ux500/board-mop500.c +17 -2
@@ -609,6 +609,13 @@ static struct platform_device *snowball_platform_devs[] __initdata = { &ab8500_device, }; +static struct platform_device *snowball_of_platform_devs[]__initdata = { + &snowball_led_dev, + &snowball_key_dev, + &snowball_sbnet_dev, + &ab8500_device, +}; +static void __init mop500_init_machine (void ) {struct device *parent =NULL ;
@@ -801,8 +808,16 @@ static void __init u8500_init_machine(void)mop500_sdi_init (parent); }else if (of_machine_is_compatible ("calaosystems,snowball-a9500" )) {snowball_pins_init (); -platform_add_devices (snowball_platform_devs, -ARRAY_SIZE (snowball_platform_devs)); + +/* +* Devices to be DT:ed: +* snowball_led_dev = todo +* snowball_key_dev = todo +* snowball_sbnet_dev = done +* ab8500_device = todo +*/ +platform_add_devices (snowball_of_platform_devs, +ARRAY_SIZE (snowball_of_platform_devs)); }else if (of_machine_is_compatible ("st-ericsson,hrefv60+" )) {/*
Signature · 1 line
1.7.9.1
PATCH 5/15 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement
Linus, Can you please take 05 and 06 please, as some of the other patches depend on them. Thanks.
/Lee
PATCH 5/15 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement
Quoted 2 lines · Lee Jones
Linus, Can you please take 05 and 06 please, as some of the other patches depend on them. Thanks.
I think I've done that now and I'm planning a first pull request to ARM SoC to get the base into -next ASAP.
Yours,
Linus Walleij
PATCH 5/15 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement
Quoted 5 lines
Quoted 2 lines
Linus, Can you please take 05 and 06 please, as some of the other patches depend on them. Thanks.
I think I've done that now and I'm planning a first pull request to ARM SoC to get the base into -next ASAP.
Looks like neither of these made it into Mainline, however subsequent patches which made changes to them did. This has caused some merge error, thus the code, especially in arch/arm/mach-ux500/cpu-db8500.c, but also in arch/arm/mach-ux500/board-mop500.c is quite wrong. :(
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 5/15 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement
Quoted 4 lines · Lee Jones
Looks like neither of these made it into Mainline, however subsequent patches which made changes to them did. This has caused some merge error, thus the code, especially in
arch/arm/mach-ux500/cpu-db8500.c, but also inarch/arm/mach-ux500/board-mop500.cis quite wrong. :(
OK can you create a fixup patch for the 3.5-rc series and send it to the ARM SoC tree?
Yours,
Linus Walleij
PATCH 6/15 ARM: ux500: New DT:ed u8500_init_devices for one-by-one device enablement
In reply to Lee JonesDuring Device Tree enablement it is necessary to remove <hw_component>_add_<device> calls one at at time, as and when particular devices are DT enabled. This patch provides a temporary solution. Once the new *of_init_devices function has been fully unpopulated it will be removed again.
--- arch/arm/mach-ux500/board-mop500.c | 2 +- arch/arm/mach-ux500/board-mop500.h | 3 +++ arch/arm/mach-ux500/cpu-db8500.c | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/board-mop500.c +1 -1
@@ -787,7 +787,7 @@ static void __init u8500_init_machine(void)int i2c0_devs;int i; - parent =u8500_init_devices (); + parent =u8500_of_init_devices (); i2c0_devs =ARRAY_SIZE (mop500_i2c0_devices);for (i =0 ; i <ARRAY_SIZE (mop500_platform_devs); i++)
arch/arm/mach-ux500/board-mop500.h +3 -0
@@ -92,4 +92,7 @@ void __init snowball_pins_init(void);void mop500_uib_i2c_add (int busnum,struct i2c_board_info *info,unsigned n); +/* TODO: Once all pieces are DT:ed, remove completely. */ +struct device *__init u8500_of_init_devices (void ); +#endif
arch/arm/mach-ux500/cpu-db8500.c +22 -0
@@ -206,3 +206,25 @@ struct device * __init u8500_init_devices(void)return parent; } + +/* TODO: Once all pieces are DT:ed, remove completely. */ +struct device *__init u8500_of_init_devices (void ) +{ +struct device *parent; +int i; + + parent =db8500_soc_device_init (); + +db8500_add_rtc (parent); +db8500_add_usb (parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); + +platform_device_register_data (parent, +"cpufreq-u8500" ,-1 ,NULL ,0 ); + +for (i =0 ; i <ARRAY_SIZE (platform_devs); i++) + platform_devs[i]->dev.parent = parent; + +platform_add_devices (platform_devs,ARRAY_SIZE (platform_devs)); + +return parent; +}
Signature · 1 line
1.7.9.1
PATCH 7/15 ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
In reply to Lee JonesEnable the Ethernet port by providing correct information via DT.
--- arch/arm/boot/dts/snowball.dts | 10 ++++++++-- arch/arm/mach-ux500/board-mop500.c | 1 - 2 files changed, 8 insertions(+), 3 deletions(-)
arch/arm/boot/dts/snowball.dts +8 -2
@@ -79,10 +79,16 @@ ranges; ethernet at 50000000 { - compatible = "smsc,9111"; + compatible = "smsc,lan9115"; reg = <0x50000000 0x10000>; - interrupts = <12 0x4>; + interrupts = <12 0x1>; interrupt-parent = <&gpio4>; + + reg-shift = <1>; + reg-io-width = <2>; + smsc,force-internal-phy; + smsc,irq-active-high; + smsc,irq-push-pull; }; };
arch/arm/mach-ux500/board-mop500.c +0 -1
@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {static struct platform_device *snowball_of_platform_devs[]__initdata = { &snowball_led_dev, &snowball_key_dev, - &snowball_sbnet_dev, &ab8500_device, };
Signature · 1 line
1.7.9.1
PATCH 7/15 ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
Lee can you please split this patch in one piece which is this:
Quoted 20 lines · Lee Jones
Enable the Ethernet port by providing correct information via DT.
Signed-off-by Lee Jones <[email protected]>---
?arch/arm/boot/dts/snowball.dts ? ? | ? 10 ++++++++-- ?arch/arm/mach-ux500/board-mop500.c | ? ?1 - ?2 files changed, 8 insertions(+), 3 deletions(-)arch/arm/boot/dts/snowball.dts +1
-2@@ -79,10 +79,16 @@ ? ? ? ? ? ? ? ? ? ? ? ?ranges; ? ? ? ? ? ? ? ? ? ? ? ?ethernet at 50000000 { - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "smsc,9111"; + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? compatible = "smsc,lan9115"; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?reg = <0x50000000 0x10000>; - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <12 0x4>;
arch/arm/boot/dts/snowball.dts line 93
Quoted 10 lines
arch/arm/boot/dts/snowball.dts +7
-0+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? interrupts = <12 0x1>; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?interrupt-parent = <&gpio4>; + + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg-shift = <1>; + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? reg-io-width = <2>; + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? smsc,force-internal-phy; + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? smsc,irq-active-high; + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? smsc,irq-push-pull; ? ? ? ? ? ? ? ? ? ? ? ?}; ? ? ? ? ? ? ? ?};
So that patch only affects arch/arm/boot/dts/*
And this in another patch:
arch/arm/mach-ux500/board-mop500.c static struct platform_device *snowball_platform_devs[] __initdata = { · line 616
Quoted 11 lines
arch/arm/mach-ux500/board-mop500.c +0
-1@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = { ?static struct platform_device *snowball_of_platform_devs[] __initdata = { ? ? ? ?&snowball_led_dev, ? ? ? ?&snowball_key_dev, - ? ? ? &snowball_sbnet_dev, ? ? ? ?&ab8500_device, ?};
So I can accumulate changes to ux500 core code and Device Tree updates on separate branches?
Yours,
Linus Walleij
PATCH 1/1 ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
From: Lee Jones <[email protected]>
Date: Tue, 24 Apr 2012 10:53:18 +0100
Subject: [PATCH 07.1/15] ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
Here we split the description of the external-bus at 50000000 over two description files. In the more generic db8500 description file we only specify the external-bus. Normally this would be used to communicate with a NOR-flash device. On the Snowball however, the SMSC9115 Ethernet chip occupies it. In the Snowball board specific description file is where we actually specify that it is in fact the Ethernet device which lives here.
--- arch/arm/boot/dts/db8500.dtsi | 9 +++++++++ arch/arm/boot/dts/snowball.dts | 22 ++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-)
arch/arm/boot/dts/db8500.dtsi +9 -0
@@ -307,5 +307,14 @@ interrupts = <0 100 0x4>; status = "disabled"; }; + + external-bus at 50000000 { + compatible = "simple-bus"; + reg = <0x50000000 0x4000000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x50000000 0x4000000>; + status = "disabled"; + }; }; };
arch/arm/boot/dts/snowball.dts +12 -10
@@ -72,17 +72,19 @@ soc-u9500 { external-bus at 50000000 { - compatible = "simple-bus"; - reg = <0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - ethernet at 50000000 { - compatible = "smsc,9111"; - reg = <0x50000000 0x10000>; - interrupts = <12 0x4>; + status = "okay"; + + ethernet at 0 { + compatible = "smsc,lan9115"; + reg = <0 0x10000>; + interrupts = <12 0x1>; interrupt-parent = <&gpio4>; + + reg-shift = <1>; + reg-io-width = <2>; + smsc,force-internal-phy; + smsc,irq-active-high; + smsc,irq-push-pull; }; };
Signature · 1 line
1.7.9.1
PATCH 1/1 ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
Quoted 12 lines · Lee Jones
From: Lee Jones <[email protected]>
Date: Tue, 24 Apr 2012 10:53:18 +0100
Subject: [PATCH 07.1/15] ARM: ux500: Enable the SMSC9115 on Snowball via Device TreeHere we split the description of the external-bus at 50000000 over two description files. In the more generic db8500 description file we only specify the external-bus. Normally this would be used to communicate with a NOR-flash device. On the Snowball however, the SMSC9115 Ethernet chip occupies it. In the Snowball board specific description file is where we actually specify that it is in fact the Ethernet device which lives here.
Quoted 1 line
Signed-off-by Lee Jones <[email protected]>
Applied with some manual intervention, don't quite know why we don't have identical merge bases but whatever, check the end result.
(You can do that by going to the branch ux500-devicetree in my linux-stericsson git.)
Linus Walleij
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
In reply to Linus WalleijFrom: Lee Jones <[email protected]>
Date: Tue, 24 Apr 2012 10:54:25 +0100
Subject: [PATCH 7.2/15] ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Now the SCMC911x is correctly enabled in Device Tree, there is no need to continue registering it from platform code. In fact, if we continue doing so, the system will throw an error on boot.
--- arch/arm/mach-ux500/board-mop500.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/board-mop500.c +0 -1
@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {static struct platform_device *snowball_of_platform_devs[]__initdata = { &snowball_led_dev, &snowball_key_dev, - &snowball_sbnet_dev, &ab8500_device, };
Signature · 1 line
1.7.9.1
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Quoted 18 lines · Lee Jones
From: Lee Jones <[email protected]>
Date: Tue, 24 Apr 2012 10:54:25 +0100
Subject: [PATCH 7.2/15] ARM: ux500: Disable SMSC911x platform code registration when DT is enabledNow the SCMC911x is correctly enabled in Device Tree, there is no need to continue registering it from platform code. In fact, if we continue doing so, the system will throw an error on boot.
Signed-off-by Lee Jones <[email protected]>--- arch/arm/mach-ux500/board-mop500.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)arch/arm/mach-ux500/board-mop500.c +0
-0
arch/arm/mach-ux500/board-mop500.c static struct platform_device *snowball_platform_devs[] __initdata = { · line 617
Quoted 7 lines
arch/arm/mach-ux500/board-mop500.c +0
-1@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {static struct platform_device *snowball_of_platform_devs[]__initdata = { &snowball_led_dev, &snowball_key_dev, - &snowball_sbnet_dev, &ab8500_device, };
This version of the patch looks good, the version that was applied does not. The same is true for "ARM: ux500: Fork cpu-db8500 platform_devs for sequential DT enablement". I only noticed because I get new build warnings for the bogus code now. It appears that some of the prerequisites for these patches, in particular "ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement" and "ARM: ux500: New DT:ed u8500_init_devices for one-by-one device enablement" are missing now and the two patches on top were mismerged.
Linus and Lee, what's going on here?
Arnd
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Quoted 3 lines · Arnd Bergmann
This version of the patch looks good, the version that was applied does not. (...)
Linus and Lee, what's going on here?
Probably just my screwups when applying Lee's patches out-of-order and splitting them.
I saw lee sent a new pull request with his baseline, throw the devcietree branch from me out and use his branch instead.
Sorry for the mess!
Linus Walleij
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Quoted 11 lines · Linus Walleij
Quoted 3 lines · Arnd Bergmann
This version of the patch looks good, the version that was applied does not. (...)
Linus and Lee, what's going on here?Probably just my screwups when applying Lee's patches out-of-order and splitting them.
I saw lee sent a new pull request with his baseline, throw the devcietree branch from me out and use his branch instead.
I've just seen another problem with this.
In the pull request was:
Quoted 19 lines
commit
dc315c470b6b69018e6b65beb1e5b0d8f737261dAuthor: Lee Jones <[email protected]> Date: Tue Apr 24 10:54:25 2012 +0100ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Now the SCMC911x is correctly enabled in Device Tree, there is no need to continue registering it from platform code. In fact, if we continue doing so, the system will throw an error on boot.
SAcked-by Linus Walleij <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>igned-off-by Lee Jones <[email protected]>arch/arm/mach-ux500/board-mop500.c +0
-0
arch/arm/mach-ux500/board-mop500.c static struct platform_device *snowball_platform_devs[] __initdata = { · line 616
Quoted 6 lines
arch/arm/mach-ux500/board-mop500.c +0
-1@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {static struct platform_device *snowball_of_platform_devs[]__initdata = { &snowball_led_dev, &snowball_key_dev, - &snowball_sbnet_dev, &ab8500_device, };
But this made it into arm-soc:
Quoted 18 lines
commit
f58546a17c5dc2255c40e4bc4287e06a93b5c9a0Author: Lee Jones <[email protected]> Date: Tue Apr 24 10:54:25 2012 +0100ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Now the SCMC911x is correctly enabled in Device Tree, there is no need to continue registering it from platform code. In fact, if we continue doing so, the system will throw an error on boot.
Signed-off-by Lee Jones <[email protected]>Signed-off-by Linus Walleij <[email protected]>arch/arm/mach-ux500/board-mop500.c +0
-0
arch/arm/mach-ux500/board-mop500.c static void __init mop500_uart_init(struct device *parent) · line 609
Quoted 6 lines
arch/arm/mach-ux500/board-mop500.c +0
-1@@ -605,7 +605,6 @@ static void __init mop500_uart_init(struct device *parent)static struct platform_device *snowball_platform_devs[]__initdata = { &snowball_led_dev, &snowball_key_dev, - &snowball_sbnet_dev, &ab8500_device, };
Somehow the incorrect *_platform_devs[] was amended.
Some kind of git automatic conflict resolution error?
Kind regards,
Lee
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Quoted 4 lines · Lee Jones
On 03/05/12 18:14, Linus Walleij wrote:
In the pull request was:
Quoted 1 line
(quoted diff) +0
-0@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
(...)
Quoted 2 lines
But this made it into arm-soc:
Review static void __init mop500_uart_init(struct device *parent)
Quoted 1 line
(quoted diff) +0
-0@@ -605,7 +605,6 @@ static void __init mop500_uart_init(struct device *parent)
Two exactly identical arrays just on different line numbers, yeah...
Quoted 2 lines
Somehow the incorrect *_platform_devs[] was amended. Some kind of git automatic conflict resolution error?
Probably a patch -p1 < foo.patch error, that's the kind of stuff it causes. My fault, certainly. The problem is that I don't see the problem with git diff, it looks correct there too.
I thought that my bad branch had been replaced with a different (correct) pull request from you though :-/
So how to we fix it? With an incremental patch on top?
Yours,
Linus Walleij
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Quoted 10 lines · Linus Walleij
Quoted 4 lines · Lee Jones
On 03/05/12 18:14, Linus Walleij wrote:
In the pull request was:
Quoted 1 line
(quoted diff) +0
-0@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {(...)
Quoted 2 lines
But this made it into arm-soc:
Review static void __init mop500_uart_init(struct device *parent)
Quoted 1 line
(quoted diff) +0
-0@@ -605,7 +605,6 @@ static void __init mop500_uart_init(struct device *parent)Two exactly identical arrays just on different line numbers, yeah...
Eh? Did you quote the wrong line?
Quoted 6 lines
Quoted 2 lines
Somehow the incorrect *_platform_devs[] was amended. Some kind of git automatic conflict resolution error?
Probably a patch -p1< foo.patch error, that's the kind of stuff it causes. My fault, certainly. The problem is that I don't see the problem with git diff, it looks correct there too.
No I don't think it has anything to do with what you did.
Quoted 2 lines
I thought that my bad branch had been replaced with a different (correct) pull request from you though :-/
I did, hence why it's not your fault. However, I've checked the pull-request I sent and it contains the _correct_ patch. This must have happened during the pull or with a subsequent git action (rebase?).
Quoted 1 line
So how to we fix it? With an incremental patch on top?
I can provide you with a patch really quickly if that's the way you want to go.
Kind regards,
Lee
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Quoted 7 lines · Lee Jones
Quoted 4 lines · Linus Walleij
Quoted 1 line · On Wed, May 16, 2012 at 9:12 AM, Lee Jones<[email protected]> ?wrote:
On 03/05/12 18:14, Linus Walleij wrote:
Two exactly identical arrays just on different line numbers, yeah...
Eh? Did you quote the wrong line?
Maybe, anyway that was the problem, was it not? I'm ever more confused with this, maybe git is confused too :-)
Quoted 4 lines
Quoted 1 line
So how to we fix it? With an incremental patch on top?
I can provide you with a patch really quickly if that's the way you want to go.
You can send it directly to ARM SoC maintainers I think, since that is where the problem sits right now. I'll just ACK it.
Yours,
Linus Walleij
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Quoted 5 lines · Linus Walleij
Quoted 4 lines · Lee Jones
Quoted 3 lines · Linus Walleij
Quoted 1 line · Lee Jones
On 03/05/12 18:14, Linus Walleij wrote:
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Two exactly identical arrays just on different line numbers, yeah...
Eh? Did you quote the wrong line?
Maybe, anyway that was the problem, was it not? I'm ever more confused with this, maybe git is confused too :-)
I think you meant:
Quoted 2 lines
static struct
platform_device*snowball_of_platform_devs[] static structplatform_device*snowball_platform_devs[]
In which case, no, they're not the same. :)
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
So how to we fix it? With an incremental patch on top?
I can provide you with a patch really quickly if that's the way you want to go.
You can send it directly to ARM SoC maintainers I think, since that is where the problem sits right now. I'll just ACK it.
Yes, I can do that.
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 1/1 ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
In reply to Linus WalleijQuoted 11 lines · Linus Walleij
Quoted 3 lines · Arnd Bergmann
This version of the patch looks good, the version that was applied does not. (...)
Linus and Lee, what's going on here?Probably just my screwups when applying Lee's patches out-of-order and splitting them.
I saw lee sent a new pull request with his baseline, throw the devcietree branch from me out and use his branch instead.
I've just seen another problem with this.
In the pull request was:
Quoted 19 lines
commit
dc315c470b6b69018e6b65beb1e5b0d8f737261dAuthor: Lee Jones <[email protected]> Date: Tue Apr 24 10:54:25 2012 +0100ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Now the SCMC911x is correctly enabled in Device Tree, there is no need to continue registering it from platform code. In fact, if we continue doing so, the system will throw an error on boot.
SAcked-by Linus Walleij <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>igned-off-by Lee Jones <[email protected]>arch/arm/mach-ux500/board-mop500.c +0
-0
arch/arm/mach-ux500/board-mop500.c static struct platform_device *snowball_platform_devs[] __initdata = { · line 616
Quoted 6 lines
arch/arm/mach-ux500/board-mop500.c +0
-1@@ -612,7 +612,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {static struct platform_device *snowball_of_platform_devs[]__initdata = { &snowball_led_dev, &snowball_key_dev, - &snowball_sbnet_dev, &ab8500_device, };
But this made it into arm-soc:
Quoted 18 lines
commit
f58546a17c5dc2255c40e4bc4287e06a93b5c9a0Author: Lee Jones <[email protected]> Date: Tue Apr 24 10:54:25 2012 +0100ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
Now the SCMC911x is correctly enabled in Device Tree, there is no need to continue registering it from platform code. In fact, if we continue doing so, the system will throw an error on boot.
Signed-off-by Lee Jones <[email protected]>Signed-off-by Linus Walleij <[email protected]>arch/arm/mach-ux500/board-mop500.c +0
-0
arch/arm/mach-ux500/board-mop500.c static void __init mop500_uart_init(struct device *parent) · line 609
Quoted 6 lines
arch/arm/mach-ux500/board-mop500.c +0
-1@@ -605,7 +605,6 @@ static void __init mop500_uart_init(struct device *parent)static struct platform_device *snowball_platform_devs[]__initdata = { &snowball_led_dev, &snowball_key_dev, - &snowball_sbnet_dev, &ab8500_device, };
Somehow the incorrect *_platform_devs[] was amended.
Some kind of git automatic conflict resolution error?
Kind regards,
Lee
Signature · 4 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 7/15 ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
In reply to Lee JonesFrom: Lee Jones <[email protected]>
Date: Tue, 24 Apr 2012 09:50:20 +0100
Subject: [PATCH 07/16] ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
Here we split the description of the external-bus at 50000000 over two description files. In the more generic db8500 description file we only specify the external-bus. Normally this would be used to communicate with a NOR-flash device. On the Snowball however, the SMSC9115 Ethernet chip occupies it. In the Snowball board specific description file is where we actually specify that it is in fact the Ethernet device which lives here.
--- arch/arm/boot/dts/snowball.dts | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
arch/arm/boot/dts/snowball.dts +8 -2
@@ -79,10 +79,16 @@ ranges; ethernet at 50000000 { - compatible = "smsc,9111"; + compatible = "smsc,lan9115"; reg = <0x50000000 0x10000>; - interrupts = <12 0x4>; + interrupts = <12 0x1>; interrupt-parent = <&gpio4>; + + reg-shift = <1>; + reg-io-width = <2>; + smsc,force-internal-phy; + smsc,irq-active-high; + smsc,irq-push-pull; }; };
Signature · 1 line
1.7.9.1
PATCH 7/15 ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree
Sorry, ignore this. It looks like I've had a git fart!
Quoted 40 lines · Lee Jones
From: Lee Jones<[email protected]>
Date: Tue, 24 Apr 2012 09:50:20 +0100
Subject: [PATCH 07/16] ARM: ux500: Enable the SMSC9115 on Snowball via Device TreeHere we split the description of the external-bus at 50000000 over two description files. In the more generic db8500 description file we only specify the external-bus. Normally this would be used to communicate with a NOR-flash device. On the Snowball however, the SMSC9115 Ethernet chip occupies it. In the Snowball board specific description file is where we actually specify that it is in fact the Ethernet device which lives here.
Signed-off-by Lee Jones<[email protected]>--- arch/arm/boot/dts/snowball.dts | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)arch/arm/boot/dts/snowball.dts +8
-2@@ -79,10 +79,16 @@ ranges; ethernet at 50000000 { - compatible = "smsc,9111"; + compatible = "smsc,lan9115"; reg =<0x50000000 0x10000>; - interrupts =<12 0x4>; + interrupts =<12 0x1>; interrupt-parent =<&gpio4>; + + reg-shift =<1>; + reg-io-width =<2>; + smsc,force-internal-phy; + smsc,irq-active-high; + smsc,irq-push-pull; }; };
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 8/15 drivers/mmc: MMCI: Use correct GPIO binding for IRQ requests
In reply to Lee JonesNow there are irqdomains in place for Snowball, we can request GPIO IRQs directly by their binding. This replaces the previous method of hard-coding the hwirq using u32 values in the DT.
--- drivers/mmc/host/mmci.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/host/mmci.c +3 -2
@@ -26,6 +26,7 @@#include <linux/clk.h> #include <linux/scatterlist.h> #include <linux/gpio.h> +#include <linux/of_gpio.h> #include <linux/regulator/consumer.h> #include <linux/dmaengine.h> #include <linux/dma-mapping.h>
@@ -1203,11 +1204,11 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np, {int bus_width =0 ; -of_property_read_u32 (np,"wp-gpios" , &pdata->gpio_wp); + pdata->gpio_wp =of_get_named_gpio (np,"wp-gpios" ,0 );if (!pdata->gpio_wp) pdata->gpio_wp =-1 ; -of_property_read_u32 (np,"cd-gpios" , &pdata->gpio_cd); + pdata->gpio_cd =of_get_named_gpio (np,"cd-gpios" ,0 );if (!pdata->gpio_cd) pdata->gpio_cd =-1 ;
Signature · 1 line
1.7.9.1
PATCH 8/15 drivers/mmc: MMCI: Use correct GPIO binding for IRQ requests
Quoted 5 lines · Lee Jones
Now there are irqdomains in place for Snowball, we can request GPIO IRQs directly by their binding. This replaces the previous method of hard-coding the hwirq using u32 values in the DT.
Signed-off-by Lee Jones <[email protected]>
Why not squash this with the previous MMCI device tree patch and update it?
Yours,
Linus Walleij
PATCH 8/15 drivers/mmc: MMCI: Use correct GPIO binding for IRQ requests
Quoted 6 lines · Linus Walleij
Quoted 4 lines · Lee Jones
Now there are irqdomains in place for Snowball, we can request GPIO IRQs directly by their binding. This replaces the previous method of hard-coding the hwirq using u32 values in the DT.
Quoted 6 lines
Quoted 1 line
Signed-off-by Lee Jones<[email protected]>Acked-by Linus Walleij<[email protected]>Why not squash this with the previous MMCI device tree patch and update it?
You mean the one I sent a couple of weeks ago?
I'd rather let that one sit in Russell's patch tracker and send this as an update, if it's all the same to you?
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 8/15 drivers/mmc: MMCI: Use correct GPIO binding for IRQ requests
Quoted 6 lines · Lee Jones
Quoted 2 lines · Linus Walleij
Why not squash this with the previous MMCI device tree patch and update it?
You mean the one I sent a couple of weeks ago?
Maybe, memory fails me...
Quoted 2 lines
I'd rather let that one sit in Russell's patch tracker and send this as an update, if it's all the same to you?
Sure.
Yours,
Linus Walleij
PATCH 9/15 ARM: ux500: Correctly describe SMSC9115 for Snowball in DT
In reply to Lee JonesHere we split the description of the external-bus at 50000000 over two description files. In the more generic db8500 description file we only specify the external-bus. Normally this would be used to communicate with a NOR-flash device. On the Snowball however, the SMSC9115 Ethernet chip occupies it. In the Snowball board specific description file is where we actually specify that it is in fact the Ethernet device which lives here.
--- arch/arm/boot/dts/db8500.dtsi | 9 +++++++++ arch/arm/boot/dts/snowball.dts | 10 +++------- 2 files changed, 12 insertions(+), 7 deletions(-)
arch/arm/boot/dts/db8500.dtsi +9 -0
@@ -307,5 +307,14 @@ interrupts = <0 100 0x4>; status = "disabled"; }; + + external-bus at 50000000 { + compatible = "simple-bus"; + reg = <0x50000000 0x4000000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x50000000 0x4000000>; + status = "disabled"; + }; }; };
arch/arm/boot/dts/snowball.dts +3 -7
@@ -72,15 +72,11 @@ soc-u9500 { external-bus at 50000000 { - compatible = "simple-bus"; - reg = <0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - ranges; + status = "okay"; - ethernet at 50000000 { + ethernet at 0 { compatible = "smsc,lan9115"; - reg = <0x50000000 0x10000>; + reg = <0 0x10000>; interrupts = <12 0x1>; interrupt-parent = <&gpio4>;
Signature · 1 line
1.7.9.1
PATCH 9/15 ARM: ux500: Correctly describe SMSC9115 for Snowball in DT
Quoted 9 lines · Lee Jones
Here we split the description of the external-bus at 50000000 over two description files. In the more generic db8500 description file we only specify the external-bus. Normally this would be used to communicate with a NOR-flash device. On the Snowball however, the SMSC9115 Ethernet chip occupies it. In the Snowball board specific description file is where we actually specify that it is in fact the Ethernet device which lives here.
Signed-off-by Lee Jones <[email protected]>
Can you please squash this into patch 7?
It seems like I get a bit more development history than I need here.
Yours,
Linus Walleij
PATCH 9/15 ARM: ux500: Correctly describe SMSC9115 for Snowball in DT
Quoted 10 lines · Linus Walleij
Quoted 8 lines · Lee Jones
Here we split the description of the external-bus at 50000000 over two description files. In the more generic db8500 description file we only specify the external-bus. Normally this would be used to communicate with a NOR-flash device. On the Snowball however, the SMSC9115 Ethernet chip occupies it. In the Snowball board specific description file is where we actually specify that it is in fact the Ethernet device which lives here.
Quoted 6 lines
Quoted 1 line
Signed-off-by Lee Jones<[email protected]>Can you please squash this into patch 7?
It seems like I get a bit more development history than I need here.
Sure.
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 10/15 drivers/gpio: represent gpio-nomadik as an IRQ controller in DT documentation
In reply to Lee JonesNow gpio-nomadik has proper bindings devices initialised by Device Tree entries are able to use the chained GPIO IRQ lines it provides. This patch aims to reflect that in the gpio-nmk documentation.
--- .../devicetree/bindings/gpio/gpio-nmk.txt | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/gpio/gpio-nmk.txt +2 -0
@@ -13,6 +13,7 @@ Required properties: 4 = active high level-sensitive. 8 = active low level-sensitive. - gpio-controller : Marks the device node as a GPIO controller. +- interrupt-controller : Marks the device node as an interrupt controller. - gpio-bank : Specifies which bank a controller owns. - st,supports-sleepmode : Specifies whether controller can sleep or not
@@ -24,6 +25,7 @@ Example: interrupts = <0 120 0x4>; #gpio-cells = <2>; gpio-controller; + interrupt-controller; supports-sleepmode; gpio-bank = <1>; };
Signature · 1 line
1.7.9.1
Linus Walleij
AppliedPATCH 10/15 drivers/gpio: represent gpio-nomadik as an IRQ controller in DT documentation
Quoted 8 lines · Lee Jones
Now gpio-nomadik has proper bindings devices initialised by Device Tree entries are able to use the chained GPIO IRQ lines it provides. This patch aims to reflect that in the gpio-nmk documentation.
Signed-off-by Lee Jones <[email protected]>---
?.../devicetree/bindings/gpio/gpio-nmk.txt ? ? ? ? ?| ? ?2 ++ ?1 files changed, 2 insertions(+), 0 deletions(-)
Thanks, applied to the ux500-devicetree branch.
I will likely have to update the subject of each and every patch on this branch to reflect the fact that it's just touching the device tree files per se.
Yours,
Linus Walleij
PATCH 10/15 drivers/gpio: represent gpio-nomadik as an IRQ controller in DT documentation
Quoted 11 lines · Linus Walleij
Quoted 8 lines · Lee Jones
Now gpio-nomadik has proper bindings devices initialised by Device Tree entries are able to use the chained GPIO IRQ lines it provides. This patch aims to reflect that in the gpio-nmk documentation.
Signed-off-by Lee Jones<[email protected]>--- .../devicetree/bindings/gpio/gpio-nmk.txt | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Quoted 5 lines
Thanks, applied to the ux500-devicetree branch.
I will likely have to update the subject of each and every patch on this branch to reflect the fact that it's just touching the device tree files per se.
I don't have a problem with that.
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 11/15 ARM: ux500: Do not attempt to register non-existent i2c devices on Snowball
In reply to Lee JonesThis patch prevents i2c devices which are not present on the Snowball low-cost development board from being registered. Devices such as; tc3589x, bu1780 and lp5521 are present on other supported boards, but are not located on Snowball.
--- arch/arm/mach-ux500/board-mop500.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-)
arch/arm/mach-ux500/board-mop500.c +13 -11
@@ -652,7 +652,6 @@ static void __init mop500_init_machine(void)static void __init snowball_init_machine (void ) {struct device *parent =NULL ; -int i2c0_devs;int i; parent =u8500_init_devices ();
@@ -670,11 +669,6 @@ static void __init snowball_init_machine(void)mop500_spi_init (parent);mop500_uart_init (parent); - i2c0_devs =ARRAY_SIZE (mop500_i2c0_devices); -i2c_register_board_info (0 , mop500_i2c0_devices, i2c0_devs); -i2c_register_board_info (2 , mop500_i2c2_devices, -ARRAY_SIZE (mop500_i2c2_devices)); -/* This board has full regulator constraints */ regulator_has_full_constraints (); }
@@ -787,7 +781,6 @@ static void __init u8500_init_machine(void)int i; parent =u8500_of_init_devices (); - i2c0_devs =ARRAY_SIZE (mop500_i2c0_devices);for (i =0 ; i <ARRAY_SIZE (mop500_platform_devs); i++) mop500_platform_devs[i]->dev.parent = parent;
@@ -805,6 +798,12 @@ static void __init u8500_init_machine(void) ARRAY_SIZE(mop500_platform_devs));mop500_sdi_init (parent); + + i2c0_devs =ARRAY_SIZE (mop500_i2c0_devices); +i2c_register_board_info (0 , mop500_i2c0_devices, i2c0_devs); +i2c_register_board_info (2 , mop500_i2c2_devices, +ARRAY_SIZE (mop500_i2c2_devices)); + }else if (of_machine_is_compatible ("calaosystems,snowball-a9500" )) {snowball_pins_init ();
@@ -831,13 +830,16 @@ static void __init u8500_init_machine(void) ARRAY_SIZE(mop500_platform_devs));hrefv60_sdi_init (parent); + + i2c0_devs =ARRAY_SIZE (mop500_i2c0_devices); + i2c0_devs -=NUM_PRE_V60_I2C0_DEVICES ; + +i2c_register_board_info (0 , mop500_i2c0_devices, i2c0_devs); +i2c_register_board_info (2 , mop500_i2c2_devices, +ARRAY_SIZE (mop500_i2c2_devices)); }mop500_i2c_init (parent); -i2c_register_board_info (0 , mop500_i2c0_devices, i2c0_devs); -i2c_register_board_info (2 , mop500_i2c2_devices, -ARRAY_SIZE (mop500_i2c2_devices)); -/* This board has full regulator constraints */ regulator_has_full_constraints (); }
Signature · 1 line
1.7.9.1
PATCH 11/15 ARM: ux500: Do not attempt to register non-existent i2c devices on Snowball
Quoted 6 lines · Lee Jones
This patch prevents i2c devices which are not present on the Snowball low-cost development board from being registered. Devices such as; tc3589x, bu1780 and lp5521 are present on other supported boards, but are not located on Snowball.
Signed-off-by Lee Jones <[email protected]>
Oh, this looks like an important fix. I've rebased it and applied it to my ux500-core branch with some small fixup.
Thanks,
Linus Walleij
PATCH 12/15 mfd/db8500-prcmu: Register as a platform driver instead of only probing
In reply to Lee JonesPass the probe function as part of the platform_driver struct and register using the more common platform_driver_register call. In subsequent patches we'll also add DT support into the struct.
--- drivers/mfd/db8500-prcmu.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/mfd/db8500-prcmu.c +3 -2
@@ -2957,7 +2957,7 @@ static struct mfd_cell db8500_prcmu_devs[] = {* prcmu_fw_init - arch init call for the Linux PRCMU fw init logic * */ -static int __init db8500_prcmu_probe (struct platform_device *pdev) +static int __devinit db8500_prcmu_probe (struct platform_device *pdev) {int err =0 ;
@@ -2998,11 +2998,12 @@ static struct platform_driver db8500_prcmu_driver = { .name = "db8500-prcmu", .owner = THIS_MODULE, }, + .probe = db8500_prcmu_probe, };static int __init db8500_prcmu_init (void ) { -return platform_driver_probe (&db8500_prcmu_driver, db8500_prcmu_probe); +return platform_driver_register (&db8500_prcmu_driver); }arch_initcall (db8500_prcmu_init);
Signature · 1 line
1.7.9.1
PATCH 12/15 mfd/db8500-prcmu: Register as a platform driver instead of only probing
Quoted 6 lines · Lee Jones
Pass the probe function as part of the
platform_driverstruct and register using the more commonplatform_driver_registercall. In subsequent patches we'll also add DT support into the struct.CC Samuel Ortiz <[email protected]>Signed-off-by Lee Jones <[email protected]>
Alternatively, if you get Sam's ACK I can carry this in the ux500 tree.
Yours,
Linus Walleij
PATCH 12/15 mfd/db8500-prcmu: Register as a platform driver instead of only probing
Quoted 6 lines · Linus Walleij
Quoted 4 lines · Lee Jones
Pass the probe function as part of the
platform_driverstruct and register using the more commonplatform_driver_registercall. In subsequent patches we'll also add DT support into the struct.
Quoted 6 lines
Quoted 2 lines
CC Samuel Ortiz<[email protected]>Signed-off-by Lee Jones<[email protected]>Acked-by Linus Walleij<[email protected]>Alternatively, if you get Sam's ACK I can carry this in the ux500 tree.
Sam, anything on this?
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Samuel Ortiz
AppliedPATCH 12/15 mfd/db8500-prcmu: Register as a platform driver instead of only probing
In reply to Linus WalleijHi Linus,
Quoted 10 lines · Linus Walleij
Quoted 6 lines · Lee Jones
Pass the probe function as part of the
platform_driverstruct and register using the more commonplatform_driver_registercall. In subsequent patches we'll also add DT support into the struct.CC Samuel Ortiz <[email protected]>Signed-off-by Lee Jones <[email protected]>Acked-by Linus Walleij <[email protected]>
Applied to my for-next branch, thanks.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/
PATCH 13/15 ARM: ux500: Fork cpu-db8500 platform_devs for sequential DT enablement
In reply to Lee JonesTo aid in sequential one-by-one Device Tree enablement, we split cpu-db8500's platform_devs structure into normal platform boot, where we leave all devices to be added in tact and a DT version where we will remove the devices as they are DT enabled.
--- arch/arm/mach-ux500/cpu-db8500.c | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-)
arch/arm/mach-ux500/cpu-db8500.c +15 -3
@@ -121,6 +121,12 @@ static struct platform_device *platform_devs[] __initdata = { &db8500_prcmu_device, }; +static struct platform_device *of_platform_devs[]__initdata = { + &u8500_dma40_device, + &db8500_pmu_device, + &db8500_prcmu_device, +}; +static resource_size_t __initdata db8500_gpio_base[] = {U8500_GPIOBANK0_BASE ,U8500_GPIOBANK1_BASE ,
@@ -221,10 +227,16 @@ struct device * __init u8500_of_init_devices(void)platform_device_register_data (parent,"cpufreq-u8500" ,-1 ,NULL ,0 ); -for (i =0 ; i <ARRAY_SIZE (platform_devs); i++) - platform_devs[i]->dev.parent = parent; +for (i =0 ; i <ARRAY_SIZE (of_platform_devs); i++) + of_platform_devs[i]->dev.parent = parent; -platform_add_devices (platform_devs,ARRAY_SIZE (platform_devs)); +/* +* Devices to be DT:ed: +* u8500_dma40_device = todo +* db8500_pmu_device = todo +* db8500_prcmu_device = todo +*/ +platform_add_devices (of_platform_devs,ARRAY_SIZE (of_platform_devs));return parent; }
Signature · 1 line
1.7.9.1
PATCH 14/15 mfd/db8500-prcmu: Add Device Tree support and enable ux500 platforms
In reply to Lee JonesHere we see the db8500-prcmu driver obtain DT support. In its current state, all we have to do is offer a matching compatible node and the driver will register and initialise correctly. We Also remove any initialisation completed in platform code to prevent any device duplication.
--- arch/arm/mach-ux500/cpu-db8500.c | 3 +-- drivers/mfd/db8500-prcmu.c | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/mach-ux500/cpu-db8500.c +1 -2
@@ -124,7 +124,6 @@ static struct platform_device *platform_devs[] __initdata = {static struct platform_device *of_platform_devs[]__initdata = { &u8500_dma40_device, &db8500_pmu_device, - &db8500_prcmu_device, };static resource_size_t __initdata db8500_gpio_base[] = {
@@ -234,7 +233,7 @@ struct device * __init u8500_of_init_devices(void)* Devices to be DT:ed: * u8500_dma40_device = todo * db8500_pmu_device = todo -* db8500_prcmu_device = todo +* db8500_prcmu_device = done */ platform_add_devices (of_platform_devs,ARRAY_SIZE (of_platform_devs));
drivers/mfd/db8500-prcmu.c +5 -0
@@ -2992,11 +2992,16 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev) no_irq_return:return err; } +static const struct of_device_id db8500_prcmu_match[] = { + { .compatible ="stericsson,db8500-prcmu" }, + { }, +};static struct platform_driver db8500_prcmu_driver = { .driver = { .name ="db8500-prcmu" , .owner =THIS_MODULE , + .of_match_table = db8500_prcmu_match, }, .probe = db8500_prcmu_probe, };
Signature · 1 line
1.7.9.1
PATCH 14/15 mfd/db8500-prcmu: Add Device Tree support and enable ux500 platforms
Quoted 8 lines · Lee Jones
Here we see the db8500-prcmu driver obtain DT support. In its current state, all we have to do is offer a matching compatible node and the driver will register and initialise correctly. We Also remove any initialisation completed in platform code to prevent any device duplication.
CC Samuel Ortiz <[email protected]>Signed-off-by Lee Jones <[email protected]>
OK I need Sam's ACK on this too, then it seems a good idea to take all three patches touching the PRCMU driver through the ux500-core tree.
Thanks,
Linus Walleij
PATCH 14/15 mfd/db8500-prcmu: Add Device Tree support and enable ux500 platforms
Quoted 8 lines · Linus Walleij
Quoted 6 lines · Lee Jones
Here we see the db8500-prcmu driver obtain DT support. In its current state, all we have to do is offer a matching compatible node and the driver will register and initialise correctly. We Also remove any initialisation completed in platform code to prevent any device duplication.
Quoted 6 lines
Quoted 2 lines
CC Samuel Ortiz<[email protected]>Signed-off-by Lee Jones<[email protected]>OK I need Sam's ACK on this too, then it seems a good idea to take all three patches touching the PRCMU driver through the ux500-core tree.
Sam, anything on this?
Signature · 5 lines
Lee Jones Linaro ST-Ericsson Landing Team Lead M: +44 77 88 633 515 Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
PATCH 14/15 mfd/db8500-prcmu: Add Device Tree support and enable ux500 platforms
In reply to Linus WalleijHi Linus,
Quoted 8 lines · Linus Walleij
Quoted 6 lines · Lee Jones
Here we see the db8500-prcmu driver obtain DT support. In its current state, all we have to do is offer a matching compatible node and the driver will register and initialise correctly. We Also remove any initialisation completed in platform code to prevent any device duplication.
Quoted 6 lines
Quoted 2 lines
CC Samuel Ortiz <[email protected]>Signed-off-by Lee Jones <[email protected]>OK I need Sam's ACK on this too, then it seems a good idea to take all three patches touching the PRCMU driver through the ux500-core tree.
I just took 2 of them:
mfd: Enable Device Tree support for the db8500-prcmu
mfd: Add support for db8500-prcmu regulator supply for nmk-i2c.4
Since you have not taken any db8500 patches yet on ux500-core, I can carry them unless you object to it.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/
PATCH 15/15 ARM: ux500: Enable PRCMU Timer 4 (clocksource) via Device Tree
In reply to Lee JonesIn dbx500 based devices the PRCMU Timer 4 is used as a clocksource and sched_clock. Here we fetch all necessary addressing information required for correct PRCMU initialisation from the Device Tree instead of using hard-coded values.
--- arch/arm/boot/dts/db8500.dtsi | 8 +++++++- arch/arm/mach-ux500/timer.c | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletions(-)
arch/arm/boot/dts/db8500.dtsi +7 -1
@@ -189,7 +189,13 @@ reg = <0x80157000 0x1000>; interrupts = <46 47>; #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; + ranges; + + prcmu-timer-4 at 80157450 { + compatible = "stericsson,db8500-prcmu-timer-4"; + reg = <0x80157450 0xC>; + }; ab8500 at 5 { compatible = "stericsson,ab8500";
arch/arm/mach-ux500/timer.c +24 -0
@@ -8,6 +8,7 @@#include <linux/errno.h> #include <linux/clksrc-dbx500-prcmu.h> #include <linux/of.h> +#include <linux/of_address.h> #include <asm/smp_twd.h>
@@ -43,10 +44,17 @@ static void __init ux500_twd_init(void)#define ux500_twd_init () do { } while(0)#endif +const static struct of_device_id prcmu_timer_of_match[]__initconst = { + { .compatible ="stericsson,db8500-prcmu-timer-4" , }, + { }, +}; +static void __init ux500_timer_init (void ) {void __iomem *mtu_timer_base;void __iomem *prcmu_timer_base; +void __iomem *tmp_base; +struct device_node *np;if (cpu_is_u5500 ()) { mtu_timer_base =__io_address (U5500_MTU0_BASE );
@@ -58,6 +66,22 @@ static void __init ux500_timer_init(void)ux500_unknown_soc (); } +/* TODO: Once MTU has been DT:ed place code above into else. */ +if (of_have_populated_dt ()) { + np =of_find_matching_node (NULL , prcmu_timer_of_match); +if (!np) + goto dt_fail; + + tmp_base =of_iomap (np,0 ); +if (!tmp_base) + goto dt_fail; + + prcmu_timer_base = tmp_base; + } + +dt_fail: +/* Doing it the old fashioned way. */ +/* * Here we register the timerblocks active in the system. * Localtimers (twd) is started when both cpu is up and running.
Signature · 1 line
1.7.9.1
PATCH 15/15 ARM: ux500: Enable PRCMU Timer 4 (clocksource) via Device Tree
Quoted 7 lines · Lee Jones
In dbx500 based devices the PRCMU Timer 4 is used as a clocksource and
sched_clock. Here we fetch all necessary addressing information required for correct PRCMU initialisation from the Device Tree instead of using hard-coded values.CC Samuel Ortiz <[email protected]>Signed-off-by Lee Jones <[email protected]>
This does not affect MFD so I can take it through ux500 and ARM SoC.
But please split it in two: one touching mach-ux500 and one messing with boot/dts/* please.
Thanks!
Linus Walleij
PATCH 1/1 ARM: ux500: Configure the PRCMU Timer for db8500 based devices in DT
From: Lee Jones <[email protected]>
Date: Tue, 24 Apr 2012 10:00:15 +0100
Subject: [PATCH 15.1/15] ARM: ux500: Configure the PRCMU Timer for db8500 based devices in DT
This patch adds the information required for successful registration of the PRCMU timer 4 (clocksource) driver to the db8500 Device Tree include file.
--- arch/arm/boot/dts/db8500.dtsi | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/boot/dts/db8500.dtsi +7 -1
@@ -189,7 +189,13 @@ reg = <0x80157000 0x1000>; interrupts = <46 47>; #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; + ranges; + + prcmu-timer-4 at 80157450 { + compatible = "stericsson,db8500-prcmu-timer-4"; + reg = <0x80157450 0xC>; + }; ab8500 at 5 { compatible = "stericsson,ab8500";
Signature · 1 line
1.7.9.1
PATCH 1/1 ARM: ux500: Enable PRCMU Timer 4 (clocksource) for Device Tree
In reply to Linus WalleijFrom: Lee Jones <[email protected]>
Date: Tue, 24 Apr 2012 10:04:46 +0100
Subject: [PATCH 16/16] ARM: ux500: Enable PRCMU Timer 4 (clocksource) for Device Tree
In dbx500 based devices the PRCMU Timer 4 is used as a clocksource and sched_clock. Here we fetch all necessary addressing information required for correct PRCMU initialisation from the Device Tree instead of using hard-coded values.
--- arch/arm/mach-ux500/timer.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
arch/arm/mach-ux500/timer.c +24 -0
@@ -8,6 +8,7 @@#include <linux/errno.h> #include <linux/clksrc-dbx500-prcmu.h> #include <linux/of.h> +#include <linux/of_address.h> #include <asm/smp_twd.h>
@@ -43,10 +44,17 @@ static void __init ux500_twd_init(void)#define ux500_twd_init () do { } while(0)#endif +const static struct of_device_id prcmu_timer_of_match[]__initconst = { + { .compatible ="stericsson,db8500-prcmu-timer-4" , }, + { }, +}; +static void __init ux500_timer_init (void ) {void __iomem *mtu_timer_base;void __iomem *prcmu_timer_base; +void __iomem *tmp_base; +struct device_node *np;if (cpu_is_u5500 ()) { mtu_timer_base =__io_address (U5500_MTU0_BASE );
@@ -58,6 +66,22 @@ static void __init ux500_timer_init(void)ux500_unknown_soc (); } +/* TODO: Once MTU has been DT:ed place code above into else. */ +if (of_have_populated_dt ()) { + np =of_find_matching_node (NULL , prcmu_timer_of_match); +if (!np) + goto dt_fail; + + tmp_base =of_iomap (np,0 ); +if (!tmp_base) + goto dt_fail; + + prcmu_timer_base = tmp_base; + } + +dt_fail: +/* Doing it the old fashioned way. */ +/* * Here we register the timerblocks active in the system. * Localtimers (twd) is started when both cpu is up and running.
Signature · 1 line
1.7.9.1