board-n8x0.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. /*
  2. * linux/arch/arm/mach-omap2/board-n8x0.c
  3. *
  4. * Copyright (C) 2005-2009 Nokia Corporation
  5. * Author: Juha Yrjola <juha.yrjola@nokia.com>
  6. *
  7. * Modified from mach-omap2/board-generic.c
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/clk.h>
  14. #include <linux/delay.h>
  15. #include <linux/gpio.h>
  16. #include <linux/init.h>
  17. #include <linux/io.h>
  18. #include <linux/stddef.h>
  19. #include <linux/i2c.h>
  20. #include <linux/spi/spi.h>
  21. #include <linux/usb/musb.h>
  22. #include <sound/tlv320aic3x.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach-types.h>
  25. #include <plat/board.h>
  26. #include "common.h"
  27. #include <plat/menelaus.h>
  28. #include <mach/irqs.h>
  29. #include <plat/mcspi.h>
  30. #include <plat/onenand.h>
  31. #include <plat/mmc.h>
  32. #include <plat/serial.h>
  33. #include "mux.h"
  34. #define TUSB6010_ASYNC_CS 1
  35. #define TUSB6010_SYNC_CS 4
  36. #define TUSB6010_GPIO_INT 58
  37. #define TUSB6010_GPIO_ENABLE 0
  38. #define TUSB6010_DMACHAN 0x3f
  39. #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
  40. /*
  41. * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
  42. * 1.5 V voltage regulators of PM companion chip. Companion chip will then
  43. * provide then PGOOD signal to TUSB6010 which will release it from reset.
  44. */
  45. static int tusb_set_power(int state)
  46. {
  47. int i, retval = 0;
  48. if (state) {
  49. gpio_set_value(TUSB6010_GPIO_ENABLE, 1);
  50. msleep(1);
  51. /* Wait until TUSB6010 pulls INT pin down */
  52. i = 100;
  53. while (i && gpio_get_value(TUSB6010_GPIO_INT)) {
  54. msleep(1);
  55. i--;
  56. }
  57. if (!i) {
  58. printk(KERN_ERR "tusb: powerup failed\n");
  59. retval = -ENODEV;
  60. }
  61. } else {
  62. gpio_set_value(TUSB6010_GPIO_ENABLE, 0);
  63. msleep(10);
  64. }
  65. return retval;
  66. }
  67. static struct musb_hdrc_config musb_config = {
  68. .multipoint = 1,
  69. .dyn_fifo = 1,
  70. .num_eps = 16,
  71. .ram_bits = 12,
  72. };
  73. static struct musb_hdrc_platform_data tusb_data = {
  74. #if defined(CONFIG_USB_MUSB_OTG)
  75. .mode = MUSB_OTG,
  76. #elif defined(CONFIG_USB_MUSB_PERIPHERAL)
  77. .mode = MUSB_PERIPHERAL,
  78. #else /* defined(CONFIG_USB_MUSB_HOST) */
  79. .mode = MUSB_HOST,
  80. #endif
  81. .set_power = tusb_set_power,
  82. .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
  83. .power = 100, /* Max 100 mA VBUS for host mode */
  84. .config = &musb_config,
  85. };
  86. static void __init n8x0_usb_init(void)
  87. {
  88. int ret = 0;
  89. static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
  90. /* PM companion chip power control pin */
  91. ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW,
  92. "TUSB6010 enable");
  93. if (ret != 0) {
  94. printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
  95. TUSB6010_GPIO_ENABLE);
  96. return;
  97. }
  98. tusb_set_power(0);
  99. ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
  100. TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,
  101. TUSB6010_GPIO_INT, TUSB6010_DMACHAN);
  102. if (ret != 0)
  103. goto err;
  104. printk(announce);
  105. return;
  106. err:
  107. gpio_free(TUSB6010_GPIO_ENABLE);
  108. }
  109. #else
  110. static void __init n8x0_usb_init(void) {}
  111. #endif /*CONFIG_USB_MUSB_TUSB6010 */
  112. static struct omap2_mcspi_device_config p54spi_mcspi_config = {
  113. .turbo_mode = 0,
  114. };
  115. static struct spi_board_info n800_spi_board_info[] __initdata = {
  116. {
  117. .modalias = "p54spi",
  118. .bus_num = 2,
  119. .chip_select = 0,
  120. .max_speed_hz = 48000000,
  121. .controller_data = &p54spi_mcspi_config,
  122. },
  123. };
  124. #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
  125. defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
  126. static struct mtd_partition onenand_partitions[] = {
  127. {
  128. .name = "bootloader",
  129. .offset = 0,
  130. .size = 0x20000,
  131. .mask_flags = MTD_WRITEABLE, /* Force read-only */
  132. },
  133. {
  134. .name = "config",
  135. .offset = MTDPART_OFS_APPEND,
  136. .size = 0x60000,
  137. },
  138. {
  139. .name = "kernel",
  140. .offset = MTDPART_OFS_APPEND,
  141. .size = 0x200000,
  142. },
  143. {
  144. .name = "initfs",
  145. .offset = MTDPART_OFS_APPEND,
  146. .size = 0x400000,
  147. },
  148. {
  149. .name = "rootfs",
  150. .offset = MTDPART_OFS_APPEND,
  151. .size = MTDPART_SIZ_FULL,
  152. },
  153. };
  154. static struct omap_onenand_platform_data board_onenand_data[] = {
  155. {
  156. .cs = 0,
  157. .gpio_irq = 26,
  158. .parts = onenand_partitions,
  159. .nr_parts = ARRAY_SIZE(onenand_partitions),
  160. .flags = ONENAND_SYNC_READ,
  161. }
  162. };
  163. #endif
  164. #if defined(CONFIG_MENELAUS) && \
  165. (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
  166. /*
  167. * On both N800 and N810, only the first of the two MMC controllers is in use.
  168. * The two MMC slots are multiplexed via Menelaus companion chip over I2C.
  169. * On N800, both slots are powered via Menelaus. On N810, only one of the
  170. * slots is powered via Menelaus. The N810 EMMC is powered via GPIO.
  171. *
  172. * VMMC slot 1 on both N800 and N810
  173. * VDCDC3_APE and VMCS2_APE slot 2 on N800
  174. * GPIO23 and GPIO9 slot 2 EMMC on N810
  175. *
  176. */
  177. #define N8X0_SLOT_SWITCH_GPIO 96
  178. #define N810_EMMC_VSD_GPIO 23
  179. #define N810_EMMC_VIO_GPIO 9
  180. static int slot1_cover_open;
  181. static int slot2_cover_open;
  182. static struct device *mmc_device;
  183. static int n8x0_mmc_switch_slot(struct device *dev, int slot)
  184. {
  185. #ifdef CONFIG_MMC_DEBUG
  186. dev_dbg(dev, "Choose slot %d\n", slot + 1);
  187. #endif
  188. gpio_set_value(N8X0_SLOT_SWITCH_GPIO, slot);
  189. return 0;
  190. }
  191. static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot,
  192. int power_on, int vdd)
  193. {
  194. int mV;
  195. #ifdef CONFIG_MMC_DEBUG
  196. dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
  197. power_on ? "on" : "off", vdd);
  198. #endif
  199. if (slot == 0) {
  200. if (!power_on)
  201. return menelaus_set_vmmc(0);
  202. switch (1 << vdd) {
  203. case MMC_VDD_33_34:
  204. case MMC_VDD_32_33:
  205. case MMC_VDD_31_32:
  206. mV = 3100;
  207. break;
  208. case MMC_VDD_30_31:
  209. mV = 3000;
  210. break;
  211. case MMC_VDD_28_29:
  212. mV = 2800;
  213. break;
  214. case MMC_VDD_165_195:
  215. mV = 1850;
  216. break;
  217. default:
  218. BUG();
  219. }
  220. return menelaus_set_vmmc(mV);
  221. } else {
  222. if (!power_on)
  223. return menelaus_set_vdcdc(3, 0);
  224. switch (1 << vdd) {
  225. case MMC_VDD_33_34:
  226. case MMC_VDD_32_33:
  227. mV = 3300;
  228. break;
  229. case MMC_VDD_30_31:
  230. case MMC_VDD_29_30:
  231. mV = 3000;
  232. break;
  233. case MMC_VDD_28_29:
  234. case MMC_VDD_27_28:
  235. mV = 2800;
  236. break;
  237. case MMC_VDD_24_25:
  238. case MMC_VDD_23_24:
  239. mV = 2400;
  240. break;
  241. case MMC_VDD_22_23:
  242. case MMC_VDD_21_22:
  243. mV = 2200;
  244. break;
  245. case MMC_VDD_20_21:
  246. mV = 2000;
  247. break;
  248. case MMC_VDD_165_195:
  249. mV = 1800;
  250. break;
  251. default:
  252. BUG();
  253. }
  254. return menelaus_set_vdcdc(3, mV);
  255. }
  256. return 0;
  257. }
  258. static void n810_set_power_emmc(struct device *dev,
  259. int power_on)
  260. {
  261. dev_dbg(dev, "Set EMMC power %s\n", power_on ? "on" : "off");
  262. if (power_on) {
  263. gpio_set_value(N810_EMMC_VSD_GPIO, 1);
  264. msleep(1);
  265. gpio_set_value(N810_EMMC_VIO_GPIO, 1);
  266. msleep(1);
  267. } else {
  268. gpio_set_value(N810_EMMC_VIO_GPIO, 0);
  269. msleep(50);
  270. gpio_set_value(N810_EMMC_VSD_GPIO, 0);
  271. msleep(50);
  272. }
  273. }
  274. static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on,
  275. int vdd)
  276. {
  277. if (machine_is_nokia_n800() || slot == 0)
  278. return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd);
  279. n810_set_power_emmc(dev, power_on);
  280. return 0;
  281. }
  282. static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
  283. {
  284. int r;
  285. dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1,
  286. bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
  287. BUG_ON(slot != 0 && slot != 1);
  288. slot++;
  289. switch (bus_mode) {
  290. case MMC_BUSMODE_OPENDRAIN:
  291. r = menelaus_set_mmc_opendrain(slot, 1);
  292. break;
  293. case MMC_BUSMODE_PUSHPULL:
  294. r = menelaus_set_mmc_opendrain(slot, 0);
  295. break;
  296. default:
  297. BUG();
  298. }
  299. if (r != 0 && printk_ratelimit())
  300. dev_err(dev, "MMC: unable to set bus mode for slot %d\n",
  301. slot);
  302. return r;
  303. }
  304. static int n8x0_mmc_get_cover_state(struct device *dev, int slot)
  305. {
  306. slot++;
  307. BUG_ON(slot != 1 && slot != 2);
  308. if (slot == 1)
  309. return slot1_cover_open;
  310. else
  311. return slot2_cover_open;
  312. }
  313. static void n8x0_mmc_callback(void *data, u8 card_mask)
  314. {
  315. int bit, *openp, index;
  316. if (machine_is_nokia_n800()) {
  317. bit = 1 << 1;
  318. openp = &slot2_cover_open;
  319. index = 1;
  320. } else {
  321. bit = 1;
  322. openp = &slot1_cover_open;
  323. index = 0;
  324. }
  325. if (card_mask & bit)
  326. *openp = 1;
  327. else
  328. *openp = 0;
  329. #ifdef CONFIG_MMC_OMAP
  330. omap_mmc_notify_cover_event(mmc_device, index, *openp);
  331. #else
  332. pr_warn("MMC: notify cover event not available\n");
  333. #endif
  334. }
  335. static int n8x0_mmc_late_init(struct device *dev)
  336. {
  337. int r, bit, *openp;
  338. int vs2sel;
  339. mmc_device = dev;
  340. r = menelaus_set_slot_sel(1);
  341. if (r < 0)
  342. return r;
  343. if (machine_is_nokia_n800())
  344. vs2sel = 0;
  345. else
  346. vs2sel = 2;
  347. r = menelaus_set_mmc_slot(2, 0, vs2sel, 1);
  348. if (r < 0)
  349. return r;
  350. n8x0_mmc_set_power(dev, 0, MMC_POWER_ON, 16); /* MMC_VDD_28_29 */
  351. n8x0_mmc_set_power(dev, 1, MMC_POWER_ON, 16);
  352. r = menelaus_set_mmc_slot(1, 1, 0, 1);
  353. if (r < 0)
  354. return r;
  355. r = menelaus_set_mmc_slot(2, 1, vs2sel, 1);
  356. if (r < 0)
  357. return r;
  358. r = menelaus_get_slot_pin_states();
  359. if (r < 0)
  360. return r;
  361. if (machine_is_nokia_n800()) {
  362. bit = 1 << 1;
  363. openp = &slot2_cover_open;
  364. } else {
  365. bit = 1;
  366. openp = &slot1_cover_open;
  367. slot2_cover_open = 0;
  368. }
  369. /* All slot pin bits seem to be inversed until first switch change */
  370. if (r == 0xf || r == (0xf & ~bit))
  371. r = ~r;
  372. if (r & bit)
  373. *openp = 1;
  374. else
  375. *openp = 0;
  376. r = menelaus_register_mmc_callback(n8x0_mmc_callback, NULL);
  377. return r;
  378. }
  379. static void n8x0_mmc_shutdown(struct device *dev)
  380. {
  381. int vs2sel;
  382. if (machine_is_nokia_n800())
  383. vs2sel = 0;
  384. else
  385. vs2sel = 2;
  386. menelaus_set_mmc_slot(1, 0, 0, 0);
  387. menelaus_set_mmc_slot(2, 0, vs2sel, 0);
  388. }
  389. static void n8x0_mmc_cleanup(struct device *dev)
  390. {
  391. menelaus_unregister_mmc_callback();
  392. gpio_free(N8X0_SLOT_SWITCH_GPIO);
  393. if (machine_is_nokia_n810()) {
  394. gpio_free(N810_EMMC_VSD_GPIO);
  395. gpio_free(N810_EMMC_VIO_GPIO);
  396. }
  397. }
  398. /*
  399. * MMC controller1 has two slots that are multiplexed via I2C.
  400. * MMC controller2 is not in use.
  401. */
  402. static struct omap_mmc_platform_data mmc1_data = {
  403. .nr_slots = 2,
  404. .switch_slot = n8x0_mmc_switch_slot,
  405. .init = n8x0_mmc_late_init,
  406. .cleanup = n8x0_mmc_cleanup,
  407. .shutdown = n8x0_mmc_shutdown,
  408. .max_freq = 24000000,
  409. .dma_mask = 0xffffffff,
  410. .slots[0] = {
  411. .wires = 4,
  412. .set_power = n8x0_mmc_set_power,
  413. .set_bus_mode = n8x0_mmc_set_bus_mode,
  414. .get_cover_state = n8x0_mmc_get_cover_state,
  415. .ocr_mask = MMC_VDD_165_195 | MMC_VDD_30_31 |
  416. MMC_VDD_32_33 | MMC_VDD_33_34,
  417. .name = "internal",
  418. },
  419. .slots[1] = {
  420. .set_power = n8x0_mmc_set_power,
  421. .set_bus_mode = n8x0_mmc_set_bus_mode,
  422. .get_cover_state = n8x0_mmc_get_cover_state,
  423. .ocr_mask = MMC_VDD_165_195 | MMC_VDD_20_21 |
  424. MMC_VDD_21_22 | MMC_VDD_22_23 |
  425. MMC_VDD_23_24 | MMC_VDD_24_25 |
  426. MMC_VDD_27_28 | MMC_VDD_28_29 |
  427. MMC_VDD_29_30 | MMC_VDD_30_31 |
  428. MMC_VDD_32_33 | MMC_VDD_33_34,
  429. .name = "external",
  430. },
  431. };
  432. static struct omap_mmc_platform_data *mmc_data[OMAP24XX_NR_MMC];
  433. static struct gpio n810_emmc_gpios[] __initdata = {
  434. { N810_EMMC_VSD_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vddf" },
  435. { N810_EMMC_VIO_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vdd" },
  436. };
  437. static void __init n8x0_mmc_init(void)
  438. {
  439. int err;
  440. if (machine_is_nokia_n810()) {
  441. mmc1_data.slots[0].name = "external";
  442. /*
  443. * Some Samsung Movinand chips do not like open-ended
  444. * multi-block reads and fall to braind-dead state
  445. * while doing so. Reducing the number of blocks in
  446. * the transfer or delays in clock disable do not help
  447. */
  448. mmc1_data.slots[1].name = "internal";
  449. mmc1_data.slots[1].ban_openended = 1;
  450. }
  451. err = gpio_request_one(N8X0_SLOT_SWITCH_GPIO, GPIOF_OUT_INIT_LOW,
  452. "MMC slot switch");
  453. if (err)
  454. return;
  455. if (machine_is_nokia_n810()) {
  456. err = gpio_request_array(n810_emmc_gpios,
  457. ARRAY_SIZE(n810_emmc_gpios));
  458. if (err) {
  459. gpio_free(N8X0_SLOT_SWITCH_GPIO);
  460. return;
  461. }
  462. }
  463. mmc_data[0] = &mmc1_data;
  464. omap242x_init_mmc(mmc_data);
  465. }
  466. #else
  467. void __init n8x0_mmc_init(void)
  468. {
  469. }
  470. #endif /* CONFIG_MMC_OMAP */
  471. #ifdef CONFIG_MENELAUS
  472. static int n8x0_auto_sleep_regulators(void)
  473. {
  474. u32 val;
  475. int ret;
  476. val = EN_VPLL_SLEEP | EN_VMMC_SLEEP \
  477. | EN_VAUX_SLEEP | EN_VIO_SLEEP \
  478. | EN_VMEM_SLEEP | EN_DC3_SLEEP \
  479. | EN_VC_SLEEP | EN_DC2_SLEEP;
  480. ret = menelaus_set_regulator_sleep(1, val);
  481. if (ret < 0) {
  482. printk(KERN_ERR "Could not set regulators to sleep on "
  483. "menelaus: %u\n", ret);
  484. return ret;
  485. }
  486. return 0;
  487. }
  488. static int n8x0_auto_voltage_scale(void)
  489. {
  490. int ret;
  491. ret = menelaus_set_vcore_hw(1400, 1050);
  492. if (ret < 0) {
  493. printk(KERN_ERR "Could not set VCORE voltage on "
  494. "menelaus: %u\n", ret);
  495. return ret;
  496. }
  497. return 0;
  498. }
  499. static int n8x0_menelaus_late_init(struct device *dev)
  500. {
  501. int ret;
  502. ret = n8x0_auto_voltage_scale();
  503. if (ret < 0)
  504. return ret;
  505. ret = n8x0_auto_sleep_regulators();
  506. if (ret < 0)
  507. return ret;
  508. return 0;
  509. }
  510. #else
  511. static int n8x0_menelaus_late_init(struct device *dev)
  512. {
  513. return 0;
  514. }
  515. #endif
  516. static struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = {
  517. .late_init = n8x0_menelaus_late_init,
  518. };
  519. static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = {
  520. {
  521. I2C_BOARD_INFO("menelaus", 0x72),
  522. .irq = INT_24XX_SYS_NIRQ,
  523. .platform_data = &n8x0_menelaus_platform_data,
  524. },
  525. };
  526. static struct aic3x_pdata n810_aic33_data __initdata = {
  527. .gpio_reset = 118,
  528. };
  529. static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
  530. {
  531. I2C_BOARD_INFO("tlv320aic3x", 0x18),
  532. .platform_data = &n810_aic33_data,
  533. },
  534. };
  535. #ifdef CONFIG_OMAP_MUX
  536. static struct omap_board_mux board_mux[] __initdata = {
  537. /* I2S codec port pins for McBSP block */
  538. OMAP2420_MUX(EAC_AC_SCLK, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  539. OMAP2420_MUX(EAC_AC_FS, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  540. OMAP2420_MUX(EAC_AC_DIN, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  541. OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
  542. { .reg_offset = OMAP_MUX_TERMINATOR },
  543. };
  544. static struct omap_device_pad serial2_pads[] __initdata = {
  545. {
  546. .name = "uart3_rx_irrx.uart3_rx_irrx",
  547. .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
  548. .enable = OMAP_MUX_MODE0,
  549. .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */
  550. },
  551. };
  552. static inline void board_serial_init(void)
  553. {
  554. struct omap_board_data bdata;
  555. bdata.flags = 0;
  556. bdata.pads = NULL;
  557. bdata.pads_cnt = 0;
  558. bdata.id = 0;
  559. omap_serial_init_port(&bdata, NULL);
  560. bdata.id = 1;
  561. omap_serial_init_port(&bdata, NULL);
  562. bdata.id = 2;
  563. bdata.pads = serial2_pads;
  564. bdata.pads_cnt = ARRAY_SIZE(serial2_pads);
  565. omap_serial_init_port(&bdata, NULL);
  566. }
  567. #else
  568. static inline void board_serial_init(void)
  569. {
  570. omap_serial_init();
  571. }
  572. #endif
  573. static void __init n8x0_init_machine(void)
  574. {
  575. omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
  576. /* FIXME: add n810 spi devices */
  577. spi_register_board_info(n800_spi_board_info,
  578. ARRAY_SIZE(n800_spi_board_info));
  579. omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
  580. ARRAY_SIZE(n8x0_i2c_board_info_1));
  581. omap_register_i2c_bus(2, 400, NULL, 0);
  582. if (machine_is_nokia_n810())
  583. i2c_register_board_info(2, n810_i2c_board_info_2,
  584. ARRAY_SIZE(n810_i2c_board_info_2));
  585. board_serial_init();
  586. omap_sdrc_init(NULL, NULL);
  587. gpmc_onenand_init(board_onenand_data);
  588. n8x0_mmc_init();
  589. n8x0_usb_init();
  590. }
  591. MACHINE_START(NOKIA_N800, "Nokia N800")
  592. .atag_offset = 0x100,
  593. .reserve = omap_reserve,
  594. .map_io = omap242x_map_io,
  595. .init_early = omap2420_init_early,
  596. .init_irq = omap2_init_irq,
  597. .handle_irq = omap2_intc_handle_irq,
  598. .init_machine = n8x0_init_machine,
  599. .timer = &omap2_timer,
  600. .restart = omap_prcm_restart,
  601. MACHINE_END
  602. MACHINE_START(NOKIA_N810, "Nokia N810")
  603. .atag_offset = 0x100,
  604. .reserve = omap_reserve,
  605. .map_io = omap242x_map_io,
  606. .init_early = omap2420_init_early,
  607. .init_irq = omap2_init_irq,
  608. .handle_irq = omap2_intc_handle_irq,
  609. .init_machine = n8x0_init_machine,
  610. .timer = &omap2_timer,
  611. .restart = omap_prcm_restart,
  612. MACHINE_END
  613. MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
  614. .atag_offset = 0x100,
  615. .reserve = omap_reserve,
  616. .map_io = omap242x_map_io,
  617. .init_early = omap2420_init_early,
  618. .init_irq = omap2_init_irq,
  619. .handle_irq = omap2_intc_handle_irq,
  620. .init_machine = n8x0_init_machine,
  621. .timer = &omap2_timer,
  622. .restart = omap_prcm_restart,
  623. MACHINE_END