diff options
author | Olof Johansson <olof@lixom.net> | 2013-02-09 17:27:13 -0800 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-02-09 17:27:13 -0800 |
commit | 93ce285503e375a4a751b632dd7b93291629c5cd (patch) | |
tree | 83ddfe4de81a87f9fecae220782a28ae340864c1 /arch | |
parent | 13c5d51953441bd03cfd057e8f340100516ef24c (diff) | |
parent | 19c7c0d81a9b1fe7342d0208b629b5e085e4f3ae (diff) | |
download | op-kernel-dev-93ce285503e375a4a751b632dd7b93291629c5cd.zip op-kernel-dev-93ce285503e375a4a751b632dd7b93291629c5cd.tar.gz |
Merge tag 'davinci-for-v3.9/dt-2' of git://gitorious.org/linux-davinci/linux-davinci into next/dt
From Sekhar Nori:
Second round of DT updates for DaVinci.
This pull request adds support for I2C0 and watchdog timer
for DA850 EVM booting using device tree. It also enables
machine reboot when using device tree.
* tag 'davinci-for-v3.9/dt-2' of git://gitorious.org/linux-davinci/linux-davinci:
ARM: davinci: da850 DT: add support for machine reboot
ARM: davinci: da850: add wdt DT node
ARM: davinci: da850: add DT node for I2C0
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/dts/da850-evm.dts | 9 | ||||
-rw-r--r-- | arch/arm/boot/dts/da850.dtsi | 19 | ||||
-rw-r--r-- | arch/arm/mach-davinci/da8xx-dt.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/da8xx.h | 1 |
5 files changed, 46 insertions, 4 deletions
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts index fa04152..f712fb6 100644 --- a/arch/arm/boot/dts/da850-evm.dts +++ b/arch/arm/boot/dts/da850-evm.dts @@ -30,6 +30,15 @@ rtc0: rtc@1c23000 { status = "okay"; }; + i2c0: i2c@1c22000 { + status = "okay"; + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + }; + wdt: wdt@1c21000 { + status = "okay"; + }; }; nand_cs3@62000000 { status = "okay"; diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi index 8dd15c0..3ec1bda 100644 --- a/arch/arm/boot/dts/da850.dtsi +++ b/arch/arm/boot/dts/da850.dtsi @@ -56,6 +56,12 @@ 0x30 0x01100000 0x0ff00000 >; }; + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,bits = < + /* I2C0_SDA,I2C0_SCL */ + 0x10 0x00002200 0x0000ff00 + >; + }; }; serial0: serial@1c42000 { compatible = "ns16550a"; @@ -88,6 +94,19 @@ 19>; status = "disabled"; }; + i2c0: i2c@1c22000 { + compatible = "ti,davinci-i2c"; + reg = <0x22000 0x1000>; + interrupts = <15>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + wdt: wdt@1c21000 { + compatible = "ti,davinci-wdt"; + reg = <0x21000 0x1000>; + status = "disabled"; + }; }; nand_cs3@62000000 { compatible = "ti,davinci-nand"; diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 9a7c76e..6b7a0a2 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -37,11 +37,18 @@ static void __init da8xx_init_irq(void) of_irq_init(da8xx_irq_match); } +struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { + OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), + OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), + {} +}; + #ifdef CONFIG_ARCH_DAVINCI_DA850 static void __init da850_init_machine(void) { - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + of_platform_populate(NULL, of_default_bus_match_table, + da850_auxdata_lookup, NULL); da8xx_uart_clk_enable(); } diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index aa402bc..fc50243 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -359,7 +359,7 @@ static struct resource da8xx_watchdog_resources[] = { }, }; -struct platform_device da8xx_wdt_device = { +static struct platform_device da8xx_wdt_device = { .name = "watchdog", .id = -1, .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), @@ -368,7 +368,15 @@ struct platform_device da8xx_wdt_device = { void da8xx_restart(char mode, const char *cmd) { - davinci_watchdog_reset(&da8xx_wdt_device); + struct device *dev; + + dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog"); + if (!dev) { + pr_err("%s: failed to find watchdog device\n", __func__); + return; + } + + davinci_watchdog_reset(to_platform_device(dev)); } int __init da8xx_register_watchdog(void) diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index 1b14aea..de439b7 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -110,7 +110,6 @@ extern struct emac_platform_data da8xx_emac_pdata; extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; -extern struct platform_device da8xx_wdt_device; extern const short da830_emif25_pins[]; extern const short da830_spi0_pins[]; |