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