vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 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> |
Sukumar Ghorai | d5ce2b6 | 2011-01-28 15:42:03 +0530 | [diff] [blame] | 14 | #include <linux/mtd/nand.h> |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 15 | |
| 16 | #include <asm/mach-types.h> |
| 17 | #include <asm/mach/arch.h> |
| 18 | |
| 19 | #include <plat/common.h> |
| 20 | #include <plat/board.h> |
| 21 | #include <plat/gpmc-smc91x.h> |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 22 | #include <plat/usb.h> |
| 23 | |
| 24 | #include <mach/board-zoom.h> |
| 25 | |
Manjunath Kondaiah G | 04aeae7 | 2010-10-08 09:58:35 -0700 | [diff] [blame] | 26 | #include "board-flash.h" |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 27 | #include "mux.h" |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 28 | #include "sdram-hynix-h8mbx00u0mer-0em.h" |
| 29 | |
| 30 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 31 | |
| 32 | static struct omap_smc91x_platform_data board_smc91x_data = { |
| 33 | .cs = 3, |
| 34 | .flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL, |
| 35 | }; |
| 36 | |
| 37 | static void __init board_smc91x_init(void) |
| 38 | { |
| 39 | board_smc91x_data.gpio_irq = 158; |
| 40 | gpmc_smc91x_init(&board_smc91x_data); |
| 41 | } |
| 42 | |
| 43 | #else |
| 44 | |
| 45 | static inline void board_smc91x_init(void) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | #endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */ |
| 50 | |
| 51 | static void enable_board_wakeup_source(void) |
| 52 | { |
Tony Lindgren | 4896e39 | 2009-12-11 16:16:32 -0800 | [diff] [blame] | 53 | /* T2 interrupt line (keypad) */ |
| 54 | omap_mux_init_signal("sys_nirq", |
| 55 | OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 56 | } |
| 57 | |
Keshava Munegowda | 181b250 | 2011-03-01 20:08:16 +0530 | [diff] [blame] | 58 | static const struct usbhs_omap_board_data usbhs_bdata __initconst = { |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 59 | |
Keshava Munegowda | 181b250 | 2011-03-01 20:08:16 +0530 | [diff] [blame] | 60 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
| 61 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
| 62 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 63 | |
| 64 | .phy_reset = true, |
| 65 | .reset_gpio_port[0] = 126, |
| 66 | .reset_gpio_port[1] = 61, |
| 67 | .reset_gpio_port[2] = -EINVAL |
| 68 | }; |
| 69 | |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 70 | static struct omap_board_config_kernel sdp_config[] __initdata = { |
| 71 | }; |
| 72 | |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 73 | static void __init omap_sdp_init_early(void) |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 74 | { |
Paul Walmsley | 4805734 | 2010-12-21 15:25:10 -0700 | [diff] [blame] | 75 | omap2_init_common_infrastructure(); |
| 76 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, |
| 77 | h8mbx00u0mer0em_sdrc_params); |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 78 | } |
| 79 | |
Tony Lindgren | 662c8b5 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 80 | #ifdef CONFIG_OMAP_MUX |
| 81 | static struct omap_board_mux board_mux[] __initdata = { |
| 82 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 83 | }; |
Tony Lindgren | 662c8b5 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 84 | #endif |
| 85 | |
Sukumar Ghorai | 7875eea | 2010-07-09 14:27:50 +0000 | [diff] [blame] | 86 | /* |
| 87 | * SDP3630 CS organization |
| 88 | * See also the Switch S8 settings in the comments. |
| 89 | */ |
| 90 | static char chip_sel_sdp[][GPMC_CS_NUM] = { |
| 91 | {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */ |
| 92 | {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */ |
| 93 | {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */ |
| 94 | }; |
| 95 | |
| 96 | static struct mtd_partition sdp_nor_partitions[] = { |
| 97 | /* bootloader (U-Boot, etc) in first sector */ |
| 98 | { |
| 99 | .name = "Bootloader-NOR", |
| 100 | .offset = 0, |
| 101 | .size = SZ_256K, |
| 102 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 103 | }, |
| 104 | /* bootloader params in the next sector */ |
| 105 | { |
| 106 | .name = "Params-NOR", |
| 107 | .offset = MTDPART_OFS_APPEND, |
| 108 | .size = SZ_256K, |
| 109 | .mask_flags = 0, |
| 110 | }, |
| 111 | /* kernel */ |
| 112 | { |
| 113 | .name = "Kernel-NOR", |
| 114 | .offset = MTDPART_OFS_APPEND, |
| 115 | .size = SZ_2M, |
| 116 | .mask_flags = 0 |
| 117 | }, |
| 118 | /* file system */ |
| 119 | { |
| 120 | .name = "Filesystem-NOR", |
| 121 | .offset = MTDPART_OFS_APPEND, |
| 122 | .size = MTDPART_SIZ_FULL, |
| 123 | .mask_flags = 0 |
| 124 | } |
| 125 | }; |
| 126 | |
| 127 | static struct mtd_partition sdp_onenand_partitions[] = { |
| 128 | { |
| 129 | .name = "X-Loader-OneNAND", |
| 130 | .offset = 0, |
| 131 | .size = 4 * (64 * 2048), |
| 132 | .mask_flags = MTD_WRITEABLE /* force read-only */ |
| 133 | }, |
| 134 | { |
| 135 | .name = "U-Boot-OneNAND", |
| 136 | .offset = MTDPART_OFS_APPEND, |
| 137 | .size = 2 * (64 * 2048), |
| 138 | .mask_flags = MTD_WRITEABLE /* force read-only */ |
| 139 | }, |
| 140 | { |
| 141 | .name = "U-Boot Environment-OneNAND", |
| 142 | .offset = MTDPART_OFS_APPEND, |
| 143 | .size = 1 * (64 * 2048), |
| 144 | }, |
| 145 | { |
| 146 | .name = "Kernel-OneNAND", |
| 147 | .offset = MTDPART_OFS_APPEND, |
| 148 | .size = 16 * (64 * 2048), |
| 149 | }, |
| 150 | { |
| 151 | .name = "File System-OneNAND", |
| 152 | .offset = MTDPART_OFS_APPEND, |
| 153 | .size = MTDPART_SIZ_FULL, |
| 154 | }, |
| 155 | }; |
| 156 | |
| 157 | static struct mtd_partition sdp_nand_partitions[] = { |
| 158 | /* All the partition sizes are listed in terms of NAND block size */ |
| 159 | { |
| 160 | .name = "X-Loader-NAND", |
| 161 | .offset = 0, |
| 162 | .size = 4 * (64 * 2048), |
| 163 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 164 | }, |
| 165 | { |
| 166 | .name = "U-Boot-NAND", |
| 167 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ |
| 168 | .size = 10 * (64 * 2048), |
| 169 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 170 | }, |
| 171 | { |
| 172 | .name = "Boot Env-NAND", |
| 173 | |
| 174 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ |
| 175 | .size = 6 * (64 * 2048), |
| 176 | }, |
| 177 | { |
| 178 | .name = "Kernel-NAND", |
| 179 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ |
| 180 | .size = 40 * (64 * 2048), |
| 181 | }, |
| 182 | { |
| 183 | .name = "File System - NAND", |
| 184 | .size = MTDPART_SIZ_FULL, |
| 185 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */ |
| 186 | }, |
| 187 | }; |
| 188 | |
| 189 | static struct flash_partitions sdp_flash_partitions[] = { |
| 190 | { |
| 191 | .parts = sdp_nor_partitions, |
| 192 | .nr_parts = ARRAY_SIZE(sdp_nor_partitions), |
| 193 | }, |
| 194 | { |
| 195 | .parts = sdp_onenand_partitions, |
| 196 | .nr_parts = ARRAY_SIZE(sdp_onenand_partitions), |
| 197 | }, |
| 198 | { |
| 199 | .parts = sdp_nand_partitions, |
| 200 | .nr_parts = ARRAY_SIZE(sdp_nand_partitions), |
| 201 | }, |
| 202 | }; |
| 203 | |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 204 | static void __init omap_sdp_init(void) |
| 205 | { |
Tony Lindgren | 662c8b5 | 2009-12-11 16:16:33 -0800 | [diff] [blame] | 206 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
Tony Lindgren | e41cccf | 2011-02-24 14:36:03 -0800 | [diff] [blame] | 207 | omap_board_config = sdp_config; |
| 208 | omap_board_config_size = ARRAY_SIZE(sdp_config); |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 209 | zoom_peripherals_init(); |
Kishore Y | ed3f909 | 2010-11-15 07:09:04 +0100 | [diff] [blame] | 210 | zoom_display_init(); |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 211 | board_smc91x_init(); |
Sukumar Ghorai | d5ce2b6 | 2011-01-28 15:42:03 +0530 | [diff] [blame] | 212 | board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16); |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 213 | enable_board_wakeup_source(); |
Keshava Munegowda | 9e64bb1 | 2011-03-01 20:08:19 +0530 | [diff] [blame] | 214 | usbhs_init(&usbhs_bdata); |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 218 | .boot_params = 0x80000100, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 219 | .reserve = omap_reserve, |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 220 | .map_io = omap3_map_io, |
| 221 | .init_early = omap_sdp_init_early, |
| 222 | .init_irq = omap_init_irq, |
vikram pandita | 34c9ac2 | 2009-11-18 18:41:08 -0800 | [diff] [blame] | 223 | .init_machine = omap_sdp_init, |
| 224 | .timer = &omap_timer, |
| 225 | MACHINE_END |