]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blob - arch/arm/mach-omap2/board-3630sdp.c
Merge branch 'arm-next' of git://git.xilinx.com/linux-xlnx into next/dt
[can-eth-gw-linux.git] / arch / arm / mach-omap2 / board-3630sdp.c
1 /*
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 #include <linux/mtd/nand.h>
15
16 #include <asm/mach-types.h>
17 #include <asm/mach/arch.h>
18
19 #include "common.h"
20 #include "gpmc-smc91x.h"
21
22 #include "board-zoom.h"
23
24 #include "board-flash.h"
25 #include "mux.h"
26 #include "sdram-hynix-h8mbx00u0mer-0em.h"
27
28 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
29
30 static struct omap_smc91x_platform_data board_smc91x_data = {
31         .cs             = 3,
32         .flags          = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,
33 };
34
35 static void __init board_smc91x_init(void)
36 {
37         board_smc91x_data.gpio_irq = 158;
38         gpmc_smc91x_init(&board_smc91x_data);
39 }
40
41 #else
42
43 static inline void board_smc91x_init(void)
44 {
45 }
46
47 #endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
48
49 static void enable_board_wakeup_source(void)
50 {
51         /* T2 interrupt line (keypad) */
52         omap_mux_init_signal("sys_nirq",
53                 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
54 }
55
56 static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
57
58         .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
59         .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
60         .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
61
62         .phy_reset  = true,
63         .reset_gpio_port[0]  = 126,
64         .reset_gpio_port[1]  = 61,
65         .reset_gpio_port[2]  = -EINVAL
66 };
67
68 #ifdef CONFIG_OMAP_MUX
69 static struct omap_board_mux board_mux[] __initdata = {
70         { .reg_offset = OMAP_MUX_TERMINATOR },
71 };
72 #endif
73
74 /*
75  * SDP3630 CS organization
76  * See also the Switch S8 settings in the comments.
77  */
78 static char chip_sel_sdp[][GPMC_CS_NUM] = {
79         {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
80         {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
81         {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
82 };
83
84 static struct mtd_partition sdp_nor_partitions[] = {
85         /* bootloader (U-Boot, etc) in first sector */
86         {
87                 .name           = "Bootloader-NOR",
88                 .offset         = 0,
89                 .size           = SZ_256K,
90                 .mask_flags     = MTD_WRITEABLE, /* force read-only */
91         },
92         /* bootloader params in the next sector */
93         {
94                 .name           = "Params-NOR",
95                 .offset         = MTDPART_OFS_APPEND,
96                 .size           = SZ_256K,
97                 .mask_flags     = 0,
98         },
99         /* kernel */
100         {
101                 .name           = "Kernel-NOR",
102                 .offset         = MTDPART_OFS_APPEND,
103                 .size           = SZ_2M,
104                 .mask_flags     = 0
105         },
106         /* file system */
107         {
108                 .name           = "Filesystem-NOR",
109                 .offset         = MTDPART_OFS_APPEND,
110                 .size           = MTDPART_SIZ_FULL,
111                 .mask_flags     = 0
112         }
113 };
114
115 static struct mtd_partition sdp_onenand_partitions[] = {
116         {
117                 .name           = "X-Loader-OneNAND",
118                 .offset         = 0,
119                 .size           = 4 * (64 * 2048),
120                 .mask_flags     = MTD_WRITEABLE  /* force read-only */
121         },
122         {
123                 .name           = "U-Boot-OneNAND",
124                 .offset         = MTDPART_OFS_APPEND,
125                 .size           = 2 * (64 * 2048),
126                 .mask_flags     = MTD_WRITEABLE  /* force read-only */
127         },
128         {
129                 .name           = "U-Boot Environment-OneNAND",
130                 .offset         = MTDPART_OFS_APPEND,
131                 .size           = 1 * (64 * 2048),
132         },
133         {
134                 .name           = "Kernel-OneNAND",
135                 .offset         = MTDPART_OFS_APPEND,
136                 .size           = 16 * (64 * 2048),
137         },
138         {
139                 .name           = "File System-OneNAND",
140                 .offset         = MTDPART_OFS_APPEND,
141                 .size           = MTDPART_SIZ_FULL,
142         },
143 };
144
145 static struct mtd_partition sdp_nand_partitions[] = {
146         /* All the partition sizes are listed in terms of NAND block size */
147         {
148                 .name           = "X-Loader-NAND",
149                 .offset         = 0,
150                 .size           = 4 * (64 * 2048),
151                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
152         },
153         {
154                 .name           = "U-Boot-NAND",
155                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
156                 .size           = 10 * (64 * 2048),
157                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
158         },
159         {
160                 .name           = "Boot Env-NAND",
161
162                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
163                 .size           = 6 * (64 * 2048),
164         },
165         {
166                 .name           = "Kernel-NAND",
167                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
168                 .size           = 40 * (64 * 2048),
169         },
170         {
171                 .name           = "File System - NAND",
172                 .size           = MTDPART_SIZ_FULL,
173                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
174         },
175 };
176
177 static struct flash_partitions sdp_flash_partitions[] = {
178         {
179                 .parts = sdp_nor_partitions,
180                 .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
181         },
182         {
183                 .parts = sdp_onenand_partitions,
184                 .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
185         },
186         {
187                 .parts = sdp_nand_partitions,
188                 .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
189         },
190 };
191
192 static void __init omap_sdp_init(void)
193 {
194         omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
195         zoom_peripherals_init();
196         omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
197                                   h8mbx00u0mer0em_sdrc_params);
198         zoom_display_init();
199         board_smc91x_init();
200         board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
201         enable_board_wakeup_source();
202         usbhs_init(&usbhs_bdata);
203 }
204
205 MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
206         .atag_offset    = 0x100,
207         .reserve        = omap_reserve,
208         .map_io         = omap3_map_io,
209         .init_early     = omap3630_init_early,
210         .init_irq       = omap3_init_irq,
211         .handle_irq     = omap3_intc_handle_irq,
212         .init_machine   = omap_sdp_init,
213         .init_late      = omap3630_init_late,
214         .timer          = &omap3_timer,
215         .restart        = omap3xxx_restart,
216 MACHINE_END