diff options
author | Vikram Pandita <vikram.pandita@ti.com> | 2009-05-28 17:04:04 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-05-28 17:04:04 -0400 |
commit | 577145f45487b41b4d47eeaedb9d37e494f80715 (patch) | |
tree | f2dc96a149fe43053463d2fe6ef10b749ce41458 | |
parent | f52eeee83d360d536cab1c0296eae0ec5f05e4dd (diff) |
ARM: OMAP3: Add support for OMAP3 Zoom2 board
This patch creates the minimal OMAP3 Zoom2 board support.
Signed-off-by: Mikkel Christensen <mlc@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-zoom-debugboard.c | 160 | ||||
-rw-r--r-- | arch/arm/mach-omap2/board-zoom2.c | 110 |
4 files changed, 277 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 64ab386a65c7..f6cf903f94a3 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -67,3 +67,7 @@ config MACH_OMAP_3430SDP | |||
67 | config MACH_NOKIA_RX51 | 67 | config MACH_NOKIA_RX51 |
68 | bool "Nokia RX-51 board" | 68 | bool "Nokia RX-51 board" |
69 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 69 | depends on ARCH_OMAP3 && ARCH_OMAP34XX |
70 | |||
71 | config MACH_OMAP_ZOOM2 | ||
72 | bool "OMAP3 Zoom2 board" | ||
73 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | ||
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index e4f6f61c40e7..4cdb31801d2f 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -53,7 +53,9 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ | |||
53 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ | 53 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ |
54 | board-rx51-peripherals.o \ | 54 | board-rx51-peripherals.o \ |
55 | mmc-twl4030.o | 55 | mmc-twl4030.o |
56 | 56 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ | |
57 | mmc-twl4030.o \ | ||
58 | board-zoom-debugboard.o | ||
57 | # Platform specific device init code | 59 | # Platform specific device init code |
58 | ifeq ($(CONFIG_USB_MUSB_SOC),y) | 60 | ifeq ($(CONFIG_USB_MUSB_SOC),y) |
59 | obj-y += usb-musb.o | 61 | obj-y += usb-musb.o |
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c new file mode 100644 index 000000000000..bac5c4321ff7 --- /dev/null +++ b/arch/arm/mach-omap2/board-zoom-debugboard.c | |||
@@ -0,0 +1,160 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Texas Instruments Inc. | ||
3 | * Mikkel Christensen <mlc@ti.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/gpio.h> | ||
13 | #include <linux/serial_8250.h> | ||
14 | #include <linux/smsc911x.h> | ||
15 | |||
16 | #include <mach/gpmc.h> | ||
17 | |||
18 | #define ZOOM2_SMSC911X_CS 7 | ||
19 | #define ZOOM2_SMSC911X_GPIO 158 | ||
20 | #define ZOOM2_QUADUART_CS 3 | ||
21 | #define ZOOM2_QUADUART_GPIO 102 | ||
22 | #define QUART_CLK 1843200 | ||
23 | #define DEBUG_BASE 0x08000000 | ||
24 | #define ZOOM2_ETHR_START DEBUG_BASE | ||
25 | |||
26 | static struct resource zoom2_smsc911x_resources[] = { | ||
27 | [0] = { | ||
28 | .start = ZOOM2_ETHR_START, | ||
29 | .end = ZOOM2_ETHR_START + SZ_4K, | ||
30 | .flags = IORESOURCE_MEM, | ||
31 | }, | ||
32 | [1] = { | ||
33 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
34 | }, | ||
35 | }; | ||
36 | |||
37 | static struct smsc911x_platform_config zoom2_smsc911x_config = { | ||
38 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
39 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | ||
40 | .flags = SMSC911X_USE_32BIT, | ||
41 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
42 | }; | ||
43 | |||
44 | static struct platform_device zoom2_smsc911x_device = { | ||
45 | .name = "smsc911x", | ||
46 | .id = -1, | ||
47 | .num_resources = ARRAY_SIZE(zoom2_smsc911x_resources), | ||
48 | .resource = zoom2_smsc911x_resources, | ||
49 | .dev = { | ||
50 | .platform_data = &zoom2_smsc911x_config, | ||
51 | }, | ||
52 | }; | ||
53 | |||
54 | static inline void __init zoom2_init_smsc911x(void) | ||
55 | { | ||
56 | int eth_cs; | ||
57 | unsigned long cs_mem_base; | ||
58 | int eth_gpio = 0; | ||
59 | |||
60 | eth_cs = ZOOM2_SMSC911X_CS; | ||
61 | |||
62 | if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { | ||
63 | printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n"); | ||
64 | return; | ||
65 | } | ||
66 | |||
67 | zoom2_smsc911x_resources[0].start = cs_mem_base + 0x0; | ||
68 | zoom2_smsc911x_resources[0].end = cs_mem_base + 0xff; | ||
69 | |||
70 | eth_gpio = ZOOM2_SMSC911X_GPIO; | ||
71 | |||
72 | zoom2_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); | ||
73 | |||
74 | if (gpio_request(eth_gpio, "smsc911x irq") < 0) { | ||
75 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", | ||
76 | eth_gpio); | ||
77 | return; | ||
78 | } | ||
79 | gpio_direction_input(eth_gpio); | ||
80 | } | ||
81 | |||
82 | static struct plat_serial8250_port serial_platform_data[] = { | ||
83 | { | ||
84 | .mapbase = 0x10000000, | ||
85 | .irq = OMAP_GPIO_IRQ(102), | ||
86 | .flags = UPF_BOOT_AUTOCONF|UPF_IOREMAP|UPF_SHARE_IRQ, | ||
87 | .iotype = UPIO_MEM, | ||
88 | .regshift = 1, | ||
89 | .uartclk = QUART_CLK, | ||
90 | }, { | ||
91 | .flags = 0 | ||
92 | } | ||
93 | }; | ||
94 | |||
95 | static struct platform_device zoom2_debugboard_serial_device = { | ||
96 | .name = "serial8250", | ||
97 | .id = PLAT8250_DEV_PLATFORM1, | ||
98 | .dev = { | ||
99 | .platform_data = serial_platform_data, | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | static inline void __init zoom2_init_quaduart(void) | ||
104 | { | ||
105 | int quart_cs; | ||
106 | unsigned long cs_mem_base; | ||
107 | int quart_gpio = 0; | ||
108 | |||
109 | quart_cs = ZOOM2_QUADUART_CS; | ||
110 | |||
111 | if (gpmc_cs_request(quart_cs, SZ_1M, &cs_mem_base) < 0) { | ||
112 | printk(KERN_ERR "Failed to request GPMC mem" | ||
113 | "for Quad UART(TL16CP754C)\n"); | ||
114 | return; | ||
115 | } | ||
116 | |||
117 | quart_gpio = ZOOM2_QUADUART_GPIO; | ||
118 | |||
119 | if (gpio_request(quart_gpio, "TL16CP754C GPIO") < 0) { | ||
120 | printk(KERN_ERR "Failed to request GPIO%d for TL16CP754C\n", | ||
121 | quart_gpio); | ||
122 | return; | ||
123 | } | ||
124 | gpio_direction_input(quart_gpio); | ||
125 | } | ||
126 | |||
127 | static inline int omap_zoom2_debugboard_detect(void) | ||
128 | { | ||
129 | int debug_board_detect = 0; | ||
130 | |||
131 | debug_board_detect = ZOOM2_SMSC911X_GPIO; | ||
132 | |||
133 | if (gpio_request(debug_board_detect, "Zoom2 debug board detect") < 0) { | ||
134 | printk(KERN_ERR "Failed to request GPIO%d for Zoom2 debug" | ||
135 | "board detect\n", debug_board_detect); | ||
136 | return 0; | ||
137 | } | ||
138 | gpio_direction_input(debug_board_detect); | ||
139 | |||
140 | if (!gpio_get_value(debug_board_detect)) { | ||
141 | gpio_free(debug_board_detect); | ||
142 | return 0; | ||
143 | } | ||
144 | return 1; | ||
145 | } | ||
146 | |||
147 | static struct platform_device *zoom2_devices[] __initdata = { | ||
148 | &zoom2_smsc911x_device, | ||
149 | &zoom2_debugboard_serial_device, | ||
150 | }; | ||
151 | |||
152 | int __init omap_zoom2_debugboard_init(void) | ||
153 | { | ||
154 | if (!omap_zoom2_debugboard_detect()) | ||
155 | return 0; | ||
156 | |||
157 | zoom2_init_smsc911x(); | ||
158 | zoom2_init_quaduart(); | ||
159 | return platform_add_devices(zoom2_devices, ARRAY_SIZE(zoom2_devices)); | ||
160 | } | ||
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c new file mode 100644 index 000000000000..bcc0f7632dea --- /dev/null +++ b/arch/arm/mach-omap2/board-zoom2.c | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Texas Instruments Inc. | ||
3 | * Mikkel Christensen <mlc@ti.com> | ||
4 | * | ||
5 | * Modified from mach-omap2/board-ldp.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 | #include <linux/gpio.h> | ||
16 | #include <linux/i2c/twl4030.h> | ||
17 | |||
18 | #include <asm/mach-types.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | |||
21 | #include <mach/common.h> | ||
22 | #include <mach/usb.h> | ||
23 | |||
24 | #include "mmc-twl4030.h" | ||
25 | |||
26 | static void __init omap_zoom2_init_irq(void) | ||
27 | { | ||
28 | omap2_init_common_hw(NULL); | ||
29 | omap_init_irq(); | ||
30 | omap_gpio_init(); | ||
31 | } | ||
32 | |||
33 | static struct omap_uart_config zoom2_uart_config __initdata = { | ||
34 | .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), | ||
35 | }; | ||
36 | |||
37 | static struct omap_board_config_kernel zoom2_config[] __initdata = { | ||
38 | { OMAP_TAG_UART, &zoom2_uart_config }, | ||
39 | }; | ||
40 | |||
41 | static struct twl4030_gpio_platform_data zoom2_gpio_data = { | ||
42 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
43 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
44 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
45 | }; | ||
46 | |||
47 | static struct twl4030_platform_data zoom2_twldata = { | ||
48 | .irq_base = TWL4030_IRQ_BASE, | ||
49 | .irq_end = TWL4030_IRQ_END, | ||
50 | |||
51 | /* platform_data for children goes here */ | ||
52 | .gpio = &zoom2_gpio_data, | ||
53 | }; | ||
54 | |||
55 | static struct i2c_board_info __initdata zoom2_i2c_boardinfo[] = { | ||
56 | { | ||
57 | I2C_BOARD_INFO("twl4030", 0x48), | ||
58 | .flags = I2C_CLIENT_WAKE, | ||
59 | .irq = INT_34XX_SYS_NIRQ, | ||
60 | .platform_data = &zoom2_twldata, | ||
61 | }, | ||
62 | }; | ||
63 | |||
64 | static int __init omap_i2c_init(void) | ||
65 | { | ||
66 | omap_register_i2c_bus(1, 2600, zoom2_i2c_boardinfo, | ||
67 | ARRAY_SIZE(zoom2_i2c_boardinfo)); | ||
68 | omap_register_i2c_bus(2, 400, NULL, 0); | ||
69 | omap_register_i2c_bus(3, 400, NULL, 0); | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static struct twl4030_hsmmc_info mmc[] __initdata = { | ||
74 | { | ||
75 | .mmc = 1, | ||
76 | .wires = 4, | ||
77 | .gpio_cd = -EINVAL, | ||
78 | .gpio_wp = -EINVAL, | ||
79 | }, | ||
80 | {} /* Terminator */ | ||
81 | }; | ||
82 | |||
83 | extern int __init omap_zoom2_debugboard_init(void); | ||
84 | |||
85 | static void __init omap_zoom2_init(void) | ||
86 | { | ||
87 | omap_i2c_init(); | ||
88 | omap_board_config = zoom2_config; | ||
89 | omap_board_config_size = ARRAY_SIZE(zoom2_config); | ||
90 | omap_serial_init(); | ||
91 | omap_zoom2_debugboard_init(); | ||
92 | twl4030_mmc_init(mmc); | ||
93 | usb_musb_init(); | ||
94 | } | ||
95 | |||
96 | static void __init omap_zoom2_map_io(void) | ||
97 | { | ||
98 | omap2_set_globals_343x(); | ||
99 | omap2_map_common_io(); | ||
100 | } | ||
101 | |||
102 | MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") | ||
103 | .phys_io = 0x48000000, | ||
104 | .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, | ||
105 | .boot_params = 0x80000100, | ||
106 | .map_io = omap_zoom2_map_io, | ||
107 | .init_irq = omap_zoom2_init_irq, | ||
108 | .init_machine = omap_zoom2_init, | ||
109 | .timer = &omap_timer, | ||
110 | MACHINE_END | ||