From fd9a80b238ffd5fb4c82e3752327968bd7b01ad1 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 13 Apr 2012 15:05:03 +0100 Subject: [PATCH 1/9] ARM: ux500: Rename the DT compatible entry for i2c devices on Snowball It is believed that the i2c compatible match entry is too long and cumbersome in its current form. This patch takes steps to decrease its length by using ST-Microelectronics' abbreviation ST. Acked-by: Arnd Bergmann Signed-off-by: Lee Jones Signed-off-by: Linus Walleij --- arch/arm/boot/dts/db8500.dtsi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 14bc30705099..45b6eb425f00 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -55,7 +55,7 @@ gpio0: gpio@8012e000 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8012e000 0x80>; interrupts = <0 119 0x4>; supports-sleepmode; @@ -64,7 +64,7 @@ gpio1: gpio@8012e080 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8012e080 0x80>; interrupts = <0 120 0x4>; supports-sleepmode; @@ -73,7 +73,7 @@ gpio2: gpio@8000e000 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8000e000 0x80>; interrupts = <0 121 0x4>; supports-sleepmode; @@ -82,7 +82,7 @@ gpio3: gpio@8000e080 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8000e080 0x80>; interrupts = <0 122 0x4>; supports-sleepmode; @@ -91,7 +91,7 @@ gpio4: gpio@8000e100 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8000e100 0x80>; interrupts = <0 123 0x4>; supports-sleepmode; @@ -100,7 +100,7 @@ gpio5: gpio@8000e180 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8000e180 0x80>; interrupts = <0 124 0x4>; supports-sleepmode; @@ -109,7 +109,7 @@ gpio6: gpio@8011e000 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8011e000 0x80>; interrupts = <0 125 0x4>; supports-sleepmode; @@ -118,7 +118,7 @@ gpio7: gpio@8011e080 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0x8011e080 0x80>; interrupts = <0 126 0x4>; supports-sleepmode; @@ -127,7 +127,7 @@ gpio8: gpio@a03fe000 { compatible = "stericsson,db8500-gpio", - "stmicroelectronics,nomadik-gpio"; + "st,nomadik-gpio"; reg = <0xa03fe000 0x80>; interrupts = <0 127 0x4>; supports-sleepmode; From 785834a18140ef832a2455bee3fad9b76011f562 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 13 Apr 2012 15:05:04 +0100 Subject: [PATCH 2/9] ARM: ux500: Shorten Snowball's DT compatible gpio entry It is believed that the gpio compatible match entry is too long and cumbersome in its current form. This patch takes steps to decrease its length by using ST-Microelectronics' abbreviation ST. Acked-by: Arnd Bergmann Signed-off-by: Lee Jones Signed-off-by: Linus Walleij --- arch/arm/boot/dts/db8500.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 45b6eb425f00..add7cab30f0c 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -163,7 +163,7 @@ }; i2c@80004000 { - compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c"; + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; reg = <0x80004000 0x1000>; interrupts = <0 21 0x4>; #address-cells = <1>; @@ -171,7 +171,7 @@ }; i2c@80122000 { - compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c"; + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; reg = <0x80122000 0x1000>; interrupts = <0 22 0x4>; #address-cells = <1>; @@ -179,7 +179,7 @@ }; i2c@80128000 { - compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c"; + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; reg = <0x80128000 0x1000>; interrupts = <0 55 0x4>; #address-cells = <1>; @@ -187,7 +187,7 @@ }; i2c@80110000 { - compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c"; + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; reg = <0x80110000 0x1000>; interrupts = <0 12 0x4>; #address-cells = <1>; @@ -195,7 +195,7 @@ }; i2c@8012a000 { - compatible = "stericsson,db8500-i2c", "stmicroelectronics,nomadik-i2c"; + compatible = "stericsson,db8500-i2c", "st,nomadik-i2c"; reg = <0x8012a000 0x1000>; interrupts = <0 51 0x4>; #address-cells = <1>; From 2cfaa62de5f1fa5ded043ffeb00548082ed30712 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 19 Apr 2012 21:36:30 +0100 Subject: [PATCH 3/9] 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. Signed-off-by: Lee Jones Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/board-mop500.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 77d03c1fbd04..539da3f3c1c7 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -753,9 +753,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"}, { }, }; @@ -774,7 +775,7 @@ static void __init u8500_init_machine(void) snowball_platform_devs[i]->dev.parent = parent; /* automatically probe child nodes of db8500 device */ - of_platform_populate(NULL, u8500_soc_node, u8500_auxdata_lookup, parent); + of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent); if (of_machine_is_compatible("st-ericsson,mop500")) { mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; From c0b133bda1eb89f7ce737fc7c646fa68ec7b9f1a Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 13 Apr 2012 15:05:05 +0100 Subject: [PATCH 4/9] drivers/gpio: gpio-nomadik: Device Tree bindings This creates Device Tree bindings for the Nomadik GPIO driver. Acked-by: Arnd Bergmann Signed-off-by: Lee Jones [Split off from the patch actually implementing the bindings] Signed-off-by: Linus Walleij --- arch/arm/boot/dts/db8500.dtsi | 18 ++++++++++++++++++ arch/arm/boot/dts/snowball.dts | 10 +++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index add7cab30f0c..e8403006d52d 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -60,6 +60,8 @@ interrupts = <0 119 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <0>; }; gpio1: gpio@8012e080 { @@ -69,6 +71,8 @@ interrupts = <0 120 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <1>; }; gpio2: gpio@8000e000 { @@ -78,6 +82,8 @@ interrupts = <0 121 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <2>; }; gpio3: gpio@8000e080 { @@ -87,6 +93,8 @@ interrupts = <0 122 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <3>; }; gpio4: gpio@8000e100 { @@ -96,6 +104,8 @@ interrupts = <0 123 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <4>; }; gpio5: gpio@8000e180 { @@ -105,6 +115,8 @@ interrupts = <0 124 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <5>; }; gpio6: gpio@8011e000 { @@ -114,6 +126,8 @@ interrupts = <0 125 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <6>; }; gpio7: gpio@8011e080 { @@ -123,6 +137,8 @@ interrupts = <0 126 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <7>; }; gpio8: gpio@a03fe000 { @@ -132,6 +148,8 @@ interrupts = <0 127 0x4>; supports-sleepmode; gpio-controller; + #gpio-cells = <2>; + gpio-bank = <8>; }; usb@a03e0000 { diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index 359c6d679156..738959de2a1d 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -30,35 +30,35 @@ wakeup = <1>; linux,code = <2>; label = "userpb"; - gpios = <&gpio1 0>; + gpios = <&gpio1 0 0>; }; button@2 { debounce_interval = <50>; wakeup = <1>; linux,code = <3>; label = "userpb"; - gpios = <&gpio4 23>; + gpios = <&gpio4 23 0>; }; button@3 { debounce_interval = <50>; wakeup = <1>; linux,code = <4>; label = "userpb"; - gpios = <&gpio4 23>; + gpios = <&gpio4 24 0>; }; button@4 { debounce_interval = <50>; wakeup = <1>; linux,code = <5>; label = "userpb"; - gpios = <&gpio5 1>; + gpios = <&gpio5 1 0>; }; button@5 { debounce_interval = <50>; wakeup = <1>; linux,code = <6>; label = "userpb"; - gpios = <&gpio5 2>; + gpios = <&gpio5 2 0>; }; }; From b55ac4ea96adc907bec7b0a804c1edd3dbf2e64d Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 4 Apr 2012 17:06:41 +0100 Subject: [PATCH 5/9] drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings Add required documentation for specific gpio-nomadik DT bindings. Acked-by: Arnd Bergmann Signed-off-by: Lee Jones Signed-off-by: Linus Walleij --- .../devicetree/bindings/gpio/gpio-nmk.txt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-nmk.txt diff --git a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file mode 100644 index 000000000000..3856789b52ea --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt @@ -0,0 +1,29 @@ +Nomadik GPIO controller + +Required properties: +- compatible : Should be "st,nomadik-gpio". +- reg : Physical base address and length of the controller's registers. +- interrupts : The interrupt outputs from the controller. +- #gpio-cells : Should be two: + The first cell is the pin number. + The second cell is used to specify optional parameters: + - bits[3:0] trigger type and level flags: + 1 = low-to-high edge triggered. + 2 = high-to-low edge triggered. + 4 = active high level-sensitive. + 8 = active low level-sensitive. +- gpio-controller : Marks the device node as a GPIO controller. +- gpio-bank : Specifies which bank a controller owns. +- st,supports-sleepmode : Specifies whether controller can sleep or not + +Example: + + gpio1: gpio@8012e080 { + compatible = "st,nomadik-gpio"; + reg = <0x8012e080 0x80>; + interrupts = <0 120 0x4>; + #gpio-cells = <2>; + gpio-controller; + supports-sleepmode; + gpio-bank = <1>; + }; From 3f3ed40060ddef0c9fb6aef021a7937f8528f32c Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 13 Apr 2012 15:05:07 +0100 Subject: [PATCH 6/9] ARM: ux500: Rename gpio_keys in the Device Tree file Ensure each button is individually identifiable by using their correct unique given device names. Acked-by: Arnd Bergmann Signed-off-by: Lee Jones Signed-off-by: Linus Walleij --- arch/arm/boot/dts/snowball.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index 738959de2a1d..0cec47ba0de7 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -36,28 +36,28 @@ debounce_interval = <50>; wakeup = <1>; linux,code = <3>; - label = "userpb"; + label = "extkb1"; gpios = <&gpio4 23 0>; }; button@3 { debounce_interval = <50>; wakeup = <1>; linux,code = <4>; - label = "userpb"; + label = "extkb2"; gpios = <&gpio4 24 0>; }; button@4 { debounce_interval = <50>; wakeup = <1>; linux,code = <5>; - label = "userpb"; + label = "extkb3"; gpios = <&gpio5 1 0>; }; button@5 { debounce_interval = <50>; wakeup = <1>; linux,code = <6>; - label = "userpb"; + label = "extkb4"; gpios = <&gpio5 2 0>; }; }; From 7919fb18cfcc9bc8c4751af4b26dada052483e98 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 19 Apr 2012 21:36:39 +0100 Subject: [PATCH 7/9] drivers/gpio: represent gpio-nomadik as an IRQ controller in DT documentation 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 Signed-off-by: Linus Walleij --- Documentation/devicetree/bindings/gpio/gpio-nmk.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt index 3856789b52ea..ee87467ad8d6 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt @@ -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>; }; From bf76e062c1b451223c462bb3452a1a8c7d5c0de5 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 24 Apr 2012 10:53:18 +0100 Subject: [PATCH 8/9] ARM: ux500: Enable the SMSC9115 on Snowball via Device Tree Here we split the description of the external-bus@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 Signed-off-by: Linus Walleij --- arch/arm/boot/dts/db8500.dtsi | 9 +++++++++ arch/arm/boot/dts/snowball.dts | 22 ++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index e8403006d52d..a2eb095e4a3c 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -288,5 +288,14 @@ interrupts = <0 100 0x4>; status = "disabled"; }; + + external-bus@50000000 { + compatible = "simple-bus"; + reg = <0x50000000 0x4000000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x50000000 0x4000000>; + status = "disabled"; + }; }; }; diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index 0cec47ba0de7..d99dc04f0d91 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -73,17 +73,19 @@ soc-u9500 { external-bus@50000000 { - compatible = "simple-bus"; - reg = <0x50000000 0x10000000>; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - ethernet@50000000 { - compatible = "smsc,9111"; - reg = <0x50000000 0x10000>; - interrupts = <12>; + status = "okay"; + + ethernet@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; }; }; From 3de3d74956e26af0a5647e98f73eaf8efd0d07bd Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 24 Apr 2012 10:00:15 +0100 Subject: [PATCH 9/9] 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. Signed-off-by: Lee Jones Signed-off-by: Linus Walleij --- arch/arm/boot/dts/db8500.dtsi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index a2eb095e4a3c..881bc3987844 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -171,7 +171,13 @@ reg = <0x80157000 0x1000>; interrupts = <46 47>; #address-cells = <1>; - #size-cells = <0>; + #size-cells = <1>; + ranges; + + prcmu-timer-4@80157450 { + compatible = "stericsson,db8500-prcmu-timer-4"; + reg = <0x80157450 0xC>; + }; ab8500@5 { compatible = "stericsson,ab8500";