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 */
14 #include <linux/clk.h>
15 #include <linux/delay.h>
16 #include <linux/gpio.h>
17 #include <linux/init.h>
18 #include <linux/irq.h>
19 #include <linux/io.h>
20 #include <linux/stddef.h>
21 #include <linux/platform_device.h>
22 #include <linux/platform_data/cbus.h>
23 #include <linux/i2c.h>
24 #include <linux/spi/spi.h>
25 #include <linux/usb/musb.h>
26 #include <sound/tlv320aic3x.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach-types.h>
31 #include <plat/board.h>
32 #include "common.h"
33 #include <plat/menelaus.h>
34 #include <mach/irqs.h>
35 #include <plat/mcspi.h>
36 #include <plat/onenand.h>
37 #include <plat/mmc.h>
38 #include <plat/serial.h>
40 #include "mux.h"
42 static int slot1_cover_open;
43 static int slot2_cover_open;
44 static struct device *mmc_device;
46 #define TUSB6010_ASYNC_CS 1
47 #define TUSB6010_SYNC_CS 4
48 #define TUSB6010_GPIO_INT 58
49 #define TUSB6010_GPIO_ENABLE 0
50 #define TUSB6010_DMACHAN 0x3f
52 #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
53 /*
54 * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
55 * 1.5 V voltage regulators of PM companion chip. Companion chip will then
56 * provide then PGOOD signal to TUSB6010 which will release it from reset.
57 */
58 static int tusb_set_power(int state)
59 {
60 int i, retval = 0;
62 if (state) {
63 gpio_set_value(TUSB6010_GPIO_ENABLE, 1);
64 msleep(1);
66 /* Wait until TUSB6010 pulls INT pin down */
67 i = 100;
68 while (i && gpio_get_value(TUSB6010_GPIO_INT)) {
69 msleep(1);
70 i--;
71 }
73 if (!i) {
74 printk(KERN_ERR "tusb: powerup failed\n");
75 retval = -ENODEV;
76 }
77 } else {
78 gpio_set_value(TUSB6010_GPIO_ENABLE, 0);
79 msleep(10);
80 }
82 return retval;
83 }
85 static struct musb_hdrc_config musb_config = {
86 .multipoint = 1,
87 .dyn_fifo = 1,
88 .num_eps = 16,
89 .ram_bits = 12,
90 };
92 static struct musb_hdrc_platform_data tusb_data = {
93 #if defined(CONFIG_USB_MUSB_OTG)
94 .mode = MUSB_OTG,
95 #elif defined(CONFIG_USB_MUSB_PERIPHERAL)
96 .mode = MUSB_PERIPHERAL,
97 #else /* defined(CONFIG_USB_MUSB_HOST) */
98 .mode = MUSB_HOST,
99 #endif
100 .set_power = tusb_set_power,
101 .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
102 .power = 100, /* Max 100 mA VBUS for host mode */
103 .config = &musb_config,
104 };
106 static void __init n8x0_usb_init(void)
107 {
108 int ret = 0;
109 static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
111 /* PM companion chip power control pin */
112 ret = gpio_request_one(TUSB6010_GPIO_ENABLE, GPIOF_OUT_INIT_LOW,
113 "TUSB6010 enable");
114 if (ret != 0) {
115 printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
116 TUSB6010_GPIO_ENABLE);
117 return;
118 }
119 tusb_set_power(0);
121 ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
122 TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,
123 TUSB6010_GPIO_INT, TUSB6010_DMACHAN);
124 if (ret != 0)
125 goto err;
127 printk(announce);
129 return;
131 err:
132 gpio_free(TUSB6010_GPIO_ENABLE);
133 }
134 #else
136 static void __init n8x0_usb_init(void) {}
138 #endif /*CONFIG_USB_MUSB_TUSB6010 */
141 static struct omap2_mcspi_device_config p54spi_mcspi_config = {
142 .turbo_mode = 0,
143 };
145 static struct spi_board_info n800_spi_board_info[] __initdata = {
146 {
147 .modalias = "p54spi",
148 .bus_num = 2,
149 .chip_select = 0,
150 .max_speed_hz = 48000000,
151 .controller_data = &p54spi_mcspi_config,
152 },
153 };
155 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
156 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
158 static struct mtd_partition onenand_partitions[] = {
159 {
160 .name = "bootloader",
161 .offset = 0,
162 .size = 0x20000,
163 .mask_flags = MTD_WRITEABLE, /* Force read-only */
164 },
165 {
166 .name = "config",
167 .offset = MTDPART_OFS_APPEND,
168 .size = 0x60000,
169 },
170 {
171 .name = "kernel",
172 .offset = MTDPART_OFS_APPEND,
173 .size = 0x200000,
174 },
175 {
176 .name = "initfs",
177 .offset = MTDPART_OFS_APPEND,
178 .size = 0x400000,
179 },
180 {
181 .name = "rootfs",
182 .offset = MTDPART_OFS_APPEND,
183 .size = MTDPART_SIZ_FULL,
184 },
185 };
187 static struct omap_onenand_platform_data board_onenand_data[] = {
188 {
189 .cs = 0,
190 .gpio_irq = 26,
191 .parts = onenand_partitions,
192 .nr_parts = ARRAY_SIZE(onenand_partitions),
193 .flags = ONENAND_SYNC_READ,
194 }
195 };
196 #endif
198 #if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE)
200 static struct cbus_host_platform_data n8x0_cbus_data = {
201 .clk_gpio = 66,
202 .dat_gpio = 65,
203 .sel_gpio = 64,
204 };
206 static struct platform_device n8x0_cbus_device = {
207 .name = "cbus",
208 .id = -1,
209 .dev = {
210 .platform_data = &n8x0_cbus_data,
211 },
212 };
214 static struct resource retu_resource[] = {
215 {
216 .start = -EINVAL, /* set later */
217 .flags = IORESOURCE_IRQ,
218 },
219 };
221 static struct platform_device retu_device = {
222 .name = "retu",
223 .id = -1,
224 .resource = retu_resource,
225 .num_resources = ARRAY_SIZE(retu_resource),
226 .dev = {
227 .parent = &n8x0_cbus_device.dev,
228 },
229 };
231 static struct resource tahvo_resource[] = {
232 {
233 .start = -EINVAL, /* set later */
234 .flags = IORESOURCE_IRQ,
235 }
236 };
238 static struct platform_device tahvo_device = {
239 .name = "tahvo",
240 .id = -1,
241 .resource = tahvo_resource,
242 .num_resources = ARRAY_SIZE(tahvo_resource),
243 .dev = {
244 .parent = &n8x0_cbus_device.dev,
245 },
246 };
248 static void __init n8x0_cbus_init(void)
249 {
250 int ret;
252 platform_device_register(&n8x0_cbus_device);
254 ret = gpio_request(108, "RETU irq");
255 if (ret < 0) {
256 pr_err("retu: Unable to reserve IRQ GPIO\n");
257 return;
258 }
260 ret = gpio_direction_input(108);
261 if (ret < 0) {
262 pr_err("retu: Unable to change gpio direction\n");
263 gpio_free(108);
264 return;
265 }
267 irq_set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
268 retu_resource[0].start = gpio_to_irq(108);
269 platform_device_register(&retu_device);
271 ret = gpio_request(111, "TAHVO irq");
272 if (ret) {
273 pr_err("tahvo: Unable to reserve IRQ GPIO\n");
274 gpio_free(108);
275 return;
276 }
278 /* Set the pin as input */
279 ret = gpio_direction_input(111);
280 if (ret) {
281 pr_err("tahvo: Unable to change direction\n");
282 gpio_free(108);
283 gpio_free(111);
284 return;
285 }
287 tahvo_resource[0].start = gpio_to_irq(111);
288 platform_device_register(&tahvo_device);
289 }
291 #else
292 static inline void __init n8x0_cbus_init(void)
293 {
294 }
295 #endif
297 #if defined(CONFIG_MENELAUS) && \
298 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
300 /*
301 * On both N800 and N810, only the first of the two MMC controllers is in use.
302 * The two MMC slots are multiplexed via Menelaus companion chip over I2C.
303 * On N800, both slots are powered via Menelaus. On N810, only one of the
304 * slots is powered via Menelaus. The N810 EMMC is powered via GPIO.
305 *
306 * VMMC slot 1 on both N800 and N810
307 * VDCDC3_APE and VMCS2_APE slot 2 on N800
308 * GPIO23 and GPIO9 slot 2 EMMC on N810
309 *
310 */
311 #define N8X0_SLOT_SWITCH_GPIO 96
312 #define N810_EMMC_VSD_GPIO 23
313 #define N810_EMMC_VIO_GPIO 9
315 static int n8x0_mmc_switch_slot(struct device *dev, int slot)
316 {
317 #ifdef CONFIG_MMC_DEBUG
318 dev_dbg(dev, "Choose slot %d\n", slot + 1);
319 #endif
320 gpio_set_value(N8X0_SLOT_SWITCH_GPIO, slot);
321 return 0;
322 }
324 static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot,
325 int power_on, int vdd)
326 {
327 int mV;
329 #ifdef CONFIG_MMC_DEBUG
330 dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
331 power_on ? "on" : "off", vdd);
332 #endif
333 if (slot == 0) {
334 if (!power_on)
335 return menelaus_set_vmmc(0);
336 switch (1 << vdd) {
337 case MMC_VDD_33_34:
338 case MMC_VDD_32_33:
339 case MMC_VDD_31_32:
340 mV = 3100;
341 break;
342 case MMC_VDD_30_31:
343 mV = 3000;
344 break;
345 case MMC_VDD_28_29:
346 mV = 2800;
347 break;
348 case MMC_VDD_165_195:
349 mV = 1850;
350 break;
351 default:
352 BUG();
353 }
354 return menelaus_set_vmmc(mV);
355 } else {
356 if (!power_on)
357 return menelaus_set_vdcdc(3, 0);
358 switch (1 << vdd) {
359 case MMC_VDD_33_34:
360 case MMC_VDD_32_33:
361 mV = 3300;
362 break;
363 case MMC_VDD_30_31:
364 case MMC_VDD_29_30:
365 mV = 3000;
366 break;
367 case MMC_VDD_28_29:
368 case MMC_VDD_27_28:
369 mV = 2800;
370 break;
371 case MMC_VDD_24_25:
372 case MMC_VDD_23_24:
373 mV = 2400;
374 break;
375 case MMC_VDD_22_23:
376 case MMC_VDD_21_22:
377 mV = 2200;
378 break;
379 case MMC_VDD_20_21:
380 mV = 2000;
381 break;
382 case MMC_VDD_165_195:
383 mV = 1800;
384 break;
385 default:
386 BUG();
387 }
388 return menelaus_set_vdcdc(3, mV);
389 }
390 return 0;
391 }
393 static void n810_set_power_emmc(struct device *dev,
394 int power_on)
395 {
396 dev_dbg(dev, "Set EMMC power %s\n", power_on ? "on" : "off");
398 if (power_on) {
399 gpio_set_value(N810_EMMC_VSD_GPIO, 1);
400 msleep(1);
401 gpio_set_value(N810_EMMC_VIO_GPIO, 1);
402 msleep(1);
403 } else {
404 gpio_set_value(N810_EMMC_VIO_GPIO, 0);
405 msleep(50);
406 gpio_set_value(N810_EMMC_VSD_GPIO, 0);
407 msleep(50);
408 }
409 }
411 static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on,
412 int vdd)
413 {
414 if (machine_is_nokia_n800() || slot == 0)
415 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd);
417 n810_set_power_emmc(dev, power_on);
419 return 0;
420 }
422 static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
423 {
424 int r;
426 dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1,
427 bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
428 BUG_ON(slot != 0 && slot != 1);
429 slot++;
430 switch (bus_mode) {
431 case MMC_BUSMODE_OPENDRAIN:
432 r = menelaus_set_mmc_opendrain(slot, 1);
433 break;
434 case MMC_BUSMODE_PUSHPULL:
435 r = menelaus_set_mmc_opendrain(slot, 0);
436 break;
437 default:
438 BUG();
439 }
440 if (r != 0 && printk_ratelimit())
441 dev_err(dev, "MMC: unable to set bus mode for slot %d\n",
442 slot);
443 return r;
444 }
446 static int n8x0_mmc_get_cover_state(struct device *dev, int slot)
447 {
448 slot++;
449 BUG_ON(slot != 1 && slot != 2);
450 if (slot == 1)
451 return slot1_cover_open;
452 else
453 return slot2_cover_open;
454 }
456 static void n8x0_mmc_callback(void *data, u8 card_mask)
457 {
458 int bit, *openp, index;
460 if (machine_is_nokia_n800()) {
461 bit = 1 << 1;
462 openp = &slot2_cover_open;
463 index = 1;
464 } else {
465 bit = 1;
466 openp = &slot1_cover_open;
467 index = 0;
468 }
470 if (card_mask & bit)
471 *openp = 1;
472 else
473 *openp = 0;
475 omap_mmc_notify_cover_event(mmc_device, index, *openp);
476 }
478 static int n8x0_mmc_late_init(struct device *dev)
479 {
480 int r, bit, *openp;
481 int vs2sel;
483 mmc_device = dev;
485 r = menelaus_set_slot_sel(1);
486 if (r < 0)
487 return r;
489 if (machine_is_nokia_n800())
490 vs2sel = 0;
491 else
492 vs2sel = 2;
494 r = menelaus_set_mmc_slot(2, 0, vs2sel, 1);
495 if (r < 0)
496 return r;
498 n8x0_mmc_set_power(dev, 0, MMC_POWER_ON, 16); /* MMC_VDD_28_29 */
499 n8x0_mmc_set_power(dev, 1, MMC_POWER_ON, 16);
501 r = menelaus_set_mmc_slot(1, 1, 0, 1);
502 if (r < 0)
503 return r;
504 r = menelaus_set_mmc_slot(2, 1, vs2sel, 1);
505 if (r < 0)
506 return r;
508 r = menelaus_get_slot_pin_states();
509 if (r < 0)
510 return r;
512 if (machine_is_nokia_n800()) {
513 bit = 1 << 1;
514 openp = &slot2_cover_open;
515 } else {
516 bit = 1;
517 openp = &slot1_cover_open;
518 slot2_cover_open = 0;
519 }
521 /* All slot pin bits seem to be inversed until first switch change */
522 if (r == 0xf || r == (0xf & ~bit))
523 r = ~r;
525 if (r & bit)
526 *openp = 1;
527 else
528 *openp = 0;
530 r = menelaus_register_mmc_callback(n8x0_mmc_callback, NULL);
532 return r;
533 }
535 static void n8x0_mmc_shutdown(struct device *dev)
536 {
537 int vs2sel;
539 if (machine_is_nokia_n800())
540 vs2sel = 0;
541 else
542 vs2sel = 2;
544 menelaus_set_mmc_slot(1, 0, 0, 0);
545 menelaus_set_mmc_slot(2, 0, vs2sel, 0);
546 }
548 static void n8x0_mmc_cleanup(struct device *dev)
549 {
550 menelaus_unregister_mmc_callback();
552 gpio_free(N8X0_SLOT_SWITCH_GPIO);
554 if (machine_is_nokia_n810()) {
555 gpio_free(N810_EMMC_VSD_GPIO);
556 gpio_free(N810_EMMC_VIO_GPIO);
557 }
558 }
560 /*
561 * MMC controller1 has two slots that are multiplexed via I2C.
562 * MMC controller2 is not in use.
563 */
564 static struct omap_mmc_platform_data mmc1_data = {
565 .nr_slots = 2,
566 .switch_slot = n8x0_mmc_switch_slot,
567 .init = n8x0_mmc_late_init,
568 .cleanup = n8x0_mmc_cleanup,
569 .shutdown = n8x0_mmc_shutdown,
570 .max_freq = 24000000,
571 .dma_mask = 0xffffffff,
572 .slots[0] = {
573 .wires = 4,
574 .set_power = n8x0_mmc_set_power,
575 .set_bus_mode = n8x0_mmc_set_bus_mode,
576 .get_cover_state = n8x0_mmc_get_cover_state,
577 .ocr_mask = MMC_VDD_165_195 | MMC_VDD_30_31 |
578 MMC_VDD_32_33 | MMC_VDD_33_34,
579 .name = "internal",
580 },
581 .slots[1] = {
582 .set_power = n8x0_mmc_set_power,
583 .set_bus_mode = n8x0_mmc_set_bus_mode,
584 .get_cover_state = n8x0_mmc_get_cover_state,
585 .ocr_mask = MMC_VDD_165_195 | MMC_VDD_20_21 |
586 MMC_VDD_21_22 | MMC_VDD_22_23 |
587 MMC_VDD_23_24 | MMC_VDD_24_25 |
588 MMC_VDD_27_28 | MMC_VDD_28_29 |
589 MMC_VDD_29_30 | MMC_VDD_30_31 |
590 MMC_VDD_32_33 | MMC_VDD_33_34,
591 .name = "external",
592 },
593 };
595 static struct omap_mmc_platform_data *mmc_data[OMAP24XX_NR_MMC];
597 static struct gpio n810_emmc_gpios[] __initdata = {
598 { N810_EMMC_VSD_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vddf" },
599 { N810_EMMC_VIO_GPIO, GPIOF_OUT_INIT_LOW, "MMC slot 2 Vdd" },
600 };
602 static void __init n8x0_mmc_init(void)
603 {
604 int err;
606 if (machine_is_nokia_n810()) {
607 mmc1_data.slots[0].name = "external";
609 /*
610 * Some Samsung Movinand chips do not like open-ended
611 * multi-block reads and fall to braind-dead state
612 * while doing so. Reducing the number of blocks in
613 * the transfer or delays in clock disable do not help
614 */
615 mmc1_data.slots[1].name = "internal";
616 mmc1_data.slots[1].ban_openended = 1;
617 }
619 err = gpio_request_one(N8X0_SLOT_SWITCH_GPIO, GPIOF_OUT_INIT_LOW,
620 "MMC slot switch");
621 if (err)
622 return;
624 if (machine_is_nokia_n810()) {
625 err = gpio_request_array(n810_emmc_gpios,
626 ARRAY_SIZE(n810_emmc_gpios));
627 if (err) {
628 gpio_free(N8X0_SLOT_SWITCH_GPIO);
629 return;
630 }
631 }
633 mmc_data[0] = &mmc1_data;
634 omap242x_init_mmc(mmc_data);
635 }
636 #else
638 void __init n8x0_mmc_init(void)
639 {
640 }
641 #endif /* CONFIG_MMC_OMAP */
643 #ifdef CONFIG_MENELAUS
645 static int n8x0_auto_sleep_regulators(void)
646 {
647 u32 val;
648 int ret;
650 val = EN_VPLL_SLEEP | EN_VMMC_SLEEP \
651 | EN_VAUX_SLEEP | EN_VIO_SLEEP \
652 | EN_VMEM_SLEEP | EN_DC3_SLEEP \
653 | EN_VC_SLEEP | EN_DC2_SLEEP;
655 ret = menelaus_set_regulator_sleep(1, val);
656 if (ret < 0) {
657 printk(KERN_ERR "Could not set regulators to sleep on "
658 "menelaus: %u\n", ret);
659 return ret;
660 }
661 return 0;
662 }
664 static int n8x0_auto_voltage_scale(void)
665 {
666 int ret;
668 ret = menelaus_set_vcore_hw(1400, 1050);
669 if (ret < 0) {
670 printk(KERN_ERR "Could not set VCORE voltage on "
671 "menelaus: %u\n", ret);
672 return ret;
673 }
674 return 0;
675 }
677 static int n8x0_menelaus_late_init(struct device *dev)
678 {
679 int ret;
681 ret = n8x0_auto_voltage_scale();
682 if (ret < 0)
683 return ret;
684 ret = n8x0_auto_sleep_regulators();
685 if (ret < 0)
686 return ret;
687 return 0;
688 }
690 #else
691 static int n8x0_menelaus_late_init(struct device *dev)
692 {
693 return 0;
694 }
695 #endif
697 static struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = {
698 .late_init = n8x0_menelaus_late_init,
699 };
701 static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = {
702 {
703 I2C_BOARD_INFO("menelaus", 0x72),
704 .irq = INT_24XX_SYS_NIRQ,
705 .platform_data = &n8x0_menelaus_platform_data,
706 },
707 };
709 static struct aic3x_pdata n810_aic33_data __initdata = {
710 .gpio_reset = 118,
711 };
713 static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
714 {
715 I2C_BOARD_INFO("tlv320aic3x", 0x18),
716 .platform_data = &n810_aic33_data,
717 },
718 };
720 #ifdef CONFIG_OMAP_MUX
721 static struct omap_board_mux board_mux[] __initdata = {
722 /* I2S codec port pins for McBSP block */
723 OMAP2420_MUX(EAC_AC_SCLK, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
724 OMAP2420_MUX(EAC_AC_FS, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
725 OMAP2420_MUX(EAC_AC_DIN, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
726 OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
727 { .reg_offset = OMAP_MUX_TERMINATOR },
728 };
730 static struct omap_device_pad serial2_pads[] __initdata = {
731 {
732 .name = "uart3_rx_irrx.uart3_rx_irrx",
733 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
734 .enable = OMAP_MUX_MODE0,
735 .idle = OMAP_MUX_MODE3 /* Mux as GPIO for idle */
736 },
737 };
739 static inline void board_serial_init(void)
740 {
741 struct omap_board_data bdata;
743 bdata.flags = 0;
744 bdata.pads = NULL;
745 bdata.pads_cnt = 0;
747 bdata.id = 0;
748 omap_serial_init_port(&bdata, NULL);
750 bdata.id = 1;
751 omap_serial_init_port(&bdata, NULL);
753 bdata.id = 2;
754 bdata.pads = serial2_pads;
755 bdata.pads_cnt = ARRAY_SIZE(serial2_pads);
756 omap_serial_init_port(&bdata, NULL);
757 }
759 #else
761 static inline void board_serial_init(void)
762 {
763 omap_serial_init();
764 }
766 #endif
768 static void __init n8x0_init_machine(void)
769 {
770 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
771 n8x0_cbus_init();
773 /* FIXME: add n810 spi devices */
774 spi_register_board_info(n800_spi_board_info,
775 ARRAY_SIZE(n800_spi_board_info));
776 omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
777 ARRAY_SIZE(n8x0_i2c_board_info_1));
778 omap_register_i2c_bus(2, 400, NULL, 0);
779 if (machine_is_nokia_n810())
780 i2c_register_board_info(2, n810_i2c_board_info_2,
781 ARRAY_SIZE(n810_i2c_board_info_2));
782 board_serial_init();
783 omap_sdrc_init(NULL, NULL);
784 gpmc_onenand_init(board_onenand_data);
785 n8x0_mmc_init();
786 n8x0_usb_init();
787 }
789 MACHINE_START(NOKIA_N800, "Nokia N800")
790 .atag_offset = 0x100,
791 .reserve = omap_reserve,
792 .map_io = omap242x_map_io,
793 .init_early = omap2420_init_early,
794 .init_irq = omap2_init_irq,
795 .handle_irq = omap2_intc_handle_irq,
796 .init_machine = n8x0_init_machine,
797 .timer = &omap2_timer,
798 MACHINE_END
800 MACHINE_START(NOKIA_N810, "Nokia N810")
801 .atag_offset = 0x100,
802 .reserve = omap_reserve,
803 .map_io = omap242x_map_io,
804 .init_early = omap2420_init_early,
805 .init_irq = omap2_init_irq,
806 .handle_irq = omap2_intc_handle_irq,
807 .init_machine = n8x0_init_machine,
808 .timer = &omap2_timer,
809 MACHINE_END
811 MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
812 .atag_offset = 0x100,
813 .reserve = omap_reserve,
814 .map_io = omap242x_map_io,
815 .init_early = omap2420_init_early,
816 .init_irq = omap2_init_irq,
817 .handle_irq = omap2_intc_handle_irq,
818 .init_machine = n8x0_init_machine,
819 .timer = &omap2_timer,
820 MACHINE_END