board-n8x0.c 16 KB

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