board-n8x0.c 16 KB

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