Merge branches 'release', 'APERF', 'ARAT', 'misc', 'kelvin', 'device-lock' and 'bjorn...
[sfrench/cifs-2.6.git] / arch / arm / mach-orion5x / common.c
index 8a0e49d842566dffe67037dc2dfef3ccf4f0bce4..6af99ddabdfb92e0159ba96252654549dc04b9ce 100644 (file)
@@ -31,6 +31,7 @@
 #include <plat/ehci-orion.h>
 #include <plat/mv_xor.h>
 #include <plat/orion_nand.h>
+#include <plat/orion5x_wdt.h>
 #include <plat/time.h>
 #include "common.h"
 
@@ -219,14 +220,17 @@ static struct platform_device orion5x_switch_device = {
 
 void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
 {
+       int i;
+
        if (irq != NO_IRQ) {
                orion5x_switch_resources[0].start = irq;
                orion5x_switch_resources[0].end = irq;
                orion5x_switch_device.num_resources = 1;
        }
 
-       d->mii_bus = &orion5x_eth_shared.dev;
        d->netdev = &orion5x_eth.dev;
+       for (i = 0; i < d->nr_chips; i++)
+               d->chip[i].mii_bus = &orion5x_eth_shared.dev;
        orion5x_switch_device.dev.platform_data = d;
 
        platform_device_register(&orion5x_switch_device);
@@ -459,7 +463,7 @@ static struct platform_device orion5x_xor_shared = {
        .resource       = orion5x_xor_shared_resources,
 };
 
-static u64 orion5x_xor_dmamask = DMA_32BIT_MASK;
+static u64 orion5x_xor_dmamask = DMA_BIT_MASK(32);
 
 static struct resource orion5x_xor0_resources[] = {
        [0] = {
@@ -482,7 +486,7 @@ static struct platform_device orion5x_xor0_channel = {
        .resource       = orion5x_xor0_resources,
        .dev            = {
                .dma_mask               = &orion5x_xor_dmamask,
-               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .coherent_dma_mask      = DMA_BIT_MASK(64),
                .platform_data          = (void *)&orion5x_xor0_data,
        },
 };
@@ -508,7 +512,7 @@ static struct platform_device orion5x_xor1_channel = {
        .resource       = orion5x_xor1_resources,
        .dev            = {
                .dma_mask               = &orion5x_xor_dmamask,
-               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .coherent_dma_mask      = DMA_BIT_MASK(64),
                .platform_data          = (void *)&orion5x_xor1_data,
        },
 };
@@ -532,6 +536,29 @@ void __init orion5x_xor_init(void)
 }
 
 
+/*****************************************************************************
+ * Watchdog
+ ****************************************************************************/
+static struct orion5x_wdt_platform_data orion5x_wdt_data = {
+       .tclk                   = 0,
+};
+
+static struct platform_device orion5x_wdt_device = {
+       .name           = "orion5x_wdt",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &orion5x_wdt_data,
+       },
+       .num_resources  = 0,
+};
+
+void __init orion5x_wdt_init(void)
+{
+       orion5x_wdt_data.tclk = orion5x_tclk;
+       platform_device_register(&orion5x_wdt_device);
+}
+
+
 /*****************************************************************************
  * Time handling
  ****************************************************************************/
@@ -631,6 +658,11 @@ void __init orion5x_init(void)
                printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
                disable_hlt();
        }
+
+       /*
+        * Register watchdog driver
+        */
+       orion5x_wdt_init();
 }
 
 /*