From 855f80cd1683179b251b01d232b3ae228c614766 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Sat, 26 May 2012 06:09:29 +0100 Subject: pinctrl-nomadik: Allow Device Tree driver probing The Nomadik GPIO controller now relies on Nomadik pinctrl, however the pinctrl driver is not currently started by any ux500 platform. This is requred or GPIOs do not work at all. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- drivers/pinctrl/pinctrl-nomadik.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index b8e01c3eaa95..b26395d16347 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1688,18 +1689,34 @@ static struct pinctrl_desc nmk_pinctrl_desc = { .owner = THIS_MODULE, }; +static const struct of_device_id nmk_pinctrl_match[] = { + { + .compatible = "stericsson,nmk_pinctrl", + .data = (void *)PINCTRL_NMK_DB8500, + }, + {}, +}; + static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) { const struct platform_device_id *platid = platform_get_device_id(pdev); + struct device_node *np = pdev->dev.of_node; struct nmk_pinctrl *npct; + unsigned int version = 0; int i; npct = devm_kzalloc(&pdev->dev, sizeof(*npct), GFP_KERNEL); if (!npct) return -ENOMEM; + if (platid) + version = platid->driver_data; + else if (np) + version = (unsigned int) + of_match_device(nmk_pinctrl_match, &pdev->dev)->data; + /* Poke in other ASIC variants here */ - if (platid->driver_data == PINCTRL_NMK_DB8500) + if (version == PINCTRL_NMK_DB8500) nmk_pinctrl_db8500_init(&npct->soc); /* @@ -1758,6 +1775,7 @@ static struct platform_driver nmk_pinctrl_driver = { .driver = { .owner = THIS_MODULE, .name = "pinctrl-nomadik", + .of_match_table = nmk_pinctrl_match, }, .probe = nmk_pinctrl_probe, .id_table = nmk_pinctrl_id, -- cgit v1.2.3 From 11a0b5f09c941ede301ed3eee59fd69c2b4850c2 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 30 May 2012 09:55:38 +0800 Subject: ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement During Device Tree enablement it is necessary to remove snowball_* 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. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/board-mop500.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index fba8adea421e..d1bd2bac22f0 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -676,6 +676,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; @@ -876,8 +883,15 @@ static void __init u8500_init_machine(void) ARRAY_SIZE(mop500_i2c2_devices)); } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { - 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 = todo + * ab8500_device = todo + */ + 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+")) { -- cgit v1.2.3 From f65c1982faca257053564e7ba6864ee9506f6a83 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 29 May 2012 10:03:09 +0800 Subject: ARM: ux500: New DT:ed u8500_init_devices for one-by-one device enablement During Device Tree enablement it is necessary to remove _add_ 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. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- 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 deletion(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index d1bd2bac22f0..1718462622c5 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -859,7 +859,7 @@ static void __init u8500_init_machine(void) else if (of_machine_is_compatible("st-ericsson,hrefv60+")) hrefv60_pinmaps_init(); - parent = u8500_init_devices(); + parent = u8500_of_init_devices(); for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) mop500_platform_devs[i]->dev.parent = parent; diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index bc44c07c71a9..3be0cb8f8914 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h @@ -92,4 +92,7 @@ void __init hrefv60_pinmaps_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 diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 16169c4bf6ca..04244b081a47 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -219,6 +219,28 @@ struct device * __init u8500_init_devices(void) db8500_add_gpios(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; +} + +/* 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); -- cgit v1.2.3 From ada46cda50369444a81a2cf4bf21f580fcb1d6d1 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 29 May 2012 10:28:34 +0800 Subject: 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. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/board-mop500.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 1718462622c5..57e89f60ae4b 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -679,7 +679,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, }; @@ -887,7 +886,7 @@ static void __init u8500_init_machine(void) * Devices to be DT:ed: * snowball_led_dev = todo * snowball_key_dev = todo - * snowball_sbnet_dev = todo + * snowball_sbnet_dev = done * ab8500_device = todo */ platform_add_devices(snowball_of_platform_devs, -- cgit v1.2.3 From dee42ebe45321aa5852d47bde520564e715cf321 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 28 May 2012 16:47:15 +0800 Subject: ARM: ux500: Remove DB8500 PRCMU platform registration when DT is enabled Now the DB8500 has Device Tree support it will be probed when the DT is parsed, rendering the requirement for platform registration void. This patch removes DB8500 PRCMU platform registration. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- 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 04244b081a47..33275eb4c689 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -140,7 +140,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[] = { @@ -251,7 +250,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)); -- cgit v1.2.3 From ccf74f7677ff1cd0044b24335a968bf9e95990eb Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Mon, 28 May 2012 16:50:49 +0800 Subject: ARM: ux500: PRCMU related configuration and layout corrections for Device Tree Apply db8500 related PRCMU Device Tree settings and clean up some formatting errors. We also remove one of the PRCMU assigned IRQs, as it is currently not used. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/boot/dts/db8500.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 881bc3987844..7be77dffc6d0 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -169,12 +169,12 @@ prcmu@80157000 { compatible = "stericsson,db8500-prcmu"; reg = <0x80157000 0x1000>; - interrupts = <46 47>; + interrupts = <0 47 0x4>; #address-cells = <1>; #size-cells = <1>; ranges; - prcmu-timer-4@80157450 { + prcmu-timer-4@80157450 { compatible = "stericsson,db8500-prcmu-timer-4"; reg = <0x80157450 0xC>; }; -- cgit v1.2.3 From e6fada59d4ca59b26600c60de8f4368c8f89961f Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 17 May 2012 13:18:36 +0100 Subject: ARM: ux500: Re-enable SMSC911x platform code registration during non-DT boots The patch to disable SMSC911x registration was applied twice in the upstream kernel by mistake. Git interpreted this as 'take the same entry from a similar struct' which was close by. This was the wrong thing to do. This patch rectifies this error and re-enables SMSC911x registration when Device Tree is not enabled. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/board-mop500.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 57e89f60ae4b..c27a9b07bd50 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -673,6 +673,7 @@ static void __init u8500_cryp1_hash1_init(struct device *parent) static struct platform_device *snowball_platform_devs[] __initdata = { &snowball_led_dev, &snowball_key_dev, + &snowball_sbnet_dev, &ab8500_device, }; -- cgit v1.2.3 From 93b5698aae844f75709f759a6c92109ce40780da Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 29 May 2012 14:17:36 +0800 Subject: ARM: ux500: Use correct format for dynamic IRQ assignment 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. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/boot/dts/db8500.dtsi | 21 ++++++++++++++++++++- arch/arm/boot/dts/snowball.dts | 17 ++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 7be77dffc6d0..707000098ed9 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -58,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>; @@ -69,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>; @@ -80,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>; @@ -91,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>; @@ -102,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>; @@ -113,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>; @@ -124,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>; @@ -135,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>; @@ -146,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>; @@ -235,7 +253,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>; }; diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index d99dc04f0d91..81ff557177a7 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 0>; + gpios = <&gpio1 0 0x4>; }; button@2 { debounce_interval = <50>; wakeup = <1>; linux,code = <3>; label = "extkb1"; - gpios = <&gpio4 23 0>; + gpios = <&gpio4 23 0x4>; }; button@3 { debounce_interval = <50>; wakeup = <1>; linux,code = <4>; label = "extkb2"; - gpios = <&gpio4 24 0>; + gpios = <&gpio4 24 0x4>; }; button@4 { debounce_interval = <50>; wakeup = <1>; linux,code = <5>; label = "extkb3"; - gpios = <&gpio5 1 0>; + gpios = <&gpio5 1 0x4>; }; button@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@50000000 { status = "okay"; @@ -91,7 +90,7 @@ sdi@80126000 { status = "enabled"; - cd-gpios = <&gpio6 26>; + cd-gpios = <&gpio6 26 0x4>; // 218 }; sdi@80114000 { @@ -114,7 +113,7 @@ tc3589x@42 { //compatible = "tc3589x"; reg = <0x42>; - interrupts = <25>; + gpios = <&gpio6 25 0x4>; interrupt-parent = <&gpio6>; }; tps61052@33 { -- cgit v1.2.3 From 48a4ea626ddfad1c714ac4e3b7049347c22f2aa2 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 29 May 2012 15:06:55 +0800 Subject: ARM: ux500: Disable platform setup of the ab8500 when DT is enabled The final piece of the ab8500 puzzle. Here we prevent any of the ab8500-* drivers from being registered from platform code when Device Tree is enabled, as we expect DT do probe each of these individually. We also provide the relevant compatible strings, so that DT knows which nodes it needs to pay attention to during population. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/board-mop500.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index c27a9b07bd50..5c5bfd5d1b11 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -680,7 +680,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = { static struct platform_device *snowball_of_platform_devs[] __initdata = { &snowball_led_dev, &snowball_key_dev, - &ab8500_device, }; static void __init mop500_init_machine(void) @@ -841,6 +840,9 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { static const struct of_device_id u8500_local_bus_nodes[] = { /* only create devices below soc node */ { .compatible = "stericsson,db8500", }, + { .compatible = "stericsson,db8500-prcmu", }, + { .compatible = "stericsson,ab8500", }, + { .compatible = "stericsson,ab8500-regulator", }, { .compatible = "simple-bus"}, { }, }; @@ -876,7 +878,6 @@ 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, @@ -888,7 +889,7 @@ static void __init u8500_init_machine(void) * snowball_led_dev = todo * snowball_key_dev = todo * snowball_sbnet_dev = done - * ab8500_device = todo + * ab8500_device = done */ platform_add_devices(snowball_of_platform_devs, ARRAY_SIZE(snowball_of_platform_devs)); -- cgit v1.2.3 From fd6948bb2aee1020001d7fd4747160541d69e30f Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 2 May 2012 09:53:48 +0100 Subject: ARM: ux500: Only initialise STE's UIBs on boards which support them ST-Ericsson uses User Interface Boards to extend functionality of some of their development boards. However, these aren't compatible with all the supported boards found in Mainline (Snowball for instance). This patch ensures that the UIBs are only probed on boards which can actually support them. This in turn saves lots of unnecessary error messages normally found in Snowball's boot log. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/board-mop500-uib.c | 4 +--- arch/arm/mach-ux500/board-mop500.c | 8 ++++++++ arch/arm/mach-ux500/board-mop500.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500-uib.c b/arch/arm/mach-ux500/board-mop500-uib.c index b29a788f498c..1f47d962e3a1 100644 --- a/arch/arm/mach-ux500/board-mop500-uib.c +++ b/arch/arm/mach-ux500/board-mop500-uib.c @@ -96,7 +96,7 @@ static void __init __mop500_uib_init(struct uib *uib, const char *why) /* * Detect the UIB attached based on the presence or absence of i2c devices. */ -static int __init mop500_uib_init(void) +int __init mop500_uib_init(void) { struct uib *uib = mop500_uib; struct i2c_adapter *i2c0; @@ -131,5 +131,3 @@ static int __init mop500_uib_init(void) return 0; } - -module_init(mop500_uib_init); diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 5c5bfd5d1b11..c3ece275b22c 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -716,6 +716,8 @@ static void __init mop500_init_machine(void) /* This board has full regulator constraints */ regulator_has_full_constraints(); + + mop500_uib_init(); } static void __init snowball_init_machine(void) @@ -780,6 +782,8 @@ static void __init hrefv60_init_machine(void) /* This board has full regulator constraints */ regulator_has_full_constraints(); + + mop500_uib_init(); } MACHINE_START(U8500, "ST-Ericsson MOP500 platform") @@ -883,6 +887,8 @@ static void __init u8500_init_machine(void) i2c_register_board_info(2, mop500_i2c2_devices, ARRAY_SIZE(mop500_i2c2_devices)); + mop500_uib_init(); + } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { /* * Devices to be DT:ed: @@ -913,6 +919,8 @@ static void __init u8500_init_machine(void) i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); i2c_register_board_info(2, mop500_i2c2_devices, ARRAY_SIZE(mop500_i2c2_devices)); + + mop500_uib_init(); } mop500_i2c_init(parent); diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index 3be0cb8f8914..2f87b25a908a 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h @@ -89,6 +89,7 @@ void __init mop500_pinmaps_init(void); void __init snowball_pinmaps_init(void); void __init hrefv60_pinmaps_init(void); +int __init mop500_uib_init(void); void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, unsigned n); -- cgit v1.2.3 From e5999f28903ebf795e83c95ed19191517ad3c001 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 4 May 2012 13:32:34 +0100 Subject: ARM: ux500: Apply db8500-prcmu regulator information to db8500 Device Tree Here we inform Device Tree of which regulators are provided by the db8500- prcmu. This way we can reference some of their consumers directly from the Device Tree e.g. SMSC911x Ethernet chip. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/boot/dts/db8500.dtsi | 107 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 707000098ed9..646c80b41661 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -197,6 +197,113 @@ reg = <0x80157450 0xC>; }; + db8500-prcmu-regulators { + compatible = "stericsson,db8500-prcmu-regulator"; + + // DB8500_REGULATOR_VAPE + db8500_vape_reg: db8500_vape { + regulator-name = "db8500-vape"; + regulator-always-on; + }; + + // DB8500_REGULATOR_VARM + db8500_varm_reg: db8500_varm { + regulator-name = "db8500-varm"; + }; + + // DB8500_REGULATOR_VMODEM + db8500_vmodem_reg: db8500_vmodem { + regulator-name = "db8500-vmodem"; + }; + + // DB8500_REGULATOR_VPLL + db8500_vpll_reg: db8500_vpll { + regulator-name = "db8500-vpll"; + }; + + // DB8500_REGULATOR_VSMPS1 + db8500_vsmps1_reg: db8500_vsmps1 { + regulator-name = "db8500-vsmps1"; + }; + + // DB8500_REGULATOR_VSMPS2 + db8500_vsmps2_reg: db8500_vsmps2 { + regulator-name = "db8500-vsmps2"; + }; + + // DB8500_REGULATOR_VSMPS3 + db8500_vsmps3_reg: db8500_vsmps3 { + regulator-name = "db8500-vsmps3"; + }; + + // DB8500_REGULATOR_VRF1 + db8500_vrf1_reg: db8500_vrf1 { + regulator-name = "db8500-vrf1"; + }; + + // DB8500_REGULATOR_SWITCH_SVAMMDSP + db8500_sva_mmdsp_reg: db8500_sva_mmdsp { + regulator-name = "db8500-sva-mmdsp"; + }; + + // DB8500_REGULATOR_SWITCH_SVAMMDSPRET + db8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret { + regulator-name = "db8500-sva-mmdsp-ret"; + }; + + // DB8500_REGULATOR_SWITCH_SVAPIPE + db8500_sva_pipe_reg: db8500_sva_pipe { + regulator-name = "db8500_sva_pipe"; + }; + + // DB8500_REGULATOR_SWITCH_SIAMMDSP + db8500_sia_mmdsp_reg: db8500_sia_mmdsp { + regulator-name = "db8500_sia_mmdsp"; + }; + + // DB8500_REGULATOR_SWITCH_SIAMMDSPRET + db8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret { + regulator-name = "db8500-sia-mmdsp-ret"; + }; + + // DB8500_REGULATOR_SWITCH_SIAPIPE + db8500_sia_pipe_reg: db8500_sia_pipe { + regulator-name = "db8500-sia-pipe"; + }; + + // DB8500_REGULATOR_SWITCH_SGA + db8500_sga_reg: db8500_sga { + regulator-name = "db8500-sga"; + vin-supply = <&db8500_vape_reg>; + }; + + // DB8500_REGULATOR_SWITCH_B2R2_MCDE + db8500_b2r2_mcde_reg: db8500_b2r2_mcde { + regulator-name = "db8500-b2r2-mcde"; + vin-supply = <&db8500_vape_reg>; + }; + + // DB8500_REGULATOR_SWITCH_ESRAM12 + db8500_esram12_reg: db8500_esram12 { + regulator-name = "db8500-esram12"; + }; + + // DB8500_REGULATOR_SWITCH_ESRAM12RET + db8500_esram12_ret_reg: db8500_esram12_ret { + regulator-name = "db8500-esram12-ret"; + }; + + // DB8500_REGULATOR_SWITCH_ESRAM34 + db8500_esram34_reg: db8500_esram34 { + regulator-name = "db8500-esram34"; + }; + + // DB8500_REGULATOR_SWITCH_ESRAM34RET + db8500_esram34_ret_reg: db8500_esram34_ret { + regulator-name = "db8500-esram34-ret"; + }; + }; + ab8500@5 { compatible = "stericsson,ab8500"; reg = <5>; /* mailbox 5 is i2c */ -- cgit v1.2.3 From 890d84fac09b7e3986317c9f6d53a7924ac10161 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 4 May 2012 14:01:00 +0100 Subject: ARM: ux500: Allow PRCMU regulator to be probed during a DT enabled boot This patch adds the correct compatible string for use during Device Tree population. Without it the DB8500 PRCMU regulators would be processed when DT is enabled. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/mach-ux500/board-mop500.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index c3ece275b22c..9c74ac545849 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -845,6 +845,7 @@ static const struct of_device_id u8500_local_bus_nodes[] = { /* only create devices below soc node */ { .compatible = "stericsson,db8500", }, { .compatible = "stericsson,db8500-prcmu", }, + { .compatible = "stericsson,db8500-prcmu-regulator", }, { .compatible = "stericsson,ab8500", }, { .compatible = "stericsson,ab8500-regulator", }, { .compatible = "simple-bus"}, -- cgit v1.2.3 From bc36748153eea3813018fae3e361a941213e9ada Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 3 May 2012 11:23:47 +0100 Subject: ARM: ux500: Provide regulator support for SMSC911x via Device Tree This patch adds a fixed regulator for use by the SMSC911x Ethernet chip driver into the db8500 Device Tree. It also references other regulators required by the same device. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/boot/dts/snowball.dts | 13 +++++++++++++ arch/arm/configs/u8500_defconfig | 1 + drivers/mfd/db8500-prcmu.c | 1 + 3 files changed, 15 insertions(+) diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index 81ff557177a7..d6c05ea9e518 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -20,6 +20,16 @@ reg = <0x00000000 0x20000000>; }; + en_3v3_reg: en_3v3 { + compatible = "regulator-fixed"; + regulator-name = "en-3v3-fixed-supply"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpios = <&gpio0 26 0x4>; // 26 + startup-delay-us = <5000>; + enable-active-high; + }; + gpio_keys { compatible = "gpio-keys"; #address-cells = <1>; @@ -79,6 +89,9 @@ reg = <0 0x10000>; interrupts = <12 0x1>; interrupt-parent = <&gpio4>; + vdd33a-supply = <&en_3v3_reg>; + vddvario-supply = <&db8500_vape_reg>; + reg-shift = <1>; reg-io-width = <2>; diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig index 7e84f453e8a6..2d4f661d1cf6 100644 --- a/arch/arm/configs/u8500_defconfig +++ b/arch/arm/configs/u8500_defconfig @@ -75,6 +75,7 @@ CONFIG_AB5500_CORE=y CONFIG_AB8500_CORE=y CONFIG_REGULATOR=y CONFIG_REGULATOR_AB8500=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y # CONFIG_HID_SUPPORT is not set CONFIG_USB_GADGET=y CONFIG_AB8500_USB=y diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 671c8bc14bbc..50e83dc5dc49 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -2735,6 +2735,7 @@ static struct regulator_consumer_supply db8500_vape_consumers[] = { REGULATOR_SUPPLY("vcore", "uart2"), REGULATOR_SUPPLY("v-ape", "nmk-ske-keypad.0"), REGULATOR_SUPPLY("v-hsi", "ste_hsi.0"), + REGULATOR_SUPPLY("vddvario", "smsc911x.0"), }; static struct regulator_consumer_supply db8500_vsmps2_consumers[] = { -- cgit v1.2.3 From 4a85c7fa52d71806dd7389486f11eda907b49fd6 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Tue, 29 May 2012 14:29:53 +0800 Subject: ARM: ux500: Add support for ab8500 regulators into the Device Tree Here we supply the information required to setup regulators successfully on Snowball and other db8500 variants which use the ab8500 regulators. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- arch/arm/boot/dts/db8500.dtsi | 68 ++++++++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/snowball.dts | 2 ++ 2 files changed, 70 insertions(+) diff --git a/arch/arm/boot/dts/db8500.dtsi b/arch/arm/boot/dts/db8500.dtsi index 646c80b41661..1fa5546b5971 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -308,6 +308,74 @@ compatible = "stericsson,ab8500"; reg = <5>; /* mailbox 5 is i2c */ interrupts = <0 40 0x4>; + + ab8500-regulators { + compatible = "stericsson,ab8500-regulator"; + + // supplies to the display/camera + ab8500_ldo_aux1_reg: ab8500_ldo_aux1 { + regulator-name = "V-DISPLAY"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2900000>; + regulator-boot-on; + /* BUG: If turned off MMC will be affected. */ + regulator-always-on; + }; + + // supplies to the on-board eMMC + ab8500_ldo_aux2_reg: ab8500_ldo_aux2 { + regulator-name = "V-eMMC1"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <3300000>; + }; + + // supply for VAUX3; SDcard slots + ab8500_ldo_aux3_reg: ab8500_ldo_aux3 { + regulator-name = "V-MMC-SD"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <3300000>; + }; + + // supply for v-intcore12; VINTCORE12 LDO + ab8500_ldo_initcore_reg: ab8500_ldo_initcore { + regulator-name = "V-INTCORE"; + }; + + // supply for tvout; gpadc; TVOUT LDO + ab8500_ldo_tvout_reg: ab8500_ldo_tvout { + regulator-name = "V-TVOUT"; + }; + + // supply for ab8500-usb; USB LDO + ab8500_ldo_usb_reg: ab8500_ldo_usb { + regulator-name = "dummy"; + }; + + // supply for ab8500-vaudio; VAUDIO LDO + ab8500_ldo_audio_reg: ab8500_ldo_audio { + regulator-name = "V-AUD"; + }; + + // supply for v-anamic1 VAMic1-LDO + ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 { + regulator-name = "V-AMIC1"; + }; + + // supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1 + ab8500_ldo_amamic2_reg: ab8500_ldo_amamic2 { + regulator-name = "V-AMIC2"; + }; + + // supply for v-dmic; VDMIC LDO + ab8500_ldo_dmic_reg: ab8500_ldo_dmic { + regulator-name = "V-DMIC"; + }; + + // supply for U8500 CSI/DSI; VANA LDO + ab8500_ldo_ana_reg: ab8500_ldo_ana { + regulator-name = "V-CSI/DSI"; + }; + }; }; }; diff --git a/arch/arm/boot/dts/snowball.dts b/arch/arm/boot/dts/snowball.dts index d6c05ea9e518..ec3c33975110 100644 --- a/arch/arm/boot/dts/snowball.dts +++ b/arch/arm/boot/dts/snowball.dts @@ -103,11 +103,13 @@ sdi@80126000 { status = "enabled"; + vmmc-supply = <&ab8500_ldo_aux3_reg>; cd-gpios = <&gpio6 26 0x4>; // 218 }; sdi@80114000 { status = "enabled"; + vmmc-supply = <&ab8500_ldo_aux2_reg>; }; uart@80120000 { -- cgit v1.2.3 From 5910de9e2de453956c3a18816f4838d96ac86988 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Sat, 26 May 2012 06:25:36 +0100 Subject: ARM: ux500: Enable probing of pinctrl through Device Tree The Nomadik GPIO controller now relies on Nomadik pinctrl, however the pinctrl driver is not currently started by any ux500 platform. This is requred or GPIOs do not work at all. Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Arnd Bergmann --- 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 1fa5546b5971..4ad5160018cb 100644 --- a/arch/arm/boot/dts/db8500.dtsi +++ b/arch/arm/boot/dts/db8500.dtsi @@ -170,6 +170,10 @@ gpio-bank = <8>; }; + pinctrl { + compatible = "stericsson,nmk_pinctrl"; + }; + usb@a03e0000 { compatible = "stericsson,db8500-musb", "mentor,musb"; -- cgit v1.2.3