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.
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 #include <linux/mtd/nand.h>
16 #include <asm/mach-types.h>
17 #include <asm/mach/arch.h>
20 #include "gpmc-smc91x.h"
22 #include "board-zoom.h"
24 #include "board-flash.h"
26 #include "sdram-hynix-h8mbx00u0mer-0em.h"
28 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
30 static struct omap_smc91x_platform_data board_smc91x_data
= {
32 .flags
= GPMC_MUX_ADD_DATA
| IORESOURCE_IRQ_LOWLEVEL
,
35 static void __init
board_smc91x_init(void)
37 board_smc91x_data
.gpio_irq
= 158;
38 gpmc_smc91x_init(&board_smc91x_data
);
43 static inline void board_smc91x_init(void)
47 #endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
49 static void enable_board_wakeup_source(void)
51 /* T2 interrupt line (keypad) */
52 omap_mux_init_signal("sys_nirq",
53 OMAP_WAKEUP_EN
| OMAP_PIN_INPUT_PULLUP
);
56 static struct usbhs_phy_data phy_data
[] __initdata
= {
69 static struct usbhs_omap_platform_data usbhs_bdata __initdata
= {
71 .port_mode
[0] = OMAP_EHCI_PORT_MODE_PHY
,
72 .port_mode
[1] = OMAP_EHCI_PORT_MODE_PHY
,
75 #ifdef CONFIG_OMAP_MUX
76 static struct omap_board_mux board_mux
[] __initdata
= {
77 { .reg_offset
= OMAP_MUX_TERMINATOR
},
82 * SDP3630 CS organization
83 * See also the Switch S8 settings in the comments.
85 static char chip_sel_sdp
[][GPMC_CS_NUM
] = {
86 {PDC_NOR
, PDC_NAND
, PDC_ONENAND
, DBG_MPDB
, 0, 0, 0, 0}, /* S8:1111 */
87 {PDC_ONENAND
, PDC_NAND
, PDC_NOR
, DBG_MPDB
, 0, 0, 0, 0}, /* S8:1110 */
88 {PDC_NAND
, PDC_ONENAND
, PDC_NOR
, DBG_MPDB
, 0, 0, 0, 0}, /* S8:1101 */
91 static struct mtd_partition sdp_nor_partitions
[] = {
92 /* bootloader (U-Boot, etc) in first sector */
94 .name
= "Bootloader-NOR",
97 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
99 /* bootloader params in the next sector */
101 .name
= "Params-NOR",
102 .offset
= MTDPART_OFS_APPEND
,
108 .name
= "Kernel-NOR",
109 .offset
= MTDPART_OFS_APPEND
,
115 .name
= "Filesystem-NOR",
116 .offset
= MTDPART_OFS_APPEND
,
117 .size
= MTDPART_SIZ_FULL
,
122 static struct mtd_partition sdp_onenand_partitions
[] = {
124 .name
= "X-Loader-OneNAND",
126 .size
= 4 * (64 * 2048),
127 .mask_flags
= MTD_WRITEABLE
/* force read-only */
130 .name
= "U-Boot-OneNAND",
131 .offset
= MTDPART_OFS_APPEND
,
132 .size
= 2 * (64 * 2048),
133 .mask_flags
= MTD_WRITEABLE
/* force read-only */
136 .name
= "U-Boot Environment-OneNAND",
137 .offset
= MTDPART_OFS_APPEND
,
138 .size
= 1 * (64 * 2048),
141 .name
= "Kernel-OneNAND",
142 .offset
= MTDPART_OFS_APPEND
,
143 .size
= 16 * (64 * 2048),
146 .name
= "File System-OneNAND",
147 .offset
= MTDPART_OFS_APPEND
,
148 .size
= MTDPART_SIZ_FULL
,
152 static struct mtd_partition sdp_nand_partitions
[] = {
153 /* All the partition sizes are listed in terms of NAND block size */
155 .name
= "X-Loader-NAND",
157 .size
= 4 * (64 * 2048),
158 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
161 .name
= "U-Boot-NAND",
162 .offset
= MTDPART_OFS_APPEND
, /* Offset = 0x80000 */
163 .size
= 10 * (64 * 2048),
164 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
167 .name
= "Boot Env-NAND",
169 .offset
= MTDPART_OFS_APPEND
, /* Offset = 0x1c0000 */
170 .size
= 6 * (64 * 2048),
173 .name
= "Kernel-NAND",
174 .offset
= MTDPART_OFS_APPEND
, /* Offset = 0x280000 */
175 .size
= 40 * (64 * 2048),
178 .name
= "File System - NAND",
179 .size
= MTDPART_SIZ_FULL
,
180 .offset
= MTDPART_OFS_APPEND
, /* Offset = 0x780000 */
184 static struct flash_partitions sdp_flash_partitions
[] = {
186 .parts
= sdp_nor_partitions
,
187 .nr_parts
= ARRAY_SIZE(sdp_nor_partitions
),
190 .parts
= sdp_onenand_partitions
,
191 .nr_parts
= ARRAY_SIZE(sdp_onenand_partitions
),
194 .parts
= sdp_nand_partitions
,
195 .nr_parts
= ARRAY_SIZE(sdp_nand_partitions
),
199 static void __init
omap_sdp_init(void)
201 omap3_mux_init(board_mux
, OMAP_PACKAGE_CBP
);
202 zoom_peripherals_init();
203 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params
,
204 h8mbx00u0mer0em_sdrc_params
);
207 board_flash_init(sdp_flash_partitions
, chip_sel_sdp
, NAND_BUSWIDTH_16
);
208 enable_board_wakeup_source();
210 usbhs_init_phys(phy_data
, ARRAY_SIZE(phy_data
));
211 usbhs_init(&usbhs_bdata
);
214 MACHINE_START(OMAP_3630SDP
, "OMAP 3630SDP board")
215 .atag_offset
= 0x100,
216 .reserve
= omap_reserve
,
217 .map_io
= omap3_map_io
,
218 .init_early
= omap3630_init_early
,
219 .init_irq
= omap3_init_irq
,
220 .handle_irq
= omap3_intc_handle_irq
,
221 .init_machine
= omap_sdp_init
,
222 .init_late
= omap3630_init_late
,
223 .init_time
= omap3_sync32k_timer_init
,
224 .restart
= omap3xxx_restart
,