blob: 2eb3f94b478e9dac1d20383b1e49354bb6fc79ec [file] [log] [blame]
vikram pandita34c9ac22009-11-18 18:41:08 -08001/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/kernel.h>
10#include <linux/init.h>
11#include <linux/platform_device.h>
12#include <linux/input.h>
13#include <linux/gpio.h>
14
15#include <asm/mach-types.h>
16#include <asm/mach/arch.h>
17
18#include <plat/common.h>
19#include <plat/board.h>
20#include <plat/gpmc-smc91x.h>
vikram pandita34c9ac22009-11-18 18:41:08 -080021#include <plat/usb.h>
22
23#include <mach/board-zoom.h>
Sukumar Ghorai7875eea2010-07-09 14:27:50 +000024#include <mach/board-flash.h>
vikram pandita34c9ac22009-11-18 18:41:08 -080025
Tony Lindgren4896e392009-12-11 16:16:32 -080026#include "mux.h"
vikram pandita34c9ac22009-11-18 18:41:08 -080027#include "sdram-hynix-h8mbx00u0mer-0em.h"
28
29#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
30
31static struct omap_smc91x_platform_data board_smc91x_data = {
32 .cs = 3,
33 .flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,
34};
35
36static void __init board_smc91x_init(void)
37{
38 board_smc91x_data.gpio_irq = 158;
39 gpmc_smc91x_init(&board_smc91x_data);
40}
41
42#else
43
44static inline void board_smc91x_init(void)
45{
46}
47
48#endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
49
50static void enable_board_wakeup_source(void)
51{
Tony Lindgren4896e392009-12-11 16:16:32 -080052 /* T2 interrupt line (keypad) */
53 omap_mux_init_signal("sys_nirq",
54 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
vikram pandita34c9ac22009-11-18 18:41:08 -080055}
56
Felipe Balbi6f69a182010-03-04 09:45:53 +020057static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
vikram pandita34c9ac22009-11-18 18:41:08 -080058
59 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
60 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
61 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
62
63 .phy_reset = true,
64 .reset_gpio_port[0] = 126,
65 .reset_gpio_port[1] = 61,
66 .reset_gpio_port[2] = -EINVAL
67};
68
69static void __init omap_sdp_map_io(void)
70{
Tony Lindgren4f2c49f2010-02-15 08:48:53 -080071 omap2_set_globals_36xx();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -080072 omap34xx_map_common_io();
vikram pandita34c9ac22009-11-18 18:41:08 -080073}
74
75static struct omap_board_config_kernel sdp_config[] __initdata = {
76};
77
78static void __init omap_sdp_init_irq(void)
79{
80 omap_board_config = sdp_config;
81 omap_board_config_size = ARRAY_SIZE(sdp_config);
82 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
83 h8mbx00u0mer0em_sdrc_params);
84 omap_init_irq();
85 omap_gpio_init();
86}
87
Tony Lindgren662c8b52009-12-11 16:16:33 -080088#ifdef CONFIG_OMAP_MUX
89static struct omap_board_mux board_mux[] __initdata = {
90 { .reg_offset = OMAP_MUX_TERMINATOR },
91};
92#else
93#define board_mux NULL
94#endif
95
Sukumar Ghorai7875eea2010-07-09 14:27:50 +000096/*
97 * SDP3630 CS organization
98 * See also the Switch S8 settings in the comments.
99 */
100static char chip_sel_sdp[][GPMC_CS_NUM] = {
101 {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
102 {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
103 {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
104};
105
106static struct mtd_partition sdp_nor_partitions[] = {
107 /* bootloader (U-Boot, etc) in first sector */
108 {
109 .name = "Bootloader-NOR",
110 .offset = 0,
111 .size = SZ_256K,
112 .mask_flags = MTD_WRITEABLE, /* force read-only */
113 },
114 /* bootloader params in the next sector */
115 {
116 .name = "Params-NOR",
117 .offset = MTDPART_OFS_APPEND,
118 .size = SZ_256K,
119 .mask_flags = 0,
120 },
121 /* kernel */
122 {
123 .name = "Kernel-NOR",
124 .offset = MTDPART_OFS_APPEND,
125 .size = SZ_2M,
126 .mask_flags = 0
127 },
128 /* file system */
129 {
130 .name = "Filesystem-NOR",
131 .offset = MTDPART_OFS_APPEND,
132 .size = MTDPART_SIZ_FULL,
133 .mask_flags = 0
134 }
135};
136
137static struct mtd_partition sdp_onenand_partitions[] = {
138 {
139 .name = "X-Loader-OneNAND",
140 .offset = 0,
141 .size = 4 * (64 * 2048),
142 .mask_flags = MTD_WRITEABLE /* force read-only */
143 },
144 {
145 .name = "U-Boot-OneNAND",
146 .offset = MTDPART_OFS_APPEND,
147 .size = 2 * (64 * 2048),
148 .mask_flags = MTD_WRITEABLE /* force read-only */
149 },
150 {
151 .name = "U-Boot Environment-OneNAND",
152 .offset = MTDPART_OFS_APPEND,
153 .size = 1 * (64 * 2048),
154 },
155 {
156 .name = "Kernel-OneNAND",
157 .offset = MTDPART_OFS_APPEND,
158 .size = 16 * (64 * 2048),
159 },
160 {
161 .name = "File System-OneNAND",
162 .offset = MTDPART_OFS_APPEND,
163 .size = MTDPART_SIZ_FULL,
164 },
165};
166
167static struct mtd_partition sdp_nand_partitions[] = {
168 /* All the partition sizes are listed in terms of NAND block size */
169 {
170 .name = "X-Loader-NAND",
171 .offset = 0,
172 .size = 4 * (64 * 2048),
173 .mask_flags = MTD_WRITEABLE, /* force read-only */
174 },
175 {
176 .name = "U-Boot-NAND",
177 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
178 .size = 10 * (64 * 2048),
179 .mask_flags = MTD_WRITEABLE, /* force read-only */
180 },
181 {
182 .name = "Boot Env-NAND",
183
184 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
185 .size = 6 * (64 * 2048),
186 },
187 {
188 .name = "Kernel-NAND",
189 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
190 .size = 40 * (64 * 2048),
191 },
192 {
193 .name = "File System - NAND",
194 .size = MTDPART_SIZ_FULL,
195 .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
196 },
197};
198
199static struct flash_partitions sdp_flash_partitions[] = {
200 {
201 .parts = sdp_nor_partitions,
202 .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
203 },
204 {
205 .parts = sdp_onenand_partitions,
206 .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
207 },
208 {
209 .parts = sdp_nand_partitions,
210 .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
211 },
212};
213
vikram pandita34c9ac22009-11-18 18:41:08 -0800214static void __init omap_sdp_init(void)
215{
Tony Lindgren662c8b52009-12-11 16:16:33 -0800216 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
Sergio Aguirre9e265aa2010-03-01 11:52:36 -0600217 omap_serial_init();
vikram pandita34c9ac22009-11-18 18:41:08 -0800218 zoom_peripherals_init();
219 board_smc91x_init();
Sukumar Ghorai7875eea2010-07-09 14:27:50 +0000220 board_flash_init(sdp_flash_partitions, chip_sel_sdp);
vikram pandita34c9ac22009-11-18 18:41:08 -0800221 enable_board_wakeup_source();
222 usb_ehci_init(&ehci_pdata);
223}
224
225MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
226 .phys_io = 0x48000000,
227 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
228 .boot_params = 0x80000100,
229 .map_io = omap_sdp_map_io,
230 .init_irq = omap_sdp_init_irq,
231 .init_machine = omap_sdp_init,
232 .timer = &omap_timer,
233MACHINE_END