]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP2EVM: Adding ethernet support
authorArun KS <getarunks@gmail.com>
Mon, 30 Jun 2008 15:09:25 +0000 (20:39 +0530)
committerTony Lindgren <tony@atomide.com>
Thu, 3 Jul 2008 10:22:17 +0000 (13:22 +0300)
OMAP2EVM: Add ethernet support (smc911x)

Signed-off-by: Arun KS <arunks@mistralsolutions.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-omap2evm.c
include/asm-arm/arch-omap/board-omap2evm.h

index d00e502c77fc490b0301aa4615ebbf8fc3b55a7f..bcdf4a6a2e7a8664d6b015cec74599495dc48216 100644 (file)
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>
 
+static struct resource omap2evm_smc911x_resources[] = {
+       [0] =   {
+               .start  = OMAP2EVM_ETHR_START,
+               .end    = (OMAP2EVM_ETHR_START + OMAP2EVM_ETHR_SIZE - 1),
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] =   {
+               .start  = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .end    = OMAP_GPIO_IRQ(OMAP2EVM_ETHR_GPIO_IRQ),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device omap2evm_smc911x_device = {
+       .name       = "smc911x",
+       .id     = -1,
+       .num_resources  = ARRAY_SIZE(omap2evm_smc911x_resources),
+       .resource   = &omap2evm_smc911x_resources [0],
+};
+
+static inline void __init omap2evm_init_smc911x(void)
+{
+       int gpio = OMAP2EVM_ETHR_GPIO_IRQ;
+       int ret;
+
+       ret = gpio_request(gpio, "smc911x IRQ");
+       if (ret < 0) {
+               printk(KERN_ERR "Failed to request GPIO %d for smc911x IRQ\n",
+                               gpio);
+               return;
+       }
+       gpio_direction_input(gpio);
+
+}
+
 static void __init omap2_evm_init_irq(void)
 {
        omap2_init_common_hw();
        omap_init_irq();
        omap_gpio_init();
+       omap2evm_init_smc911x();
 }
 
 static struct omap_uart_config omap2_evm_uart_config __initdata = {
@@ -53,8 +89,13 @@ static int __init omap2_evm_i2c_init(void)
        return 0;
 }
 
+static struct platform_device *omap2_evm_devices[] __initdata = {
+    &omap2evm_smc911x_device,
+};
+
 static void __init omap2_evm_init(void)
 {
+       platform_add_devices(omap2_evm_devices, ARRAY_SIZE(omap2_evm_devices));
        omap_board_config = omap2_evm_config;
        omap_board_config_size = ARRAY_SIZE(omap2_evm_config);
        omap_serial_init();
index 98273a91d3b8a6efc36adebf1aa84ee656ab9f81..d770c5824c162804c50a42f695c1e89fd92df869 100644 (file)
@@ -30,7 +30,8 @@
 #define __ASM_ARCH_OMAP2_EVM_H
 
 /* Placeholder for OMAP2EVM specific defines */
-#define OMAP24XX_ETHR_START            0x08000300
-#define OMAP24XX_ETHR_GPIO_IRQ         149
+#define OMAP2EVM_ETHR_START                    0x2c000000
+#define OMAP2EVM_ETHR_SIZE                     1024
+#define OMAP2EVM_ETHR_GPIO_IRQ         149
 
 #endif /* __ASM_ARCH_OMAP2_EVM_H */