From 5e1ac7db04f963e230ffa0a39c5df376733f8c0b Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 29 May 2012 14:40:04 +0800 Subject: [PATCH 01/20] ARM: ux500: Enable Device Tree support mmci for Snowball Allow proper initialisation for MMC via the mmci driver for the Snowball low-cost development board using DT. At the moment we continue to use DMA setup from platform code. Once the DMA generic DT bindings have been completed we can then port the remainder over to DT. Acked-by: Linus Walleij Acked-by: Arnd Bergmann Signed-off-by: Lee Jones --- arch/arm/boot/dts/snowball.dts | 19 +++++++++++++++++-- arch/arm/mach-ux500/board-mop500-sdi.c | 4 ++-- arch/arm/mach-ux500/board-mop500.c | 3 ++- arch/arm/mach-ux500/board-mop500.h | 3 +++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index ec3c33975110..68f66f3096a0 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -101,15 +101,30 @@ }; }; + // External Micro SD slot sdi@80126000 { - status = "enabled"; + arm,primecell-periphid = <0x10480180>; + max-frequency = <50000000>; + bus-width = <8>; + mmc-cap-mmc-highspeed; vmmc-supply = <&ab8500_ldo_aux3_reg>; + + #gpio-cells = <1>; cd-gpios = <&gpio6 26 0x4>; // 218 + cd-inverted; + + status = "okay"; }; + // On-board eMMC sdi@80114000 { - status = "enabled"; + arm,primecell-periphid = <0x10480180>; + max-frequency = <50000000>; + bus-width = <8>; + mmc-cap-mmc-highspeed; vmmc-supply = <&ab8500_ldo_aux2_reg>; + + status = "okay"; }; uart@80120000 { diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 920251cf834c..18ff781cfbe4 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c @@ -80,7 +80,7 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = { }; #endif -static struct mmci_platform_data mop500_sdi0_data = { +struct mmci_platform_data mop500_sdi0_data = { .ios_handler = mop500_sdi0_ios_handler, .ocr_mask = MMC_VDD_29_30, .f_max = 50000000, @@ -227,7 +227,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = { }; #endif -static struct mmci_platform_data mop500_sdi4_data = { +struct mmci_platform_data mop500_sdi4_data = { .ocr_mask = MMC_VDD_29_30, .f_max = 50000000, .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 4fd93f5c49ec..1bf179e91eab 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -776,6 +776,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat), /* Requires DMA bindings. */ OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), + OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), + OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data), /* Requires clock name bindings. */ OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL), OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL), @@ -851,7 +853,6 @@ static void __init u8500_init_machine(void) platform_add_devices(snowball_of_platform_devs, ARRAY_SIZE(snowball_of_platform_devs)); - snowball_sdi_init(parent); } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { /* * The HREFv60 board removed a GPIO expander and routed diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index 2f87b25a908a..b5bfc1a78b1a 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h @@ -9,6 +9,7 @@ /* For NOMADIK_NR_GPIO */ #include +#include /* Snowball specific GPIO assignments, this board has no GPIO expander */ #define SNOWBALL_ACCEL_INT1_GPIO 163 @@ -78,6 +79,8 @@ struct device; struct i2c_board_info; +extern struct mmci_platform_data mop500_sdi0_data; +extern struct mmci_platform_data mop500_sdi4_data; extern void mop500_sdi_init(struct device *parent); extern void snowball_sdi_init(struct device *parent); From 98582d9562b4bea6b0eb6e2bfafcd3fab3b60ccb Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 17 Apr 2012 15:52:26 +0100 Subject: [PATCH 02/20] ARM: ux500: Remove unused i2c platform_data initialisation code Now that u5500 is obsolete, u8500 is the only user of the Nomadik i2c driver. As such there is no requirement to differentiate between initialisation values. By the time a new SoC is released, almost all of the ux500 platform will be DT:ed, so we can make decisions based on the compatible property instead. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 39 +++--------------------------- drivers/i2c/busses/i2c-nomadik.c | 3 +-- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 1bf179e91eab..f4bbe5d2fa5b 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -331,43 +331,12 @@ static struct i2c_board_info __initdata mop500_i2c2_devices[] = { }, }; -#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, t_out, _sm) \ -static struct nmk_i2c_controller u8500_i2c##id##_data = { \ - /* \ - * slave data setup time, which is \ - * 250 ns,100ns,10ns which is 14,6,2 \ - * respectively for a 48 Mhz \ - * i2c clock \ - */ \ - .slsu = _slsu, \ - /* Tx FIFO threshold */ \ - .tft = _tft, \ - /* Rx FIFO threshold */ \ - .rft = _rft, \ - /* std. mode operation */ \ - .clk_freq = clk, \ - /* Slave response timeout(ms) */\ - .timeout = t_out, \ - .sm = _sm, \ -} - -/* - * The board uses 4 i2c controllers, initialize all of - * them with slave data setup time of 250 ns, - * Tx & Rx FIFO threshold values as 8 and standard - * mode of operation - */ -U8500_I2C_CONTROLLER(0, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); -U8500_I2C_CONTROLLER(1, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); -U8500_I2C_CONTROLLER(2, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); -U8500_I2C_CONTROLLER(3, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); - static void __init mop500_i2c_init(struct device *parent) { - db8500_add_i2c0(parent, &u8500_i2c0_data); - db8500_add_i2c1(parent, &u8500_i2c1_data); - db8500_add_i2c2(parent, &u8500_i2c2_data); - db8500_add_i2c3(parent, &u8500_i2c3_data); + db8500_add_i2c0(parent, NULL); + db8500_add_i2c1(parent, NULL); + db8500_add_i2c2(parent, NULL); + db8500_add_i2c3(parent, NULL); } static struct gpio_keys_button mop500_gpio_keys[] = { diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 5267ab93d550..a92440dbef07 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -965,8 +965,7 @@ static int __devinit nmk_i2c_probe(struct platform_device *pdev) adap->owner = THIS_MODULE; adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; adap->algo = &nmk_i2c_algo; - adap->timeout = pdata->timeout ? msecs_to_jiffies(pdata->timeout) : - msecs_to_jiffies(20000); + adap->timeout = msecs_to_jiffies(pdata->timeout); snprintf(adap->name, sizeof(adap->name), "Nomadik I2C%d at %lx", pdev->id, (unsigned long)res->start); From 079c61e120bf88ee04b65a2150b060e9f986cfb9 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 17 Apr 2012 16:11:02 +0100 Subject: [PATCH 03/20] ARM: ux500: Provide auxdata to be used as name base clock search for nmk-i2c This patch provides a way for find_clk() to complete its name-based searches and still find the nmk-i2c clocks. As Device Tree has a different naming structure to that of more traditional initialisation methods, find_clk() not succeed without these bindings. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index f4bbe5d2fa5b..2130faec0c47 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -757,6 +757,11 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL), OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL), OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL), + OF_DEV_AUXDATA("st,nomadik-i2c", 0x80004000, "nmk-i2c.0", NULL), + OF_DEV_AUXDATA("st,nomadik-i2c", 0x80122000, "nmk-i2c.1", NULL), + OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL), + OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL), + OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL), /* Requires device name bindings. */ OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL), {}, @@ -843,7 +848,6 @@ static void __init u8500_init_machine(void) mop500_uib_init(); } - mop500_i2c_init(parent); /* This board has full regulator constraints */ regulator_has_full_constraints(); From 8733f53c67544ccf358437cc8bb5a175c351ceba Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 17 May 2012 10:40:39 +0100 Subject: [PATCH 04/20] ARM: ux500: Kconfig: Compile in leds-gpio support for Snowball Code exists in the mop500 board file (used for HREF and Snowball) to initialise Snowball's user LED via the leds-gpio driver. However, the driver isn't currently built when using the current configuration. This patch aims to change that behavior. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/mach-ux500/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 53d3d46dec12..c013bbf79cac 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig @@ -41,6 +41,7 @@ config MACH_HREFV60 config MACH_SNOWBALL bool "U8500 Snowball platform" select MACH_MOP500 + select LEDS_GPIO help Include support for the snowball development platform. From 7fd975fabe65ee8cc1d53811c9aa607e95def406 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 15 Jun 2012 09:30:30 +0100 Subject: [PATCH 05/20] ARM: ux500: Enable the user LED on Snowball via Device Tree This patch enables and illuminates the user_led on the Snowball low-cost development board using DT. It also removes initialisation carried out from platform code. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/snowball.dts | 1 + arch/arm/mach-ux500/board-mop500.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index 68f66f3096a0..aefcb7f3825e 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -77,6 +77,7 @@ used-led { label = "user_led"; gpios = <&gpio4 14 0x4>; + default-state = "on"; }; }; diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 2130faec0c47..e4e63c76c28d 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -819,7 +819,7 @@ static void __init u8500_init_machine(void) } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { /* * Devices to be DT:ed: - * snowball_led_dev = todo + * snowball_led_dev = done * snowball_key_dev = todo * snowball_sbnet_dev = done * ab8500_device = done From 4eda912908935946ba64e71cb3f5909843a1a566 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 28 May 2012 16:59:26 +0800 Subject: [PATCH 06/20] ARM: ux500: Add a ab8500-gpadc node to the db8500 Device Tree This patch provides support for the ab8500-gpadc driver. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 4ad5160018cb..84032d17ea23 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -313,6 +313,14 @@ reg = <5>; /* mailbox 5 is i2c */ interrupts = <0 40 0x4>; + ab8500-gpadc { + compatible = "stericsson,ab8500-gpadc"; + interrupts = <0 32 0x4 + 0 39 0x4>; + interrupt-names = "HW_CONV_END", "SW_CONV_END"; + vddadc-supply = <&ab8500_ldo_tvout_reg>; + }; + ab8500-regulators { compatible = "stericsson,ab8500-regulator"; From 12cb7bd48f4fc89bbe31ee2cbac135131a6fb499 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 2 May 2012 08:45:40 +0100 Subject: [PATCH 07/20] ARM: ux500: Add support for input/ponkey into the db8500's Device Tree Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 84032d17ea23..8c494d3a9421 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -321,6 +321,13 @@ vddadc-supply = <&ab8500_ldo_tvout_reg>; }; + ab8500-ponkey { + compatible = "stericsson,ab8500-ponkey"; + interrupts = <0 6 0x4 + 0 7 0x4>; + interrupt-names = "ONKEY_DBF", "ONKEY_DBR"; + }; + ab8500-regulators { compatible = "stericsson,ab8500-regulator"; From c525f07110c08b4a0c8ed4182d86101d4d023cc0 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 2 May 2012 09:20:37 +0100 Subject: [PATCH 08/20] ARM: ux500: Enable LED heartbeat functionality on Snowball This patch configures the user LED on Snowball to double flash every second or so, whilst it's still alive. This can give key indications as to what the board is doing in the case of no console output. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index e4e63c76c28d..9ba952865300 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -58,7 +58,7 @@ static struct gpio_led snowball_led_array[] = { { .name = "user_led", - .default_trigger = "none", + .default_trigger = "heartbeat", .gpio = 142, }, }; From fd53d04280672c17540d958b472c0b5b444a06c3 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 2 May 2012 09:48:38 +0100 Subject: [PATCH 09/20] ARM: ux500: Enable LED heartbeat functionality on Snowbal via DT This patch configures the user LED on Snowball to double flash every second or so, whilst it's still alive. This can give key indications as to what the board is doing in the case of no console output. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/snowball.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index aefcb7f3825e..7e334d4cae21 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -78,6 +78,7 @@ label = "user_led"; gpios = <&gpio4 14 0x4>; default-state = "on"; + linux,default-trigger = "heartbeat"; }; }; From 401cd1b851ace22a8a3a94916abec462f4d0fe28 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 3 May 2012 12:53:55 +0100 Subject: [PATCH 10/20] ARM: ux500: Add db8500 Device Tree node for ab8500-sysctrl This adds the DT node for the mfd/ab8500-sysctrl driver. It will allow probing of the driver during a Device Tree enabled boot. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 8c494d3a9421..7a9ad1519dae 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -328,6 +328,10 @@ interrupt-names = "ONKEY_DBF", "ONKEY_DBR"; }; + ab8500-sysctrl { + compatible = "stericsson,ab8500-sysctrl"; + }; + ab8500-regulators { compatible = "stericsson,ab8500-regulator"; From 78451de7475be601cff4f283f95122a1ca61de16 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 3 May 2012 13:03:59 +0100 Subject: [PATCH 11/20] ARM: ux500: Add db8500 Device Tree node for misc/ab8500-pwm This adds the DT node for the misc/ab8500-pwm driver. It will allow probing of the driver during a Device Tree enabled boot. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 7a9ad1519dae..185f8d470d64 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -332,6 +332,10 @@ compatible = "stericsson,ab8500-sysctrl"; }; + ab8500-pwm { + compatible = "stericsson,ab8500-pwm"; + }; + ab8500-regulators { compatible = "stericsson,ab8500-regulator"; From ee189cefa8aaa3db3d65fc330aaf324820c0a623 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 3 May 2012 14:40:24 +0100 Subject: [PATCH 12/20] ARM: ux500: Add a ab8500-usb Device Tree node for db8500 based devices Here we specify each of the ab8500 USB driver's seven IRQs, which the driver references by name. We also apply regulator support for the three used by the device. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 185f8d470d64..40d8244b6fa8 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -321,6 +321,27 @@ vddadc-supply = <&ab8500_ldo_tvout_reg>; }; + ab8500-usb { + compatible = "stericsson,ab8500-usb"; + interrupts = < 0 90 0x4 + 0 96 0x4 + 0 14 0x4 + 0 15 0x4 + 0 79 0x4 + 0 74 0x4 + 0 75 0x4>; + interrupt-names = "ID_WAKEUP_R", + "ID_WAKEUP_F", + "VBUS_DET_F", + "VBUS_DET_R", + "USB_LINK_STATUS", + "USB_ADP_PROBE_PLUG", + "USB_ADP_PROBE_UNPLUG"; + vddulpivio18-supply = <&ab8500_ldo_initcore_reg>; + v-ape-supply = <&db8500_vape_reg>; + musb_1v8-supply = <&db8500_vsmps2_reg>; + }; + ab8500-ponkey { compatible = "stericsson,ab8500-ponkey"; interrupts = <0 6 0x4 From 215891eca1c17aceb4cd8d598659fa86f0f33f8d Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 1 May 2012 16:11:19 +0100 Subject: [PATCH 13/20] ARM: ux500: Apply ab8500-debug node do the db8500 DT structure This node has no properties. It merely allows probing of the ab8500-debugfs driver during Device Tree initialisation. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 40d8244b6fa8..9669e7279683 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -357,6 +357,10 @@ compatible = "stericsson,ab8500-pwm"; }; + ab8500-debugfs { + compatible = "stericsson,ab8500-debug"; + }; + ab8500-regulators { compatible = "stericsson,ab8500-regulator"; From 732973c87fa48011d7f86230691686d53bf22548 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 29 May 2012 10:49:33 +0800 Subject: [PATCH 14/20] ARM: ux500: Correctly reference IRQs supplied by the AB8500 from Device Tree The AB8500 driver has now been provided with IRQ domain support. This means we can request IRQs from any of it's uses via Device Tree. This patch advertises the AB8500 as an Interrupt Controller and provides the correct calls in the format the driver expects. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 9669e7279683..d698bd8de609 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -312,24 +312,26 @@ compatible = "stericsson,ab8500"; reg = <5>; /* mailbox 5 is i2c */ interrupts = <0 40 0x4>; + interrupt-controller; + #interrupt-cells = <2>; ab8500-gpadc { compatible = "stericsson,ab8500-gpadc"; - interrupts = <0 32 0x4 - 0 39 0x4>; + interrupts = <32 0x4 + 39 0x4>; interrupt-names = "HW_CONV_END", "SW_CONV_END"; vddadc-supply = <&ab8500_ldo_tvout_reg>; }; ab8500-usb { compatible = "stericsson,ab8500-usb"; - interrupts = < 0 90 0x4 - 0 96 0x4 - 0 14 0x4 - 0 15 0x4 - 0 79 0x4 - 0 74 0x4 - 0 75 0x4>; + interrupts = < 90 0x4 + 96 0x4 + 14 0x4 + 15 0x4 + 79 0x4 + 74 0x4 + 75 0x4>; interrupt-names = "ID_WAKEUP_R", "ID_WAKEUP_F", "VBUS_DET_F", @@ -344,8 +346,8 @@ ab8500-ponkey { compatible = "stericsson,ab8500-ponkey"; - interrupts = <0 6 0x4 - 0 7 0x4>; + interrupts = <6 0x4 + 7 0x4>; interrupt-names = "ONKEY_DBF", "ONKEY_DBR"; }; From d4b29ac1893e342f27fe79bd37641918e3364699 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Sat, 26 May 2012 07:03:48 +0100 Subject: [PATCH 15/20] ARM: ux500: Enable the AB8500 RTC for all DT:ed DB8500 based devices Here we add a node for the AB8500 Real Time Clock in all devices supporting the DB8500. The AB8500 RTC driver makes use of named interrupts we provide support for this too. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index d698bd8de609..1b7f79526a93 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -315,6 +315,13 @@ interrupt-controller; #interrupt-cells = <2>; + ab8500-rtc { + compatible = "stericsson,ab8500-rtc"; + interrupts = <17 0x4 + 18 0x4>; + interrupt-names = "60S", "ALARM"; + }; + ab8500-gpadc { compatible = "stericsson,ab8500-gpadc"; interrupts = <32 0x4 From ddb3b99c532930c9f891e97af5ef4e6691076c16 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Sat, 26 May 2012 07:01:31 +0100 Subject: [PATCH 16/20] ARM: ux500: Move rtc-pl031 registration to Device Tree when enabled During a Device Tree boot, all probing will now be completed on parse of the Device Tree binary. In the same patch we remove platform registration of the Real Time Clock. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/boot/dts/db8500.dtsi | 2 +- arch/arm/mach-ux500/cpu-db8500.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 1b7f79526a93..f1dc98d4471d 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -48,7 +48,7 @@ }; rtc@80154000 { - compatible = "stericsson,db8500-rtc"; + compatible = "arm,rtc-pl031", "arm,primecell"; reg = <0x80154000 0x1000>; interrupts = <0 18 0x4>; }; diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 33275eb4c689..a12bd9eff08b 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -237,7 +237,6 @@ struct device * __init u8500_of_init_devices(void) 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, From 612e1d5f1c192996889038598fb82ea03fb01573 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 14 Jun 2012 11:27:56 +0100 Subject: [PATCH 17/20] pinctrl: pinctrl-nomadik: Append sleepmode property with vendor specific prefixes Any non-standard property should contain the vendor's identifier which should be perpended onto the property name followed by a comma. This aids in name-space collision prevention. This patch ensures the sleepmode property adheres to the rules. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- Documentation/devicetree/bindings/gpio/gpio-nmk.txt | 2 +- drivers/pinctrl/pinctrl-nomadik.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt index ee87467ad8d6..8315ac7780ef 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-nmk.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-nmk.txt @@ -26,6 +26,6 @@ Example: #gpio-cells = <2>; gpio-controller; interrupt-controller; - supports-sleepmode; + st,supports-sleepmode; gpio-bank = <1>; }; diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 3e7e47d6b385..dd9e6f26416d 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -1198,7 +1198,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev) if (!pdata) return -ENOMEM; - if (of_get_property(np, "supports-sleepmode", NULL)) + if (of_get_property(np, "st,supports-sleepmode", NULL)) pdata->supports_sleepmode = true; if (of_property_read_u32(np, "gpio-bank", &dev->id)) { From 61be4981f4c216fb78a133827b04540cdff7afd6 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 14 Jun 2012 11:16:03 +0100 Subject: [PATCH 18/20] ARM: ux500: Ensure vendor specific properties have the vendor's identifier Any non-standard property should contain the vendor's identifier which should be perpended onto the property name followed by a comma. This aids in name-space collision prevention. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- 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 f1dc98d4471d..e9c2e92f75cb 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -60,7 +60,7 @@ interrupts = <0 119 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <0>; @@ -73,7 +73,7 @@ interrupts = <0 120 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <1>; @@ -86,7 +86,7 @@ interrupts = <0 121 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <2>; @@ -99,7 +99,7 @@ interrupts = <0 122 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <3>; @@ -112,7 +112,7 @@ interrupts = <0 123 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <4>; @@ -125,7 +125,7 @@ interrupts = <0 124 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <5>; @@ -138,7 +138,7 @@ interrupts = <0 125 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <6>; @@ -151,7 +151,7 @@ interrupts = <0 126 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <7>; @@ -164,7 +164,7 @@ interrupts = <0 127 0x4>; interrupt-controller; #interrupt-cells = <2>; - supports-sleepmode; + st,supports-sleepmode; gpio-controller; #gpio-cells = <2>; gpio-bank = <8>; From fc67a597a25684084c539a369c09684bf3c0d88e Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 15 Jun 2012 10:46:49 +0100 Subject: [PATCH 19/20] ARM: ux500: Remove temporary snowball_of_platform_devs enablement structure All Device Tree enablement for Snowball's Platform devices; LEDs, Keys, Ethernet and all associated AB8500 Multi-Functional Devices are now complete, so here we remove any trace of adding those devices when Device Tree is enabled. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 9ba952865300..84461fa2a3ba 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -796,8 +796,6 @@ static void __init u8500_init_machine(void) for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) mop500_platform_devs[i]->dev.parent = parent; - for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++) - snowball_platform_devs[i]->dev.parent = parent; /* automatically probe child nodes of db8500 device */ of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent); @@ -816,17 +814,6 @@ static void __init u8500_init_machine(void) mop500_uib_init(); - } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { - /* - * Devices to be DT:ed: - * snowball_led_dev = done - * snowball_key_dev = todo - * snowball_sbnet_dev = done - * ab8500_device = done - */ - platform_add_devices(snowball_of_platform_devs, - ARRAY_SIZE(snowball_of_platform_devs)); - } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { /* * The HREFv60 board removed a GPIO expander and routed From da38487000de965bb94b8f4bca88eade4bb9a485 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 15 Jun 2012 17:37:44 +0100 Subject: [PATCH 20/20] ARM: ux500: Remove PMU platform registration when booting with DT PMU registration is successfully completed by Device Tree now, so there is no longer a requirement to register it from platform code. This patch removes platform registration during a DT boot. Acked-by: Linus Walleij Signed-off-by: Lee Jones --- arch/arm/mach-ux500/cpu-db8500.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index a12bd9eff08b..c8dd94f606dc 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -139,7 +139,6 @@ static struct platform_device *platform_devs[] __initdata = { static struct platform_device *of_platform_devs[] __initdata = { &u8500_dma40_device, - &db8500_pmu_device, }; static resource_size_t __initdata db8500_gpio_base[] = { @@ -248,7 +247,7 @@ struct device * __init u8500_of_init_devices(void) /* * Devices to be DT:ed: * u8500_dma40_device = todo - * db8500_pmu_device = todo + * db8500_pmu_device = done * db8500_prcmu_device = done */ platform_add_devices(of_platform_devs, ARRAY_SIZE(of_platform_devs));