diff options
-rw-r--r-- | arch/arm/mach-omap2/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-h4.c | 46 | ||||
-rw-r--r-- | arch/arm/plat-omap/Kconfig | 9 | ||||
-rw-r--r-- | arch/arm/plat-omap/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-omap/debug-devices.c | 86 | ||||
-rw-r--r-- | include/asm-arm/arch-omap/board.h | 4 |
6 files changed, 102 insertions, 46 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 7393109f5c30..cf4268e46b03 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -21,7 +21,7 @@ config MACH_OMAP_GENERIC | |||
21 | config MACH_OMAP_H4 | 21 | config MACH_OMAP_H4 |
22 | bool "OMAP 2420 H4 board" | 22 | bool "OMAP 2420 H4 board" |
23 | depends on ARCH_OMAP2 && ARCH_OMAP24XX | 23 | depends on ARCH_OMAP2 && ARCH_OMAP24XX |
24 | select OMAP_DEBUG_LEDS if LEDS || LEDS_OMAP_DEBUG | 24 | select OMAP_DEBUG_DEVICES |
25 | 25 | ||
26 | config MACH_OMAP_APOLLON | 26 | config MACH_OMAP_APOLLON |
27 | bool "OMAP 2420 Apollon board" | 27 | bool "OMAP 2420 Apollon board" |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 452193f01531..f125f432cc3e 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -131,26 +131,6 @@ static struct platform_device h4_flash_device = { | |||
131 | .resource = &h4_flash_resource, | 131 | .resource = &h4_flash_resource, |
132 | }; | 132 | }; |
133 | 133 | ||
134 | static struct resource h4_smc91x_resources[] = { | ||
135 | [0] = { | ||
136 | .start = OMAP24XX_ETHR_START, /* Physical */ | ||
137 | .end = OMAP24XX_ETHR_START + 0xf, | ||
138 | .flags = IORESOURCE_MEM, | ||
139 | }, | ||
140 | [1] = { | ||
141 | .start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ), | ||
142 | .end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ), | ||
143 | .flags = IORESOURCE_IRQ, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | static struct platform_device h4_smc91x_device = { | ||
148 | .name = "smc91x", | ||
149 | .id = -1, | ||
150 | .num_resources = ARRAY_SIZE(h4_smc91x_resources), | ||
151 | .resource = h4_smc91x_resources, | ||
152 | }; | ||
153 | |||
154 | /* Select between the IrDA and aGPS module | 134 | /* Select between the IrDA and aGPS module |
155 | */ | 135 | */ |
156 | static int h4_select_irda(struct device *dev, int state) | 136 | static int h4_select_irda(struct device *dev, int state) |
@@ -266,29 +246,14 @@ static struct platform_device h4_lcd_device = { | |||
266 | .id = -1, | 246 | .id = -1, |
267 | }; | 247 | }; |
268 | 248 | ||
269 | static struct resource h4_led_resources[] = { | ||
270 | [0] = { | ||
271 | .flags = IORESOURCE_MEM, | ||
272 | }, | ||
273 | }; | ||
274 | |||
275 | static struct platform_device h4_led_device = { | ||
276 | .name = "omap_dbg_led", | ||
277 | .id = -1, | ||
278 | .num_resources = ARRAY_SIZE(h4_led_resources), | ||
279 | .resource = h4_led_resources, | ||
280 | }; | ||
281 | |||
282 | static struct platform_device *h4_devices[] __initdata = { | 249 | static struct platform_device *h4_devices[] __initdata = { |
283 | &h4_smc91x_device, | ||
284 | &h4_flash_device, | 250 | &h4_flash_device, |
285 | &h4_irda_device, | 251 | &h4_irda_device, |
286 | &h4_kp_device, | 252 | &h4_kp_device, |
287 | &h4_lcd_device, | 253 | &h4_lcd_device, |
288 | &h4_led_device, | ||
289 | }; | 254 | }; |
290 | 255 | ||
291 | static inline void __init h4_init_smc91x(void) | 256 | static inline void __init h4_init_debug(void) |
292 | { | 257 | { |
293 | /* Make sure CS1 timings are correct */ | 258 | /* Make sure CS1 timings are correct */ |
294 | GPMC_CONFIG1_1 = 0x00011200; | 259 | GPMC_CONFIG1_1 = 0x00011200; |
@@ -301,12 +266,8 @@ static inline void __init h4_init_smc91x(void) | |||
301 | udelay(100); | 266 | udelay(100); |
302 | 267 | ||
303 | omap_cfg_reg(M15_24XX_GPIO92); | 268 | omap_cfg_reg(M15_24XX_GPIO92); |
304 | if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) { | 269 | if (debug_card_init(cs_mem_base, OMAP24XX_ETHR_GPIO_IRQ) < 0) |
305 | printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", | 270 | gpmc_cs_free(eth_cs); |
306 | OMAP24XX_ETHR_GPIO_IRQ); | ||
307 | return; | ||
308 | } | ||
309 | omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1); | ||
310 | } | 271 | } |
311 | 272 | ||
312 | static void __init omap_h4_init_irq(void) | 273 | static void __init omap_h4_init_irq(void) |
@@ -314,7 +275,6 @@ static void __init omap_h4_init_irq(void) | |||
314 | omap2_init_common_hw(); | 275 | omap2_init_common_hw(); |
315 | omap_init_irq(); | 276 | omap_init_irq(); |
316 | omap_gpio_init(); | 277 | omap_gpio_init(); |
317 | h4_init_smc91x(); | ||
318 | } | 278 | } |
319 | 279 | ||
320 | static struct omap_uart_config h4_uart_config __initdata = { | 280 | static struct omap_uart_config h4_uart_config __initdata = { |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index cfc69f3842fd..c1f7e5a819a3 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -20,10 +20,15 @@ endchoice | |||
20 | 20 | ||
21 | comment "OMAP Feature Selections" | 21 | comment "OMAP Feature Selections" |
22 | 22 | ||
23 | config OMAP_DEBUG_LEDS | 23 | config OMAP_DEBUG_DEVICES |
24 | bool | 24 | bool |
25 | help | 25 | help |
26 | For debug card leds on TI reference boards. | 26 | For debug cards on TI reference boards. |
27 | |||
28 | config OMAP_DEBUG_LEDS | ||
29 | bool | ||
30 | depends on OMAP_DEBUG_DEVICES | ||
31 | default y if LEDS || LEDS_OMAP_DEBUG | ||
27 | 32 | ||
28 | config OMAP_RESET_CLOCKS | 33 | config OMAP_RESET_CLOCKS |
29 | bool "Reset unused clocks during boot" | 34 | bool "Reset unused clocks during boot" |
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 41a3c1cf3bd4..2549129aabc6 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile | |||
@@ -17,4 +17,5 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o | |||
17 | 17 | ||
18 | obj-$(CONFIG_CPU_FREQ) += cpu-omap.o | 18 | obj-$(CONFIG_CPU_FREQ) += cpu-omap.o |
19 | obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o | 19 | obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o |
20 | obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o | ||
20 | obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o | 21 | obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o |
diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c new file mode 100644 index 000000000000..83a5f8b91857 --- /dev/null +++ b/arch/arm/plat-omap/debug-devices.c | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/plat-omap/debug-devices.c | ||
3 | * | ||
4 | * Copyright (C) 2005 Nokia Corporation | ||
5 | * Modified from mach-omap2/board-h4.c | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | |||
16 | #include <asm/hardware.h> | ||
17 | #include <asm/io.h> | ||
18 | |||
19 | #include <asm/arch/board.h> | ||
20 | #include <asm/arch/gpio.h> | ||
21 | |||
22 | |||
23 | /* Many OMAP development platforms reuse the same "debug board"; these | ||
24 | * platforms include H2, H3, H4, and Perseus2. | ||
25 | */ | ||
26 | |||
27 | static struct resource smc91x_resources[] = { | ||
28 | [0] = { | ||
29 | .flags = IORESOURCE_MEM, | ||
30 | }, | ||
31 | [1] = { | ||
32 | .flags = IORESOURCE_IRQ, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | static struct platform_device smc91x_device = { | ||
37 | .name = "smc91x", | ||
38 | .id = -1, | ||
39 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
40 | .resource = smc91x_resources, | ||
41 | }; | ||
42 | |||
43 | static struct resource led_resources[] = { | ||
44 | [0] = { | ||
45 | .flags = IORESOURCE_MEM, | ||
46 | }, | ||
47 | }; | ||
48 | |||
49 | static struct platform_device led_device = { | ||
50 | .name = "omap_dbg_led", | ||
51 | .id = -1, | ||
52 | .num_resources = ARRAY_SIZE(led_resources), | ||
53 | .resource = led_resources, | ||
54 | }; | ||
55 | |||
56 | static struct platform_device *debug_devices[] __initdata = { | ||
57 | &smc91x_device, | ||
58 | &led_device, | ||
59 | /* ps2 kbd + mouse ports */ | ||
60 | /* 4 extra uarts */ | ||
61 | /* 6 input dip switches */ | ||
62 | /* 8 output pins */ | ||
63 | }; | ||
64 | |||
65 | int __init debug_card_init(u32 addr, unsigned gpio) | ||
66 | { | ||
67 | int status; | ||
68 | |||
69 | smc91x_resources[0].start = addr + 0x300; | ||
70 | smc91x_resources[0].end = addr + 0x30f; | ||
71 | |||
72 | smc91x_resources[1].start = OMAP_GPIO_IRQ(gpio); | ||
73 | smc91x_resources[1].end = OMAP_GPIO_IRQ(gpio); | ||
74 | |||
75 | status = omap_request_gpio(gpio); | ||
76 | if (status < 0) { | ||
77 | printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio); | ||
78 | return status; | ||
79 | } | ||
80 | omap_set_gpio_direction(gpio, 1); | ||
81 | |||
82 | led_resources[0].start = addr; | ||
83 | led_resources[0].end = addr + SZ_4K - 1; | ||
84 | |||
85 | return platform_add_devices(debug_devices, ARRAY_SIZE(debug_devices)); | ||
86 | } | ||
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h index 031672c56377..db44c5d1f1a0 100644 --- a/include/asm-arm/arch-omap/board.h +++ b/include/asm-arm/arch-omap/board.h | |||
@@ -179,4 +179,8 @@ extern const void *omap_get_var_config(u16 tag, size_t *len); | |||
179 | extern struct omap_board_config_kernel *omap_board_config; | 179 | extern struct omap_board_config_kernel *omap_board_config; |
180 | extern int omap_board_config_size; | 180 | extern int omap_board_config_size; |
181 | 181 | ||
182 | |||
183 | /* for TI reference platforms sharing the same debug card */ | ||
184 | extern int debug_card_init(u32 addr, unsigned gpio); | ||
185 | |||
182 | #endif | 186 | #endif |