Skip to content

Commit

Permalink
Merge tag 'davinci-for-v3.9/dt-2' of git://gitorious.org/linux-davinc…
Browse files Browse the repository at this point in the history
…i/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
  • Loading branch information
Olof Johansson committed Feb 10, 2013
2 parents 13c5d51 + 19c7c0d commit 93ce285
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
9 changes: 9 additions & 0 deletions arch/arm/boot/dts/da850-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
19 changes: 19 additions & 0 deletions arch/arm/boot/dts/da850.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
9 changes: 8 additions & 1 deletion arch/arm/mach-davinci/da8xx-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
12 changes: 10 additions & 2 deletions arch/arm/mach-davinci/devices-da8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-davinci/include/mach/da8xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down

0 comments on commit 93ce285

Please sign in to comment.