arm: remove machine_desc.io_pg_offst and .phys_io
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-omap2 / board-3630sdp.c
blobfd27ac0860b0c6b6d217f0d46b61c65a4574c36b
1 /*
2 * Copyright (C) 2009 Texas Instruments Inc.
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 */
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>
15 #include <asm/mach-types.h>
16 #include <asm/mach/arch.h>
18 #include <plat/common.h>
19 #include <plat/board.h>
20 #include <plat/gpmc-smc91x.h>
21 #include <plat/usb.h>
23 #include <mach/board-zoom.h>
24 #include <mach/board-flash.h>
26 #include "mux.h"
27 #include "sdram-hynix-h8mbx00u0mer-0em.h"
29 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
31 static struct omap_smc91x_platform_data board_smc91x_data = {
32 .cs = 3,
33 .flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,
36 static void __init board_smc91x_init(void)
38 board_smc91x_data.gpio_irq = 158;
39 gpmc_smc91x_init(&board_smc91x_data);
42 #else
44 static inline void board_smc91x_init(void)
48 #endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
50 static void enable_board_wakeup_source(void)
52 /* T2 interrupt line (keypad) */
53 omap_mux_init_signal("sys_nirq",
54 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
57 static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
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,
63 .phy_reset = true,
64 .reset_gpio_port[0] = 126,
65 .reset_gpio_port[1] = 61,
66 .reset_gpio_port[2] = -EINVAL
69 static struct omap_board_config_kernel sdp_config[] __initdata = {
72 static void __init omap_sdp_init_irq(void)
74 omap_board_config = sdp_config;
75 omap_board_config_size = ARRAY_SIZE(sdp_config);
76 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
77 h8mbx00u0mer0em_sdrc_params);
78 omap_init_irq();
79 omap_gpio_init();
82 #ifdef CONFIG_OMAP_MUX
83 static struct omap_board_mux board_mux[] __initdata = {
84 { .reg_offset = OMAP_MUX_TERMINATOR },
86 #else
87 #define board_mux NULL
88 #endif
91 * SDP3630 CS organization
92 * See also the Switch S8 settings in the comments.
94 static char chip_sel_sdp[][GPMC_CS_NUM] = {
95 {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
96 {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
97 {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
100 static struct mtd_partition sdp_nor_partitions[] = {
101 /* bootloader (U-Boot, etc) in first sector */
103 .name = "Bootloader-NOR",
104 .offset = 0,
105 .size = SZ_256K,
106 .mask_flags = MTD_WRITEABLE, /* force read-only */
108 /* bootloader params in the next sector */
110 .name = "Params-NOR",
111 .offset = MTDPART_OFS_APPEND,
112 .size = SZ_256K,
113 .mask_flags = 0,
115 /* kernel */
117 .name = "Kernel-NOR",
118 .offset = MTDPART_OFS_APPEND,
119 .size = SZ_2M,
120 .mask_flags = 0
122 /* file system */
124 .name = "Filesystem-NOR",
125 .offset = MTDPART_OFS_APPEND,
126 .size = MTDPART_SIZ_FULL,
127 .mask_flags = 0
131 static struct mtd_partition sdp_onenand_partitions[] = {
133 .name = "X-Loader-OneNAND",
134 .offset = 0,
135 .size = 4 * (64 * 2048),
136 .mask_flags = MTD_WRITEABLE /* force read-only */
139 .name = "U-Boot-OneNAND",
140 .offset = MTDPART_OFS_APPEND,
141 .size = 2 * (64 * 2048),
142 .mask_flags = MTD_WRITEABLE /* force read-only */
145 .name = "U-Boot Environment-OneNAND",
146 .offset = MTDPART_OFS_APPEND,
147 .size = 1 * (64 * 2048),
150 .name = "Kernel-OneNAND",
151 .offset = MTDPART_OFS_APPEND,
152 .size = 16 * (64 * 2048),
155 .name = "File System-OneNAND",
156 .offset = MTDPART_OFS_APPEND,
157 .size = MTDPART_SIZ_FULL,
161 static struct mtd_partition sdp_nand_partitions[] = {
162 /* All the partition sizes are listed in terms of NAND block size */
164 .name = "X-Loader-NAND",
165 .offset = 0,
166 .size = 4 * (64 * 2048),
167 .mask_flags = MTD_WRITEABLE, /* force read-only */
170 .name = "U-Boot-NAND",
171 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
172 .size = 10 * (64 * 2048),
173 .mask_flags = MTD_WRITEABLE, /* force read-only */
176 .name = "Boot Env-NAND",
178 .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
179 .size = 6 * (64 * 2048),
182 .name = "Kernel-NAND",
183 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
184 .size = 40 * (64 * 2048),
187 .name = "File System - NAND",
188 .size = MTDPART_SIZ_FULL,
189 .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
193 static struct flash_partitions sdp_flash_partitions[] = {
195 .parts = sdp_nor_partitions,
196 .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
199 .parts = sdp_onenand_partitions,
200 .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
203 .parts = sdp_nand_partitions,
204 .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
208 static void __init omap_sdp_init(void)
210 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
211 omap_serial_init();
212 zoom_peripherals_init();
213 board_smc91x_init();
214 board_flash_init(sdp_flash_partitions, chip_sel_sdp);
215 enable_board_wakeup_source();
216 usb_ehci_init(&ehci_pdata);
219 MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
220 .boot_params = 0x80000100,
221 .map_io = omap3_map_io,
222 .reserve = omap_reserve,
223 .init_irq = omap_sdp_init_irq,
224 .init_machine = omap_sdp_init,
225 .timer = &omap_timer,
226 MACHINE_END