Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 1 | /* |
Uwe Zeisberger | f30c226 | 2006-10-03 23:01:26 +0200 | [diff] [blame] | 2 | * linux/arch/arm/mach-omap2/board-h4.c |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2005 Nokia Corporation |
| 5 | * Author: Paul Mundt <paul.mundt@nokia.com> |
| 6 | * |
| 7 | * Modified from mach-omap/omap1/board-generic.c |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/mtd/mtd.h> |
| 18 | #include <linux/mtd/partitions.h> |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 19 | #include <linux/mtd/physmap.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 20 | #include <linux/delay.h> |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 21 | #include <linux/workqueue.h> |
Jean Delvare | 9df013b | 2008-10-14 17:30:02 +0200 | [diff] [blame] | 22 | #include <linux/i2c.h> |
David Brownell | 6a769ed | 2008-12-10 17:36:33 -0800 | [diff] [blame] | 23 | #include <linux/i2c/at24.h> |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 24 | #include <linux/input.h> |
Paul Walmsley | 4459598 | 2008-03-18 10:04:51 +0200 | [diff] [blame] | 25 | #include <linux/err.h> |
| 26 | #include <linux/clk.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 27 | #include <linux/io.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 28 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 29 | #include <mach/hardware.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 30 | #include <asm/mach-types.h> |
| 31 | #include <asm/mach/arch.h> |
| 32 | #include <asm/mach/map.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 33 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 34 | #include <mach/gpio.h> |
Tony Lindgren | ce491cf | 2009-10-20 09:40:47 -0700 | [diff] [blame] | 35 | #include <plat/usb.h> |
| 36 | #include <plat/board.h> |
| 37 | #include <plat/common.h> |
| 38 | #include <plat/keypad.h> |
| 39 | #include <plat/menelaus.h> |
| 40 | #include <plat/dma.h> |
| 41 | #include <plat/gpmc.h> |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 42 | |
Tony Lindgren | 23275d4 | 2010-07-05 16:31:37 +0300 | [diff] [blame] | 43 | #include "mux.h" |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 44 | #include "control.h" |
Tony Lindgren | 23275d4 | 2010-07-05 16:31:37 +0300 | [diff] [blame] | 45 | |
Paul Walmsley | 4459598 | 2008-03-18 10:04:51 +0200 | [diff] [blame] | 46 | #define H4_FLASH_CS 0 |
| 47 | #define H4_SMC91X_CS 1 |
| 48 | |
Tony Lindgren | 40662d77 | 2009-03-23 18:07:36 -0700 | [diff] [blame] | 49 | #define H4_ETHR_GPIO_IRQ 92 |
| 50 | |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 51 | static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; |
| 52 | static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; |
| 53 | |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 54 | static const unsigned int h4_keymap[] = { |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 55 | KEY(0, 0, KEY_LEFT), |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 56 | KEY(1, 0, KEY_RIGHT), |
| 57 | KEY(2, 0, KEY_A), |
| 58 | KEY(3, 0, KEY_B), |
| 59 | KEY(4, 0, KEY_C), |
| 60 | KEY(0, 1, KEY_DOWN), |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 61 | KEY(1, 1, KEY_UP), |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 62 | KEY(2, 1, KEY_E), |
| 63 | KEY(3, 1, KEY_F), |
| 64 | KEY(4, 1, KEY_G), |
| 65 | KEY(0, 2, KEY_ENTER), |
| 66 | KEY(1, 2, KEY_I), |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 67 | KEY(2, 2, KEY_J), |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 68 | KEY(3, 2, KEY_K), |
| 69 | KEY(4, 2, KEY_3), |
| 70 | KEY(0, 3, KEY_M), |
| 71 | KEY(1, 3, KEY_N), |
| 72 | KEY(2, 3, KEY_O), |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 73 | KEY(3, 3, KEY_P), |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 74 | KEY(4, 3, KEY_Q), |
| 75 | KEY(0, 4, KEY_R), |
| 76 | KEY(1, 4, KEY_4), |
| 77 | KEY(2, 4, KEY_T), |
| 78 | KEY(3, 4, KEY_U), |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 79 | KEY(4, 4, KEY_ENTER), |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 80 | KEY(0, 5, KEY_V), |
| 81 | KEY(1, 5, KEY_W), |
| 82 | KEY(2, 5, KEY_L), |
| 83 | KEY(3, 5, KEY_S), |
| 84 | KEY(4, 5, KEY_ENTER), |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 85 | }; |
| 86 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 87 | static struct mtd_partition h4_partitions[] = { |
| 88 | /* bootloader (U-Boot, etc) in first sector */ |
| 89 | { |
| 90 | .name = "bootloader", |
| 91 | .offset = 0, |
| 92 | .size = SZ_128K, |
| 93 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 94 | }, |
| 95 | /* bootloader params in the next sector */ |
| 96 | { |
| 97 | .name = "params", |
| 98 | .offset = MTDPART_OFS_APPEND, |
| 99 | .size = SZ_128K, |
| 100 | .mask_flags = 0, |
| 101 | }, |
| 102 | /* kernel */ |
| 103 | { |
| 104 | .name = "kernel", |
| 105 | .offset = MTDPART_OFS_APPEND, |
| 106 | .size = SZ_2M, |
| 107 | .mask_flags = 0 |
| 108 | }, |
| 109 | /* file system */ |
| 110 | { |
| 111 | .name = "filesystem", |
| 112 | .offset = MTDPART_OFS_APPEND, |
| 113 | .size = MTDPART_SIZ_FULL, |
| 114 | .mask_flags = 0 |
| 115 | } |
| 116 | }; |
| 117 | |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 118 | static struct physmap_flash_data h4_flash_data = { |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 119 | .width = 2, |
| 120 | .parts = h4_partitions, |
| 121 | .nr_parts = ARRAY_SIZE(h4_partitions), |
| 122 | }; |
| 123 | |
| 124 | static struct resource h4_flash_resource = { |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 125 | .flags = IORESOURCE_MEM, |
| 126 | }; |
| 127 | |
| 128 | static struct platform_device h4_flash_device = { |
Ladislav Michl | 561b036 | 2010-02-15 10:03:32 -0800 | [diff] [blame] | 129 | .name = "physmap-flash", |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 130 | .id = 0, |
| 131 | .dev = { |
| 132 | .platform_data = &h4_flash_data, |
| 133 | }, |
| 134 | .num_resources = 1, |
| 135 | .resource = &h4_flash_resource, |
| 136 | }; |
| 137 | |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 138 | static const struct matrix_keymap_data h4_keymap_data = { |
| 139 | .keymap = h4_keymap, |
| 140 | .keymap_size = ARRAY_SIZE(h4_keymap), |
| 141 | }; |
| 142 | |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 143 | static struct omap_kp_platform_data h4_kp_data = { |
| 144 | .rows = 6, |
| 145 | .cols = 7, |
Janusz Krzysztofik | da1f026 | 2010-12-20 21:09:22 +0000 | [diff] [blame] | 146 | .keymap_data = &h4_keymap_data, |
| 147 | .rep = true, |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 148 | .row_gpios = row_gpios, |
| 149 | .col_gpios = col_gpios, |
| 150 | }; |
| 151 | |
| 152 | static struct platform_device h4_kp_device = { |
| 153 | .name = "omap-keypad", |
| 154 | .id = -1, |
| 155 | .dev = { |
| 156 | .platform_data = &h4_kp_data, |
| 157 | }, |
| 158 | }; |
| 159 | |
| 160 | static struct platform_device h4_lcd_device = { |
| 161 | .name = "lcd_h4", |
| 162 | .id = -1, |
| 163 | }; |
| 164 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 165 | static struct platform_device *h4_devices[] __initdata = { |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 166 | &h4_flash_device, |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 167 | &h4_kp_device, |
| 168 | &h4_lcd_device, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 169 | }; |
| 170 | |
Paul Walmsley | 4459598 | 2008-03-18 10:04:51 +0200 | [diff] [blame] | 171 | /* 2420 Sysboot setup (2430 is different) */ |
| 172 | static u32 get_sysboot_value(void) |
| 173 | { |
| 174 | return (omap_ctrl_readl(OMAP24XX_CONTROL_STATUS) & |
| 175 | (OMAP2_SYSBOOT_5_MASK | OMAP2_SYSBOOT_4_MASK | |
| 176 | OMAP2_SYSBOOT_3_MASK | OMAP2_SYSBOOT_2_MASK | |
| 177 | OMAP2_SYSBOOT_1_MASK | OMAP2_SYSBOOT_0_MASK)); |
| 178 | } |
| 179 | |
| 180 | /* H4-2420's always used muxed mode, H4-2422's always use non-muxed |
| 181 | * |
| 182 | * Note: OMAP-GIT doesn't correctly do is_cpu_omap2422 and is_cpu_omap2423 |
| 183 | * correctly. The macro needs to look at production_id not just hawkeye. |
| 184 | */ |
| 185 | static u32 is_gpmc_muxed(void) |
| 186 | { |
| 187 | u32 mux; |
| 188 | mux = get_sysboot_value(); |
| 189 | if ((mux & 0xF) == 0xd) |
| 190 | return 1; /* NAND config (could be either) */ |
| 191 | if (mux & 0x2) /* if mux'ed */ |
| 192 | return 1; |
| 193 | else |
| 194 | return 0; |
| 195 | } |
| 196 | |
David Brownell | f604931 | 2006-12-06 17:14:03 -0800 | [diff] [blame] | 197 | static inline void __init h4_init_debug(void) |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 198 | { |
Paul Walmsley | 4459598 | 2008-03-18 10:04:51 +0200 | [diff] [blame] | 199 | int eth_cs; |
| 200 | unsigned long cs_mem_base; |
| 201 | unsigned int muxed, rate; |
| 202 | struct clk *gpmc_fck; |
| 203 | |
| 204 | eth_cs = H4_SMC91X_CS; |
| 205 | |
| 206 | gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */ |
| 207 | if (IS_ERR(gpmc_fck)) { |
| 208 | WARN_ON(1); |
| 209 | return; |
| 210 | } |
| 211 | |
| 212 | clk_enable(gpmc_fck); |
| 213 | rate = clk_get_rate(gpmc_fck); |
| 214 | clk_disable(gpmc_fck); |
| 215 | clk_put(gpmc_fck); |
| 216 | |
| 217 | if (is_gpmc_muxed()) |
| 218 | muxed = 0x200; |
| 219 | else |
| 220 | muxed = 0; |
| 221 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 222 | /* Make sure CS1 timings are correct */ |
Paul Walmsley | 4459598 | 2008-03-18 10:04:51 +0200 | [diff] [blame] | 223 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, |
| 224 | 0x00011000 | muxed); |
| 225 | |
| 226 | if (rate >= 160000000) { |
| 227 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01); |
| 228 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803); |
| 229 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a); |
| 230 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F); |
| 231 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4); |
| 232 | } else if (rate >= 130000000) { |
| 233 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00); |
| 234 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802); |
| 235 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09); |
| 236 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F); |
| 237 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4); |
| 238 | } else {/* rate = 100000000 */ |
| 239 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00); |
| 240 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802); |
| 241 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09); |
| 242 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F); |
| 243 | gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2); |
| 244 | } |
| 245 | |
| 246 | if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { |
| 247 | printk(KERN_ERR "Failed to request GPMC mem for smc91x\n"); |
| 248 | goto out; |
| 249 | } |
| 250 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 251 | udelay(100); |
| 252 | |
Tony Lindgren | f99bf16 | 2010-07-05 16:31:40 +0300 | [diff] [blame] | 253 | omap_mux_init_gpio(92, 0); |
Tony Lindgren | 40662d77 | 2009-03-23 18:07:36 -0700 | [diff] [blame] | 254 | if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0) |
David Brownell | f604931 | 2006-12-06 17:14:03 -0800 | [diff] [blame] | 255 | gpmc_cs_free(eth_cs); |
Paul Walmsley | 4459598 | 2008-03-18 10:04:51 +0200 | [diff] [blame] | 256 | |
| 257 | out: |
| 258 | clk_disable(gpmc_fck); |
| 259 | clk_put(gpmc_fck); |
| 260 | } |
| 261 | |
| 262 | static void __init h4_init_flash(void) |
| 263 | { |
| 264 | unsigned long base; |
| 265 | |
| 266 | if (gpmc_cs_request(H4_FLASH_CS, SZ_64M, &base) < 0) { |
| 267 | printk("Can't request GPMC CS for flash\n"); |
| 268 | return; |
| 269 | } |
| 270 | h4_flash_resource.start = base; |
| 271 | h4_flash_resource.end = base + SZ_64M - 1; |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 272 | } |
| 273 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 274 | static struct omap_lcd_config h4_lcd_config __initdata = { |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 275 | .ctrl_name = "internal", |
| 276 | }; |
| 277 | |
Felipe Balbi | b0b5aa3 | 2009-03-23 18:07:49 -0700 | [diff] [blame] | 278 | static struct omap_usb_config h4_usb_config __initdata = { |
Felipe Balbi | b0b5aa3 | 2009-03-23 18:07:49 -0700 | [diff] [blame] | 279 | /* S1.10 OFF -- usb "download port" |
| 280 | * usb0 switched to Mini-B port and isp1105 transceiver; |
| 281 | * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging |
| 282 | */ |
| 283 | .register_dev = 1, |
| 284 | .pins[0] = 3, |
| 285 | /* .hmc_mode = 0x14,*/ /* 0:dev 1:host 2:disable */ |
| 286 | .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */ |
Felipe Balbi | b0b5aa3 | 2009-03-23 18:07:49 -0700 | [diff] [blame] | 287 | }; |
| 288 | |
Bryan Wu | 1a6b592 | 2010-12-08 02:41:25 +0000 | [diff] [blame] | 289 | static struct omap_board_config_kernel h4_config[] __initdata = { |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 290 | { OMAP_TAG_LCD, &h4_lcd_config }, |
| 291 | }; |
| 292 | |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 293 | static void __init omap_h4_init_early(void) |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 294 | { |
Paul Walmsley | 4805734 | 2010-12-21 15:25:10 -0700 | [diff] [blame] | 295 | omap2_init_common_infrastructure(); |
| 296 | omap2_init_common_devices(NULL, NULL); |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | static void __init omap_h4_init_irq(void) |
| 300 | { |
Tony Lindgren | 741e3a8 | 2011-05-17 03:51:26 -0700 | [diff] [blame] | 301 | omap2_init_irq(); |
Paul Walmsley | b3c6df3 | 2009-09-03 20:14:02 +0300 | [diff] [blame] | 302 | } |
| 303 | |
David Brownell | 6a769ed | 2008-12-10 17:36:33 -0800 | [diff] [blame] | 304 | static struct at24_platform_data m24c01 = { |
| 305 | .byte_len = SZ_1K / 8, |
| 306 | .page_size = 16, |
| 307 | }; |
| 308 | |
Jean Delvare | 9df013b | 2008-10-14 17:30:02 +0200 | [diff] [blame] | 309 | static struct i2c_board_info __initdata h4_i2c_board_info[] = { |
| 310 | { |
| 311 | I2C_BOARD_INFO("isp1301_omap", 0x2d), |
| 312 | .irq = OMAP_GPIO_IRQ(125), |
| 313 | }, |
David Brownell | 6a769ed | 2008-12-10 17:36:33 -0800 | [diff] [blame] | 314 | { /* EEPROM on mainboard */ |
| 315 | I2C_BOARD_INFO("24c01", 0x52), |
| 316 | .platform_data = &m24c01, |
| 317 | }, |
| 318 | { /* EEPROM on cpu card */ |
| 319 | I2C_BOARD_INFO("24c01", 0x57), |
| 320 | .platform_data = &m24c01, |
| 321 | }, |
Jean Delvare | 9df013b | 2008-10-14 17:30:02 +0200 | [diff] [blame] | 322 | }; |
| 323 | |
Tony Lindgren | 23275d4 | 2010-07-05 16:31:37 +0300 | [diff] [blame] | 324 | #ifdef CONFIG_OMAP_MUX |
| 325 | static struct omap_board_mux board_mux[] __initdata = { |
| 326 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 327 | }; |
Tony Lindgren | 23275d4 | 2010-07-05 16:31:37 +0300 | [diff] [blame] | 328 | #endif |
| 329 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 330 | static void __init omap_h4_init(void) |
| 331 | { |
Tony Lindgren | 23275d4 | 2010-07-05 16:31:37 +0300 | [diff] [blame] | 332 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); |
| 333 | |
Tony Lindgren | e41cccf | 2011-02-24 14:36:03 -0800 | [diff] [blame] | 334 | omap_board_config = h4_config; |
| 335 | omap_board_config_size = ARRAY_SIZE(h4_config); |
| 336 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 337 | /* |
| 338 | * Make sure the serial ports are muxed on at this point. |
| 339 | * You have to mux them off in device drivers later on |
| 340 | * if not needed. |
| 341 | */ |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 342 | |
| 343 | #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) |
Tony Lindgren | 93c43f2 | 2010-07-05 16:31:39 +0300 | [diff] [blame] | 344 | omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP); |
| 345 | omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP); |
| 346 | omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP); |
| 347 | omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 348 | if (omap_has_menelaus()) { |
Tony Lindgren | 93c43f2 | 2010-07-05 16:31:39 +0300 | [diff] [blame] | 349 | omap_mux_init_signal("sdrc_a14.gpio0", |
| 350 | OMAP_PULL_ENA | OMAP_PULL_UP); |
| 351 | omap_mux_init_signal("vlynq_rx0.gpio_15", 0); |
| 352 | omap_mux_init_signal("gpio_98", 0); |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 353 | row_gpios[5] = 0; |
| 354 | col_gpios[2] = 15; |
| 355 | col_gpios[6] = 18; |
Tony Lindgren | 93c43f2 | 2010-07-05 16:31:39 +0300 | [diff] [blame] | 356 | } else { |
| 357 | omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP); |
| 358 | omap_mux_init_signal("gpio_100", 0); |
| 359 | omap_mux_init_signal("gpio_98", 0); |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 360 | } |
Tony Lindgren | 93c43f2 | 2010-07-05 16:31:39 +0300 | [diff] [blame] | 361 | omap_mux_init_signal("gpio_90", 0); |
| 362 | omap_mux_init_signal("gpio_91", 0); |
| 363 | omap_mux_init_signal("gpio_36", 0); |
| 364 | omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); |
| 365 | omap_mux_init_signal("gpio_97", 0); |
Tony Lindgren | 9b6553c | 2006-04-02 17:46:30 +0100 | [diff] [blame] | 366 | #endif |
| 367 | |
Jean Delvare | 9df013b | 2008-10-14 17:30:02 +0200 | [diff] [blame] | 368 | i2c_register_board_info(1, h4_i2c_board_info, |
| 369 | ARRAY_SIZE(h4_i2c_board_info)); |
| 370 | |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 371 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); |
Tony Lindgren | b5e8905 | 2010-07-05 16:31:29 +0300 | [diff] [blame] | 372 | omap2_usbfs_init(&h4_usb_config); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 373 | omap_serial_init(); |
Tony Lindgren | 4292435 | 2011-03-10 09:51:29 -0800 | [diff] [blame] | 374 | h4_init_flash(); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 375 | } |
| 376 | |
| 377 | static void __init omap_h4_map_io(void) |
| 378 | { |
Paul Walmsley | c8d2eb8 | 2008-05-07 16:55:13 -0700 | [diff] [blame] | 379 | omap2_set_globals_242x(); |
Tony Lindgren | 6fbd55d | 2010-02-12 12:26:47 -0800 | [diff] [blame] | 380 | omap242x_map_common_io(); |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 381 | } |
| 382 | |
| 383 | MACHINE_START(OMAP_H4, "OMAP2420 H4 board") |
| 384 | /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 385 | .boot_params = 0x80000100, |
Russell King | 71ee7da | 2010-05-23 10:18:16 +0100 | [diff] [blame] | 386 | .reserve = omap_reserve, |
Russell King - ARM Linux | 3dc3bad | 2011-02-14 15:40:20 -0800 | [diff] [blame] | 387 | .map_io = omap_h4_map_io, |
| 388 | .init_early = omap_h4_init_early, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 389 | .init_irq = omap_h4_init_irq, |
| 390 | .init_machine = omap_h4_init, |
Tony Lindgren | e74984e | 2011-03-29 15:54:48 -0700 | [diff] [blame] | 391 | .timer = &omap2_timer, |
Tony Lindgren | 1dbae81 | 2005-11-10 14:26:51 +0000 | [diff] [blame] | 392 | MACHINE_END |