board-n8x0.c 16 KB

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