board-osk.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * linux/arch/arm/mach-omap1/board-osk.c
  3. *
  4. * Board specific init for OMAP5912 OSK
  5. *
  6. * Written by Dirk Behme <dirk.behme@de.bosch.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  14. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  16. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  17. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  20. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. *
  24. * You should have received a copy of the GNU General Public License along
  25. * with this program; if not, write to the Free Software Foundation, Inc.,
  26. * 675 Mass Ave, Cambridge, MA 02139, USA.
  27. */
  28. #include <linux/gpio.h>
  29. #include <linux/kernel.h>
  30. #include <linux/init.h>
  31. #include <linux/platform_device.h>
  32. #include <linux/interrupt.h>
  33. #include <linux/irq.h>
  34. #include <linux/i2c.h>
  35. #include <linux/leds.h>
  36. #include <linux/smc91x.h>
  37. #include <linux/omapfb.h>
  38. #include <linux/mtd/mtd.h>
  39. #include <linux/mtd/partitions.h>
  40. #include <linux/mtd/physmap.h>
  41. #include <linux/i2c/tps65010.h>
  42. #include <linux/platform_data/gpio-omap.h>
  43. #include <linux/platform_data/omap1_bl.h>
  44. #include <asm/mach-types.h>
  45. #include <asm/mach/arch.h>
  46. #include <asm/mach/map.h>
  47. #include "flash.h"
  48. #include <mach/mux.h>
  49. #include <mach/tc.h>
  50. #include <mach/hardware.h>
  51. #include <mach/usb.h>
  52. #include "common.h"
  53. /* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
  54. #define OMAP_OSK_ETHR_START 0x04800300
  55. /* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with
  56. * alternate pin configurations for hardware-controlled blinking.
  57. */
  58. #define OSK_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
  59. # define OSK_TPS_GPIO_USB_PWR_EN (OSK_TPS_GPIO_BASE + 0)
  60. # define OSK_TPS_GPIO_LED_D3 (OSK_TPS_GPIO_BASE + 1)
  61. # define OSK_TPS_GPIO_LAN_RESET (OSK_TPS_GPIO_BASE + 2)
  62. # define OSK_TPS_GPIO_DSP_PWR_EN (OSK_TPS_GPIO_BASE + 3)
  63. # define OSK_TPS_GPIO_LED_D9 (OSK_TPS_GPIO_BASE + 4)
  64. # define OSK_TPS_GPIO_LED_D2 (OSK_TPS_GPIO_BASE + 5)
  65. static struct mtd_partition osk_partitions[] = {
  66. /* bootloader (U-Boot, etc) in first sector */
  67. {
  68. .name = "bootloader",
  69. .offset = 0,
  70. .size = SZ_128K,
  71. .mask_flags = MTD_WRITEABLE, /* force read-only */
  72. },
  73. /* bootloader params in the next sector */
  74. {
  75. .name = "params",
  76. .offset = MTDPART_OFS_APPEND,
  77. .size = SZ_128K,
  78. .mask_flags = 0,
  79. }, {
  80. .name = "kernel",
  81. .offset = MTDPART_OFS_APPEND,
  82. .size = SZ_2M,
  83. .mask_flags = 0
  84. }, {
  85. .name = "filesystem",
  86. .offset = MTDPART_OFS_APPEND,
  87. .size = MTDPART_SIZ_FULL,
  88. .mask_flags = 0
  89. }
  90. };
  91. static struct physmap_flash_data osk_flash_data = {
  92. .width = 2,
  93. .set_vpp = omap1_set_vpp,
  94. .parts = osk_partitions,
  95. .nr_parts = ARRAY_SIZE(osk_partitions),
  96. };
  97. static struct resource osk_flash_resource = {
  98. /* this is on CS3, wherever it's mapped */
  99. .flags = IORESOURCE_MEM,
  100. };
  101. static struct platform_device osk5912_flash_device = {
  102. .name = "physmap-flash",
  103. .id = 0,
  104. .dev = {
  105. .platform_data = &osk_flash_data,
  106. },
  107. .num_resources = 1,
  108. .resource = &osk_flash_resource,
  109. };
  110. static struct smc91x_platdata osk5912_smc91x_info = {
  111. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  112. .leda = RPC_LED_100_10,
  113. .ledb = RPC_LED_TX_RX,
  114. };
  115. static struct resource osk5912_smc91x_resources[] = {
  116. [0] = {
  117. .start = OMAP_OSK_ETHR_START, /* Physical */
  118. .end = OMAP_OSK_ETHR_START + 0xf,
  119. .flags = IORESOURCE_MEM,
  120. },
  121. [1] = {
  122. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  123. },
  124. };
  125. static struct platform_device osk5912_smc91x_device = {
  126. .name = "smc91x",
  127. .id = -1,
  128. .dev = {
  129. .platform_data = &osk5912_smc91x_info,
  130. },
  131. .num_resources = ARRAY_SIZE(osk5912_smc91x_resources),
  132. .resource = osk5912_smc91x_resources,
  133. };
  134. static struct resource osk5912_cf_resources[] = {
  135. [0] = {
  136. .flags = IORESOURCE_IRQ,
  137. },
  138. };
  139. static struct platform_device osk5912_cf_device = {
  140. .name = "omap_cf",
  141. .id = -1,
  142. .dev = {
  143. .platform_data = (void *) 2 /* CS2 */,
  144. },
  145. .num_resources = ARRAY_SIZE(osk5912_cf_resources),
  146. .resource = osk5912_cf_resources,
  147. };
  148. static struct platform_device *osk5912_devices[] __initdata = {
  149. &osk5912_flash_device,
  150. &osk5912_smc91x_device,
  151. &osk5912_cf_device,
  152. };
  153. static struct gpio_led tps_leds[] = {
  154. /* NOTE: D9 and D2 have hardware blink support.
  155. * Also, D9 requires non-battery power.
  156. */
  157. { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9",
  158. .default_trigger = "disk-activity", },
  159. { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", },
  160. { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1,
  161. .default_trigger = "heartbeat", },
  162. };
  163. static struct gpio_led_platform_data tps_leds_data = {
  164. .num_leds = 3,
  165. .leds = tps_leds,
  166. };
  167. static struct platform_device osk5912_tps_leds = {
  168. .name = "leds-gpio",
  169. .id = 0,
  170. .dev.platform_data = &tps_leds_data,
  171. };
  172. static int osk_tps_setup(struct i2c_client *client, void *context)
  173. {
  174. if (!IS_BUILTIN(CONFIG_TPS65010))
  175. return -ENOSYS;
  176. /* Set GPIO 1 HIGH to disable VBUS power supply;
  177. * OHCI driver powers it up/down as needed.
  178. */
  179. gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en");
  180. gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1);
  181. /* Set GPIO 2 high so LED D3 is off by default */
  182. tps65010_set_gpio_out_value(GPIO2, HIGH);
  183. /* Set GPIO 3 low to take ethernet out of reset */
  184. gpio_request(OSK_TPS_GPIO_LAN_RESET, "smc_reset");
  185. gpio_direction_output(OSK_TPS_GPIO_LAN_RESET, 0);
  186. /* GPIO4 is VDD_DSP */
  187. gpio_request(OSK_TPS_GPIO_DSP_PWR_EN, "dsp_power");
  188. gpio_direction_output(OSK_TPS_GPIO_DSP_PWR_EN, 1);
  189. /* REVISIT if DSP support isn't configured, power it off ... */
  190. /* Let LED1 (D9) blink; leds-gpio may override it */
  191. tps65010_set_led(LED1, BLINK);
  192. /* Set LED2 off by default */
  193. tps65010_set_led(LED2, OFF);
  194. /* Enable LOW_PWR handshake */
  195. tps65010_set_low_pwr(ON);
  196. /* Switch VLDO2 to 3.0V for AIC23 */
  197. tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V
  198. | TPS_LDO1_ENABLE);
  199. /* register these three LEDs */
  200. osk5912_tps_leds.dev.parent = &client->dev;
  201. platform_device_register(&osk5912_tps_leds);
  202. return 0;
  203. }
  204. static struct tps65010_board tps_board = {
  205. .base = OSK_TPS_GPIO_BASE,
  206. .outmask = 0x0f,
  207. .setup = osk_tps_setup,
  208. };
  209. static struct i2c_board_info __initdata osk_i2c_board_info[] = {
  210. {
  211. I2C_BOARD_INFO("tps65010", 0x48),
  212. .platform_data = &tps_board,
  213. },
  214. {
  215. I2C_BOARD_INFO("tlv320aic23", 0x1B),
  216. },
  217. /* TODO when driver support is ready:
  218. * - optionally on Mistral, ov9640 camera sensor at 0x30
  219. */
  220. };
  221. static void __init osk_init_smc91x(void)
  222. {
  223. u32 l;
  224. if ((gpio_request(0, "smc_irq")) < 0) {
  225. printk("Error requesting gpio 0 for smc91x irq\n");
  226. return;
  227. }
  228. /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
  229. l = omap_readl(EMIFS_CCS(1));
  230. l |= 0x3;
  231. omap_writel(l, EMIFS_CCS(1));
  232. }
  233. static void __init osk_init_cf(void)
  234. {
  235. omap_cfg_reg(M7_1610_GPIO62);
  236. if ((gpio_request(62, "cf_irq")) < 0) {
  237. printk("Error requesting gpio 62 for CF irq\n");
  238. return;
  239. }
  240. /* the CF I/O IRQ is really active-low */
  241. irq_set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING);
  242. }
  243. static struct omap_usb_config osk_usb_config __initdata = {
  244. /* has usb host connector (A) ... for development it can also
  245. * be used, with a NONSTANDARD gender-bending cable/dongle, as
  246. * a peripheral.
  247. */
  248. #if IS_ENABLED(CONFIG_USB_OMAP)
  249. .register_dev = 1,
  250. .hmc_mode = 0,
  251. #else
  252. .register_host = 1,
  253. .hmc_mode = 16,
  254. .rwc = 1,
  255. #endif
  256. .pins[0] = 2,
  257. };
  258. #ifdef CONFIG_OMAP_OSK_MISTRAL
  259. static struct omap_lcd_config osk_lcd_config __initdata = {
  260. .ctrl_name = "internal",
  261. };
  262. #endif
  263. #ifdef CONFIG_OMAP_OSK_MISTRAL
  264. #include <linux/input.h>
  265. #include <linux/platform_data/at24.h>
  266. #include <linux/spi/spi.h>
  267. #include <linux/spi/ads7846.h>
  268. #include <linux/platform_data/keypad-omap.h>
  269. static struct at24_platform_data at24c04 = {
  270. .byte_len = SZ_4K / 8,
  271. .page_size = 16,
  272. };
  273. static struct i2c_board_info __initdata mistral_i2c_board_info[] = {
  274. {
  275. /* NOTE: powered from LCD supply */
  276. I2C_BOARD_INFO("24c04", 0x50),
  277. .platform_data = &at24c04,
  278. },
  279. /* TODO when driver support is ready:
  280. * - optionally ov9640 camera sensor at 0x30
  281. */
  282. };
  283. static const unsigned int osk_keymap[] = {
  284. /* KEY(col, row, code) */
  285. KEY(0, 0, KEY_F1), /* SW4 */
  286. KEY(3, 0, KEY_UP), /* (sw2/up) */
  287. KEY(1, 1, KEY_LEFTCTRL), /* SW5 */
  288. KEY(2, 1, KEY_LEFT), /* (sw2/left) */
  289. KEY(0, 2, KEY_SPACE), /* SW3 */
  290. KEY(1, 2, KEY_ESC), /* SW6 */
  291. KEY(2, 2, KEY_DOWN), /* (sw2/down) */
  292. KEY(2, 3, KEY_ENTER), /* (sw2/select) */
  293. KEY(3, 3, KEY_RIGHT), /* (sw2/right) */
  294. };
  295. static const struct matrix_keymap_data osk_keymap_data = {
  296. .keymap = osk_keymap,
  297. .keymap_size = ARRAY_SIZE(osk_keymap),
  298. };
  299. static struct omap_kp_platform_data osk_kp_data = {
  300. .rows = 8,
  301. .cols = 8,
  302. .keymap_data = &osk_keymap_data,
  303. .delay = 9,
  304. };
  305. static struct resource osk5912_kp_resources[] = {
  306. [0] = {
  307. .start = INT_KEYBOARD,
  308. .end = INT_KEYBOARD,
  309. .flags = IORESOURCE_IRQ,
  310. },
  311. };
  312. static struct platform_device osk5912_kp_device = {
  313. .name = "omap-keypad",
  314. .id = -1,
  315. .dev = {
  316. .platform_data = &osk_kp_data,
  317. },
  318. .num_resources = ARRAY_SIZE(osk5912_kp_resources),
  319. .resource = osk5912_kp_resources,
  320. };
  321. static struct omap_backlight_config mistral_bl_data = {
  322. .default_intensity = 0xa0,
  323. };
  324. static struct platform_device mistral_bl_device = {
  325. .name = "omap-bl",
  326. .id = -1,
  327. .dev = {
  328. .platform_data = &mistral_bl_data,
  329. },
  330. };
  331. static struct platform_device osk5912_lcd_device = {
  332. .name = "lcd_osk",
  333. .id = -1,
  334. };
  335. static struct gpio_led mistral_gpio_led_pins[] = {
  336. {
  337. .name = "mistral:red",
  338. .default_trigger = "heartbeat",
  339. .gpio = 3,
  340. },
  341. {
  342. .name = "mistral:green",
  343. .default_trigger = "cpu0",
  344. .gpio = OMAP_MPUIO(4),
  345. },
  346. };
  347. static struct gpio_led_platform_data mistral_gpio_led_data = {
  348. .leds = mistral_gpio_led_pins,
  349. .num_leds = ARRAY_SIZE(mistral_gpio_led_pins),
  350. };
  351. static struct platform_device mistral_gpio_leds = {
  352. .name = "leds-gpio",
  353. .id = -1,
  354. .dev = {
  355. .platform_data = &mistral_gpio_led_data,
  356. },
  357. };
  358. static struct platform_device *mistral_devices[] __initdata = {
  359. &osk5912_kp_device,
  360. &mistral_bl_device,
  361. &osk5912_lcd_device,
  362. &mistral_gpio_leds,
  363. };
  364. static int mistral_get_pendown_state(void)
  365. {
  366. return !gpio_get_value(4);
  367. }
  368. static const struct ads7846_platform_data mistral_ts_info = {
  369. .model = 7846,
  370. .vref_delay_usecs = 100, /* internal, no capacitor */
  371. .x_plate_ohms = 419,
  372. .y_plate_ohms = 486,
  373. .get_pendown_state = mistral_get_pendown_state,
  374. };
  375. static struct spi_board_info __initdata mistral_boardinfo[] = { {
  376. /* MicroWire (bus 2) CS0 has an ads7846e */
  377. .modalias = "ads7846",
  378. .platform_data = &mistral_ts_info,
  379. .max_speed_hz = 120000 /* max sample rate at 3V */
  380. * 26 /* command + data + overhead */,
  381. .bus_num = 2,
  382. .chip_select = 0,
  383. } };
  384. #ifdef CONFIG_PM
  385. static irqreturn_t
  386. osk_mistral_wake_interrupt(int irq, void *ignored)
  387. {
  388. return IRQ_HANDLED;
  389. }
  390. #endif
  391. static void __init osk_mistral_init(void)
  392. {
  393. /* NOTE: we could actually tell if there's a Mistral board
  394. * attached, e.g. by trying to read something from the ads7846.
  395. * But this arch_init() code is too early for that, since we
  396. * can't talk to the ads or even the i2c eeprom.
  397. */
  398. /* parallel camera interface */
  399. omap_cfg_reg(J15_1610_CAM_LCLK);
  400. omap_cfg_reg(J18_1610_CAM_D7);
  401. omap_cfg_reg(J19_1610_CAM_D6);
  402. omap_cfg_reg(J14_1610_CAM_D5);
  403. omap_cfg_reg(K18_1610_CAM_D4);
  404. omap_cfg_reg(K19_1610_CAM_D3);
  405. omap_cfg_reg(K15_1610_CAM_D2);
  406. omap_cfg_reg(K14_1610_CAM_D1);
  407. omap_cfg_reg(L19_1610_CAM_D0);
  408. omap_cfg_reg(L18_1610_CAM_VS);
  409. omap_cfg_reg(L15_1610_CAM_HS);
  410. omap_cfg_reg(M19_1610_CAM_RSTZ);
  411. omap_cfg_reg(Y15_1610_CAM_OUTCLK);
  412. /* serial camera interface */
  413. omap_cfg_reg(H19_1610_CAM_EXCLK);
  414. omap_cfg_reg(W13_1610_CCP_CLKM);
  415. omap_cfg_reg(Y12_1610_CCP_CLKP);
  416. /* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */
  417. /* omap_cfg_reg(Y14_1610_CCP_DATAM); */
  418. omap_cfg_reg(W14_1610_CCP_DATAP);
  419. /* CAM_PWDN */
  420. if (gpio_request(11, "cam_pwdn") == 0) {
  421. omap_cfg_reg(N20_1610_GPIO11);
  422. gpio_direction_output(11, 0);
  423. } else
  424. pr_debug("OSK+Mistral: CAM_PWDN is awol\n");
  425. /* omap_cfg_reg(P19_1610_GPIO6); */ /* BUSY */
  426. gpio_request(6, "ts_busy");
  427. gpio_direction_input(6);
  428. omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */
  429. gpio_request(4, "ts_int");
  430. gpio_direction_input(4);
  431. irq_set_irq_type(gpio_to_irq(4), IRQ_TYPE_EDGE_FALLING);
  432. mistral_boardinfo[0].irq = gpio_to_irq(4);
  433. spi_register_board_info(mistral_boardinfo,
  434. ARRAY_SIZE(mistral_boardinfo));
  435. /* the sideways button (SW1) is for use as a "wakeup" button
  436. *
  437. * NOTE: The Mistral board has the wakeup button (SW1) wired
  438. * to the LCD 3.3V rail, which is powered down during suspend.
  439. * To allow this button to wake up the omap, work around this
  440. * HW bug by rewiring SW1 to use the main 3.3V rail.
  441. */
  442. omap_cfg_reg(N15_1610_MPUIO2);
  443. if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) {
  444. int ret = 0;
  445. int irq = gpio_to_irq(OMAP_MPUIO(2));
  446. gpio_direction_input(OMAP_MPUIO(2));
  447. irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
  448. #ifdef CONFIG_PM
  449. /* share the IRQ in case someone wants to use the
  450. * button for more than wakeup from system sleep.
  451. */
  452. ret = request_irq(irq,
  453. &osk_mistral_wake_interrupt,
  454. IRQF_SHARED, "mistral_wakeup",
  455. &osk_mistral_wake_interrupt);
  456. if (ret != 0) {
  457. gpio_free(OMAP_MPUIO(2));
  458. printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
  459. ret);
  460. } else
  461. enable_irq_wake(irq);
  462. #endif
  463. } else
  464. printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
  465. /* LCD: backlight, and power; power controls other devices on the
  466. * board, like the touchscreen, EEPROM, and wakeup (!) switch.
  467. */
  468. omap_cfg_reg(PWL);
  469. if (gpio_request(2, "lcd_pwr") == 0)
  470. gpio_direction_output(2, 1);
  471. /*
  472. * GPIO based LEDs
  473. */
  474. omap_cfg_reg(P18_1610_GPIO3);
  475. omap_cfg_reg(MPUIO4);
  476. i2c_register_board_info(1, mistral_i2c_board_info,
  477. ARRAY_SIZE(mistral_i2c_board_info));
  478. platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
  479. }
  480. #else
  481. static void __init osk_mistral_init(void) { }
  482. #endif
  483. #define EMIFS_CS3_VAL (0x88013141)
  484. static void __init osk_init(void)
  485. {
  486. u32 l;
  487. osk_init_smc91x();
  488. osk_init_cf();
  489. /* Workaround for wrong CS3 (NOR flash) timing
  490. * There are some U-Boot versions out there which configure
  491. * wrong CS3 memory timings. This mainly leads to CRC
  492. * or similar errors if you use NOR flash (e.g. with JFFS2)
  493. */
  494. l = omap_readl(EMIFS_CCS(3));
  495. if (l != EMIFS_CS3_VAL)
  496. omap_writel(EMIFS_CS3_VAL, EMIFS_CCS(3));
  497. osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();
  498. osk_flash_resource.end += SZ_32M - 1;
  499. osk5912_smc91x_resources[1].start = gpio_to_irq(0);
  500. osk5912_smc91x_resources[1].end = gpio_to_irq(0);
  501. osk5912_cf_resources[0].start = gpio_to_irq(62);
  502. osk5912_cf_resources[0].end = gpio_to_irq(62);
  503. platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
  504. l = omap_readl(USB_TRANSCEIVER_CTRL);
  505. l |= (3 << 1);
  506. omap_writel(l, USB_TRANSCEIVER_CTRL);
  507. omap1_usb_init(&osk_usb_config);
  508. /* irq for tps65010 chip */
  509. /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */
  510. if (gpio_request(OMAP_MPUIO(1), "tps65010") == 0)
  511. gpio_direction_input(OMAP_MPUIO(1));
  512. omap_serial_init();
  513. osk_i2c_board_info[0].irq = gpio_to_irq(OMAP_MPUIO(1));
  514. omap_register_i2c_bus(1, 400, osk_i2c_board_info,
  515. ARRAY_SIZE(osk_i2c_board_info));
  516. osk_mistral_init();
  517. #ifdef CONFIG_OMAP_OSK_MISTRAL
  518. omapfb_set_lcd_config(&osk_lcd_config);
  519. #endif
  520. }
  521. MACHINE_START(OMAP_OSK, "TI-OSK")
  522. /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
  523. .atag_offset = 0x100,
  524. .map_io = omap16xx_map_io,
  525. .init_early = omap1_init_early,
  526. .init_irq = omap1_init_irq,
  527. .handle_irq = omap1_handle_irq,
  528. .init_machine = osk_init,
  529. .init_late = omap1_init_late,
  530. .init_time = omap1_timer_init,
  531. .restart = omap1_restart,
  532. MACHINE_END