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