aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-n8x0.c
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@iki.fi>2009-08-28 13:51:38 -0400
committerTony Lindgren <tony@atomide.com>2009-08-28 13:51:38 -0400
commit6313881292c238190bc119404ae13f65c61b2daa (patch)
tree711414ecc91c5152a56aafa60a039254bc853b5e /arch/arm/mach-omap2/board-n8x0.c
parent1b52d5df64bea12bed82dbc1c736638e77d1ce80 (diff)
OMAP2: add board file for Nokia N800 and N810
Add board file for Nokia N800 and N810 devices. Currently only serial ports, onenand and spi are configured, more to come later. Tested on Nokia N800. Signed-off-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-n8x0.c')
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c150
1 files changed, 150 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
new file mode 100644
index 000000000000..8341632d260b
--- /dev/null
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -0,0 +1,150 @@
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
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
26#include <mach/board.h>
27#include <mach/common.h>
28#include <mach/irqs.h>
29#include <mach/mcspi.h>
30#include <mach/onenand.h>
31#include <mach/serial.h>
32
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();
102 omap2_map_common_io();
103}
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,
124 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
125 .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,
134 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
135 .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,
144 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
145 .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