Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / arch / mips / ar7 / platform.c
index 5422449..cf50fa2 100644 (file)
 #include <linux/serial_8250.h>
 #include <linux/ioport.h>
 #include <linux/io.h>
-#include <linux/version.h>
 #include <linux/vlynq.h>
 #include <linux/leds.h>
 #include <linux/string.h>
 #include <linux/etherdevice.h>
+#include <linux/phy.h>
+#include <linux/phy_fixed.h>
 
 #include <asm/addrspace.h>
 #include <asm/mach-ar7/ar7.h>
@@ -209,6 +210,12 @@ static struct physmap_flash_data physmap_flash_data = {
        .width = 2,
 };
 
+static struct fixed_phy_status fixed_phy_status __initdata = {
+       .link = 1,
+       .speed = 100,
+       .duplex = 1,
+};
+
 static struct plat_cpmac_data cpmac_low_data = {
        .reset_bit = 17,
        .power_bit = 20,
@@ -243,13 +250,13 @@ static struct platform_device physmap_flash = {
        .num_resources = 1,
 };
 
-static u64 cpmac_dma_mask = DMA_32BIT_MASK;
+static u64 cpmac_dma_mask = DMA_BIT_MASK(32);
 static struct platform_device cpmac_low = {
        .id = 0,
        .name = "cpmac",
        .dev = {
                .dma_mask = &cpmac_dma_mask,
-               .coherent_dma_mask = DMA_32BIT_MASK,
+               .coherent_dma_mask = DMA_BIT_MASK(32),
                .platform_data = &cpmac_low_data,
        },
        .resource = cpmac_low_res,
@@ -261,7 +268,7 @@ static struct platform_device cpmac_high = {
        .name = "cpmac",
        .dev = {
                .dma_mask = &cpmac_dma_mask,
-               .coherent_dma_mask = DMA_32BIT_MASK,
+               .coherent_dma_mask = DMA_BIT_MASK(32),
                .platform_data = &cpmac_high_data,
        },
        .resource = cpmac_high_res,
@@ -481,6 +488,7 @@ static void __init detect_leds(void)
 static int __init ar7_register_devices(void)
 {
        int res;
+#ifdef CONFIG_SERIAL_8250
        static struct uart_port uart_port[2];
 
        memset(uart_port, 0, sizeof(struct uart_port) * 2);
@@ -512,7 +520,7 @@ static int __init ar7_register_devices(void)
                if (res)
                        return res;
        }
-
+#endif /* CONFIG_SERIAL_8250 */
        res = platform_device_register(&physmap_flash);
        if (res)
                return res;
@@ -530,6 +538,9 @@ static int __init ar7_register_devices(void)
        }
 
        if (ar7_has_high_cpmac()) {
+               res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
+               if (res && res != -ENODEV)
+                       return res;
                cpmac_get_mac(1, cpmac_high_data.dev_addr);
                res = platform_device_register(&cpmac_high);
                if (res)
@@ -538,6 +549,10 @@ static int __init ar7_register_devices(void)
                cpmac_low_data.phy_mask = 0xffffffff;
        }
 
+       res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
+       if (res && res != -ENODEV)
+               return res;
+
        cpmac_get_mac(0, cpmac_low_data.dev_addr);
        res = platform_device_register(&cpmac_low);
        if (res)