Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 1 | /* |
| 2 | * board-omap3pandora.c (Pandora Handheld Console) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, but |
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | * General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program; if not, write to the Free Software |
| 15 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 16 | * 02110-1301 USA |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | #include <linux/init.h> |
| 21 | #include <linux/kernel.h> |
| 22 | #include <linux/platform_device.h> |
| 23 | |
| 24 | #include <linux/spi/spi.h> |
| 25 | #include <linux/spi/ads7846.h> |
Grazvydas Ignotas | 64f535a | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 26 | #include <linux/regulator/machine.h> |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 27 | #include <linux/i2c/twl4030.h> |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 28 | #include <linux/leds.h> |
| 29 | #include <linux/input.h> |
Janusz Krzysztofik | 6135434 | 2009-10-22 14:43:17 -0700 | [diff] [blame] | 30 | #include <linux/input/matrix_keypad.h> |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 31 | #include <linux/gpio_keys.h> |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 32 | |
| 33 | #include <asm/mach-types.h> |
| 34 | #include <asm/mach/arch.h> |
| 35 | #include <asm/mach/map.h> |
| 36 | |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 37 | #include <plat/board.h> |
| 38 | #include <plat/common.h> |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 39 | #include <mach/gpio.h> |
| 40 | #include <mach/hardware.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 41 | #include <plat/mcspi.h> |
| 42 | #include <plat/usb.h> |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 43 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 44 | #include "mux.h" |
Paul Walmsley | 2e12bd7 | 2009-05-28 14:03:59 -0700 | [diff] [blame] | 45 | #include "sdram-micron-mt46h32m32lf-6.h" |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 46 | #include "mmc-twl4030.h" |
| 47 | |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 48 | #define OMAP3_PANDORA_TS_GPIO 94 |
| 49 | |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 50 | /* hardware debounce: (value + 1) * 31us */ |
| 51 | #define GPIO_DEBOUNCE_TIME 127 |
| 52 | |
| 53 | static struct gpio_led pandora_gpio_leds[] = { |
| 54 | { |
| 55 | .name = "pandora::sd1", |
| 56 | .default_trigger = "mmc0", |
| 57 | .gpio = 128, |
| 58 | }, { |
| 59 | .name = "pandora::sd2", |
| 60 | .default_trigger = "mmc1", |
| 61 | .gpio = 129, |
| 62 | }, { |
| 63 | .name = "pandora::bluetooth", |
| 64 | .gpio = 158, |
| 65 | }, { |
| 66 | .name = "pandora::wifi", |
| 67 | .gpio = 159, |
| 68 | }, |
| 69 | }; |
| 70 | |
| 71 | static struct gpio_led_platform_data pandora_gpio_led_data = { |
| 72 | .leds = pandora_gpio_leds, |
| 73 | .num_leds = ARRAY_SIZE(pandora_gpio_leds), |
| 74 | }; |
| 75 | |
| 76 | static struct platform_device pandora_leds_gpio = { |
| 77 | .name = "leds-gpio", |
| 78 | .id = -1, |
| 79 | .dev = { |
| 80 | .platform_data = &pandora_gpio_led_data, |
| 81 | }, |
| 82 | }; |
| 83 | |
| 84 | #define GPIO_BUTTON(gpio_num, ev_type, ev_code, act_low, descr) \ |
| 85 | { \ |
| 86 | .gpio = gpio_num, \ |
| 87 | .type = ev_type, \ |
| 88 | .code = ev_code, \ |
| 89 | .active_low = act_low, \ |
| 90 | .desc = "btn " descr, \ |
| 91 | } |
| 92 | |
| 93 | #define GPIO_BUTTON_LOW(gpio_num, event_code, description) \ |
| 94 | GPIO_BUTTON(gpio_num, EV_KEY, event_code, 1, description) |
| 95 | |
| 96 | static struct gpio_keys_button pandora_gpio_keys[] = { |
| 97 | GPIO_BUTTON_LOW(110, KEY_UP, "up"), |
| 98 | GPIO_BUTTON_LOW(103, KEY_DOWN, "down"), |
| 99 | GPIO_BUTTON_LOW(96, KEY_LEFT, "left"), |
| 100 | GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"), |
Grazvydas Ignotas | 8d88f7f | 2009-12-11 16:16:34 -0800 | [diff] [blame] | 101 | GPIO_BUTTON_LOW(109, KEY_KP1, "game 1"), |
| 102 | GPIO_BUTTON_LOW(111, KEY_KP2, "game 2"), |
| 103 | GPIO_BUTTON_LOW(106, KEY_KP3, "game 3"), |
| 104 | GPIO_BUTTON_LOW(101, KEY_KP4, "game 4"), |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 105 | GPIO_BUTTON_LOW(102, BTN_TL, "l"), |
| 106 | GPIO_BUTTON_LOW(97, BTN_TL2, "l2"), |
| 107 | GPIO_BUTTON_LOW(105, BTN_TR, "r"), |
| 108 | GPIO_BUTTON_LOW(107, BTN_TR2, "r2"), |
| 109 | GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"), |
| 110 | GPIO_BUTTON_LOW(99, KEY_MENU, "menu"), |
| 111 | GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"), |
| 112 | GPIO_BUTTON(100, EV_KEY, KEY_LEFTALT, 0, "alt"), |
| 113 | GPIO_BUTTON(108, EV_SW, SW_LID, 1, "lid"), |
| 114 | }; |
| 115 | |
| 116 | static struct gpio_keys_platform_data pandora_gpio_key_info = { |
| 117 | .buttons = pandora_gpio_keys, |
| 118 | .nbuttons = ARRAY_SIZE(pandora_gpio_keys), |
| 119 | }; |
| 120 | |
| 121 | static struct platform_device pandora_keys_gpio = { |
| 122 | .name = "gpio-keys", |
| 123 | .id = -1, |
| 124 | .dev = { |
| 125 | .platform_data = &pandora_gpio_key_info, |
| 126 | }, |
| 127 | }; |
| 128 | |
| 129 | static void __init pandora_keys_gpio_init(void) |
| 130 | { |
| 131 | /* set debounce time for GPIO banks 4 and 6 */ |
| 132 | omap_set_gpio_debounce_time(32 * 3, GPIO_DEBOUNCE_TIME); |
| 133 | omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME); |
| 134 | } |
| 135 | |
Tony Lindgren | 4f54333 | 2009-09-24 16:23:16 -0700 | [diff] [blame] | 136 | static int board_keymap[] = { |
Grazvydas Ignotas | 24de042 | 2009-11-11 11:00:35 -0800 | [diff] [blame] | 137 | /* row, col, code */ |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 138 | KEY(0, 0, KEY_9), |
Grazvydas Ignotas | 24de042 | 2009-11-11 11:00:35 -0800 | [diff] [blame] | 139 | KEY(0, 1, KEY_8), |
| 140 | KEY(0, 2, KEY_I), |
| 141 | KEY(0, 3, KEY_J), |
| 142 | KEY(0, 4, KEY_N), |
| 143 | KEY(0, 5, KEY_M), |
| 144 | KEY(1, 0, KEY_0), |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 145 | KEY(1, 1, KEY_7), |
Grazvydas Ignotas | 24de042 | 2009-11-11 11:00:35 -0800 | [diff] [blame] | 146 | KEY(1, 2, KEY_U), |
| 147 | KEY(1, 3, KEY_H), |
| 148 | KEY(1, 4, KEY_B), |
| 149 | KEY(1, 5, KEY_SPACE), |
| 150 | KEY(2, 0, KEY_BACKSPACE), |
| 151 | KEY(2, 1, KEY_6), |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 152 | KEY(2, 2, KEY_Y), |
Grazvydas Ignotas | 24de042 | 2009-11-11 11:00:35 -0800 | [diff] [blame] | 153 | KEY(2, 3, KEY_G), |
| 154 | KEY(2, 4, KEY_V), |
| 155 | KEY(2, 5, KEY_FN), |
| 156 | KEY(3, 0, KEY_O), |
| 157 | KEY(3, 1, KEY_5), |
| 158 | KEY(3, 2, KEY_T), |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 159 | KEY(3, 3, KEY_F), |
Grazvydas Ignotas | 24de042 | 2009-11-11 11:00:35 -0800 | [diff] [blame] | 160 | KEY(3, 4, KEY_C), |
| 161 | KEY(4, 0, KEY_P), |
| 162 | KEY(4, 1, KEY_4), |
| 163 | KEY(4, 2, KEY_R), |
| 164 | KEY(4, 3, KEY_D), |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 165 | KEY(4, 4, KEY_X), |
Grazvydas Ignotas | 24de042 | 2009-11-11 11:00:35 -0800 | [diff] [blame] | 166 | KEY(5, 0, KEY_K), |
| 167 | KEY(5, 1, KEY_3), |
| 168 | KEY(5, 2, KEY_E), |
| 169 | KEY(5, 3, KEY_S), |
| 170 | KEY(5, 4, KEY_Z), |
| 171 | KEY(6, 0, KEY_L), |
| 172 | KEY(6, 1, KEY_2), |
| 173 | KEY(6, 2, KEY_W), |
| 174 | KEY(6, 3, KEY_A), |
| 175 | KEY(6, 4, KEY_DOT), |
| 176 | KEY(7, 0, KEY_ENTER), |
| 177 | KEY(7, 1, KEY_1), |
| 178 | KEY(7, 2, KEY_Q), |
| 179 | KEY(7, 3, KEY_LEFTSHIFT), |
| 180 | KEY(7, 4, KEY_COMMA), |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 181 | }; |
| 182 | |
Tony Lindgren | 4f54333 | 2009-09-24 16:23:16 -0700 | [diff] [blame] | 183 | static struct matrix_keymap_data board_map_data = { |
| 184 | .keymap = board_keymap, |
| 185 | .keymap_size = ARRAY_SIZE(board_keymap), |
| 186 | }; |
| 187 | |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 188 | static struct twl4030_keypad_data pandora_kp_data = { |
Tony Lindgren | 4f54333 | 2009-09-24 16:23:16 -0700 | [diff] [blame] | 189 | .keymap_data = &board_map_data, |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 190 | .rows = 8, |
| 191 | .cols = 6, |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 192 | .rep = 1, |
| 193 | }; |
| 194 | |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 195 | static struct twl4030_hsmmc_info omap3pandora_mmc[] = { |
| 196 | { |
| 197 | .mmc = 1, |
| 198 | .wires = 4, |
| 199 | .gpio_cd = -EINVAL, |
| 200 | .gpio_wp = 126, |
| 201 | .ext_clock = 0, |
| 202 | }, |
| 203 | { |
| 204 | .mmc = 2, |
| 205 | .wires = 4, |
| 206 | .gpio_cd = -EINVAL, |
| 207 | .gpio_wp = 127, |
| 208 | .ext_clock = 1, |
David Brownell | 0329c37 | 2009-03-23 18:23:47 -0700 | [diff] [blame] | 209 | .transceiver = true, |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 210 | }, |
Grazvydas Ignotas | 07d83cc | 2009-03-23 18:23:47 -0700 | [diff] [blame] | 211 | { |
| 212 | .mmc = 3, |
| 213 | .wires = 4, |
| 214 | .gpio_cd = -EINVAL, |
| 215 | .gpio_wp = -EINVAL, |
| 216 | }, |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 217 | {} /* Terminator */ |
| 218 | }; |
| 219 | |
Grazvydas Ignotas | 64f535a | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 220 | static struct regulator_consumer_supply pandora_vmmc1_supply = { |
| 221 | .supply = "vmmc", |
| 222 | }; |
| 223 | |
| 224 | static struct regulator_consumer_supply pandora_vmmc2_supply = { |
| 225 | .supply = "vmmc", |
| 226 | }; |
| 227 | |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 228 | static int omap3pandora_twl_gpio_setup(struct device *dev, |
| 229 | unsigned gpio, unsigned ngpio) |
| 230 | { |
| 231 | /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ |
| 232 | omap3pandora_mmc[0].gpio_cd = gpio + 0; |
| 233 | omap3pandora_mmc[1].gpio_cd = gpio + 1; |
| 234 | twl4030_mmc_init(omap3pandora_mmc); |
| 235 | |
Grazvydas Ignotas | 64f535a | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 236 | /* link regulators to MMC adapters */ |
| 237 | pandora_vmmc1_supply.dev = omap3pandora_mmc[0].dev; |
| 238 | pandora_vmmc2_supply.dev = omap3pandora_mmc[1].dev; |
| 239 | |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 240 | return 0; |
| 241 | } |
| 242 | |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 243 | static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { |
| 244 | .gpio_base = OMAP_MAX_GPIO_LINES, |
| 245 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
| 246 | .irq_end = TWL4030_GPIO_IRQ_END, |
Tony Lindgren | 90c62bf | 2008-12-10 17:37:17 -0800 | [diff] [blame] | 247 | .setup = omap3pandora_twl_gpio_setup, |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 248 | }; |
| 249 | |
Grazvydas Ignotas | 64f535a | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 250 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
| 251 | static struct regulator_init_data pandora_vmmc1 = { |
| 252 | .constraints = { |
| 253 | .min_uV = 1850000, |
| 254 | .max_uV = 3150000, |
| 255 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 256 | | REGULATOR_MODE_STANDBY, |
| 257 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 258 | | REGULATOR_CHANGE_MODE |
| 259 | | REGULATOR_CHANGE_STATUS, |
| 260 | }, |
| 261 | .num_consumer_supplies = 1, |
| 262 | .consumer_supplies = &pandora_vmmc1_supply, |
| 263 | }; |
| 264 | |
| 265 | /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */ |
| 266 | static struct regulator_init_data pandora_vmmc2 = { |
| 267 | .constraints = { |
| 268 | .min_uV = 1850000, |
| 269 | .max_uV = 3150000, |
| 270 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 271 | | REGULATOR_MODE_STANDBY, |
| 272 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
| 273 | | REGULATOR_CHANGE_MODE |
| 274 | | REGULATOR_CHANGE_STATUS, |
| 275 | }, |
| 276 | .num_consumer_supplies = 1, |
| 277 | .consumer_supplies = &pandora_vmmc2_supply, |
| 278 | }; |
| 279 | |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 280 | static struct twl4030_usb_data omap3pandora_usb_data = { |
| 281 | .usb_mode = T2_USB_MODE_ULPI, |
| 282 | }; |
| 283 | |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 284 | static struct twl4030_codec_audio_data omap3pandora_audio_data = { |
| 285 | .audio_mclk = 26000000, |
| 286 | }; |
| 287 | |
| 288 | static struct twl4030_codec_data omap3pandora_codec_data = { |
Peter Ujfalusi | 6df74ef | 2009-11-04 09:58:18 +0200 | [diff] [blame] | 289 | .audio_mclk = 26000000, |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 290 | .audio = &omap3pandora_audio_data, |
| 291 | }; |
| 292 | |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 293 | static struct twl4030_platform_data omap3pandora_twldata = { |
| 294 | .irq_base = TWL4030_IRQ_BASE, |
| 295 | .irq_end = TWL4030_IRQ_END, |
| 296 | .gpio = &omap3pandora_gpio_data, |
| 297 | .usb = &omap3pandora_usb_data, |
Peter Ujfalusi | e86fa0b | 2009-10-22 13:26:46 +0300 | [diff] [blame] | 298 | .codec = &omap3pandora_codec_data, |
Grazvydas Ignotas | 64f535a | 2009-05-28 14:04:04 -0700 | [diff] [blame] | 299 | .vmmc1 = &pandora_vmmc1, |
| 300 | .vmmc2 = &pandora_vmmc2, |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 301 | .keypad = &pandora_kp_data, |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 302 | }; |
| 303 | |
| 304 | static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = { |
| 305 | { |
| 306 | I2C_BOARD_INFO("tps65950", 0x48), |
| 307 | .flags = I2C_CLIENT_WAKE, |
| 308 | .irq = INT_34XX_SYS_NIRQ, |
| 309 | .platform_data = &omap3pandora_twldata, |
| 310 | }, |
| 311 | }; |
| 312 | |
| 313 | static int __init omap3pandora_i2c_init(void) |
| 314 | { |
| 315 | omap_register_i2c_bus(1, 2600, omap3pandora_i2c_boardinfo, |
| 316 | ARRAY_SIZE(omap3pandora_i2c_boardinfo)); |
| 317 | /* i2c2 pins are not connected */ |
Grazvydas Ignotas | 8d88f7f | 2009-12-11 16:16:34 -0800 | [diff] [blame] | 318 | omap_register_i2c_bus(3, 100, NULL, 0); |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 319 | return 0; |
| 320 | } |
| 321 | |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 322 | static void __init omap3pandora_ads7846_init(void) |
| 323 | { |
| 324 | int gpio = OMAP3_PANDORA_TS_GPIO; |
| 325 | int ret; |
| 326 | |
| 327 | ret = gpio_request(gpio, "ads7846_pen_down"); |
| 328 | if (ret < 0) { |
| 329 | printk(KERN_ERR "Failed to request GPIO %d for " |
| 330 | "ads7846 pen down IRQ\n", gpio); |
| 331 | return; |
| 332 | } |
| 333 | |
| 334 | gpio_direction_input(gpio); |
| 335 | } |
| 336 | |
| 337 | static int ads7846_get_pendown_state(void) |
| 338 | { |
| 339 | return !gpio_get_value(OMAP3_PANDORA_TS_GPIO); |
| 340 | } |
| 341 | |
| 342 | static struct ads7846_platform_data ads7846_config = { |
| 343 | .x_max = 0x0fff, |
| 344 | .y_max = 0x0fff, |
| 345 | .x_plate_ohms = 180, |
| 346 | .pressure_max = 255, |
| 347 | .debounce_max = 10, |
| 348 | .debounce_tol = 3, |
| 349 | .debounce_rep = 1, |
| 350 | .get_pendown_state = ads7846_get_pendown_state, |
| 351 | .keep_vref_on = 1, |
| 352 | }; |
| 353 | |
| 354 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { |
| 355 | .turbo_mode = 0, |
| 356 | .single_channel = 1, /* 0: slave, 1: master */ |
| 357 | }; |
| 358 | |
| 359 | static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { |
| 360 | { |
| 361 | .modalias = "ads7846", |
| 362 | .bus_num = 1, |
| 363 | .chip_select = 0, |
| 364 | .max_speed_hz = 1500000, |
| 365 | .controller_data = &ads7846_mcspi_config, |
| 366 | .irq = OMAP_GPIO_IRQ(OMAP3_PANDORA_TS_GPIO), |
| 367 | .platform_data = &ads7846_config, |
| 368 | } |
| 369 | }; |
| 370 | |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 371 | static void __init omap3pandora_init_irq(void) |
| 372 | { |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 373 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, |
| 374 | mt46h32m32lf6_sdrc_params); |
| 375 | omap_init_irq(); |
| 376 | omap_gpio_init(); |
| 377 | } |
| 378 | |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 379 | static struct platform_device *omap3pandora_devices[] __initdata = { |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 380 | &pandora_leds_gpio, |
| 381 | &pandora_keys_gpio, |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 382 | }; |
| 383 | |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 384 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
| 385 | |
| 386 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, |
| 387 | .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 388 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| 389 | |
| 390 | .phy_reset = true, |
| 391 | .reset_gpio_port[0] = 16, |
| 392 | .reset_gpio_port[1] = -EINVAL, |
| 393 | .reset_gpio_port[2] = -EINVAL |
| 394 | }; |
| 395 | |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 396 | #ifdef CONFIG_OMAP_MUX |
| 397 | static struct omap_board_mux board_mux[] __initdata = { |
| 398 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 399 | }; |
| 400 | #else |
| 401 | #define board_mux NULL |
| 402 | #endif |
| 403 | |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 404 | static void __init omap3pandora_init(void) |
| 405 | { |
Tony Lindgren | ca5742b | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 406 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 407 | omap3pandora_i2c_init(); |
| 408 | platform_add_devices(omap3pandora_devices, |
| 409 | ARRAY_SIZE(omap3pandora_devices)); |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 410 | omap_serial_init(); |
| 411 | spi_register_board_info(omap3pandora_spi_board_info, |
| 412 | ARRAY_SIZE(omap3pandora_spi_board_info)); |
| 413 | omap3pandora_ads7846_init(); |
Felipe Balbi | 58a5491 | 2009-11-22 10:11:01 -0800 | [diff] [blame] | 414 | usb_ehci_init(&ehci_pdata); |
Grazvydas Ignotas | 7419045 | 2009-05-28 14:15:44 -0700 | [diff] [blame] | 415 | pandora_keys_gpio_init(); |
Felipe Balbi | 18cb7ac | 2009-03-23 18:34:06 -0700 | [diff] [blame] | 416 | usb_musb_init(); |
Jean Pihet | 9fb9741 | 2009-07-24 19:43:25 -0600 | [diff] [blame] | 417 | |
| 418 | /* Ensure SDRC pins are mux'd for self-refresh */ |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 419 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
| 420 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 421 | } |
| 422 | |
| 423 | static void __init omap3pandora_map_io(void) |
| 424 | { |
| 425 | omap2_set_globals_343x(); |
| 426 | omap2_map_common_io(); |
| 427 | } |
| 428 | |
| 429 | MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") |
| 430 | .phys_io = 0x48000000, |
Santosh Shilimkar | b4224b2 | 2009-10-19 17:25:55 -0700 | [diff] [blame] | 431 | .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, |
Grazvydas Ignotas | da17724 | 2008-12-10 17:36:54 -0800 | [diff] [blame] | 432 | .boot_params = 0x80000100, |
| 433 | .map_io = omap3pandora_map_io, |
| 434 | .init_irq = omap3pandora_init_irq, |
| 435 | .init_machine = omap3pandora_init, |
| 436 | .timer = &omap_timer, |
| 437 | MACHINE_END |