diff options
author | Stanley.Miao <stanley.miao@windriver.com> | 2008-12-10 20:36:53 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-12-10 20:36:53 -0500 |
commit | b1c056d20caa6fdd3481b348567f1f91e98aaa4b (patch) | |
tree | b4c3dace2722580f9f4b47103b89339431b07447 /arch/arm/mach-omap2/board-ldp.c | |
parent | ad636ad84e059e714013e009f76878b888de1f09 (diff) |
ARM: OMAP3: LDP: Add Ethernet device support to make ldp boot succeess
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>
Diffstat (limited to 'arch/arm/mach-omap2/board-ldp.c')
-rw-r--r-- | arch/arm/mach-omap2/board-ldp.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 1ea59986aa7a..43c7ac4b7f8f 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -38,11 +38,67 @@ | |||
38 | #include <asm/delay.h> | 38 | #include <asm/delay.h> |
39 | #include <mach/control.h> | 39 | #include <mach/control.h> |
40 | 40 | ||
41 | #define SDP3430_SMC91X_CS 3 | ||
42 | |||
43 | static struct resource ldp_smc911x_resources[] = { | ||
44 | [0] = { | ||
45 | .start = OMAP34XX_ETHR_START, | ||
46 | .end = OMAP34XX_ETHR_START + SZ_4K, | ||
47 | .flags = IORESOURCE_MEM, | ||
48 | }, | ||
49 | [1] = { | ||
50 | .start = 0, | ||
51 | .end = 0, | ||
52 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
53 | }, | ||
54 | }; | ||
55 | |||
56 | static struct platform_device ldp_smc911x_device = { | ||
57 | .name = "smc911x", | ||
58 | .id = -1, | ||
59 | .num_resources = ARRAY_SIZE(ldp_smc911x_resources), | ||
60 | .resource = ldp_smc911x_resources, | ||
61 | }; | ||
62 | |||
63 | static struct platform_device *ldp_devices[] __initdata = { | ||
64 | &ldp_smc911x_device, | ||
65 | }; | ||
66 | |||
67 | static inline void __init ldp_init_smc911x(void) | ||
68 | { | ||
69 | int eth_cs; | ||
70 | unsigned long cs_mem_base; | ||
71 | int eth_gpio = 0; | ||
72 | |||
73 | eth_cs = LDP_SMC911X_CS; | ||
74 | |||
75 | if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { | ||
76 | printk(KERN_ERR "Failed to request GPMC mem for smc911x\n"); | ||
77 | return; | ||
78 | } | ||
79 | |||
80 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; | ||
81 | ldp_smc911x_resources[0].end = cs_mem_base + 0xf; | ||
82 | udelay(100); | ||
83 | |||
84 | eth_gpio = LDP_SMC911X_GPIO; | ||
85 | |||
86 | ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); | ||
87 | |||
88 | if (omap_request_gpio(eth_gpio) < 0) { | ||
89 | printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", | ||
90 | eth_gpio); | ||
91 | return; | ||
92 | } | ||
93 | gpio_direction_input(eth_gpio); | ||
94 | } | ||
95 | |||
41 | static void __init omap_ldp_init_irq(void) | 96 | static void __init omap_ldp_init_irq(void) |
42 | { | 97 | { |
43 | omap2_init_common_hw(); | 98 | omap2_init_common_hw(); |
44 | omap_init_irq(); | 99 | omap_init_irq(); |
45 | omap_gpio_init(); | 100 | omap_gpio_init(); |
101 | ldp_init_smc911x(); | ||
46 | } | 102 | } |
47 | 103 | ||
48 | static struct omap_uart_config ldp_uart_config __initdata = { | 104 | static struct omap_uart_config ldp_uart_config __initdata = { |
@@ -64,6 +120,7 @@ static int __init omap_i2c_init(void) | |||
64 | static void __init omap_ldp_init(void) | 120 | static void __init omap_ldp_init(void) |
65 | { | 121 | { |
66 | omap_i2c_init(); | 122 | omap_i2c_init(); |
123 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); | ||
67 | omap_board_config = ldp_config; | 124 | omap_board_config = ldp_config; |
68 | omap_board_config_size = ARRAY_SIZE(ldp_config); | 125 | omap_board_config_size = ARRAY_SIZE(ldp_config); |
69 | omap_serial_init(); | 126 | omap_serial_init(); |