Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-bf548/boards/ezkit.c |
| 3 | * Based on: arch/blackfin/mach-bf537/boards/ezkit.c |
| 4 | * Author: Aidan Williams <aidan@nicta.com.au> |
| 5 | * |
| 6 | * Created: |
| 7 | * Description: |
| 8 | * |
| 9 | * Modified: |
| 10 | * Copyright 2005 National ICT Australia (NICTA) |
| 11 | * Copyright 2004-2007 Analog Devices Inc. |
| 12 | * |
| 13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or modify |
| 16 | * it under the terms of the GNU General Public License as published by |
| 17 | * the Free Software Foundation; either version 2 of the License, or |
| 18 | * (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, see the file COPYING, or write |
| 27 | * to the Free Software Foundation, Inc., |
| 28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 | */ |
| 30 | |
| 31 | #include <linux/device.h> |
| 32 | #include <linux/platform_device.h> |
| 33 | #include <linux/mtd/mtd.h> |
| 34 | #include <linux/mtd/partitions.h> |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 35 | #include <linux/mtd/physmap.h> |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 36 | #include <linux/spi/spi.h> |
| 37 | #include <linux/spi/flash.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 38 | #include <linux/irq.h> |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 39 | #include <linux/i2c.h> |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 40 | #include <linux/interrupt.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 41 | #include <linux/usb/musb.h> |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 42 | #include <asm/bfin5xx_spi.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 43 | #include <asm/dma.h> |
| 44 | #include <asm/gpio.h> |
| 45 | #include <asm/nand.h> |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 46 | #include <asm/dpmc.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 47 | #include <asm/portmux.h> |
Cliff Cai | 501674a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 48 | #include <asm/bfin_sdh.h> |
Bryan Wu | 639f657 | 2008-08-27 10:51:02 +0800 | [diff] [blame] | 49 | #include <mach/bf54x_keys.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 50 | #include <linux/input.h> |
| 51 | #include <linux/spi/ad7877.h> |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 52 | |
| 53 | /* |
| 54 | * Name the Board for the /proc/cpuinfo |
| 55 | */ |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 56 | const char bfin_board_name[] = "ADI BF548-EZKIT"; |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 57 | |
| 58 | /* |
| 59 | * Driver needs to know address, irq and flag pin. |
| 60 | */ |
| 61 | |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 62 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 63 | #include <linux/usb/isp1760.h> |
| 64 | static struct resource bfin_isp1760_resources[] = { |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 65 | [0] = { |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 66 | .start = 0x2C0C0000, |
| 67 | .end = 0x2C0C0000 + 0xfffff, |
| 68 | .flags = IORESOURCE_MEM, |
| 69 | }, |
| 70 | [1] = { |
| 71 | .start = IRQ_PG7, |
| 72 | .end = IRQ_PG7, |
| 73 | .flags = IORESOURCE_IRQ, |
| 74 | }, |
| 75 | }; |
| 76 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 77 | static struct isp1760_platform_data isp1760_priv = { |
| 78 | .is_isp1761 = 0, |
| 79 | .port1_disable = 0, |
| 80 | .bus_width_16 = 1, |
| 81 | .port1_otg = 0, |
| 82 | .analog_oc = 0, |
| 83 | .dack_polarity_high = 0, |
| 84 | .dreq_polarity_high = 0, |
| 85 | }; |
| 86 | |
| 87 | static struct platform_device bfin_isp1760_device = { |
| 88 | .name = "isp1760-hcd", |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 89 | .id = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 90 | .dev = { |
| 91 | .platform_data = &isp1760_priv, |
| 92 | }, |
| 93 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), |
| 94 | .resource = bfin_isp1760_resources, |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 95 | }; |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 96 | #endif |
| 97 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 98 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) |
| 99 | |
Bryan Wu | 639f657 | 2008-08-27 10:51:02 +0800 | [diff] [blame] | 100 | #include <mach/bf54x-lq043.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 101 | |
| 102 | static struct bfin_bf54xfb_mach_info bf54x_lq043_data = { |
| 103 | .width = 480, |
| 104 | .height = 272, |
| 105 | .xres = {480, 480, 480}, |
| 106 | .yres = {272, 272, 272}, |
| 107 | .bpp = {24, 24, 24}, |
| 108 | .disp = GPIO_PE3, |
| 109 | }; |
| 110 | |
| 111 | static struct resource bf54x_lq043_resources[] = { |
| 112 | { |
| 113 | .start = IRQ_EPPI0_ERR, |
| 114 | .end = IRQ_EPPI0_ERR, |
| 115 | .flags = IORESOURCE_IRQ, |
| 116 | }, |
| 117 | }; |
| 118 | |
| 119 | static struct platform_device bf54x_lq043_device = { |
| 120 | .name = "bf54x-lq043", |
| 121 | .id = -1, |
| 122 | .num_resources = ARRAY_SIZE(bf54x_lq043_resources), |
| 123 | .resource = bf54x_lq043_resources, |
| 124 | .dev = { |
| 125 | .platform_data = &bf54x_lq043_data, |
| 126 | }, |
| 127 | }; |
| 128 | #endif |
| 129 | |
| 130 | #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) |
Michael Hennerich | 8f740ef | 2007-10-13 00:36:46 -0400 | [diff] [blame] | 131 | static const unsigned int bf548_keymap[] = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 132 | KEYVAL(0, 0, KEY_ENTER), |
| 133 | KEYVAL(0, 1, KEY_HELP), |
| 134 | KEYVAL(0, 2, KEY_0), |
| 135 | KEYVAL(0, 3, KEY_BACKSPACE), |
| 136 | KEYVAL(1, 0, KEY_TAB), |
| 137 | KEYVAL(1, 1, KEY_9), |
| 138 | KEYVAL(1, 2, KEY_8), |
| 139 | KEYVAL(1, 3, KEY_7), |
| 140 | KEYVAL(2, 0, KEY_DOWN), |
| 141 | KEYVAL(2, 1, KEY_6), |
| 142 | KEYVAL(2, 2, KEY_5), |
| 143 | KEYVAL(2, 3, KEY_4), |
| 144 | KEYVAL(3, 0, KEY_UP), |
| 145 | KEYVAL(3, 1, KEY_3), |
| 146 | KEYVAL(3, 2, KEY_2), |
| 147 | KEYVAL(3, 3, KEY_1), |
| 148 | }; |
| 149 | |
| 150 | static struct bfin_kpad_platform_data bf54x_kpad_data = { |
| 151 | .rows = 4, |
| 152 | .cols = 4, |
Michael Hennerich | 8f740ef | 2007-10-13 00:36:46 -0400 | [diff] [blame] | 153 | .keymap = bf548_keymap, |
| 154 | .keymapsize = ARRAY_SIZE(bf548_keymap), |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 155 | .repeat = 0, |
| 156 | .debounce_time = 5000, /* ns (5ms) */ |
| 157 | .coldrive_time = 1000, /* ns (1ms) */ |
| 158 | .keyup_test_interval = 50, /* ms (50ms) */ |
| 159 | }; |
| 160 | |
| 161 | static struct resource bf54x_kpad_resources[] = { |
| 162 | { |
| 163 | .start = IRQ_KEY, |
| 164 | .end = IRQ_KEY, |
| 165 | .flags = IORESOURCE_IRQ, |
| 166 | }, |
| 167 | }; |
| 168 | |
| 169 | static struct platform_device bf54x_kpad_device = { |
| 170 | .name = "bf54x-keys", |
| 171 | .id = -1, |
| 172 | .num_resources = ARRAY_SIZE(bf54x_kpad_resources), |
| 173 | .resource = bf54x_kpad_resources, |
| 174 | .dev = { |
| 175 | .platform_data = &bf54x_kpad_data, |
| 176 | }, |
| 177 | }; |
| 178 | #endif |
| 179 | |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 180 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) |
| 181 | #include <asm/bfin_rotary.h> |
| 182 | |
| 183 | static struct bfin_rotary_platform_data bfin_rotary_data = { |
| 184 | /*.rotary_up_key = KEY_UP,*/ |
| 185 | /*.rotary_down_key = KEY_DOWN,*/ |
| 186 | .rotary_rel_code = REL_WHEEL, |
| 187 | .rotary_button_key = KEY_ENTER, |
| 188 | .debounce = 10, /* 0..17 */ |
| 189 | .mode = ROT_QUAD_ENC | ROT_DEBE, |
| 190 | }; |
| 191 | |
| 192 | static struct resource bfin_rotary_resources[] = { |
| 193 | { |
| 194 | .start = IRQ_CNT, |
| 195 | .end = IRQ_CNT, |
| 196 | .flags = IORESOURCE_IRQ, |
| 197 | }, |
| 198 | }; |
| 199 | |
| 200 | static struct platform_device bfin_rotary_device = { |
| 201 | .name = "bfin-rotary", |
| 202 | .id = -1, |
| 203 | .num_resources = ARRAY_SIZE(bfin_rotary_resources), |
| 204 | .resource = bfin_rotary_resources, |
| 205 | .dev = { |
| 206 | .platform_data = &bfin_rotary_data, |
| 207 | }, |
| 208 | }; |
| 209 | #endif |
| 210 | |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 211 | #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) |
| 212 | #include <linux/input.h> |
| 213 | #include <linux/spi/adxl34x.h> |
| 214 | static const struct adxl34x_platform_data adxl34x_info = { |
| 215 | .x_axis_offset = 0, |
| 216 | .y_axis_offset = 0, |
| 217 | .z_axis_offset = 0, |
| 218 | .tap_threshold = 0x31, |
| 219 | .tap_duration = 0x10, |
| 220 | .tap_latency = 0x60, |
| 221 | .tap_window = 0xF0, |
| 222 | .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN, |
| 223 | .act_axis_control = 0xFF, |
| 224 | .activity_threshold = 5, |
| 225 | .inactivity_threshold = 3, |
| 226 | .inactivity_time = 4, |
| 227 | .free_fall_threshold = 0x7, |
| 228 | .free_fall_time = 0x20, |
| 229 | .data_rate = 0x8, |
| 230 | .data_range = ADXL_FULL_RES, |
| 231 | |
| 232 | .ev_type = EV_ABS, |
| 233 | .ev_code_x = ABS_X, /* EV_REL */ |
| 234 | .ev_code_y = ABS_Y, /* EV_REL */ |
| 235 | .ev_code_z = ABS_Z, /* EV_REL */ |
| 236 | |
| 237 | .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */ |
| 238 | .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */ |
| 239 | .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */ |
| 240 | |
| 241 | /* .ev_code_ff = KEY_F,*/ /* EV_KEY */ |
| 242 | /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */ |
| 243 | .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK, |
| 244 | .fifo_mode = ADXL_FIFO_STREAM, |
| 245 | }; |
| 246 | #endif |
| 247 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 248 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 249 | static struct platform_device rtc_device = { |
| 250 | .name = "rtc-bfin", |
| 251 | .id = -1, |
| 252 | }; |
| 253 | #endif |
| 254 | |
| 255 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 256 | static struct resource bfin_uart_resources[] = { |
| 257 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 258 | { |
| 259 | .start = 0xFFC00400, |
| 260 | .end = 0xFFC004FF, |
| 261 | .flags = IORESOURCE_MEM, |
| 262 | }, |
| 263 | #endif |
| 264 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 265 | { |
| 266 | .start = 0xFFC02000, |
| 267 | .end = 0xFFC020FF, |
| 268 | .flags = IORESOURCE_MEM, |
| 269 | }, |
| 270 | #endif |
| 271 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
| 272 | { |
| 273 | .start = 0xFFC02100, |
| 274 | .end = 0xFFC021FF, |
| 275 | .flags = IORESOURCE_MEM, |
| 276 | }, |
| 277 | #endif |
| 278 | #ifdef CONFIG_SERIAL_BFIN_UART3 |
| 279 | { |
| 280 | .start = 0xFFC03100, |
| 281 | .end = 0xFFC031FF, |
Mike Frysinger | cc2e16b | 2008-07-19 16:43:51 +0800 | [diff] [blame] | 282 | .flags = IORESOURCE_MEM, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 283 | }, |
| 284 | #endif |
| 285 | }; |
| 286 | |
| 287 | static struct platform_device bfin_uart_device = { |
| 288 | .name = "bfin-uart", |
| 289 | .id = 1, |
| 290 | .num_resources = ARRAY_SIZE(bfin_uart_resources), |
| 291 | .resource = bfin_uart_resources, |
| 292 | }; |
| 293 | #endif |
| 294 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 295 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 296 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 297 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 298 | { |
| 299 | .start = 0xFFC00400, |
| 300 | .end = 0xFFC004FF, |
| 301 | .flags = IORESOURCE_MEM, |
| 302 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 303 | { |
| 304 | .start = IRQ_UART0_RX, |
| 305 | .end = IRQ_UART0_RX+1, |
| 306 | .flags = IORESOURCE_IRQ, |
| 307 | }, |
| 308 | { |
| 309 | .start = CH_UART0_RX, |
| 310 | .end = CH_UART0_RX+1, |
| 311 | .flags = IORESOURCE_DMA, |
| 312 | }, |
| 313 | }; |
| 314 | static struct platform_device bfin_sir0_device = { |
| 315 | .name = "bfin_sir", |
| 316 | .id = 0, |
| 317 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 318 | .resource = bfin_sir0_resources, |
| 319 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 320 | #endif |
| 321 | #ifdef CONFIG_BFIN_SIR1 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 322 | static struct resource bfin_sir1_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 323 | { |
| 324 | .start = 0xFFC02000, |
| 325 | .end = 0xFFC020FF, |
| 326 | .flags = IORESOURCE_MEM, |
| 327 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 328 | { |
| 329 | .start = IRQ_UART1_RX, |
| 330 | .end = IRQ_UART1_RX+1, |
| 331 | .flags = IORESOURCE_IRQ, |
| 332 | }, |
| 333 | { |
| 334 | .start = CH_UART1_RX, |
| 335 | .end = CH_UART1_RX+1, |
| 336 | .flags = IORESOURCE_DMA, |
| 337 | }, |
| 338 | }; |
| 339 | static struct platform_device bfin_sir1_device = { |
| 340 | .name = "bfin_sir", |
| 341 | .id = 1, |
| 342 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), |
| 343 | .resource = bfin_sir1_resources, |
| 344 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 345 | #endif |
| 346 | #ifdef CONFIG_BFIN_SIR2 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 347 | static struct resource bfin_sir2_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 348 | { |
| 349 | .start = 0xFFC02100, |
| 350 | .end = 0xFFC021FF, |
| 351 | .flags = IORESOURCE_MEM, |
| 352 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 353 | { |
| 354 | .start = IRQ_UART2_RX, |
| 355 | .end = IRQ_UART2_RX+1, |
| 356 | .flags = IORESOURCE_IRQ, |
| 357 | }, |
| 358 | { |
| 359 | .start = CH_UART2_RX, |
| 360 | .end = CH_UART2_RX+1, |
| 361 | .flags = IORESOURCE_DMA, |
| 362 | }, |
| 363 | }; |
| 364 | static struct platform_device bfin_sir2_device = { |
| 365 | .name = "bfin_sir", |
| 366 | .id = 2, |
| 367 | .num_resources = ARRAY_SIZE(bfin_sir2_resources), |
| 368 | .resource = bfin_sir2_resources, |
| 369 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 370 | #endif |
| 371 | #ifdef CONFIG_BFIN_SIR3 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 372 | static struct resource bfin_sir3_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 373 | { |
| 374 | .start = 0xFFC03100, |
| 375 | .end = 0xFFC031FF, |
| 376 | .flags = IORESOURCE_MEM, |
| 377 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 378 | { |
| 379 | .start = IRQ_UART3_RX, |
| 380 | .end = IRQ_UART3_RX+1, |
| 381 | .flags = IORESOURCE_IRQ, |
| 382 | }, |
| 383 | { |
| 384 | .start = CH_UART3_RX, |
| 385 | .end = CH_UART3_RX+1, |
| 386 | .flags = IORESOURCE_DMA, |
| 387 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 388 | }; |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 389 | static struct platform_device bfin_sir3_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 390 | .name = "bfin_sir", |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 391 | .id = 3, |
| 392 | .num_resources = ARRAY_SIZE(bfin_sir3_resources), |
| 393 | .resource = bfin_sir3_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 394 | }; |
| 395 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 396 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 397 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 398 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
Mike Frysinger | 7a8b71d | 2009-06-05 20:41:17 -0400 | [diff] [blame^] | 399 | #include <linux/smsc911x.h> |
| 400 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 401 | static struct resource smsc911x_resources[] = { |
| 402 | { |
| 403 | .name = "smsc911x-memory", |
| 404 | .start = 0x24000000, |
| 405 | .end = 0x24000000 + 0xFF, |
| 406 | .flags = IORESOURCE_MEM, |
| 407 | }, |
| 408 | { |
| 409 | .start = IRQ_PE8, |
| 410 | .end = IRQ_PE8, |
| 411 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 412 | }, |
| 413 | }; |
Mike Frysinger | 7a8b71d | 2009-06-05 20:41:17 -0400 | [diff] [blame^] | 414 | |
| 415 | static struct smsc911x_platform_config smsc911x_config = { |
| 416 | .flags = SMSC911X_USE_32BIT, |
| 417 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 418 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, |
| 419 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 420 | }; |
| 421 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 422 | static struct platform_device smsc911x_device = { |
| 423 | .name = "smsc911x", |
| 424 | .id = 0, |
| 425 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
| 426 | .resource = smsc911x_resources, |
Mike Frysinger | 7a8b71d | 2009-06-05 20:41:17 -0400 | [diff] [blame^] | 427 | .dev = { |
| 428 | .platform_data = &smsc911x_config, |
| 429 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 430 | }; |
| 431 | #endif |
| 432 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 433 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 434 | static struct resource musb_resources[] = { |
| 435 | [0] = { |
| 436 | .start = 0xFFC03C00, |
| 437 | .end = 0xFFC040FF, |
| 438 | .flags = IORESOURCE_MEM, |
| 439 | }, |
| 440 | [1] = { /* general IRQ */ |
| 441 | .start = IRQ_USB_INT0, |
| 442 | .end = IRQ_USB_INT0, |
| 443 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 444 | }, |
| 445 | [2] = { /* DMA IRQ */ |
| 446 | .start = IRQ_USB_DMA, |
| 447 | .end = IRQ_USB_DMA, |
| 448 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 449 | }, |
| 450 | }; |
| 451 | |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 452 | static struct musb_hdrc_config musb_config = { |
| 453 | .multipoint = 0, |
| 454 | .dyn_fifo = 0, |
| 455 | .soft_con = 1, |
| 456 | .dma = 1, |
Bryan Wu | fea05da | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 457 | .num_eps = 8, |
| 458 | .dma_channels = 8, |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 459 | .gpio_vrsel = GPIO_PE7, |
| 460 | }; |
| 461 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 462 | static struct musb_hdrc_platform_data musb_plat = { |
Bryan Wu | 2935077 | 2007-12-24 12:20:19 +0800 | [diff] [blame] | 463 | #if defined(CONFIG_USB_MUSB_OTG) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 464 | .mode = MUSB_OTG, |
Bryan Wu | 2935077 | 2007-12-24 12:20:19 +0800 | [diff] [blame] | 465 | #elif defined(CONFIG_USB_MUSB_HDRC_HCD) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 466 | .mode = MUSB_HOST, |
Bryan Wu | 2935077 | 2007-12-24 12:20:19 +0800 | [diff] [blame] | 467 | #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 468 | .mode = MUSB_PERIPHERAL, |
| 469 | #endif |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 470 | .config = &musb_config, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 471 | }; |
| 472 | |
| 473 | static u64 musb_dmamask = ~(u32)0; |
| 474 | |
| 475 | static struct platform_device musb_device = { |
| 476 | .name = "musb_hdrc", |
| 477 | .id = 0, |
| 478 | .dev = { |
| 479 | .dma_mask = &musb_dmamask, |
| 480 | .coherent_dma_mask = 0xffffffff, |
| 481 | .platform_data = &musb_plat, |
| 482 | }, |
| 483 | .num_resources = ARRAY_SIZE(musb_resources), |
| 484 | .resource = musb_resources, |
| 485 | }; |
| 486 | #endif |
| 487 | |
| 488 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) |
| 489 | static struct resource bfin_atapi_resources[] = { |
| 490 | { |
| 491 | .start = 0xFFC03800, |
| 492 | .end = 0xFFC0386F, |
| 493 | .flags = IORESOURCE_MEM, |
| 494 | }, |
| 495 | { |
| 496 | .start = IRQ_ATAPI_ERR, |
| 497 | .end = IRQ_ATAPI_ERR, |
| 498 | .flags = IORESOURCE_IRQ, |
| 499 | }, |
| 500 | }; |
| 501 | |
| 502 | static struct platform_device bfin_atapi_device = { |
| 503 | .name = "pata-bf54x", |
| 504 | .id = -1, |
| 505 | .num_resources = ARRAY_SIZE(bfin_atapi_resources), |
| 506 | .resource = bfin_atapi_resources, |
| 507 | }; |
| 508 | #endif |
| 509 | |
| 510 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 511 | static struct mtd_partition partition_info[] = { |
| 512 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 513 | .name = "linux kernel(nand)", |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 514 | .offset = 0, |
Mike Frysinger | f4585a0 | 2008-10-13 14:45:21 +0800 | [diff] [blame] | 515 | .size = 4 * 1024 * 1024, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 516 | }, |
| 517 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 518 | .name = "file system(nand)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 519 | .offset = MTDPART_OFS_APPEND, |
| 520 | .size = MTDPART_SIZ_FULL, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 521 | }, |
| 522 | }; |
| 523 | |
| 524 | static struct bf5xx_nand_platform bf5xx_nand_platform = { |
| 525 | .page_size = NFC_PG_SIZE_256, |
| 526 | .data_width = NFC_NWIDTH_8, |
| 527 | .partitions = partition_info, |
| 528 | .nr_partitions = ARRAY_SIZE(partition_info), |
| 529 | .rd_dly = 3, |
| 530 | .wr_dly = 3, |
| 531 | }; |
| 532 | |
| 533 | static struct resource bf5xx_nand_resources[] = { |
| 534 | { |
| 535 | .start = 0xFFC03B00, |
| 536 | .end = 0xFFC03B4F, |
| 537 | .flags = IORESOURCE_MEM, |
| 538 | }, |
| 539 | { |
| 540 | .start = CH_NFC, |
| 541 | .end = CH_NFC, |
| 542 | .flags = IORESOURCE_IRQ, |
| 543 | }, |
| 544 | }; |
| 545 | |
| 546 | static struct platform_device bf5xx_nand_device = { |
| 547 | .name = "bf5xx-nand", |
| 548 | .id = 0, |
| 549 | .num_resources = ARRAY_SIZE(bf5xx_nand_resources), |
| 550 | .resource = bf5xx_nand_resources, |
| 551 | .dev = { |
| 552 | .platform_data = &bf5xx_nand_platform, |
| 553 | }, |
| 554 | }; |
| 555 | #endif |
| 556 | |
Michael Hennerich | 3d7e6cf | 2008-03-03 17:40:28 -0700 | [diff] [blame] | 557 | #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) |
Cliff Cai | 501674a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 558 | |
| 559 | static struct bfin_sd_host bfin_sdh_data = { |
| 560 | .dma_chan = CH_SDH, |
| 561 | .irq_int0 = IRQ_SDH_MASK0, |
| 562 | .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0}, |
| 563 | }; |
| 564 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 565 | static struct platform_device bf54x_sdh_device = { |
| 566 | .name = "bfin-sdh", |
| 567 | .id = 0, |
Cliff Cai | 501674a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 568 | .dev = { |
| 569 | .platform_data = &bfin_sdh_data, |
| 570 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 571 | }; |
| 572 | #endif |
| 573 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 574 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 575 | static struct mtd_partition ezkit_partitions[] = { |
| 576 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 577 | .name = "bootloader(nor)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 578 | .size = 0x40000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 579 | .offset = 0, |
| 580 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 581 | .name = "linux kernel(nor)", |
Mike Frysinger | 664d040 | 2008-10-09 17:28:36 +0800 | [diff] [blame] | 582 | .size = 0x400000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 583 | .offset = MTDPART_OFS_APPEND, |
| 584 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 585 | .name = "file system(nor)", |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 586 | .size = MTDPART_SIZ_FULL, |
| 587 | .offset = MTDPART_OFS_APPEND, |
| 588 | } |
| 589 | }; |
| 590 | |
| 591 | static struct physmap_flash_data ezkit_flash_data = { |
| 592 | .width = 2, |
| 593 | .parts = ezkit_partitions, |
| 594 | .nr_parts = ARRAY_SIZE(ezkit_partitions), |
| 595 | }; |
| 596 | |
| 597 | static struct resource ezkit_flash_resource = { |
| 598 | .start = 0x20000000, |
Mike Frysinger | 664d040 | 2008-10-09 17:28:36 +0800 | [diff] [blame] | 599 | .end = 0x21ffffff, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 600 | .flags = IORESOURCE_MEM, |
| 601 | }; |
| 602 | |
| 603 | static struct platform_device ezkit_flash_device = { |
| 604 | .name = "physmap-flash", |
| 605 | .id = 0, |
| 606 | .dev = { |
| 607 | .platform_data = &ezkit_flash_data, |
| 608 | }, |
| 609 | .num_resources = 1, |
| 610 | .resource = &ezkit_flash_resource, |
| 611 | }; |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 612 | #endif |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 613 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 614 | #if defined(CONFIG_MTD_M25P80) \ |
| 615 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 616 | /* SPI flash chip (m25p16) */ |
| 617 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 618 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 619 | .name = "bootloader(spi)", |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 620 | .size = 0x00040000, |
| 621 | .offset = 0, |
| 622 | .mask_flags = MTD_CAP_ROM |
| 623 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 624 | .name = "linux kernel(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 625 | .size = MTDPART_SIZ_FULL, |
| 626 | .offset = MTDPART_OFS_APPEND, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 627 | } |
| 628 | }; |
| 629 | |
| 630 | static struct flash_platform_data bfin_spi_flash_data = { |
| 631 | .name = "m25p80", |
| 632 | .parts = bfin_spi_flash_partitions, |
| 633 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
| 634 | .type = "m25p16", |
| 635 | }; |
| 636 | |
| 637 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 638 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 639 | .bits_per_word = 8, |
| 640 | .cs_change_per_word = 0, |
| 641 | }; |
| 642 | #endif |
| 643 | |
Bernd Schmidt | 37fa242 | 2008-04-24 05:19:02 +0800 | [diff] [blame] | 644 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 645 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 646 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
| 647 | .enable_dma = 0, |
| 648 | .bits_per_word = 16, |
| 649 | }; |
| 650 | #endif |
| 651 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 652 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
| 653 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { |
Michael Hennerich | c7d4896 | 2007-11-15 21:33:31 +0800 | [diff] [blame] | 654 | .cs_change_per_word = 0, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 655 | .enable_dma = 0, |
| 656 | .bits_per_word = 16, |
| 657 | }; |
| 658 | |
| 659 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { |
| 660 | .model = 7877, |
| 661 | .vref_delay_usecs = 50, /* internal, no capacitor */ |
| 662 | .x_plate_ohms = 419, |
| 663 | .y_plate_ohms = 486, |
| 664 | .pressure_max = 1000, |
| 665 | .pressure_min = 0, |
| 666 | .stopacq_polarity = 1, |
| 667 | .first_conversion_delay = 3, |
| 668 | .acquisition_time = 1, |
| 669 | .averaging = 1, |
| 670 | .pen_down_acc_interval = 1, |
| 671 | }; |
| 672 | #endif |
| 673 | |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 674 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 675 | static struct bfin5xx_spi_chip spidev_chip_info = { |
| 676 | .enable_dma = 0, |
| 677 | .bits_per_word = 8, |
| 678 | }; |
| 679 | #endif |
| 680 | |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 681 | #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) |
| 682 | static struct bfin5xx_spi_chip spi_adxl34x_chip_info = { |
| 683 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 684 | .bits_per_word = 8, |
| 685 | .cs_change_per_word = 0, |
| 686 | }; |
| 687 | #endif |
| 688 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 689 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 690 | #if defined(CONFIG_MTD_M25P80) \ |
| 691 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 692 | { |
| 693 | /* the modalias must be the same as spi device driver name */ |
| 694 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 695 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
| 696 | .bus_num = 0, /* Framework bus number */ |
| 697 | .chip_select = 1, /* SPI_SSEL1*/ |
| 698 | .platform_data = &bfin_spi_flash_data, |
| 699 | .controller_data = &spi_flash_chip_info, |
| 700 | .mode = SPI_MODE_3, |
| 701 | }, |
| 702 | #endif |
Bernd Schmidt | 37fa242 | 2008-04-24 05:19:02 +0800 | [diff] [blame] | 703 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 704 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| 705 | { |
| 706 | .modalias = "ad1836-spi", |
| 707 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 708 | .bus_num = 1, |
| 709 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
| 710 | .controller_data = &ad1836_spi_chip_info, |
| 711 | }, |
| 712 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 713 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 714 | { |
| 715 | .modalias = "ad7877", |
| 716 | .platform_data = &bfin_ad7877_ts_info, |
| 717 | .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ |
| 718 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
| 719 | .bus_num = 0, |
| 720 | .chip_select = 2, |
| 721 | .controller_data = &spi_ad7877_chip_info, |
| 722 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 723 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 724 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 725 | { |
| 726 | .modalias = "spidev", |
| 727 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 728 | .bus_num = 0, |
| 729 | .chip_select = 1, |
| 730 | .controller_data = &spidev_chip_info, |
| 731 | }, |
| 732 | #endif |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 733 | #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) |
| 734 | { |
| 735 | .modalias = "adxl34x", |
| 736 | .platform_data = &adxl34x_info, |
| 737 | .irq = IRQ_PC5, |
| 738 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ |
| 739 | .bus_num = 1, |
| 740 | .chip_select = 2, |
| 741 | .controller_data = &spi_adxl34x_chip_info, |
| 742 | .mode = SPI_MODE_3, |
| 743 | }, |
| 744 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 745 | }; |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 746 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 747 | /* SPI (0) */ |
| 748 | static struct resource bfin_spi0_resource[] = { |
| 749 | [0] = { |
| 750 | .start = SPI0_REGBASE, |
| 751 | .end = SPI0_REGBASE + 0xFF, |
| 752 | .flags = IORESOURCE_MEM, |
| 753 | }, |
| 754 | [1] = { |
| 755 | .start = CH_SPI0, |
| 756 | .end = CH_SPI0, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 757 | .flags = IORESOURCE_DMA, |
| 758 | }, |
| 759 | [2] = { |
| 760 | .start = IRQ_SPI0, |
| 761 | .end = IRQ_SPI0, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 762 | .flags = IORESOURCE_IRQ, |
| 763 | } |
| 764 | }; |
| 765 | |
| 766 | /* SPI (1) */ |
| 767 | static struct resource bfin_spi1_resource[] = { |
| 768 | [0] = { |
| 769 | .start = SPI1_REGBASE, |
| 770 | .end = SPI1_REGBASE + 0xFF, |
| 771 | .flags = IORESOURCE_MEM, |
| 772 | }, |
| 773 | [1] = { |
| 774 | .start = CH_SPI1, |
| 775 | .end = CH_SPI1, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 776 | .flags = IORESOURCE_DMA, |
| 777 | }, |
| 778 | [2] = { |
| 779 | .start = IRQ_SPI1, |
| 780 | .end = IRQ_SPI1, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 781 | .flags = IORESOURCE_IRQ, |
| 782 | } |
| 783 | }; |
| 784 | |
| 785 | /* SPI controller data */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 786 | static struct bfin5xx_spi_master bf54x_spi_master_info0 = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 787 | .num_chipselect = 8, |
| 788 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 789 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 790 | }; |
| 791 | |
| 792 | static struct platform_device bf54x_spi_master0 = { |
| 793 | .name = "bfin-spi", |
| 794 | .id = 0, /* Bus number */ |
| 795 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 796 | .resource = bfin_spi0_resource, |
| 797 | .dev = { |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 798 | .platform_data = &bf54x_spi_master_info0, /* Passed to driver */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 799 | }, |
| 800 | }; |
| 801 | |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 802 | static struct bfin5xx_spi_master bf54x_spi_master_info1 = { |
| 803 | .num_chipselect = 8, |
| 804 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
| 805 | .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, |
| 806 | }; |
| 807 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 808 | static struct platform_device bf54x_spi_master1 = { |
| 809 | .name = "bfin-spi", |
| 810 | .id = 1, /* Bus number */ |
| 811 | .num_resources = ARRAY_SIZE(bfin_spi1_resource), |
| 812 | .resource = bfin_spi1_resource, |
| 813 | .dev = { |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 814 | .platform_data = &bf54x_spi_master_info1, /* Passed to driver */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 815 | }, |
| 816 | }; |
| 817 | #endif /* spi master and devices */ |
| 818 | |
| 819 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 820 | static struct resource bfin_twi0_resource[] = { |
| 821 | [0] = { |
| 822 | .start = TWI0_REGBASE, |
| 823 | .end = TWI0_REGBASE + 0xFF, |
| 824 | .flags = IORESOURCE_MEM, |
| 825 | }, |
| 826 | [1] = { |
| 827 | .start = IRQ_TWI0, |
| 828 | .end = IRQ_TWI0, |
| 829 | .flags = IORESOURCE_IRQ, |
| 830 | }, |
| 831 | }; |
| 832 | |
| 833 | static struct platform_device i2c_bfin_twi0_device = { |
| 834 | .name = "i2c-bfin-twi", |
| 835 | .id = 0, |
| 836 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 837 | .resource = bfin_twi0_resource, |
| 838 | }; |
| 839 | |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 840 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 841 | static struct resource bfin_twi1_resource[] = { |
| 842 | [0] = { |
| 843 | .start = TWI1_REGBASE, |
| 844 | .end = TWI1_REGBASE + 0xFF, |
| 845 | .flags = IORESOURCE_MEM, |
| 846 | }, |
| 847 | [1] = { |
| 848 | .start = IRQ_TWI1, |
| 849 | .end = IRQ_TWI1, |
| 850 | .flags = IORESOURCE_IRQ, |
| 851 | }, |
| 852 | }; |
| 853 | |
| 854 | static struct platform_device i2c_bfin_twi1_device = { |
| 855 | .name = "i2c-bfin-twi", |
| 856 | .id = 1, |
| 857 | .num_resources = ARRAY_SIZE(bfin_twi1_resource), |
| 858 | .resource = bfin_twi1_resource, |
| 859 | }; |
| 860 | #endif |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 861 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 862 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 863 | static struct i2c_board_info __initdata bfin_i2c_board_info0[] = { |
| 864 | }; |
| 865 | |
| 866 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ |
| 867 | static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { |
Mike Frysinger | a261eec | 2009-05-20 14:05:36 +0000 | [diff] [blame] | 868 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 869 | { |
| 870 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 871 | }, |
| 872 | #endif |
| 873 | #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) |
| 874 | { |
| 875 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 876 | .irq = 212, |
| 877 | }, |
| 878 | #endif |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 879 | #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) |
| 880 | { |
| 881 | I2C_BOARD_INFO("adxl34x", 0x53), |
| 882 | .irq = IRQ_PC5, |
| 883 | .platform_data = (void *)&adxl34x_info, |
| 884 | }, |
| 885 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 886 | }; |
| 887 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 888 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 889 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 890 | #include <linux/gpio_keys.h> |
| 891 | |
| 892 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 893 | {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"}, |
| 894 | {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"}, |
| 895 | {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"}, |
| 896 | {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"}, |
| 897 | }; |
| 898 | |
| 899 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 900 | .buttons = bfin_gpio_keys_table, |
| 901 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 902 | }; |
| 903 | |
| 904 | static struct platform_device bfin_device_gpiokeys = { |
| 905 | .name = "gpio-keys", |
| 906 | .dev = { |
| 907 | .platform_data = &bfin_gpio_keys_data, |
| 908 | }, |
| 909 | }; |
| 910 | #endif |
| 911 | |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 912 | static struct resource bfin_gpios_resources = { |
| 913 | .start = 0, |
| 914 | .end = MAX_BLACKFIN_GPIOS - 1, |
| 915 | .flags = IORESOURCE_IRQ, |
| 916 | }; |
| 917 | |
| 918 | static struct platform_device bfin_gpios_device = { |
| 919 | .name = "simple-gpio", |
| 920 | .id = -1, |
| 921 | .num_resources = 1, |
| 922 | .resource = &bfin_gpios_resources, |
| 923 | }; |
| 924 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 925 | static const unsigned int cclk_vlev_datasheet[] = |
| 926 | { |
| 927 | /* |
| 928 | * Internal VLEV BF54XSBBC1533 |
| 929 | ****temporarily using these values until data sheet is updated |
| 930 | */ |
| 931 | VRPAIR(VLEV_085, 150000000), |
| 932 | VRPAIR(VLEV_090, 250000000), |
| 933 | VRPAIR(VLEV_110, 276000000), |
| 934 | VRPAIR(VLEV_115, 301000000), |
| 935 | VRPAIR(VLEV_120, 525000000), |
| 936 | VRPAIR(VLEV_125, 550000000), |
| 937 | VRPAIR(VLEV_130, 600000000), |
| 938 | }; |
| 939 | |
| 940 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 941 | .tuple_tab = cclk_vlev_datasheet, |
| 942 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 943 | .vr_settling_time = 25 /* us */, |
| 944 | }; |
| 945 | |
| 946 | static struct platform_device bfin_dpmc = { |
| 947 | .name = "bfin dpmc", |
| 948 | .dev = { |
| 949 | .platform_data = &bfin_dmpc_vreg_data, |
| 950 | }, |
| 951 | }; |
| 952 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 953 | static struct platform_device *ezkit_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 954 | |
| 955 | &bfin_dpmc, |
| 956 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 957 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 958 | &rtc_device, |
| 959 | #endif |
| 960 | |
| 961 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 962 | &bfin_uart_device, |
| 963 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 964 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 965 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 966 | #ifdef CONFIG_BFIN_SIR0 |
| 967 | &bfin_sir0_device, |
| 968 | #endif |
| 969 | #ifdef CONFIG_BFIN_SIR1 |
| 970 | &bfin_sir1_device, |
| 971 | #endif |
| 972 | #ifdef CONFIG_BFIN_SIR2 |
| 973 | &bfin_sir2_device, |
| 974 | #endif |
| 975 | #ifdef CONFIG_BFIN_SIR3 |
| 976 | &bfin_sir3_device, |
| 977 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 978 | #endif |
| 979 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 980 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) |
| 981 | &bf54x_lq043_device, |
| 982 | #endif |
| 983 | |
| 984 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
| 985 | &smsc911x_device, |
| 986 | #endif |
| 987 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 988 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 989 | &musb_device, |
| 990 | #endif |
| 991 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 992 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 993 | &bfin_isp1760_device, |
| 994 | #endif |
| 995 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 996 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) |
| 997 | &bfin_atapi_device, |
| 998 | #endif |
| 999 | |
| 1000 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 1001 | &bf5xx_nand_device, |
| 1002 | #endif |
| 1003 | |
Michael Hennerich | 3d7e6cf | 2008-03-03 17:40:28 -0700 | [diff] [blame] | 1004 | #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1005 | &bf54x_sdh_device, |
| 1006 | #endif |
| 1007 | |
| 1008 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 1009 | &bf54x_spi_master0, |
Bryan Wu | d4b1d27 | 2007-10-21 17:03:55 +0800 | [diff] [blame] | 1010 | &bf54x_spi_master1, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1011 | #endif |
| 1012 | |
| 1013 | #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) |
| 1014 | &bf54x_kpad_device, |
| 1015 | #endif |
| 1016 | |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 1017 | #if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE) |
| 1018 | &bfin_rotary_device, |
| 1019 | #endif |
| 1020 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1021 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 1022 | &i2c_bfin_twi0_device, |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 1023 | #if !defined(CONFIG_BF542) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1024 | &i2c_bfin_twi1_device, |
| 1025 | #endif |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 1026 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 1027 | |
| 1028 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 1029 | &bfin_device_gpiokeys, |
| 1030 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 1031 | |
| 1032 | &bfin_gpios_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1033 | |
| 1034 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 1035 | &ezkit_flash_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1036 | #endif |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1037 | }; |
| 1038 | |
Mike Frysinger | a01d7a7 | 2008-02-02 15:34:56 +0800 | [diff] [blame] | 1039 | static int __init ezkit_init(void) |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1040 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 1041 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1042 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1043 | i2c_register_board_info(0, bfin_i2c_board_info0, |
| 1044 | ARRAY_SIZE(bfin_i2c_board_info0)); |
| 1045 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ |
| 1046 | i2c_register_board_info(1, bfin_i2c_board_info1, |
| 1047 | ARRAY_SIZE(bfin_i2c_board_info1)); |
| 1048 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1049 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1050 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1051 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1052 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1053 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1054 | return 0; |
| 1055 | } |
| 1056 | |
Mike Frysinger | a01d7a7 | 2008-02-02 15:34:56 +0800 | [diff] [blame] | 1057 | arch_initcall(ezkit_init); |