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. #ifdef CONFIG_USB_GADGET_MUSB_HDRC
  75. .mode = MUSB_OTG,
  76. #else
  77. .mode = MUSB_HOST,
  78. #endif
  79. .set_power = tusb_set_power,
  80. .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
  81. .power = 100, /* Max 100 mA VBUS for host mode */
  82. .config = &musb_config,
  83. };
  84. static void __init n8x0_usb_init(void)
  85. {
  86. int ret = 0;
  87. static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
  88. /* PM companion chip power control pin */
  89. ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW,
  90. "TUSB6010 enable");
  91. if (ret != 0) {
  92. printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
  93. TUSB6010_GPIO_ENABLE);
  94. return;
  95. }
  96. tusb_set_power(0);
  97. ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
  98. TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,
  99. TUSB6010_GPIO_INT, TUSB6010_DMACHAN);
  100. if (ret != 0)
  101. goto err;
  102. printk(announce);
  103. return;
  104. err:
  105. gpio_free(TUSB6010_GPIO_ENABLE);
  106. }
  107. #else
  108. static void __init n8x0_usb_init(void) {}
  109. #endif /*CONFIG_USB_MUSB_TUSB6010 */
  110. static struct omap2_mcspi_device_config p54spi_mcspi_config = {
  111. .turbo_mode = 0,
  112. };
  113. static struct spi_board_info n800_spi_board_info[] __initdata = {
  114. {
  115. .modalias = "p54spi",
  116. .bus_num = 2,
  117. .chip_select = 0,
  118. .max_speed_hz = 48000000,
  119. .controller_data = &p54spi_mcspi_config,
  120. },
  121. };
  122. #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
  123. defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
  124. static struct mtd_partition onenand_partitions[] = {
  125. {
  126. .name = "bootloader",
  127. .offset = 0,
  128. .size = 0x20000,
  129. .mask_flags = MTD_WRITEABLE, /* Force read-only */
  130. },
  131. {
  132. .name = "config",
  133. .offset = MTDPART_OFS_APPEND,
  134. .size = 0x60000,
  135. },
  136. {
  137. .name = "kernel",
  138. .offset = MTDPART_OFS_APPEND,
  139. .size = 0x200000,
  140. },
  141. {
  142. .name = "initfs",
  143. .offset = MTDPART_OFS_APPEND,
  144. .size = 0x400000,
  145. },
  146. {
  147. .name = "rootfs",
  148. .offset = MTDPART_OFS_APPEND,
  149. .size = MTDPART_SIZ_FULL,
  150. },
  151. };
  152. static struct omap_onenand_platform_data board_onenand_data[] = {
  153. {
  154. .cs = 0,
  155. .gpio_irq = 26,
  156. .parts = onenand_partitions,
  157. .nr_parts = ARRAY_SIZE(onenand_partitions),
  158. .flags = ONENAND_SYNC_READ,
  159. }
  160. };
  161. #endif
  162. #if defined(CONFIG_MENELAUS) && \
  163. (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
  164. /*
  165. * On both N800 and N810, only the first of the two MMC controllers is in use.
  166. * The two MMC slots are multiplexed via Menelaus companion chip over I2C.
  167. * On N800, both slots are powered via Menelaus. On N810, only one of the
  168. * slots is powered via Menelaus. The N810 EMMC is powered via GPIO.
  169. *
  170. * VMMC slot 1 on both N800 and N810
  171. * VDCDC3_APE and VMCS2_APE slot 2 on N800
  172. * GPIO23 and GPIO9 slot 2 EMMC on N810
  173. *
  174. */
  175. #define N8X0_SLOT_SWITCH_GPIO 96
  176. #define N810_EMMC_VSD_GPIO 23
  177. #define N810_EMMC_VIO_GPIO 9
  178. static int slot1_cover_open;
  179. static int slot2_cover_open;
  180. static struct device *mmc_device;
  181. static int n8x0_mmc_switch_slot(struct device *dev, int slot)
  182. {
  183. #ifdef CONFIG_MMC_DEBUG
  184. dev_dbg(dev, "Choose slot %d\n", slot + 1);
  185. #endif
  186. gpio_set_value(N8X0_SLOT_SWITCH_GPIO, slot);
  187. return 0;
  188. }
  189. static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot,
  190. int power_on, int vdd)
  191. {
  192. int mV;
  193. #ifdef CONFIG_MMC_DEBUG
  194. dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
  195. power_on ? "on" : "off", vdd);
  196. #endif
  197. if (slot == 0) {
  198. if (!power_on)
  199. return menelaus_set_vmmc(0);
  200. switch (1 << vdd) {
  201. case MMC_VDD_33_34:
  202. case MMC_VDD_32_33:
  203. case MMC_VDD_31_32:
  204. mV = 3100;
  205. break;
  206. case MMC_VDD_30_31:
  207. mV = 3000;
  208. break;
  209. case MMC_VDD_28_29:
  210. mV = 2800;
  211. break;
  212. case MMC_VDD_165_195:
  213. mV = 1850;
  214. break;
  215. default:
  216. BUG();
  217. }
  218. return menelaus_set_vmmc(mV);
  219. } else {
  220. if (!power_on)
  221. return menelaus_set_vdcdc(3, 0);
  222. switch (1 << vdd) {
  223. case MMC_VDD_33_34:
  224. case MMC_VDD_32_33:
  225. mV = 3300;
  226. break;
  227. case MMC_VDD_30_31:
  228. case MMC_VDD_29_30:
  229. mV = 3000;
  230. break;
  231. case MMC_VDD_28_29:
  232. case MMC_VDD_27_28:
  233. mV = 2800;
  234. break;
  235. case MMC_VDD_24_25:
  236. case MMC_VDD_23_24:
  237. mV = 2400;
  238. break;
  239. case MMC_VDD_22_23:
  240. case MMC_VDD_21_22:
  241. mV = 2200;
  242. break;
  243. case MMC_VDD_20_21:
  244. mV = 2000;
  245. break;
  246. case MMC_VDD_165_195:
  247. mV = 1800;
  248. break;
  249. default:
  250. BUG();
  251. }
  252. return menelaus_set_vdcdc(3, mV);
  253. }
  254. return 0;
  255. }
  256. static void n810_set_power_emmc(struct device *dev,
  257. int power_on)
  258. {
  259. dev_dbg(dev, "Set EMMC power %s\n", power_on ? "on" : "off");
  260. if (power_on) {
  261. gpio_set_value(N810_EMMC_VSD_GPIO, 1);
  262. msleep(1);
  263. gpio_set_value(N810_EMMC_VIO_GPIO, 1);
  264. msleep(1);
  265. } else {
  266. gpio_set_value(N810_EMMC_VIO_GPIO, 0);
  267. msleep(50);
  268. gpio_set_value(N810_EMMC_VSD_GPIO, 0);
  269. msleep(50);
  270. }
  271. }
  272. static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on,
  273. int vdd)
  274. {
  275. if (machine_is_nokia_n800() || slot == 0)
  276. return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd);
  277. n810_set_power_emmc(dev, power_on);
  278. return 0;
  279. }
  280. static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
  281. {
  282. int r;
  283. dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1,
  284. bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
  285. BUG_ON(slot != 0 && slot != 1);
  286. slot++;
  287. switch (bus_mode) {
  288. case MMC_BUSMODE_OPENDRAIN:
  289. r = menelaus_set_mmc_opendrain(slot, 1);
  290. break;
  291. case MMC_BUSMODE_PUSHPULL:
  292. r = menelaus_set_mmc_opendrain(slot, 0);
  293. break;
  294. default:
  295. BUG();
  296. }
  297. if (r != 0 && printk_ratelimit())
  298. dev_err(dev, "MMC: unable to set bus mode for slot %d\n",
  299. slot);
  300. return r;
  301. }
  302. static int n8x0_mmc_get_cover_state(struct device *dev, int slot)
  303. {
  304. slot++;
  305. BUG_ON(slot != 1 && slot != 2);
  306. if (slot == 1)
  307. return slot1_cover_open;
  308. else
  309. return slot2_cover_open;
  310. }
  311. static void n8x0_mmc_callback(void *data, u8 card_mask)
  312. {
  313. int bit, *openp, index;
  314. if (machine_is_nokia_n800()) {
  315. bit = 1 << 1;
  316. openp = &slot2_cover_open;
  317. index = 1;
  318. } else {
  319. bit = 1;
  320. openp = &slot1_cover_open;
  321. index = 0;
  322. }
  323. if (card_mask & bit)
  324. *openp = 1;
  325. else
  326. *openp = 0;
  327. #ifdef CONFIG_MMC_OMAP
  328. omap_mmc_notify_cover_event(mmc_device, index, *openp);
  329. #else
  330. pr_warn("MMC: notify cover event not available\n");
  331. #endif
  332. }
  333. static int n8x0_mmc_late_init(struct device *dev)
  334. {
  335. int r, bit, *openp;
  336. int vs2sel;
  337. mmc_device = dev;
  338. r = menelaus_set_slot_sel(1);
  339. if (r < 0)
  340. return r;
  341. if (machine_is_nokia_n800())
  342. vs2sel = 0;
  343. else
  344. vs2sel = 2;
  345. r = menelaus_set_mmc_slot(2, 0, vs2sel, 1);
  346. if (r < 0)
  347. return r;
  348. n8x0_mmc_set_power(dev, 0, MMC_POWER_ON, 16); /* MMC_VDD_28_29 */
  349. n8x0_mmc_set_power(dev, 1, MMC_POWER_ON, 16);
  350. r = menelaus_set_mmc_slot(1, 1, 0, 1);
  351. if (r < 0)
  352. return r;
  353. r = menelaus_set_mmc_slot(2, 1, vs2sel, 1);
  354. if (r < 0)
  355. return r;
  356. r = menelaus_get_slot_pin_states();
  357. if (r < 0)
  358. return r;
  359. if (machine_is_nokia_n800()) {
  360. bit = 1 << 1;
  361. openp = &slot2_cover_open;
  362. } else {
  363. bit = 1;
  364. openp = &slot1_cover_open;
  365. slot2_cover_open = 0;
  366. }
  367. /* All slot pin bits seem to be inversed until first switch change */
  368. if (r == 0xf || r == (0xf & ~bit))
  369. r = ~r;
  370. if (r & bit)
  371. *openp = 1;
  372. else
  373. *openp = 0;
  374. r = menelaus_register_mmc_callback(n8x0_mmc_callback, NULL);
  375. return r;
  376. }
  377. static void n8x0_mmc_shutdown(struct device *dev)
  378. {
  379. int vs2sel;
  380. if (machine_is_nokia_n800())
  381. vs2sel = 0;
  382. else
  383. vs2sel = 2;
  384. menelaus_set_mmc_slot(1, 0, 0, 0);
  385. menelaus_set_mmc_slot(2, 0, vs2sel, 0);
  386. }
  387. static void n8x0_mmc_cleanup(struct device *dev)
  388. {
  389. menelaus_unregister_mmc_callback();
  390. gpio_free(N8X0_SLOT_SWITCH_GPIO);
  391. if (machine_is_nokia_n810()) {
  392. gpio_free(N810_EMMC_VSD_GPIO);
  393. gpio_free(N810_EMMC_VIO_GPIO);
  394. }
  395. }
  396. /*
  397. * MMC controller1 has two slots that are multiplexed via I2C.
  398. * MMC controller2 is not in use.
  399. */
  400. static struct omap_mmc_platform_data mmc1_data = {
  401. .nr_slots = 2,
  402. .switch_slot = n8x0_mmc_switch_slot,
  403. .init = n8x0_mmc_late_init,
  404. .cleanup = n8x0_mmc_cleanup,
  405. .shutdown = n8x0_mmc_shutdown,
  406. .max_freq = 24000000,
  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. #ifdef CONFIG_OMAP_MUX
  533. static struct omap_board_mux board_mux[] __initdata = {
  534. /* I2S codec port pins for McBSP block */
  535. OMAP2420_MUX(EAC_AC_SCLK, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  536. OMAP2420_MUX(EAC_AC_FS, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  537. OMAP2420_MUX(EAC_AC_DIN, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
  538. OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
  539. { .reg_offset = OMAP_MUX_TERMINATOR },
  540. };
  541. static struct omap_device_pad serial2_pads[] __initdata = {
  542. {
  543. .name = "uart3_rx_irrx.uart3_rx_irrx",
  544. .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
  545. .enable = OMAP_MUX_MODE0,
  546. .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */
  547. },
  548. };
  549. static inline void board_serial_init(void)
  550. {
  551. struct omap_board_data bdata;
  552. bdata.flags = 0;
  553. bdata.pads = NULL;
  554. bdata.pads_cnt = 0;
  555. bdata.id = 0;
  556. omap_serial_init_port(&bdata, NULL);
  557. bdata.id = 1;
  558. omap_serial_init_port(&bdata, NULL);
  559. bdata.id = 2;
  560. bdata.pads = serial2_pads;
  561. bdata.pads_cnt = ARRAY_SIZE(serial2_pads);
  562. omap_serial_init_port(&bdata, NULL);
  563. }
  564. #else
  565. static inline void board_serial_init(void)
  566. {
  567. omap_serial_init();
  568. }
  569. #endif
  570. static void __init n8x0_init_machine(void)
  571. {
  572. omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
  573. /* FIXME: add n810 spi devices */
  574. spi_register_board_info(n800_spi_board_info,
  575. ARRAY_SIZE(n800_spi_board_info));
  576. omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
  577. ARRAY_SIZE(n8x0_i2c_board_info_1));
  578. omap_register_i2c_bus(2, 400, NULL, 0);
  579. if (machine_is_nokia_n810())
  580. i2c_register_board_info(2, n810_i2c_board_info_2,
  581. ARRAY_SIZE(n810_i2c_board_info_2));
  582. board_serial_init();
  583. omap_sdrc_init(NULL, NULL);
  584. gpmc_onenand_init(board_onenand_data);
  585. n8x0_mmc_init();
  586. n8x0_usb_init();
  587. }
  588. MACHINE_START(NOKIA_N800, "Nokia N800")
  589. .atag_offset = 0x100,
  590. .reserve = omap_reserve,
  591. .map_io = omap242x_map_io,
  592. .init_early = omap2420_init_early,
  593. .init_irq = omap2_init_irq,
  594. .handle_irq = omap2_intc_handle_irq,
  595. .init_machine = n8x0_init_machine,
  596. .init_late = omap2420_init_late,
  597. .timer = &omap2_timer,
  598. .restart = omap_prcm_restart,
  599. MACHINE_END
  600. MACHINE_START(NOKIA_N810, "Nokia N810")
  601. .atag_offset = 0x100,
  602. .reserve = omap_reserve,
  603. .map_io = omap242x_map_io,
  604. .init_early = omap2420_init_early,
  605. .init_irq = omap2_init_irq,
  606. .handle_irq = omap2_intc_handle_irq,
  607. .init_machine = n8x0_init_machine,
  608. .init_late = omap2420_init_late,
  609. .timer = &omap2_timer,
  610. .restart = omap_prcm_restart,
  611. MACHINE_END
  612. MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
  613. .atag_offset = 0x100,
  614. .reserve = omap_reserve,
  615. .map_io = omap242x_map_io,
  616. .init_early = omap2420_init_early,
  617. .init_irq = omap2_init_irq,
  618. .handle_irq = omap2_intc_handle_irq,
  619. .init_machine = n8x0_init_machine,
  620. .init_late = omap2420_init_late,
  621. .timer = &omap2_timer,
  622. .restart = omap_prcm_restart,
  623. MACHINE_END