]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP_LDP: Add Ethernet device support to make ldp boot succeess.
authorStanley.Miao <stanley.miao@windriver.com>
Tue, 11 Nov 2008 11:50:54 +0000 (19:50 +0800)
committerTony Lindgren <tony@atomide.com>
Thu, 13 Nov 2008 22:41:36 +0000 (14:41 -0800)
Add Ethernet device support in board-ldp.c to make ldp can boot and mount nfs
successfully.

Signed-off-by: Stanley.Miao <stanley.miao@windriver.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-ldp.c
arch/arm/plat-omap/include/mach/board-ldp.h

index 3ad5dba8519be661d2eb9583921ce435292dece5..c8e2360fb8820bab0d51f56a3cd8eb909556f0a1 100644 (file)
@@ -44,6 +44,7 @@
 #include "mmc-twl4030.h"
 
 
+#define SDP3430_SMC91X_CS      3
 #define CONFIG_DISABLE_HFCLK 1
 
 #define ENABLE_VAUX1_DEDICATED 0x03
 
 #define TWL4030_MSECURE_GPIO   22
 
+static struct resource ldp_smc911x_resources[] = {
+       [0] = {
+               .start  = OMAP34XX_ETHR_START,
+               .end    = OMAP34XX_ETHR_START + SZ_4K,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 0,
+               .end    = 0,
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
+       },
+};
+
+static struct platform_device ldp_smc911x_device = {
+       .name           = "smc911x",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(ldp_smc911x_resources),
+       .resource       = ldp_smc911x_resources,
+};
+
 static int ts_gpio;
 
 static int __init msecure_init(void)
@@ -177,14 +198,46 @@ static struct platform_device ldp_lcd_device = {
 };
 
 static struct platform_device *ldp_devices[] __initdata = {
+       &ldp_smc911x_device,
        &ldp_lcd_device,
 };
 
+static inline void __init ldp_init_smc911x(void)
+{
+       int eth_cs;
+       unsigned long cs_mem_base;
+       int eth_gpio = 0;
+
+       eth_cs = LDP_SMC911X_CS;
+
+       if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
+               printk(KERN_ERR "Failed to request GPMC mem for smc911x\n");
+               return;
+       }
+
+       ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
+       ldp_smc911x_resources[0].end   = cs_mem_base + 0xf;
+       udelay(100);
+
+       eth_gpio = LDP_SMC911X_GPIO;
+
+       ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
+
+       if (omap_request_gpio(eth_gpio) < 0) {
+               printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n",
+                               eth_gpio);
+               return;
+       }
+       omap_set_gpio_direction(eth_gpio, 1);
+}
+
+
 static void __init omap_ldp_init_irq(void)
 {
        omap2_init_common_hw(NULL);
        omap_init_irq();
        omap_gpio_init();
+       ldp_init_smc911x();
 }
 
 static struct omap_uart_config ldp_uart_config __initdata = {
index 66e2746c04cac80a8637b3ce28e74c01782591cd..f23399665212f11c988834b835c900fc2cc01038 100644 (file)
@@ -32,5 +32,8 @@
 extern void twl4030_bci_battery_init(void);
 
 #define TWL4030_IRQNUM         INT_34XX_SYS_NIRQ
-
+#define LDP_SMC911X_CS         1
+#define LDP_SMC911X_GPIO       152
+#define DEBUG_BASE             0x08000000
+#define OMAP34XX_ETHR_START    DEBUG_BASE
 #endif /* __ASM_ARCH_OMAP_LDP_H */