blob: 16538757291a656ea77f798cbadad652bdecd1e7 [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>
24
Manjunath Kondaiah G04aeae72010-10-08 09:58:35 -070025#include "board-flash.h"
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
vikram pandita34c9ac22009-11-18 18:41:08 -080069static struct omap_board_config_kernel sdp_config[] __initdata = {
70};
71
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -080072static void __init omap_sdp_init_early(void)
vikram pandita34c9ac22009-11-18 18:41:08 -080073{
74 omap_board_config = sdp_config;
75 omap_board_config_size = ARRAY_SIZE(sdp_config);
Paul Walmsley48057342010-12-21 15:25:10 -070076 omap2_init_common_infrastructure();
77 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
78 h8mbx00u0mer0em_sdrc_params);
vikram pandita34c9ac22009-11-18 18:41:08 -080079}
80
Tony Lindgren662c8b52009-12-11 16:16:33 -080081#ifdef CONFIG_OMAP_MUX
82static struct omap_board_mux board_mux[] __initdata = {
83 { .reg_offset = OMAP_MUX_TERMINATOR },
84};
Tony Lindgren662c8b52009-12-11 16:16:33 -080085#endif
86
Sukumar Ghorai7875eea2010-07-09 14:27:50 +000087/*
88 * SDP3630 CS organization
89 * See also the Switch S8 settings in the comments.
90 */
91static char chip_sel_sdp[][GPMC_CS_NUM] = {
92 {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
93 {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
94 {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
95};
96
97static struct mtd_partition sdp_nor_partitions[] = {
98 /* bootloader (U-Boot, etc) in first sector */
99 {
100 .name = "Bootloader-NOR",
101 .offset = 0,
102 .size = SZ_256K,
103 .mask_flags = MTD_WRITEABLE, /* force read-only */
104 },
105 /* bootloader params in the next sector */
106 {
107 .name = "Params-NOR",
108 .offset = MTDPART_OFS_APPEND,
109 .size = SZ_256K,
110 .mask_flags = 0,
111 },
112 /* kernel */
113 {
114 .name = "Kernel-NOR",
115 .offset = MTDPART_OFS_APPEND,
116 .size = SZ_2M,
117 .mask_flags = 0
118 },
119 /* file system */
120 {
121 .name = "Filesystem-NOR",
122 .offset = MTDPART_OFS_APPEND,
123 .size = MTDPART_SIZ_FULL,
124 .mask_flags = 0
125 }
126};
127
128static struct mtd_partition sdp_onenand_partitions[] = {
129 {
130 .name = "X-Loader-OneNAND",
131 .offset = 0,
132 .size = 4 * (64 * 2048),
133 .mask_flags = MTD_WRITEABLE /* force read-only */
134 },
135 {
136 .name = "U-Boot-OneNAND",
137 .offset = MTDPART_OFS_APPEND,
138 .size = 2 * (64 * 2048),
139 .mask_flags = MTD_WRITEABLE /* force read-only */
140 },
141 {
142 .name = "U-Boot Environment-OneNAND",
143 .offset = MTDPART_OFS_APPEND,
144 .size = 1 * (64 * 2048),
145 },
146 {
147 .name = "Kernel-OneNAND",
148 .offset = MTDPART_OFS_APPEND,
149 .size = 16 * (64 * 2048),
150 },
151 {
152 .name = "File System-OneNAND",
153 .offset = MTDPART_OFS_APPEND,
154 .size = MTDPART_SIZ_FULL,
155 },
156};
157
158static struct mtd_partition sdp_nand_partitions[] = {
159 /* All the partition sizes are listed in terms of NAND block size */
160 {
161 .name = "X-Loader-NAND",
162 .offset = 0,
163 .size = 4 * (64 * 2048),
164 .mask_flags = MTD_WRITEABLE, /* force read-only */
165 },
166 {
167 .name = "U-Boot-NAND",
168 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
169 .size = 10 * (64 * 2048),
170 .mask_flags = MTD_WRITEABLE, /* force read-only */
171 },
172 {
173 .name = "Boot Env-NAND",
174
175 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
176 .size = 6 * (64 * 2048),
177 },
178 {
179 .name = "Kernel-NAND",
180 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
181 .size = 40 * (64 * 2048),
182 },
183 {
184 .name = "File System - NAND",
185 .size = MTDPART_SIZ_FULL,
186 .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
187 },
188};
189
190static struct flash_partitions sdp_flash_partitions[] = {
191 {
192 .parts = sdp_nor_partitions,
193 .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
194 },
195 {
196 .parts = sdp_onenand_partitions,
197 .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
198 },
199 {
200 .parts = sdp_nand_partitions,
201 .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
202 },
203};
204
vikram pandita34c9ac22009-11-18 18:41:08 -0800205static void __init omap_sdp_init(void)
206{
Tony Lindgren662c8b52009-12-11 16:16:33 -0800207 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
vikram pandita34c9ac22009-11-18 18:41:08 -0800208 zoom_peripherals_init();
Kishore Yed3f9092010-11-15 07:09:04 +0100209 zoom_display_init();
vikram pandita34c9ac22009-11-18 18:41:08 -0800210 board_smc91x_init();
Sukumar Ghorai7875eea2010-07-09 14:27:50 +0000211 board_flash_init(sdp_flash_partitions, chip_sel_sdp);
vikram pandita34c9ac22009-11-18 18:41:08 -0800212 enable_board_wakeup_source();
213 usb_ehci_init(&ehci_pdata);
214}
215
216MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
vikram pandita34c9ac22009-11-18 18:41:08 -0800217 .boot_params = 0x80000100,
Russell King71ee7da2010-05-23 10:18:16 +0100218 .reserve = omap_reserve,
Russell King - ARM Linux3dc3bad2011-02-14 15:40:20 -0800219 .map_io = omap3_map_io,
220 .init_early = omap_sdp_init_early,
221 .init_irq = omap_init_irq,
vikram pandita34c9ac22009-11-18 18:41:08 -0800222 .init_machine = omap_sdp_init,
223 .timer = &omap_timer,
224MACHINE_END