blob: 9de03f8e2e680c40a8c985f0e76dd2a82eb220c8 [file] [log] [blame]
Kalle Valo63138812009-08-28 10:51:38 -07001/*
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
14#include <linux/clk.h>
15#include <linux/delay.h>
16#include <linux/gpio.h>
17#include <linux/init.h>
18#include <linux/io.h>
19#include <linux/stddef.h>
20#include <linux/spi/spi.h>
21#include <linux/usb/musb.h>
22
23#include <asm/mach/arch.h>
24#include <asm/mach-types.h>
25
Tony Lindgrence491cf2009-10-20 09:40:47 -070026#include <plat/board.h>
27#include <plat/common.h>
Kalle Valo63138812009-08-28 10:51:38 -070028#include <mach/irqs.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070029#include <plat/mcspi.h>
30#include <plat/onenand.h>
31#include <plat/serial.h>
Kalle Valo63138812009-08-28 10:51:38 -070032
33static struct omap2_mcspi_device_config p54spi_mcspi_config = {
34 .turbo_mode = 0,
35 .single_channel = 1,
36};
37
38static struct spi_board_info n800_spi_board_info[] __initdata = {
39 {
40 .modalias = "p54spi",
41 .bus_num = 2,
42 .chip_select = 0,
43 .max_speed_hz = 48000000,
44 .controller_data = &p54spi_mcspi_config,
45 },
46};
47
48#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
49 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
50
51static struct mtd_partition onenand_partitions[] = {
52 {
53 .name = "bootloader",
54 .offset = 0,
55 .size = 0x20000,
56 .mask_flags = MTD_WRITEABLE, /* Force read-only */
57 },
58 {
59 .name = "config",
60 .offset = MTDPART_OFS_APPEND,
61 .size = 0x60000,
62 },
63 {
64 .name = "kernel",
65 .offset = MTDPART_OFS_APPEND,
66 .size = 0x200000,
67 },
68 {
69 .name = "initfs",
70 .offset = MTDPART_OFS_APPEND,
71 .size = 0x400000,
72 },
73 {
74 .name = "rootfs",
75 .offset = MTDPART_OFS_APPEND,
76 .size = MTDPART_SIZ_FULL,
77 },
78};
79
80static struct omap_onenand_platform_data board_onenand_data = {
81 .cs = 0,
82 .gpio_irq = 26,
83 .parts = onenand_partitions,
84 .nr_parts = ARRAY_SIZE(onenand_partitions),
85 .flags = ONENAND_SYNC_READ,
86};
87
88static void __init n8x0_onenand_init(void)
89{
90 gpmc_onenand_init(&board_onenand_data);
91}
92
93#else
94
95static void __init n8x0_onenand_init(void) {}
96
97#endif
98
99static void __init n8x0_map_io(void)
100{
101 omap2_set_globals_242x();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800102 omap242x_map_common_io();
Kalle Valo63138812009-08-28 10:51:38 -0700103}
104
105static void __init n8x0_init_irq(void)
106{
107 omap2_init_common_hw(NULL, NULL);
108 omap_init_irq();
109 omap_gpio_init();
110}
111
112static void __init n8x0_init_machine(void)
113{
114 /* FIXME: add n810 spi devices */
115 spi_register_board_info(n800_spi_board_info,
116 ARRAY_SIZE(n800_spi_board_info));
117
118 omap_serial_init();
119 n8x0_onenand_init();
120}
121
122MACHINE_START(NOKIA_N800, "Nokia N800")
123 .phys_io = 0x48000000,
Santosh Shilimkarb4224b22009-10-19 17:25:55 -0700124 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
Kalle Valo63138812009-08-28 10:51:38 -0700125 .boot_params = 0x80000100,
126 .map_io = n8x0_map_io,
127 .init_irq = n8x0_init_irq,
128 .init_machine = n8x0_init_machine,
129 .timer = &omap_timer,
130MACHINE_END
131
132MACHINE_START(NOKIA_N810, "Nokia N810")
133 .phys_io = 0x48000000,
Santosh Shilimkarb4224b22009-10-19 17:25:55 -0700134 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
Kalle Valo63138812009-08-28 10:51:38 -0700135 .boot_params = 0x80000100,
136 .map_io = n8x0_map_io,
137 .init_irq = n8x0_init_irq,
138 .init_machine = n8x0_init_machine,
139 .timer = &omap_timer,
140MACHINE_END
141
142MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
143 .phys_io = 0x48000000,
Santosh Shilimkarb4224b22009-10-19 17:25:55 -0700144 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
Kalle Valo63138812009-08-28 10:51:38 -0700145 .boot_params = 0x80000100,
146 .map_io = n8x0_map_io,
147 .init_irq = n8x0_init_irq,
148 .init_machine = n8x0_init_machine,
149 .timer = &omap_timer,
150MACHINE_END