[brcm63xx] add infrastructure to register gpio-input reset button
[openwrt.git] / target / linux / brcm63xx / files / arch / mips / bcm63xx / boards / board_bcm963xx.c
index c61438e..0a8ecbd 100644 (file)
@@ -543,6 +543,27 @@ static struct board_info __initdata board_AGPFS0 = {
        .has_ohci0 = 1,
        .has_ehci0 = 1,
 };
+
+static struct board_info __initdata board_DWVS0 = {
+       .name                           = "DWV-S0",
+       .expected_cpu_id                = 0x6358,
+
+       .has_enet0                      = 1,
+       .has_enet1                      = 1,
+       .has_pci                        = 1,
+
+       .enet0 = {
+               .has_phy                = 1,
+               .use_internal_phy       = 1,
+       },
+
+       .enet1 = {
+               .force_speed_100        = 1,
+               .force_duplex_full      = 1,
+       },
+
+       .has_ohci0 = 1,
+};
 #endif
 
 /*
@@ -570,6 +591,7 @@ static const struct board_info __initdata *bcm963xx_boards[] = {
        &board_96358vw,
        &board_96358vw2,
        &board_AGPFS0,
+       &board_DWVS0,
 #endif
 };
 
@@ -780,6 +802,17 @@ static struct platform_device bcm63xx_gpio_leds = {
        .dev.platform_data      = &bcm63xx_led_data,
 };
 
+struct gpio_buttons_platform_data bcm63xx_gpio_buttons_data = {
+       .poll_interval  = 20,
+};
+
+struct platform_device bcm63xx_gpio_buttons_device = {
+        .name           = "gpio-buttons",
+        .id             = 0,
+        .dev.platform_data = &bcm63xx_gpio_buttons_data,
+};
+
+
 /*
  * third stage init callback, register all board devices.
  */
@@ -789,7 +822,9 @@ int __init board_register_devices(void)
 
        bcm63xx_uart_register();
        bcm63xx_wdt_register();
-       bcm63xx_spi_register();
+
+       if (!BCMCPU_IS_6345())
+               bcm63xx_spi_register();
 
        if (board.has_pccard)
                bcm63xx_pcmcia_register();
@@ -845,6 +880,11 @@ int __init board_register_devices(void)
 
        platform_device_register(&bcm63xx_gpio_leds);
 
+       bcm63xx_gpio_buttons_data.nbuttons = 1,
+       bcm63xx_gpio_buttons_data.buttons = board.reset_btm;
+
+       platform_device_register(&bcm63xx_gpio_buttons);
+
        return 0;
 }