Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/board-am3517evm.c |
| 3 | * |
| 4 | * Copyright (C) 2009 Texas Instruments Incorporated |
| 5 | * Author: Ranjith Lohithakshan <ranjithl@ti.com> |
| 6 | * |
| 7 | * Based on mach-omap2/board-omap3evm.c |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU General Public License as published by the |
| 11 | * Free Software Foundation version 2. |
| 12 | * |
| 13 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind, |
| 14 | * whether express or implied; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * General Public License for more details. |
| 17 | */ |
| 18 | |
| 19 | #include <linux/kernel.h> |
| 20 | #include <linux/init.h> |
| 21 | #include <linux/platform_device.h> |
| 22 | #include <linux/gpio.h> |
Vaibhav Hiremath | 5d4292a | 2010-02-13 11:47:57 +0000 | [diff] [blame] | 23 | #include <linux/i2c/pca953x.h> |
Sriram | 91733631 | 2010-05-10 14:29:16 -0700 | [diff] [blame] | 24 | #include <linux/can/platform/ti_hecc.h> |
Sriram | 56881d2 | 2010-05-10 14:29:17 -0700 | [diff] [blame] | 25 | #include <linux/davinci_emac.h> |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 26 | |
| 27 | #include <mach/hardware.h> |
Vaibhav Hiremath | e3d4d0a | 2010-02-15 10:03:35 -0800 | [diff] [blame] | 28 | #include <mach/am35xx.h> |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 29 | #include <asm/mach-types.h> |
| 30 | #include <asm/mach/arch.h> |
| 31 | #include <asm/mach/map.h> |
| 32 | |
| 33 | #include <plat/board.h> |
| 34 | #include <plat/common.h> |
Sriram | 56881d2 | 2010-05-10 14:29:17 -0700 | [diff] [blame] | 35 | #include <plat/control.h> |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 36 | #include <plat/usb.h> |
Vaibhav Hiremath | c3d3332 | 2010-01-13 17:17:10 +0530 | [diff] [blame] | 37 | #include <plat/display.h> |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 38 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 39 | #include "mux.h" |
| 40 | |
Sriram | 56881d2 | 2010-05-10 14:29:17 -0700 | [diff] [blame] | 41 | #define AM35XX_EVM_PHY_MASK (0xF) |
| 42 | #define AM35XX_EVM_MDIO_FREQUENCY (1000000) |
| 43 | |
| 44 | static struct emac_platform_data am3517_evm_emac_pdata = { |
| 45 | .phy_mask = AM35XX_EVM_PHY_MASK, |
| 46 | .mdio_max_freq = AM35XX_EVM_MDIO_FREQUENCY, |
| 47 | .rmii_en = 1, |
| 48 | }; |
| 49 | |
| 50 | static struct resource am3517_emac_resources[] = { |
| 51 | { |
| 52 | .start = AM35XX_IPSS_EMAC_BASE, |
| 53 | .end = AM35XX_IPSS_EMAC_BASE + 0x3FFFF, |
| 54 | .flags = IORESOURCE_MEM, |
| 55 | }, |
| 56 | { |
| 57 | .start = INT_35XX_EMAC_C0_RXTHRESH_IRQ, |
| 58 | .end = INT_35XX_EMAC_C0_RXTHRESH_IRQ, |
| 59 | .flags = IORESOURCE_IRQ, |
| 60 | }, |
| 61 | { |
| 62 | .start = INT_35XX_EMAC_C0_RX_PULSE_IRQ, |
| 63 | .end = INT_35XX_EMAC_C0_RX_PULSE_IRQ, |
| 64 | .flags = IORESOURCE_IRQ, |
| 65 | }, |
| 66 | { |
| 67 | .start = INT_35XX_EMAC_C0_TX_PULSE_IRQ, |
| 68 | .end = INT_35XX_EMAC_C0_TX_PULSE_IRQ, |
| 69 | .flags = IORESOURCE_IRQ, |
| 70 | }, |
| 71 | { |
| 72 | .start = INT_35XX_EMAC_C0_MISC_PULSE_IRQ, |
| 73 | .end = INT_35XX_EMAC_C0_MISC_PULSE_IRQ, |
| 74 | .flags = IORESOURCE_IRQ, |
| 75 | }, |
| 76 | }; |
| 77 | |
| 78 | static struct platform_device am3517_emac_device = { |
| 79 | .name = "davinci_emac", |
| 80 | .id = -1, |
| 81 | .num_resources = ARRAY_SIZE(am3517_emac_resources), |
| 82 | .resource = am3517_emac_resources, |
| 83 | }; |
| 84 | |
| 85 | static void am3517_enable_ethernet_int(void) |
| 86 | { |
| 87 | u32 regval; |
| 88 | |
| 89 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); |
| 90 | regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR | |
| 91 | AM35XX_CPGMAC_C0_TX_PULSE_CLR | |
| 92 | AM35XX_CPGMAC_C0_MISC_PULSE_CLR | |
| 93 | AM35XX_CPGMAC_C0_RX_THRESH_CLR); |
| 94 | omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR); |
| 95 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); |
| 96 | } |
| 97 | |
| 98 | static void am3517_disable_ethernet_int(void) |
| 99 | { |
| 100 | u32 regval; |
| 101 | |
| 102 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); |
| 103 | regval = (regval | AM35XX_CPGMAC_C0_RX_PULSE_CLR | |
| 104 | AM35XX_CPGMAC_C0_TX_PULSE_CLR); |
| 105 | omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR); |
| 106 | regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); |
| 107 | } |
| 108 | |
| 109 | void am3517_evm_ethernet_init(struct emac_platform_data *pdata) |
| 110 | { |
| 111 | unsigned int regval; |
| 112 | |
| 113 | pdata->ctrl_reg_offset = AM35XX_EMAC_CNTRL_OFFSET; |
| 114 | pdata->ctrl_mod_reg_offset = AM35XX_EMAC_CNTRL_MOD_OFFSET; |
| 115 | pdata->ctrl_ram_offset = AM35XX_EMAC_CNTRL_RAM_OFFSET; |
| 116 | pdata->mdio_reg_offset = AM35XX_EMAC_MDIO_OFFSET; |
| 117 | pdata->ctrl_ram_size = AM35XX_EMAC_CNTRL_RAM_SIZE; |
| 118 | pdata->version = EMAC_VERSION_2; |
| 119 | pdata->hw_ram_addr = AM35XX_EMAC_HW_RAM_ADDR; |
| 120 | pdata->interrupt_enable = am3517_enable_ethernet_int; |
| 121 | pdata->interrupt_disable = am3517_disable_ethernet_int; |
| 122 | am3517_emac_device.dev.platform_data = pdata; |
| 123 | platform_device_register(&am3517_emac_device); |
| 124 | |
| 125 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); |
| 126 | regval = regval & (~(AM35XX_CPGMACSS_SW_RST)); |
| 127 | omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET); |
| 128 | regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); |
| 129 | |
| 130 | return ; |
| 131 | } |
| 132 | |
| 133 | |
| 134 | |
Vaibhav Hiremath | c3d3332 | 2010-01-13 17:17:10 +0530 | [diff] [blame] | 135 | #define LCD_PANEL_PWR 176 |
| 136 | #define LCD_PANEL_BKLIGHT_PWR 182 |
| 137 | #define LCD_PANEL_PWM 181 |
| 138 | |
stanley.miao | b91da66 | 2010-05-13 12:39:29 +0000 | [diff] [blame] | 139 | static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = { |
Vaibhav Hiremath | f2afbbb | 2010-02-13 11:47:56 +0000 | [diff] [blame] | 140 | { |
| 141 | I2C_BOARD_INFO("s35390a", 0x30), |
| 142 | .type = "s35390a", |
| 143 | }, |
| 144 | }; |
| 145 | |
| 146 | /* |
| 147 | * RTC - S35390A |
| 148 | */ |
| 149 | #define GPIO_RTCS35390A_IRQ 55 |
| 150 | |
| 151 | static void __init am3517_evm_rtc_init(void) |
| 152 | { |
| 153 | int r; |
| 154 | |
| 155 | omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP); |
| 156 | r = gpio_request(GPIO_RTCS35390A_IRQ, "rtcs35390a-irq"); |
| 157 | if (r < 0) { |
| 158 | printk(KERN_WARNING "failed to request GPIO#%d\n", |
| 159 | GPIO_RTCS35390A_IRQ); |
| 160 | return; |
| 161 | } |
| 162 | r = gpio_direction_input(GPIO_RTCS35390A_IRQ); |
| 163 | if (r < 0) { |
| 164 | printk(KERN_WARNING "GPIO#%d cannot be configured as input\n", |
| 165 | GPIO_RTCS35390A_IRQ); |
| 166 | gpio_free(GPIO_RTCS35390A_IRQ); |
| 167 | return; |
| 168 | } |
stanley.miao | b91da66 | 2010-05-13 12:39:29 +0000 | [diff] [blame] | 169 | am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ); |
Vaibhav Hiremath | f2afbbb | 2010-02-13 11:47:56 +0000 | [diff] [blame] | 170 | } |
| 171 | |
Vaibhav Hiremath | 5d4292a | 2010-02-13 11:47:57 +0000 | [diff] [blame] | 172 | /* |
| 173 | * I2C GPIO Expander - TCA6416 |
| 174 | */ |
| 175 | |
| 176 | /* Mounted on Base-Board */ |
| 177 | static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = { |
| 178 | .gpio_base = OMAP_MAX_GPIO_LINES, |
| 179 | }; |
stanley.miao | b91da66 | 2010-05-13 12:39:29 +0000 | [diff] [blame] | 180 | static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { |
Vaibhav Hiremath | 5d4292a | 2010-02-13 11:47:57 +0000 | [diff] [blame] | 181 | { |
| 182 | I2C_BOARD_INFO("tca6416", 0x21), |
| 183 | .platform_data = &am3517evm_gpio_expander_info_0, |
| 184 | }, |
| 185 | }; |
| 186 | |
| 187 | /* Mounted on UI Card */ |
| 188 | static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = { |
| 189 | .gpio_base = OMAP_MAX_GPIO_LINES + 16, |
| 190 | }; |
| 191 | static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = { |
| 192 | .gpio_base = OMAP_MAX_GPIO_LINES + 32, |
| 193 | }; |
stanley.miao | b91da66 | 2010-05-13 12:39:29 +0000 | [diff] [blame] | 194 | static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = { |
Vaibhav Hiremath | 5d4292a | 2010-02-13 11:47:57 +0000 | [diff] [blame] | 195 | { |
| 196 | I2C_BOARD_INFO("tca6416", 0x20), |
| 197 | .platform_data = &am3517evm_ui_gpio_expander_info_1, |
| 198 | }, |
| 199 | { |
| 200 | I2C_BOARD_INFO("tca6416", 0x21), |
| 201 | .platform_data = &am3517evm_ui_gpio_expander_info_2, |
| 202 | }, |
| 203 | }; |
| 204 | |
Vaibhav Hiremath | 1f738dc | 2010-02-17 14:09:28 -0800 | [diff] [blame] | 205 | static int __init am3517_evm_i2c_init(void) |
| 206 | { |
| 207 | omap_register_i2c_bus(1, 400, NULL, 0); |
stanley.miao | b91da66 | 2010-05-13 12:39:29 +0000 | [diff] [blame] | 208 | omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo, |
| 209 | ARRAY_SIZE(am3517evm_i2c2_boardinfo)); |
| 210 | omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo, |
| 211 | ARRAY_SIZE(am3517evm_i2c3_boardinfo)); |
Vaibhav Hiremath | 1f738dc | 2010-02-17 14:09:28 -0800 | [diff] [blame] | 212 | |
| 213 | return 0; |
| 214 | } |
| 215 | |
Vaibhav Hiremath | c3d3332 | 2010-01-13 17:17:10 +0530 | [diff] [blame] | 216 | static int lcd_enabled; |
| 217 | static int dvi_enabled; |
| 218 | |
Ajay Kumar Gupta | de99771 | 2010-05-10 14:29:19 -0700 | [diff] [blame] | 219 | #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ |
| 220 | defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE) |
Vaibhav Hiremath | c3d3332 | 2010-01-13 17:17:10 +0530 | [diff] [blame] | 221 | static void __init am3517_evm_display_init(void) |
| 222 | { |
| 223 | int r; |
| 224 | |
| 225 | omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP); |
| 226 | omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN); |
| 227 | omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN); |
| 228 | /* |
| 229 | * Enable GPIO 182 = LCD Backlight Power |
| 230 | */ |
| 231 | r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr"); |
| 232 | if (r) { |
| 233 | printk(KERN_ERR "failed to get lcd_backlight_pwr\n"); |
| 234 | return; |
| 235 | } |
| 236 | gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1); |
| 237 | /* |
| 238 | * Enable GPIO 181 = LCD Panel PWM |
| 239 | */ |
| 240 | r = gpio_request(LCD_PANEL_PWM, "lcd_pwm"); |
| 241 | if (r) { |
| 242 | printk(KERN_ERR "failed to get lcd_pwm\n"); |
| 243 | goto err_1; |
| 244 | } |
| 245 | gpio_direction_output(LCD_PANEL_PWM, 1); |
| 246 | /* |
| 247 | * Enable GPIO 176 = LCD Panel Power enable pin |
| 248 | */ |
| 249 | r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr"); |
| 250 | if (r) { |
| 251 | printk(KERN_ERR "failed to get lcd_panel_pwr\n"); |
| 252 | goto err_2; |
| 253 | } |
| 254 | gpio_direction_output(LCD_PANEL_PWR, 1); |
| 255 | |
| 256 | printk(KERN_INFO "Display initialized successfully\n"); |
| 257 | return; |
| 258 | |
| 259 | err_2: |
| 260 | gpio_free(LCD_PANEL_PWM); |
| 261 | err_1: |
| 262 | gpio_free(LCD_PANEL_BKLIGHT_PWR); |
| 263 | } |
Ajay Kumar Gupta | de99771 | 2010-05-10 14:29:19 -0700 | [diff] [blame] | 264 | #else |
| 265 | static void __init am3517_evm_display_init(void) {} |
| 266 | #endif |
Vaibhav Hiremath | c3d3332 | 2010-01-13 17:17:10 +0530 | [diff] [blame] | 267 | |
| 268 | static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev) |
| 269 | { |
| 270 | if (dvi_enabled) { |
| 271 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); |
| 272 | return -EINVAL; |
| 273 | } |
| 274 | gpio_set_value(LCD_PANEL_PWR, 1); |
| 275 | lcd_enabled = 1; |
| 276 | |
| 277 | return 0; |
| 278 | } |
| 279 | |
| 280 | static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) |
| 281 | { |
| 282 | gpio_set_value(LCD_PANEL_PWR, 0); |
| 283 | lcd_enabled = 0; |
| 284 | } |
| 285 | |
| 286 | static struct omap_dss_device am3517_evm_lcd_device = { |
| 287 | .type = OMAP_DISPLAY_TYPE_DPI, |
| 288 | .name = "lcd", |
| 289 | .driver_name = "sharp_lq_panel", |
| 290 | .phy.dpi.data_lines = 16, |
| 291 | .platform_enable = am3517_evm_panel_enable_lcd, |
| 292 | .platform_disable = am3517_evm_panel_disable_lcd, |
| 293 | }; |
| 294 | |
| 295 | static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev) |
| 296 | { |
| 297 | return 0; |
| 298 | } |
| 299 | |
| 300 | static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev) |
| 301 | { |
| 302 | } |
| 303 | |
| 304 | static struct omap_dss_device am3517_evm_tv_device = { |
| 305 | .type = OMAP_DISPLAY_TYPE_VENC, |
| 306 | .name = "tv", |
| 307 | .driver_name = "venc", |
| 308 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, |
| 309 | .platform_enable = am3517_evm_panel_enable_tv, |
| 310 | .platform_disable = am3517_evm_panel_disable_tv, |
| 311 | }; |
| 312 | |
| 313 | static int am3517_evm_panel_enable_dvi(struct omap_dss_device *dssdev) |
| 314 | { |
| 315 | if (lcd_enabled) { |
| 316 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); |
| 317 | return -EINVAL; |
| 318 | } |
| 319 | dvi_enabled = 1; |
| 320 | |
| 321 | return 0; |
| 322 | } |
| 323 | |
| 324 | static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) |
| 325 | { |
| 326 | dvi_enabled = 0; |
| 327 | } |
| 328 | |
| 329 | static struct omap_dss_device am3517_evm_dvi_device = { |
| 330 | .type = OMAP_DISPLAY_TYPE_DPI, |
| 331 | .name = "dvi", |
| 332 | .driver_name = "generic_panel", |
| 333 | .phy.dpi.data_lines = 24, |
| 334 | .platform_enable = am3517_evm_panel_enable_dvi, |
| 335 | .platform_disable = am3517_evm_panel_disable_dvi, |
| 336 | }; |
| 337 | |
| 338 | static struct omap_dss_device *am3517_evm_dss_devices[] = { |
| 339 | &am3517_evm_lcd_device, |
| 340 | &am3517_evm_tv_device, |
| 341 | &am3517_evm_dvi_device, |
| 342 | }; |
| 343 | |
| 344 | static struct omap_dss_board_info am3517_evm_dss_data = { |
| 345 | .num_devices = ARRAY_SIZE(am3517_evm_dss_devices), |
| 346 | .devices = am3517_evm_dss_devices, |
| 347 | .default_device = &am3517_evm_lcd_device, |
| 348 | }; |
| 349 | |
| 350 | struct platform_device am3517_evm_dss_device = { |
| 351 | .name = "omapdss", |
| 352 | .id = -1, |
| 353 | .dev = { |
| 354 | .platform_data = &am3517_evm_dss_data, |
| 355 | }, |
| 356 | }; |
| 357 | |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 358 | /* |
| 359 | * Board initialization |
| 360 | */ |
| 361 | static struct omap_board_config_kernel am3517_evm_config[] __initdata = { |
| 362 | }; |
| 363 | |
| 364 | static struct platform_device *am3517_evm_devices[] __initdata = { |
Vaibhav Hiremath | c3d3332 | 2010-01-13 17:17:10 +0530 | [diff] [blame] | 365 | &am3517_evm_dss_device, |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 366 | }; |
| 367 | |
| 368 | static void __init am3517_evm_init_irq(void) |
| 369 | { |
| 370 | omap_board_config = am3517_evm_config; |
| 371 | omap_board_config_size = ARRAY_SIZE(am3517_evm_config); |
| 372 | |
| 373 | omap2_init_common_hw(NULL, NULL); |
| 374 | omap_init_irq(); |
| 375 | omap_gpio_init(); |
| 376 | } |
| 377 | |
Ajay Kumar Gupta | 3a0d30b | 2010-10-19 10:08:11 +0300 | [diff] [blame^] | 378 | static struct omap_musb_board_data musb_board_data = { |
| 379 | .interface_type = MUSB_INTERFACE_ULPI, |
| 380 | .mode = MUSB_OTG, |
| 381 | .power = 500, |
| 382 | }; |
| 383 | |
| 384 | static __init void am3517_evm_musb_init(void) |
| 385 | { |
| 386 | u32 devconf2; |
| 387 | |
| 388 | /* |
| 389 | * Set up USB clock/mode in the DEVCONF2 register. |
| 390 | */ |
| 391 | devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2); |
| 392 | |
| 393 | /* USB2.0 PHY reference clock is 13 MHz */ |
| 394 | devconf2 &= ~(CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE); |
| 395 | devconf2 |= CONF2_REFFREQ_13MHZ | CONF2_SESENDEN | CONF2_VBDTCTEN |
| 396 | | CONF2_DATPOL; |
| 397 | |
| 398 | omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2); |
| 399 | |
| 400 | usb_musb_init(&musb_board_data); |
| 401 | } |
| 402 | |
Felipe Balbi | 6f69a18 | 2010-03-04 09:45:53 +0200 | [diff] [blame] | 403 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 404 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, |
Ajay Kumar Gupta | de99771 | 2010-05-10 14:29:19 -0700 | [diff] [blame] | 405 | #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ |
| 406 | defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE) |
| 407 | .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 408 | #else |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 409 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, |
Ajay Kumar Gupta | de99771 | 2010-05-10 14:29:19 -0700 | [diff] [blame] | 410 | #endif |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 411 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 412 | |
| 413 | .phy_reset = true, |
| 414 | .reset_gpio_port[0] = 57, |
| 415 | .reset_gpio_port[1] = -EINVAL, |
| 416 | .reset_gpio_port[2] = -EINVAL |
| 417 | }; |
| 418 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 419 | #ifdef CONFIG_OMAP_MUX |
| 420 | static struct omap_board_mux board_mux[] __initdata = { |
Ajay Kumar Gupta | 3a0d30b | 2010-10-19 10:08:11 +0300 | [diff] [blame^] | 421 | /* USB OTG DRVVBUS offset = 0x212 */ |
| 422 | OMAP3_MUX(SAD2D_MCAD23, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN), |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 423 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 424 | }; |
| 425 | #else |
| 426 | #define board_mux NULL |
| 427 | #endif |
| 428 | |
Sriram | 91733631 | 2010-05-10 14:29:16 -0700 | [diff] [blame] | 429 | |
| 430 | static struct resource am3517_hecc_resources[] = { |
| 431 | { |
| 432 | .start = AM35XX_IPSS_HECC_BASE, |
| 433 | .end = AM35XX_IPSS_HECC_BASE + 0x3FFF, |
| 434 | .flags = IORESOURCE_MEM, |
| 435 | }, |
| 436 | { |
| 437 | .start = INT_35XX_HECC0_IRQ, |
| 438 | .end = INT_35XX_HECC0_IRQ, |
| 439 | .flags = IORESOURCE_IRQ, |
| 440 | }, |
| 441 | }; |
| 442 | |
| 443 | static struct platform_device am3517_hecc_device = { |
| 444 | .name = "ti_hecc", |
| 445 | .id = -1, |
| 446 | .num_resources = ARRAY_SIZE(am3517_hecc_resources), |
| 447 | .resource = am3517_hecc_resources, |
| 448 | }; |
| 449 | |
| 450 | static struct ti_hecc_platform_data am3517_evm_hecc_pdata = { |
| 451 | .scc_hecc_offset = AM35XX_HECC_SCC_HECC_OFFSET, |
| 452 | .scc_ram_offset = AM35XX_HECC_SCC_RAM_OFFSET, |
| 453 | .hecc_ram_offset = AM35XX_HECC_RAM_OFFSET, |
| 454 | .mbx_offset = AM35XX_HECC_MBOX_OFFSET, |
| 455 | .int_line = AM35XX_HECC_INT_LINE, |
| 456 | .version = AM35XX_HECC_VERSION, |
| 457 | }; |
| 458 | |
| 459 | static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata) |
| 460 | { |
| 461 | am3517_hecc_device.dev.platform_data = pdata; |
| 462 | platform_device_register(&am3517_hecc_device); |
| 463 | } |
| 464 | |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 465 | static void __init am3517_evm_init(void) |
| 466 | { |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 467 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
stanley.miao | 5241b6b | 2010-04-20 06:33:29 +0000 | [diff] [blame] | 468 | |
| 469 | am3517_evm_i2c_init(); |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 470 | platform_add_devices(am3517_evm_devices, |
| 471 | ARRAY_SIZE(am3517_evm_devices)); |
| 472 | |
| 473 | omap_serial_init(); |
Ajay Kumar Gupta | fec3eeb | 2010-02-22 10:21:12 +0000 | [diff] [blame] | 474 | |
| 475 | /* Configure GPIO for EHCI port */ |
| 476 | omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 477 | usb_ehci_init(&ehci_pdata); |
Sriram | 91733631 | 2010-05-10 14:29:16 -0700 | [diff] [blame] | 478 | am3517_evm_hecc_init(&am3517_evm_hecc_pdata); |
Vaibhav Hiremath | c3d3332 | 2010-01-13 17:17:10 +0530 | [diff] [blame] | 479 | /* DSS */ |
| 480 | am3517_evm_display_init(); |
Vaibhav Hiremath | f2afbbb | 2010-02-13 11:47:56 +0000 | [diff] [blame] | 481 | |
| 482 | /* RTC - S35390A */ |
| 483 | am3517_evm_rtc_init(); |
| 484 | |
stanley.miao | b91da66 | 2010-05-13 12:39:29 +0000 | [diff] [blame] | 485 | i2c_register_board_info(1, am3517evm_i2c1_boardinfo, |
| 486 | ARRAY_SIZE(am3517evm_i2c1_boardinfo)); |
Sriram | 56881d2 | 2010-05-10 14:29:17 -0700 | [diff] [blame] | 487 | /*Ethernet*/ |
| 488 | am3517_evm_ethernet_init(&am3517_evm_emac_pdata); |
Ajay Kumar Gupta | 3a0d30b | 2010-10-19 10:08:11 +0300 | [diff] [blame^] | 489 | |
| 490 | /* MUSB */ |
| 491 | am3517_evm_musb_init(); |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 492 | } |
| 493 | |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 494 | MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") |
| 495 | .phys_io = 0x48000000, |
| 496 | .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, |
| 497 | .boot_params = 0x80000100, |
Mike Rapoport | 869fef4 | 2010-08-04 14:43:18 +0300 | [diff] [blame] | 498 | .map_io = omap3_map_io, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 499 | .reserve = omap_reserve, |
Ranjith Lohithakshan | c625327 | 2009-11-18 18:41:09 -0800 | [diff] [blame] | 500 | .init_irq = am3517_evm_init_irq, |
| 501 | .init_machine = am3517_evm_init, |
| 502 | .timer = &omap_timer, |
| 503 | MACHINE_END |