diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-05-02 17:23:08 +0200 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-05-09 02:15:56 -0700 |
commit | 70888a4b412abd55c1710e2d36a9a00f4d23f474 (patch) | |
tree | edcc428dcb5062823c0505deab3f6093c0fb40a5 /arch/arm | |
parent | 47fad7c6f8d9f64780793cc67d8280259538c31c (diff) | |
parent | c51423fc067b00d8c8bd0e4e7bc861bf9050511d (diff) | |
download | op-kernel-dev-70888a4b412abd55c1710e2d36a9a00f4d23f474.zip op-kernel-dev-70888a4b412abd55c1710e2d36a9a00f4d23f474.tar.gz |
Merge branch 'ux500-devicetree-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/dt
From: Linus Walleij <linus.walleij@linaro.org>:
Four core patches paving the way for device tree enablement
of the Snowball and ux500 at large by Lee Jones.
* 'ux500-devicetree-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
ARM: ux500: Enable PRCMU Timer 4 (clocksource) for Device Tree
ARM: ux500: Disable SMSC911x platform code registration when DT is enabled
ARM: ux500: Fork cpu-db8500 platform_devs for sequential DT enablement
ARM: ux500: Do not attempt to register non-existent i2c devices on Snowball
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[olof: rebuilt branch due to drop of an early merge]
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-ux500/cpu-db8500.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-ux500/timer.c | 24 |
3 files changed, 52 insertions, 16 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 539da3f..f815015 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -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, }; @@ -646,7 +645,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(); @@ -664,11 +662,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(); } @@ -767,7 +760,6 @@ static void __init u8500_init_machine(void) int i; parent = u8500_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; @@ -785,6 +777,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(); platform_add_devices(snowball_platform_devs, @@ -798,19 +796,21 @@ static void __init u8500_init_machine(void) * instead. */ mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; - i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; hrefv60_pins_init(); platform_add_devices(mop500_platform_devs, 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(); } diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 9bd8163..f44a12c 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -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, @@ -199,10 +205,16 @@ struct device * __init u8500_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; } diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c index d37df98..885c742 100644 --- a/arch/arm/mach-ux500/timer.c +++ b/arch/arm/mach-ux500/timer.c @@ -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. |