]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/boards/board-magicpanelr2.c
sh: convert magicpanelr2 platform to use smsc911x.
[linux-2.6-omap-h63xx.git] / arch / sh / boards / board-magicpanelr2.c
index f3b8b07ea5d65a922d8a4d98114ca884db589d93..0a37c8bfc959e0a8a3e34ea7d8d4d60c7738b204 100644 (file)
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/smsc911x.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/map.h>
-#include <asm/magicpanelr2.h>
+#include <mach/magicpanelr2.h>
 #include <asm/heartbeat.h>
+#include <cpu/sh7720.h>
 
 #define LAN9115_READY  (ctrl_inl(0xA8000084UL) & 0x00000001UL)
 
@@ -170,7 +173,14 @@ static void __init setup_port_multiplexing(void)
        /* R7 A25;           R6 A24;         R5 A23;              R4 A22;
         * R3 A21;           R2 A20;         R1 A19;              R0 A0;
         */
-       ctrl_outw(0x0000, PORT_PRCR);   /* 00 00 00 00 00 00 00 00 */
+       gpio_request(GPIO_FN_A25, NULL);
+       gpio_request(GPIO_FN_A24, NULL);
+       gpio_request(GPIO_FN_A23, NULL);
+       gpio_request(GPIO_FN_A22, NULL);
+       gpio_request(GPIO_FN_A21, NULL);
+       gpio_request(GPIO_FN_A20, NULL);
+       gpio_request(GPIO_FN_A19, NULL);
+       gpio_request(GPIO_FN_A0, NULL);
 
        /* S7 (x);              S6 (x);        S5 (x);       S4 GPO(EEPROM_CS2);
         * S3 GPO(EEPROM_CS1);  S2 SIOF0_TXD;  S1 SIOF0_RXD; S0 SIOF0_SCK;
@@ -233,7 +243,7 @@ static void __init mpr2_setup(char **cmdline_p)
                printk(KERN_WARNING "Ethernet not ready\n");
 }
 
-static struct resource smc911x_resources[] = {
+static struct resource smsc911x_resources[] = {
        [0] = {
                .start          = 0xa8000000,
                .end            = 0xabffffff,
@@ -246,11 +256,21 @@ static struct resource smc911x_resources[] = {
        },
 };
 
-static struct platform_device smc911x_device = {
-       .name           = "smc911x",
+static struct smsc911x_platform_config smsc911x_config = {
+       .phy_interface  = PHY_INTERFACE_MODE_MII,
+       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+       .irq_type       = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
+       .flags          = SMSC911X_USE_32BIT,
+};
+
+static struct platform_device smsc911x_device = {
+       .name           = "smsc911x",
        .id             = -1,
-       .num_resources  = ARRAY_SIZE(smc911x_resources),
-       .resource       = smc911x_resources,
+       .num_resources  = ARRAY_SIZE(smsc911x_resources),
+       .resource       = smsc911x_resources,
+       .dev = {
+               .platform_data = &smsc911x_config,
+       },
 };
 
 static struct resource heartbeat_resources[] = {
@@ -351,7 +371,7 @@ static void __init set_mtd_partitions(void)
 
 static struct platform_device *mpr2_devices[] __initdata = {
        &heartbeat_device,
-       &smc911x_device,
+       &smsc911x_device,
        &flash_device,
 };