diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-cm-t3517.c')
-rw-r--r-- | arch/arm/mach-omap2/board-cm-t3517.c | 54 |
1 files changed, 37 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index 5b0c77732dfc..a27e3eee8292 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
@@ -124,8 +124,9 @@ static inline void cm_t3517_init_hecc(void) {} | |||
124 | #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) | 124 | #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) |
125 | #define RTC_IO_GPIO (153) | 125 | #define RTC_IO_GPIO (153) |
126 | #define RTC_WR_GPIO (154) | 126 | #define RTC_WR_GPIO (154) |
127 | #define RTC_RD_GPIO (160) | 127 | #define RTC_RD_GPIO (53) |
128 | #define RTC_CS_GPIO (163) | 128 | #define RTC_CS_GPIO (163) |
129 | #define RTC_CS_EN_GPIO (160) | ||
129 | 130 | ||
130 | struct v3020_platform_data cm_t3517_v3020_pdata = { | 131 | struct v3020_platform_data cm_t3517_v3020_pdata = { |
131 | .use_gpio = 1, | 132 | .use_gpio = 1, |
@@ -145,6 +146,16 @@ static struct platform_device cm_t3517_rtc_device = { | |||
145 | 146 | ||
146 | static void __init cm_t3517_init_rtc(void) | 147 | static void __init cm_t3517_init_rtc(void) |
147 | { | 148 | { |
149 | int err; | ||
150 | |||
151 | err = gpio_request(RTC_CS_EN_GPIO, "rtc cs en"); | ||
152 | if (err) { | ||
153 | pr_err("CM-T3517: rtc cs en gpio request failed: %d\n", err); | ||
154 | return; | ||
155 | } | ||
156 | |||
157 | gpio_direction_output(RTC_CS_EN_GPIO, 1); | ||
158 | |||
148 | platform_device_register(&cm_t3517_rtc_device); | 159 | platform_device_register(&cm_t3517_rtc_device); |
149 | } | 160 | } |
150 | #else | 161 | #else |
@@ -156,10 +167,10 @@ static inline void cm_t3517_init_rtc(void) {} | |||
156 | #define HSUSB2_RESET_GPIO (147) | 167 | #define HSUSB2_RESET_GPIO (147) |
157 | #define USB_HUB_RESET_GPIO (152) | 168 | #define USB_HUB_RESET_GPIO (152) |
158 | 169 | ||
159 | static struct ehci_hcd_omap_platform_data cm_t3517_ehci_pdata __initdata = { | 170 | static struct usbhs_omap_board_data cm_t3517_ehci_pdata __initdata = { |
160 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, | 171 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
161 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, | 172 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
162 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | 173 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, |
163 | 174 | ||
164 | .phy_reset = true, | 175 | .phy_reset = true, |
165 | .reset_gpio_port[0] = HSUSB1_RESET_GPIO, | 176 | .reset_gpio_port[0] = HSUSB1_RESET_GPIO, |
@@ -181,7 +192,7 @@ static int cm_t3517_init_usbh(void) | |||
181 | msleep(1); | 192 | msleep(1); |
182 | } | 193 | } |
183 | 194 | ||
184 | usb_ehci_init(&cm_t3517_ehci_pdata); | 195 | usbhs_init(&cm_t3517_ehci_pdata); |
185 | 196 | ||
186 | return 0; | 197 | return 0; |
187 | } | 198 | } |
@@ -214,12 +225,12 @@ static struct mtd_partition cm_t3517_nand_partitions[] = { | |||
214 | }, | 225 | }, |
215 | { | 226 | { |
216 | .name = "linux", | 227 | .name = "linux", |
217 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ | 228 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x2A0000 */ |
218 | .size = 32 * NAND_BLOCK_SIZE, | 229 | .size = 32 * NAND_BLOCK_SIZE, |
219 | }, | 230 | }, |
220 | { | 231 | { |
221 | .name = "rootfs", | 232 | .name = "rootfs", |
222 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */ | 233 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x6A0000 */ |
223 | .size = MTDPART_SIZ_FULL, | 234 | .size = MTDPART_SIZ_FULL, |
224 | }, | 235 | }, |
225 | }; | 236 | }; |
@@ -243,24 +254,29 @@ static inline void cm_t3517_init_nand(void) {} | |||
243 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { | 254 | static struct omap_board_config_kernel cm_t3517_config[] __initdata = { |
244 | }; | 255 | }; |
245 | 256 | ||
246 | static void __init cm_t3517_init_irq(void) | 257 | static void __init cm_t3517_init_early(void) |
247 | { | 258 | { |
248 | omap_board_config = cm_t3517_config; | ||
249 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | ||
250 | |||
251 | omap2_init_common_infrastructure(); | 259 | omap2_init_common_infrastructure(); |
252 | omap2_init_common_devices(NULL, NULL); | 260 | omap2_init_common_devices(NULL, NULL); |
253 | omap_init_irq(); | ||
254 | } | 261 | } |
255 | 262 | ||
263 | #ifdef CONFIG_OMAP_MUX | ||
256 | static struct omap_board_mux board_mux[] __initdata = { | 264 | static struct omap_board_mux board_mux[] __initdata = { |
257 | /* GPIO186 - Green LED */ | 265 | /* GPIO186 - Green LED */ |
258 | OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | 266 | OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
259 | /* RTC GPIOs: IO, WR#, RD#, CS# */ | 267 | |
268 | /* RTC GPIOs: */ | ||
269 | /* IO - GPIO153 */ | ||
260 | OMAP3_MUX(MCBSP4_DR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | 270 | OMAP3_MUX(MCBSP4_DR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
271 | /* WR# - GPIO154 */ | ||
261 | OMAP3_MUX(MCBSP4_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | 272 | OMAP3_MUX(MCBSP4_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
262 | OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | 273 | /* RD# - GPIO53 */ |
274 | OMAP3_MUX(GPMC_NCS2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
275 | /* CS# - GPIO163 */ | ||
263 | OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | 276 | OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), |
277 | /* CS EN - GPIO160 */ | ||
278 | OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
279 | |||
264 | /* HSUSB1 RESET */ | 280 | /* HSUSB1 RESET */ |
265 | OMAP3_MUX(UART2_TX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | 281 | OMAP3_MUX(UART2_TX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), |
266 | /* HSUSB2 RESET */ | 282 | /* HSUSB2 RESET */ |
@@ -270,11 +286,14 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
270 | 286 | ||
271 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 287 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
272 | }; | 288 | }; |
289 | #endif | ||
273 | 290 | ||
274 | static void __init cm_t3517_init(void) | 291 | static void __init cm_t3517_init(void) |
275 | { | 292 | { |
276 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 293 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
277 | omap_serial_init(); | 294 | omap_serial_init(); |
295 | omap_board_config = cm_t3517_config; | ||
296 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | ||
278 | cm_t3517_init_leds(); | 297 | cm_t3517_init_leds(); |
279 | cm_t3517_init_nand(); | 298 | cm_t3517_init_nand(); |
280 | cm_t3517_init_rtc(); | 299 | cm_t3517_init_rtc(); |
@@ -284,9 +303,10 @@ static void __init cm_t3517_init(void) | |||
284 | 303 | ||
285 | MACHINE_START(CM_T3517, "Compulab CM-T3517") | 304 | MACHINE_START(CM_T3517, "Compulab CM-T3517") |
286 | .boot_params = 0x80000100, | 305 | .boot_params = 0x80000100, |
287 | .map_io = omap3_map_io, | ||
288 | .reserve = omap_reserve, | 306 | .reserve = omap_reserve, |
289 | .init_irq = cm_t3517_init_irq, | 307 | .map_io = omap3_map_io, |
308 | .init_early = cm_t3517_init_early, | ||
309 | .init_irq = omap_init_irq, | ||
290 | .init_machine = cm_t3517_init, | 310 | .init_machine = cm_t3517_init, |
291 | .timer = &omap_timer, | 311 | .timer = &omap_timer, |
292 | MACHINE_END | 312 | MACHINE_END |