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> |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 25 | #include <asm/bfin_sport.h> |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 26 | #include <asm/portmux.h> |
Cliff Cai | 501674a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 27 | #include <asm/bfin_sdh.h> |
Bryan Wu | 639f657 | 2008-08-27 10:51:02 +0800 | [diff] [blame] | 28 | #include <mach/bf54x_keys.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 29 | #include <linux/input.h> |
| 30 | #include <linux/spi/ad7877.h> |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 31 | |
| 32 | /* |
| 33 | * Name the Board for the /proc/cpuinfo |
| 34 | */ |
Mike Frysinger | fe85cad | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 35 | const char bfin_board_name[] = "ADI BF548-EZKIT"; |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 36 | |
| 37 | /* |
| 38 | * Driver needs to know address, irq and flag pin. |
| 39 | */ |
| 40 | |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 41 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 42 | #include <linux/usb/isp1760.h> |
| 43 | static struct resource bfin_isp1760_resources[] = { |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 44 | [0] = { |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 45 | .start = 0x2C0C0000, |
| 46 | .end = 0x2C0C0000 + 0xfffff, |
| 47 | .flags = IORESOURCE_MEM, |
| 48 | }, |
| 49 | [1] = { |
| 50 | .start = IRQ_PG7, |
| 51 | .end = IRQ_PG7, |
| 52 | .flags = IORESOURCE_IRQ, |
| 53 | }, |
| 54 | }; |
| 55 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 56 | static struct isp1760_platform_data isp1760_priv = { |
| 57 | .is_isp1761 = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 58 | .bus_width_16 = 1, |
| 59 | .port1_otg = 0, |
| 60 | .analog_oc = 0, |
| 61 | .dack_polarity_high = 0, |
| 62 | .dreq_polarity_high = 0, |
| 63 | }; |
| 64 | |
| 65 | static struct platform_device bfin_isp1760_device = { |
Michael Hennerich | c6feb76 | 2009-10-15 10:37:33 +0000 | [diff] [blame] | 66 | .name = "isp1760", |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 67 | .id = 0, |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 68 | .dev = { |
| 69 | .platform_data = &isp1760_priv, |
| 70 | }, |
| 71 | .num_resources = ARRAY_SIZE(bfin_isp1760_resources), |
| 72 | .resource = bfin_isp1760_resources, |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 73 | }; |
Michael Hennerich | 0a6304a | 2008-07-26 16:14:57 +0800 | [diff] [blame] | 74 | #endif |
| 75 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 76 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) |
| 77 | |
Bryan Wu | 639f657 | 2008-08-27 10:51:02 +0800 | [diff] [blame] | 78 | #include <mach/bf54x-lq043.h> |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 79 | |
| 80 | static struct bfin_bf54xfb_mach_info bf54x_lq043_data = { |
Stefan Pledl | 0e101ec | 2009-07-29 08:09:45 +0000 | [diff] [blame] | 81 | .width = 95, |
| 82 | .height = 54, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 83 | .xres = {480, 480, 480}, |
| 84 | .yres = {272, 272, 272}, |
| 85 | .bpp = {24, 24, 24}, |
| 86 | .disp = GPIO_PE3, |
| 87 | }; |
| 88 | |
| 89 | static struct resource bf54x_lq043_resources[] = { |
| 90 | { |
| 91 | .start = IRQ_EPPI0_ERR, |
| 92 | .end = IRQ_EPPI0_ERR, |
| 93 | .flags = IORESOURCE_IRQ, |
| 94 | }, |
| 95 | }; |
| 96 | |
| 97 | static struct platform_device bf54x_lq043_device = { |
| 98 | .name = "bf54x-lq043", |
| 99 | .id = -1, |
| 100 | .num_resources = ARRAY_SIZE(bf54x_lq043_resources), |
| 101 | .resource = bf54x_lq043_resources, |
| 102 | .dev = { |
| 103 | .platform_data = &bf54x_lq043_data, |
| 104 | }, |
| 105 | }; |
| 106 | #endif |
| 107 | |
| 108 | #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) |
Michael Hennerich | 8f740ef | 2007-10-13 00:36:46 -0400 | [diff] [blame] | 109 | static const unsigned int bf548_keymap[] = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 110 | KEYVAL(0, 0, KEY_ENTER), |
| 111 | KEYVAL(0, 1, KEY_HELP), |
| 112 | KEYVAL(0, 2, KEY_0), |
| 113 | KEYVAL(0, 3, KEY_BACKSPACE), |
| 114 | KEYVAL(1, 0, KEY_TAB), |
| 115 | KEYVAL(1, 1, KEY_9), |
| 116 | KEYVAL(1, 2, KEY_8), |
| 117 | KEYVAL(1, 3, KEY_7), |
| 118 | KEYVAL(2, 0, KEY_DOWN), |
| 119 | KEYVAL(2, 1, KEY_6), |
| 120 | KEYVAL(2, 2, KEY_5), |
| 121 | KEYVAL(2, 3, KEY_4), |
| 122 | KEYVAL(3, 0, KEY_UP), |
| 123 | KEYVAL(3, 1, KEY_3), |
| 124 | KEYVAL(3, 2, KEY_2), |
| 125 | KEYVAL(3, 3, KEY_1), |
| 126 | }; |
| 127 | |
| 128 | static struct bfin_kpad_platform_data bf54x_kpad_data = { |
| 129 | .rows = 4, |
| 130 | .cols = 4, |
Michael Hennerich | 8f740ef | 2007-10-13 00:36:46 -0400 | [diff] [blame] | 131 | .keymap = bf548_keymap, |
| 132 | .keymapsize = ARRAY_SIZE(bf548_keymap), |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 133 | .repeat = 0, |
| 134 | .debounce_time = 5000, /* ns (5ms) */ |
| 135 | .coldrive_time = 1000, /* ns (1ms) */ |
| 136 | .keyup_test_interval = 50, /* ms (50ms) */ |
| 137 | }; |
| 138 | |
| 139 | static struct resource bf54x_kpad_resources[] = { |
| 140 | { |
| 141 | .start = IRQ_KEY, |
| 142 | .end = IRQ_KEY, |
| 143 | .flags = IORESOURCE_IRQ, |
| 144 | }, |
| 145 | }; |
| 146 | |
| 147 | static struct platform_device bf54x_kpad_device = { |
| 148 | .name = "bf54x-keys", |
| 149 | .id = -1, |
| 150 | .num_resources = ARRAY_SIZE(bf54x_kpad_resources), |
| 151 | .resource = bf54x_kpad_resources, |
| 152 | .dev = { |
| 153 | .platform_data = &bf54x_kpad_data, |
| 154 | }, |
| 155 | }; |
| 156 | #endif |
| 157 | |
Michael Hennerich | adfc046 | 2009-10-09 07:37:03 +0000 | [diff] [blame] | 158 | #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 159 | #include <asm/bfin_rotary.h> |
| 160 | |
| 161 | static struct bfin_rotary_platform_data bfin_rotary_data = { |
| 162 | /*.rotary_up_key = KEY_UP,*/ |
| 163 | /*.rotary_down_key = KEY_DOWN,*/ |
| 164 | .rotary_rel_code = REL_WHEEL, |
| 165 | .rotary_button_key = KEY_ENTER, |
| 166 | .debounce = 10, /* 0..17 */ |
| 167 | .mode = ROT_QUAD_ENC | ROT_DEBE, |
Sonic Zhang | 5b8163a | 2012-05-08 15:41:18 +0800 | [diff] [blame] | 168 | .pm_wakeup = 1, |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 169 | }; |
| 170 | |
| 171 | static struct resource bfin_rotary_resources[] = { |
| 172 | { |
| 173 | .start = IRQ_CNT, |
| 174 | .end = IRQ_CNT, |
| 175 | .flags = IORESOURCE_IRQ, |
| 176 | }, |
| 177 | }; |
| 178 | |
| 179 | static struct platform_device bfin_rotary_device = { |
| 180 | .name = "bfin-rotary", |
| 181 | .id = -1, |
| 182 | .num_resources = ARRAY_SIZE(bfin_rotary_resources), |
| 183 | .resource = bfin_rotary_resources, |
| 184 | .dev = { |
| 185 | .platform_data = &bfin_rotary_data, |
| 186 | }, |
| 187 | }; |
| 188 | #endif |
| 189 | |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 190 | #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) |
Michael Hennerich | 57af8ed | 2009-10-16 12:35:20 +0000 | [diff] [blame] | 191 | #include <linux/input/adxl34x.h> |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 192 | static const struct adxl34x_platform_data adxl34x_info = { |
| 193 | .x_axis_offset = 0, |
| 194 | .y_axis_offset = 0, |
| 195 | .z_axis_offset = 0, |
| 196 | .tap_threshold = 0x31, |
| 197 | .tap_duration = 0x10, |
| 198 | .tap_latency = 0x60, |
| 199 | .tap_window = 0xF0, |
| 200 | .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN, |
| 201 | .act_axis_control = 0xFF, |
| 202 | .activity_threshold = 5, |
| 203 | .inactivity_threshold = 3, |
| 204 | .inactivity_time = 4, |
| 205 | .free_fall_threshold = 0x7, |
| 206 | .free_fall_time = 0x20, |
| 207 | .data_rate = 0x8, |
| 208 | .data_range = ADXL_FULL_RES, |
| 209 | |
| 210 | .ev_type = EV_ABS, |
| 211 | .ev_code_x = ABS_X, /* EV_REL */ |
| 212 | .ev_code_y = ABS_Y, /* EV_REL */ |
| 213 | .ev_code_z = ABS_Z, /* EV_REL */ |
| 214 | |
Michael Hennerich | 57af8ed | 2009-10-16 12:35:20 +0000 | [diff] [blame] | 215 | .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */ |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 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, |
Michael Hennerich | 5db4036 | 2009-10-29 13:48:10 +0000 | [diff] [blame] | 221 | .orientation_enable = ADXL_EN_ORIENTATION_3D, |
| 222 | .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8, |
| 223 | .divisor_length = ADXL_LP_FILTER_DIVISOR_16, |
| 224 | /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */ |
| 225 | .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C}, |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 226 | }; |
| 227 | #endif |
| 228 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 229 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 230 | static struct platform_device rtc_device = { |
| 231 | .name = "rtc-bfin", |
| 232 | .id = -1, |
| 233 | }; |
| 234 | #endif |
| 235 | |
| 236 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 237 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 238 | static struct resource bfin_uart0_resources[] = { |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 239 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 240 | .start = UART0_DLL, |
| 241 | .end = UART0_RBR+2, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 242 | .flags = IORESOURCE_MEM, |
| 243 | }, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 244 | { |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 245 | .start = IRQ_UART0_TX, |
| 246 | .end = IRQ_UART0_TX, |
| 247 | .flags = IORESOURCE_IRQ, |
| 248 | }, |
| 249 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 250 | .start = IRQ_UART0_RX, |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 251 | .end = IRQ_UART0_RX, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 252 | .flags = IORESOURCE_IRQ, |
| 253 | }, |
| 254 | { |
| 255 | .start = IRQ_UART0_ERROR, |
| 256 | .end = IRQ_UART0_ERROR, |
| 257 | .flags = IORESOURCE_IRQ, |
| 258 | }, |
| 259 | { |
| 260 | .start = CH_UART0_TX, |
| 261 | .end = CH_UART0_TX, |
| 262 | .flags = IORESOURCE_DMA, |
| 263 | }, |
| 264 | { |
| 265 | .start = CH_UART0_RX, |
| 266 | .end = CH_UART0_RX, |
| 267 | .flags = IORESOURCE_DMA, |
| 268 | }, |
| 269 | }; |
| 270 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 271 | static unsigned short bfin_uart0_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 272 | P_UART0_TX, P_UART0_RX, 0 |
| 273 | }; |
| 274 | |
| 275 | static struct platform_device bfin_uart0_device = { |
| 276 | .name = "bfin-uart", |
| 277 | .id = 0, |
| 278 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
| 279 | .resource = bfin_uart0_resources, |
| 280 | .dev = { |
| 281 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ |
| 282 | }, |
| 283 | }; |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 284 | #endif |
| 285 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 286 | static struct resource bfin_uart1_resources[] = { |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 287 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 288 | .start = UART1_DLL, |
| 289 | .end = UART1_RBR+2, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 290 | .flags = IORESOURCE_MEM, |
| 291 | }, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 292 | { |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 293 | .start = IRQ_UART1_TX, |
| 294 | .end = IRQ_UART1_TX, |
| 295 | .flags = IORESOURCE_IRQ, |
| 296 | }, |
| 297 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 298 | .start = IRQ_UART1_RX, |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 299 | .end = IRQ_UART1_RX, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 300 | .flags = IORESOURCE_IRQ, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 301 | }, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 302 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 303 | .start = IRQ_UART1_ERROR, |
| 304 | .end = IRQ_UART1_ERROR, |
| 305 | .flags = IORESOURCE_IRQ, |
| 306 | }, |
| 307 | { |
| 308 | .start = CH_UART1_TX, |
| 309 | .end = CH_UART1_TX, |
| 310 | .flags = IORESOURCE_DMA, |
| 311 | }, |
| 312 | { |
| 313 | .start = CH_UART1_RX, |
| 314 | .end = CH_UART1_RX, |
| 315 | .flags = IORESOURCE_DMA, |
| 316 | }, |
| 317 | #ifdef CONFIG_BFIN_UART1_CTSRTS |
| 318 | { /* CTS pin -- 0 means not supported */ |
| 319 | .start = GPIO_PE10, |
| 320 | .end = GPIO_PE10, |
| 321 | .flags = IORESOURCE_IO, |
| 322 | }, |
| 323 | { /* RTS pin -- 0 means not supported */ |
| 324 | .start = GPIO_PE9, |
| 325 | .end = GPIO_PE9, |
| 326 | .flags = IORESOURCE_IO, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 327 | }, |
| 328 | #endif |
| 329 | }; |
| 330 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 331 | static unsigned short bfin_uart1_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 332 | P_UART1_TX, P_UART1_RX, |
| 333 | #ifdef CONFIG_BFIN_UART1_CTSRTS |
| 334 | P_UART1_RTS, P_UART1_CTS, |
| 335 | #endif |
| 336 | 0 |
| 337 | }; |
| 338 | |
| 339 | static struct platform_device bfin_uart1_device = { |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 340 | .name = "bfin-uart", |
| 341 | .id = 1, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 342 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
| 343 | .resource = bfin_uart1_resources, |
| 344 | .dev = { |
| 345 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ |
| 346 | }, |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 347 | }; |
| 348 | #endif |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 349 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
| 350 | static struct resource bfin_uart2_resources[] = { |
| 351 | { |
| 352 | .start = UART2_DLL, |
| 353 | .end = UART2_RBR+2, |
| 354 | .flags = IORESOURCE_MEM, |
| 355 | }, |
| 356 | { |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 357 | .start = IRQ_UART2_TX, |
| 358 | .end = IRQ_UART2_TX, |
| 359 | .flags = IORESOURCE_IRQ, |
| 360 | }, |
| 361 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 362 | .start = IRQ_UART2_RX, |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 363 | .end = IRQ_UART2_RX, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 364 | .flags = IORESOURCE_IRQ, |
| 365 | }, |
| 366 | { |
| 367 | .start = IRQ_UART2_ERROR, |
| 368 | .end = IRQ_UART2_ERROR, |
| 369 | .flags = IORESOURCE_IRQ, |
| 370 | }, |
| 371 | { |
| 372 | .start = CH_UART2_TX, |
| 373 | .end = CH_UART2_TX, |
| 374 | .flags = IORESOURCE_DMA, |
| 375 | }, |
| 376 | { |
| 377 | .start = CH_UART2_RX, |
| 378 | .end = CH_UART2_RX, |
| 379 | .flags = IORESOURCE_DMA, |
| 380 | }, |
| 381 | }; |
| 382 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 383 | static unsigned short bfin_uart2_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 384 | P_UART2_TX, P_UART2_RX, 0 |
| 385 | }; |
| 386 | |
| 387 | static struct platform_device bfin_uart2_device = { |
| 388 | .name = "bfin-uart", |
| 389 | .id = 2, |
| 390 | .num_resources = ARRAY_SIZE(bfin_uart2_resources), |
| 391 | .resource = bfin_uart2_resources, |
| 392 | .dev = { |
| 393 | .platform_data = &bfin_uart2_peripherals, /* Passed to driver */ |
| 394 | }, |
| 395 | }; |
| 396 | #endif |
| 397 | #ifdef CONFIG_SERIAL_BFIN_UART3 |
| 398 | static struct resource bfin_uart3_resources[] = { |
| 399 | { |
| 400 | .start = UART3_DLL, |
| 401 | .end = UART3_RBR+2, |
| 402 | .flags = IORESOURCE_MEM, |
| 403 | }, |
| 404 | { |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 405 | .start = IRQ_UART3_TX, |
| 406 | .end = IRQ_UART3_TX, |
| 407 | .flags = IORESOURCE_IRQ, |
| 408 | }, |
| 409 | { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 410 | .start = IRQ_UART3_RX, |
Sonic Zhang | edb0a64 | 2011-08-01 17:53:21 +0800 | [diff] [blame] | 411 | .end = IRQ_UART3_RX, |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 412 | .flags = IORESOURCE_IRQ, |
| 413 | }, |
| 414 | { |
| 415 | .start = IRQ_UART3_ERROR, |
| 416 | .end = IRQ_UART3_ERROR, |
| 417 | .flags = IORESOURCE_IRQ, |
| 418 | }, |
| 419 | { |
| 420 | .start = CH_UART3_TX, |
| 421 | .end = CH_UART3_TX, |
| 422 | .flags = IORESOURCE_DMA, |
| 423 | }, |
| 424 | { |
| 425 | .start = CH_UART3_RX, |
| 426 | .end = CH_UART3_RX, |
| 427 | .flags = IORESOURCE_DMA, |
| 428 | }, |
| 429 | #ifdef CONFIG_BFIN_UART3_CTSRTS |
| 430 | { /* CTS pin -- 0 means not supported */ |
| 431 | .start = GPIO_PB3, |
| 432 | .end = GPIO_PB3, |
| 433 | .flags = IORESOURCE_IO, |
| 434 | }, |
| 435 | { /* RTS pin -- 0 means not supported */ |
| 436 | .start = GPIO_PB2, |
| 437 | .end = GPIO_PB2, |
| 438 | .flags = IORESOURCE_IO, |
| 439 | }, |
| 440 | #endif |
| 441 | }; |
| 442 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 443 | static unsigned short bfin_uart3_peripherals[] = { |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 444 | P_UART3_TX, P_UART3_RX, |
| 445 | #ifdef CONFIG_BFIN_UART3_CTSRTS |
| 446 | P_UART3_RTS, P_UART3_CTS, |
| 447 | #endif |
| 448 | 0 |
| 449 | }; |
| 450 | |
| 451 | static struct platform_device bfin_uart3_device = { |
| 452 | .name = "bfin-uart", |
| 453 | .id = 3, |
| 454 | .num_resources = ARRAY_SIZE(bfin_uart3_resources), |
| 455 | .resource = bfin_uart3_resources, |
| 456 | .dev = { |
| 457 | .platform_data = &bfin_uart3_peripherals, /* Passed to driver */ |
| 458 | }, |
| 459 | }; |
| 460 | #endif |
| 461 | #endif |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 462 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 463 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 464 | #ifdef CONFIG_BFIN_SIR0 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 465 | static struct resource bfin_sir0_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 466 | { |
| 467 | .start = 0xFFC00400, |
| 468 | .end = 0xFFC004FF, |
| 469 | .flags = IORESOURCE_MEM, |
| 470 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 471 | { |
| 472 | .start = IRQ_UART0_RX, |
| 473 | .end = IRQ_UART0_RX+1, |
| 474 | .flags = IORESOURCE_IRQ, |
| 475 | }, |
| 476 | { |
| 477 | .start = CH_UART0_RX, |
| 478 | .end = CH_UART0_RX+1, |
| 479 | .flags = IORESOURCE_DMA, |
| 480 | }, |
| 481 | }; |
| 482 | static struct platform_device bfin_sir0_device = { |
| 483 | .name = "bfin_sir", |
| 484 | .id = 0, |
| 485 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 486 | .resource = bfin_sir0_resources, |
| 487 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 488 | #endif |
| 489 | #ifdef CONFIG_BFIN_SIR1 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 490 | static struct resource bfin_sir1_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 491 | { |
| 492 | .start = 0xFFC02000, |
| 493 | .end = 0xFFC020FF, |
| 494 | .flags = IORESOURCE_MEM, |
| 495 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 496 | { |
| 497 | .start = IRQ_UART1_RX, |
| 498 | .end = IRQ_UART1_RX+1, |
| 499 | .flags = IORESOURCE_IRQ, |
| 500 | }, |
| 501 | { |
| 502 | .start = CH_UART1_RX, |
| 503 | .end = CH_UART1_RX+1, |
| 504 | .flags = IORESOURCE_DMA, |
| 505 | }, |
| 506 | }; |
| 507 | static struct platform_device bfin_sir1_device = { |
| 508 | .name = "bfin_sir", |
| 509 | .id = 1, |
| 510 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), |
| 511 | .resource = bfin_sir1_resources, |
| 512 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 513 | #endif |
| 514 | #ifdef CONFIG_BFIN_SIR2 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 515 | static struct resource bfin_sir2_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 516 | { |
| 517 | .start = 0xFFC02100, |
| 518 | .end = 0xFFC021FF, |
| 519 | .flags = IORESOURCE_MEM, |
| 520 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 521 | { |
| 522 | .start = IRQ_UART2_RX, |
| 523 | .end = IRQ_UART2_RX+1, |
| 524 | .flags = IORESOURCE_IRQ, |
| 525 | }, |
| 526 | { |
| 527 | .start = CH_UART2_RX, |
| 528 | .end = CH_UART2_RX+1, |
| 529 | .flags = IORESOURCE_DMA, |
| 530 | }, |
| 531 | }; |
| 532 | static struct platform_device bfin_sir2_device = { |
| 533 | .name = "bfin_sir", |
| 534 | .id = 2, |
| 535 | .num_resources = ARRAY_SIZE(bfin_sir2_resources), |
| 536 | .resource = bfin_sir2_resources, |
| 537 | }; |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 538 | #endif |
| 539 | #ifdef CONFIG_BFIN_SIR3 |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 540 | static struct resource bfin_sir3_resources[] = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 541 | { |
| 542 | .start = 0xFFC03100, |
| 543 | .end = 0xFFC031FF, |
| 544 | .flags = IORESOURCE_MEM, |
| 545 | }, |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 546 | { |
| 547 | .start = IRQ_UART3_RX, |
| 548 | .end = IRQ_UART3_RX+1, |
| 549 | .flags = IORESOURCE_IRQ, |
| 550 | }, |
| 551 | { |
| 552 | .start = CH_UART3_RX, |
| 553 | .end = CH_UART3_RX+1, |
| 554 | .flags = IORESOURCE_DMA, |
| 555 | }, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 556 | }; |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 557 | static struct platform_device bfin_sir3_device = { |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 558 | .name = "bfin_sir", |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 559 | .id = 3, |
| 560 | .num_resources = ARRAY_SIZE(bfin_sir3_resources), |
| 561 | .resource = bfin_sir3_resources, |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 562 | }; |
| 563 | #endif |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 564 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 565 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 566 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
Mike Frysinger | 7a8b71d | 2009-06-05 20:41:17 -0400 | [diff] [blame] | 567 | #include <linux/smsc911x.h> |
| 568 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 569 | static struct resource smsc911x_resources[] = { |
| 570 | { |
| 571 | .name = "smsc911x-memory", |
| 572 | .start = 0x24000000, |
| 573 | .end = 0x24000000 + 0xFF, |
| 574 | .flags = IORESOURCE_MEM, |
| 575 | }, |
| 576 | { |
| 577 | .start = IRQ_PE8, |
| 578 | .end = IRQ_PE8, |
| 579 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
| 580 | }, |
| 581 | }; |
Mike Frysinger | 7a8b71d | 2009-06-05 20:41:17 -0400 | [diff] [blame] | 582 | |
| 583 | static struct smsc911x_platform_config smsc911x_config = { |
| 584 | .flags = SMSC911X_USE_32BIT, |
| 585 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 586 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, |
| 587 | .phy_interface = PHY_INTERFACE_MODE_MII, |
| 588 | }; |
| 589 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 590 | static struct platform_device smsc911x_device = { |
| 591 | .name = "smsc911x", |
| 592 | .id = 0, |
| 593 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
| 594 | .resource = smsc911x_resources, |
Mike Frysinger | 7a8b71d | 2009-06-05 20:41:17 -0400 | [diff] [blame] | 595 | .dev = { |
| 596 | .platform_data = &smsc911x_config, |
| 597 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 598 | }; |
| 599 | #endif |
| 600 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 601 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 602 | static struct resource musb_resources[] = { |
| 603 | [0] = { |
| 604 | .start = 0xFFC03C00, |
| 605 | .end = 0xFFC040FF, |
| 606 | .flags = IORESOURCE_MEM, |
| 607 | }, |
| 608 | [1] = { /* general IRQ */ |
| 609 | .start = IRQ_USB_INT0, |
| 610 | .end = IRQ_USB_INT0, |
| 611 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
Hema Kalliguddi | fcf173e | 2010-09-29 11:26:39 -0500 | [diff] [blame] | 612 | .name = "mc" |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 613 | }, |
| 614 | [2] = { /* DMA IRQ */ |
| 615 | .start = IRQ_USB_DMA, |
| 616 | .end = IRQ_USB_DMA, |
| 617 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
Hema Kalliguddi | fcf173e | 2010-09-29 11:26:39 -0500 | [diff] [blame] | 618 | .name = "dma" |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 619 | }, |
| 620 | }; |
| 621 | |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 622 | static struct musb_hdrc_config musb_config = { |
| 623 | .multipoint = 0, |
| 624 | .dyn_fifo = 0, |
| 625 | .soft_con = 1, |
| 626 | .dma = 1, |
Bryan Wu | fea05da | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 627 | .num_eps = 8, |
| 628 | .dma_channels = 8, |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 629 | .gpio_vrsel = GPIO_PE7, |
Cliff Cai | 85eb0e4 | 2010-01-22 04:02:46 +0000 | [diff] [blame] | 630 | /* Some custom boards need to be active low, just set it to "0" |
| 631 | * if it is the case. |
| 632 | */ |
| 633 | .gpio_vrsel_active = 1, |
Bob Liu | 759a3f3 | 2010-09-17 11:09:57 +0000 | [diff] [blame] | 634 | .clkin = 24, /* musb CLKIN in MHZ */ |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 635 | }; |
| 636 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 637 | static struct musb_hdrc_platform_data musb_plat = { |
Bob Liu | b091694 | 2012-06-18 14:36:07 +0800 | [diff] [blame] | 638 | #if defined(CONFIG_USB_MUSB_HDRC) && defined(CONFIG_USB_GADGET_MUSB_HDRC) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 639 | .mode = MUSB_OTG, |
Bob Liu | b091694 | 2012-06-18 14:36:07 +0800 | [diff] [blame] | 640 | #elif defined(CONFIG_USB_MUSB_HDRC) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 641 | .mode = MUSB_HOST, |
Bryan Wu | 2935077 | 2007-12-24 12:20:19 +0800 | [diff] [blame] | 642 | #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 643 | .mode = MUSB_PERIPHERAL, |
| 644 | #endif |
Bryan Wu | 50041ac | 2008-10-08 13:39:40 +0800 | [diff] [blame] | 645 | .config = &musb_config, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 646 | }; |
| 647 | |
| 648 | static u64 musb_dmamask = ~(u32)0; |
| 649 | |
| 650 | static struct platform_device musb_device = { |
Felipe Balbi | 9cb0308 | 2010-12-02 09:21:05 +0200 | [diff] [blame] | 651 | .name = "musb-blackfin", |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 652 | .id = 0, |
| 653 | .dev = { |
| 654 | .dma_mask = &musb_dmamask, |
| 655 | .coherent_dma_mask = 0xffffffff, |
| 656 | .platform_data = &musb_plat, |
| 657 | }, |
| 658 | .num_resources = ARRAY_SIZE(musb_resources), |
| 659 | .resource = musb_resources, |
| 660 | }; |
| 661 | #endif |
| 662 | |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 663 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 664 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 665 | static struct resource bfin_sport0_uart_resources[] = { |
| 666 | { |
| 667 | .start = SPORT0_TCR1, |
| 668 | .end = SPORT0_MRCS3+4, |
| 669 | .flags = IORESOURCE_MEM, |
| 670 | }, |
| 671 | { |
| 672 | .start = IRQ_SPORT0_RX, |
| 673 | .end = IRQ_SPORT0_RX+1, |
| 674 | .flags = IORESOURCE_IRQ, |
| 675 | }, |
| 676 | { |
| 677 | .start = IRQ_SPORT0_ERROR, |
| 678 | .end = IRQ_SPORT0_ERROR, |
| 679 | .flags = IORESOURCE_IRQ, |
| 680 | }, |
| 681 | }; |
| 682 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 683 | static unsigned short bfin_sport0_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 684 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, |
Sonic Zhang | e54b673 | 2010-11-12 02:45:38 +0000 | [diff] [blame] | 685 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0 |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 686 | }; |
| 687 | |
| 688 | static struct platform_device bfin_sport0_uart_device = { |
| 689 | .name = "bfin-sport-uart", |
| 690 | .id = 0, |
| 691 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), |
| 692 | .resource = bfin_sport0_uart_resources, |
| 693 | .dev = { |
| 694 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ |
| 695 | }, |
| 696 | }; |
| 697 | #endif |
| 698 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 699 | static struct resource bfin_sport1_uart_resources[] = { |
| 700 | { |
| 701 | .start = SPORT1_TCR1, |
| 702 | .end = SPORT1_MRCS3+4, |
| 703 | .flags = IORESOURCE_MEM, |
| 704 | }, |
| 705 | { |
| 706 | .start = IRQ_SPORT1_RX, |
| 707 | .end = IRQ_SPORT1_RX+1, |
| 708 | .flags = IORESOURCE_IRQ, |
| 709 | }, |
| 710 | { |
| 711 | .start = IRQ_SPORT1_ERROR, |
| 712 | .end = IRQ_SPORT1_ERROR, |
| 713 | .flags = IORESOURCE_IRQ, |
| 714 | }, |
| 715 | }; |
| 716 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 717 | static unsigned short bfin_sport1_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 718 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, |
Sonic Zhang | e54b673 | 2010-11-12 02:45:38 +0000 | [diff] [blame] | 719 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0 |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 720 | }; |
| 721 | |
| 722 | static struct platform_device bfin_sport1_uart_device = { |
| 723 | .name = "bfin-sport-uart", |
| 724 | .id = 1, |
| 725 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), |
| 726 | .resource = bfin_sport1_uart_resources, |
| 727 | .dev = { |
| 728 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ |
| 729 | }, |
| 730 | }; |
| 731 | #endif |
| 732 | #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART |
| 733 | static struct resource bfin_sport2_uart_resources[] = { |
| 734 | { |
| 735 | .start = SPORT2_TCR1, |
| 736 | .end = SPORT2_MRCS3+4, |
| 737 | .flags = IORESOURCE_MEM, |
| 738 | }, |
| 739 | { |
| 740 | .start = IRQ_SPORT2_RX, |
| 741 | .end = IRQ_SPORT2_RX+1, |
| 742 | .flags = IORESOURCE_IRQ, |
| 743 | }, |
| 744 | { |
| 745 | .start = IRQ_SPORT2_ERROR, |
| 746 | .end = IRQ_SPORT2_ERROR, |
| 747 | .flags = IORESOURCE_IRQ, |
| 748 | }, |
| 749 | }; |
| 750 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 751 | static unsigned short bfin_sport2_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 752 | P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS, |
| 753 | P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0 |
| 754 | }; |
| 755 | |
| 756 | static struct platform_device bfin_sport2_uart_device = { |
| 757 | .name = "bfin-sport-uart", |
| 758 | .id = 2, |
| 759 | .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources), |
| 760 | .resource = bfin_sport2_uart_resources, |
| 761 | .dev = { |
| 762 | .platform_data = &bfin_sport2_peripherals, /* Passed to driver */ |
| 763 | }, |
| 764 | }; |
| 765 | #endif |
| 766 | #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART |
| 767 | static struct resource bfin_sport3_uart_resources[] = { |
| 768 | { |
| 769 | .start = SPORT3_TCR1, |
| 770 | .end = SPORT3_MRCS3+4, |
| 771 | .flags = IORESOURCE_MEM, |
| 772 | }, |
| 773 | { |
| 774 | .start = IRQ_SPORT3_RX, |
| 775 | .end = IRQ_SPORT3_RX+1, |
| 776 | .flags = IORESOURCE_IRQ, |
| 777 | }, |
| 778 | { |
| 779 | .start = IRQ_SPORT3_ERROR, |
| 780 | .end = IRQ_SPORT3_ERROR, |
| 781 | .flags = IORESOURCE_IRQ, |
| 782 | }, |
| 783 | }; |
| 784 | |
Mike Frysinger | a8b1988 | 2010-11-24 09:23:04 +0000 | [diff] [blame] | 785 | static unsigned short bfin_sport3_peripherals[] = { |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 786 | P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS, |
| 787 | P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0 |
| 788 | }; |
| 789 | |
| 790 | static struct platform_device bfin_sport3_uart_device = { |
| 791 | .name = "bfin-sport-uart", |
| 792 | .id = 3, |
| 793 | .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources), |
| 794 | .resource = bfin_sport3_uart_resources, |
| 795 | .dev = { |
| 796 | .platform_data = &bfin_sport3_peripherals, /* Passed to driver */ |
| 797 | }, |
| 798 | }; |
| 799 | #endif |
| 800 | #endif |
| 801 | |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 802 | #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) |
Aaron Wu | 4c131c8 | 2010-12-22 06:21:03 +0000 | [diff] [blame] | 803 | |
| 804 | static unsigned short bfin_can0_peripherals[] = { |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 805 | P_CAN0_RX, P_CAN0_TX, 0 |
| 806 | }; |
| 807 | |
Aaron Wu | 4c131c8 | 2010-12-22 06:21:03 +0000 | [diff] [blame] | 808 | static struct resource bfin_can0_resources[] = { |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 809 | { |
| 810 | .start = 0xFFC02A00, |
| 811 | .end = 0xFFC02FFF, |
| 812 | .flags = IORESOURCE_MEM, |
| 813 | }, |
| 814 | { |
| 815 | .start = IRQ_CAN0_RX, |
| 816 | .end = IRQ_CAN0_RX, |
| 817 | .flags = IORESOURCE_IRQ, |
| 818 | }, |
| 819 | { |
| 820 | .start = IRQ_CAN0_TX, |
| 821 | .end = IRQ_CAN0_TX, |
| 822 | .flags = IORESOURCE_IRQ, |
| 823 | }, |
| 824 | { |
| 825 | .start = IRQ_CAN0_ERROR, |
| 826 | .end = IRQ_CAN0_ERROR, |
| 827 | .flags = IORESOURCE_IRQ, |
| 828 | }, |
| 829 | }; |
| 830 | |
Aaron Wu | 4c131c8 | 2010-12-22 06:21:03 +0000 | [diff] [blame] | 831 | static struct platform_device bfin_can0_device = { |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 832 | .name = "bfin_can", |
Aaron Wu | 4c131c8 | 2010-12-22 06:21:03 +0000 | [diff] [blame] | 833 | .id = 0, |
| 834 | .num_resources = ARRAY_SIZE(bfin_can0_resources), |
| 835 | .resource = bfin_can0_resources, |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 836 | .dev = { |
Aaron Wu | 4c131c8 | 2010-12-22 06:21:03 +0000 | [diff] [blame] | 837 | .platform_data = &bfin_can0_peripherals, /* Passed to driver */ |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 838 | }, |
| 839 | }; |
Aaron Wu | 4c131c8 | 2010-12-22 06:21:03 +0000 | [diff] [blame] | 840 | |
| 841 | static unsigned short bfin_can1_peripherals[] = { |
| 842 | P_CAN1_RX, P_CAN1_TX, 0 |
| 843 | }; |
| 844 | |
| 845 | static struct resource bfin_can1_resources[] = { |
| 846 | { |
| 847 | .start = 0xFFC03200, |
| 848 | .end = 0xFFC037FF, |
| 849 | .flags = IORESOURCE_MEM, |
| 850 | }, |
| 851 | { |
| 852 | .start = IRQ_CAN1_RX, |
| 853 | .end = IRQ_CAN1_RX, |
| 854 | .flags = IORESOURCE_IRQ, |
| 855 | }, |
| 856 | { |
| 857 | .start = IRQ_CAN1_TX, |
| 858 | .end = IRQ_CAN1_TX, |
| 859 | .flags = IORESOURCE_IRQ, |
| 860 | }, |
| 861 | { |
| 862 | .start = IRQ_CAN1_ERROR, |
| 863 | .end = IRQ_CAN1_ERROR, |
| 864 | .flags = IORESOURCE_IRQ, |
| 865 | }, |
| 866 | }; |
| 867 | |
| 868 | static struct platform_device bfin_can1_device = { |
| 869 | .name = "bfin_can", |
| 870 | .id = 1, |
| 871 | .num_resources = ARRAY_SIZE(bfin_can1_resources), |
| 872 | .resource = bfin_can1_resources, |
| 873 | .dev = { |
| 874 | .platform_data = &bfin_can1_peripherals, /* Passed to driver */ |
| 875 | }, |
| 876 | }; |
| 877 | |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 878 | #endif |
| 879 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 880 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) |
| 881 | static struct resource bfin_atapi_resources[] = { |
| 882 | { |
| 883 | .start = 0xFFC03800, |
| 884 | .end = 0xFFC0386F, |
| 885 | .flags = IORESOURCE_MEM, |
| 886 | }, |
| 887 | { |
| 888 | .start = IRQ_ATAPI_ERR, |
| 889 | .end = IRQ_ATAPI_ERR, |
| 890 | .flags = IORESOURCE_IRQ, |
| 891 | }, |
| 892 | }; |
| 893 | |
| 894 | static struct platform_device bfin_atapi_device = { |
| 895 | .name = "pata-bf54x", |
| 896 | .id = -1, |
| 897 | .num_resources = ARRAY_SIZE(bfin_atapi_resources), |
| 898 | .resource = bfin_atapi_resources, |
| 899 | }; |
| 900 | #endif |
| 901 | |
| 902 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 903 | static struct mtd_partition partition_info[] = { |
| 904 | { |
Mike Frysinger | 73775b8 | 2010-08-27 20:43:39 +0000 | [diff] [blame] | 905 | .name = "bootloader(nand)", |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 906 | .offset = 0, |
Mike Frysinger | 73775b8 | 2010-08-27 20:43:39 +0000 | [diff] [blame] | 907 | .size = 0x80000, |
| 908 | }, { |
| 909 | .name = "linux kernel(nand)", |
| 910 | .offset = MTDPART_OFS_APPEND, |
Mike Frysinger | f4585a0 | 2008-10-13 14:45:21 +0800 | [diff] [blame] | 911 | .size = 4 * 1024 * 1024, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 912 | }, |
| 913 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 914 | .name = "file system(nand)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 915 | .offset = MTDPART_OFS_APPEND, |
| 916 | .size = MTDPART_SIZ_FULL, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 917 | }, |
| 918 | }; |
| 919 | |
| 920 | static struct bf5xx_nand_platform bf5xx_nand_platform = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 921 | .data_width = NFC_NWIDTH_8, |
| 922 | .partitions = partition_info, |
| 923 | .nr_partitions = ARRAY_SIZE(partition_info), |
| 924 | .rd_dly = 3, |
| 925 | .wr_dly = 3, |
| 926 | }; |
| 927 | |
| 928 | static struct resource bf5xx_nand_resources[] = { |
| 929 | { |
| 930 | .start = 0xFFC03B00, |
| 931 | .end = 0xFFC03B4F, |
| 932 | .flags = IORESOURCE_MEM, |
| 933 | }, |
| 934 | { |
| 935 | .start = CH_NFC, |
| 936 | .end = CH_NFC, |
| 937 | .flags = IORESOURCE_IRQ, |
| 938 | }, |
| 939 | }; |
| 940 | |
| 941 | static struct platform_device bf5xx_nand_device = { |
| 942 | .name = "bf5xx-nand", |
| 943 | .id = 0, |
| 944 | .num_resources = ARRAY_SIZE(bf5xx_nand_resources), |
| 945 | .resource = bf5xx_nand_resources, |
| 946 | .dev = { |
| 947 | .platform_data = &bf5xx_nand_platform, |
| 948 | }, |
| 949 | }; |
| 950 | #endif |
| 951 | |
Michael Hennerich | 3d7e6cf | 2008-03-03 17:40:28 -0700 | [diff] [blame] | 952 | #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) |
Cliff Cai | 501674a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 953 | |
| 954 | static struct bfin_sd_host bfin_sdh_data = { |
| 955 | .dma_chan = CH_SDH, |
| 956 | .irq_int0 = IRQ_SDH_MASK0, |
| 957 | .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0}, |
| 958 | }; |
| 959 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 960 | static struct platform_device bf54x_sdh_device = { |
| 961 | .name = "bfin-sdh", |
| 962 | .id = 0, |
Cliff Cai | 501674a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 963 | .dev = { |
| 964 | .platform_data = &bfin_sdh_data, |
| 965 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 966 | }; |
| 967 | #endif |
| 968 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 969 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 970 | static struct mtd_partition ezkit_partitions[] = { |
| 971 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 972 | .name = "bootloader(nor)", |
Mike Frysinger | 73775b8 | 2010-08-27 20:43:39 +0000 | [diff] [blame] | 973 | .size = 0x80000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 974 | .offset = 0, |
| 975 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 976 | .name = "linux kernel(nor)", |
Mike Frysinger | 664d040 | 2008-10-09 17:28:36 +0800 | [diff] [blame] | 977 | .size = 0x400000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 978 | .offset = MTDPART_OFS_APPEND, |
| 979 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 980 | .name = "file system(nor)", |
Mike Frysinger | 5607204 | 2011-05-09 18:46:17 -0400 | [diff] [blame] | 981 | .size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4, |
| 982 | .offset = MTDPART_OFS_APPEND, |
| 983 | }, { |
| 984 | .name = "config(nor)", |
| 985 | .size = 0x8000 * 3, |
| 986 | .offset = MTDPART_OFS_APPEND, |
| 987 | }, { |
| 988 | .name = "u-boot env(nor)", |
| 989 | .size = 0x8000, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 990 | .offset = MTDPART_OFS_APPEND, |
| 991 | } |
| 992 | }; |
| 993 | |
| 994 | static struct physmap_flash_data ezkit_flash_data = { |
| 995 | .width = 2, |
| 996 | .parts = ezkit_partitions, |
| 997 | .nr_parts = ARRAY_SIZE(ezkit_partitions), |
| 998 | }; |
| 999 | |
| 1000 | static struct resource ezkit_flash_resource = { |
| 1001 | .start = 0x20000000, |
Mike Frysinger | 664d040 | 2008-10-09 17:28:36 +0800 | [diff] [blame] | 1002 | .end = 0x21ffffff, |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 1003 | .flags = IORESOURCE_MEM, |
| 1004 | }; |
| 1005 | |
| 1006 | static struct platform_device ezkit_flash_device = { |
| 1007 | .name = "physmap-flash", |
| 1008 | .id = 0, |
| 1009 | .dev = { |
| 1010 | .platform_data = &ezkit_flash_data, |
| 1011 | }, |
| 1012 | .num_resources = 1, |
| 1013 | .resource = &ezkit_flash_resource, |
| 1014 | }; |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1015 | #endif |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 1016 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1017 | #if defined(CONFIG_MTD_M25P80) \ |
| 1018 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 1019 | /* SPI flash chip (m25p16) */ |
| 1020 | static struct mtd_partition bfin_spi_flash_partitions[] = { |
| 1021 | { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 1022 | .name = "bootloader(spi)", |
Mike Frysinger | 73775b8 | 2010-08-27 20:43:39 +0000 | [diff] [blame] | 1023 | .size = 0x00080000, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1024 | .offset = 0, |
| 1025 | .mask_flags = MTD_CAP_ROM |
| 1026 | }, { |
Robin Getz | aa58297 | 2008-08-05 17:47:29 +0800 | [diff] [blame] | 1027 | .name = "linux kernel(spi)", |
Mike Frysinger | edf0564 | 2008-02-25 11:38:11 +0800 | [diff] [blame] | 1028 | .size = MTDPART_SIZ_FULL, |
| 1029 | .offset = MTDPART_OFS_APPEND, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1030 | } |
| 1031 | }; |
| 1032 | |
| 1033 | static struct flash_platform_data bfin_spi_flash_data = { |
| 1034 | .name = "m25p80", |
| 1035 | .parts = bfin_spi_flash_partitions, |
| 1036 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), |
| 1037 | .type = "m25p16", |
| 1038 | }; |
| 1039 | |
| 1040 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 1041 | .enable_dma = 0, /* use dma transfer with this chip*/ |
Bernd Schmidt | 37fa242 | 2008-04-24 05:19:02 +0800 | [diff] [blame] | 1042 | }; |
| 1043 | #endif |
| 1044 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1045 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1046 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { |
| 1047 | .model = 7877, |
| 1048 | .vref_delay_usecs = 50, /* internal, no capacitor */ |
| 1049 | .x_plate_ohms = 419, |
| 1050 | .y_plate_ohms = 486, |
| 1051 | .pressure_max = 1000, |
| 1052 | .pressure_min = 0, |
| 1053 | .stopacq_polarity = 1, |
| 1054 | .first_conversion_delay = 3, |
| 1055 | .acquisition_time = 1, |
| 1056 | .averaging = 1, |
| 1057 | .pen_down_acc_interval = 1, |
| 1058 | }; |
| 1059 | #endif |
| 1060 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1061 | static struct spi_board_info bfin_spi_board_info[] __initdata = { |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1062 | #if defined(CONFIG_MTD_M25P80) \ |
| 1063 | || defined(CONFIG_MTD_M25P80_MODULE) |
| 1064 | { |
| 1065 | /* the modalias must be the same as spi device driver name */ |
| 1066 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
| 1067 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
| 1068 | .bus_num = 0, /* Framework bus number */ |
| 1069 | .chip_select = 1, /* SPI_SSEL1*/ |
| 1070 | .platform_data = &bfin_spi_flash_data, |
| 1071 | .controller_data = &spi_flash_chip_info, |
| 1072 | .mode = SPI_MODE_3, |
| 1073 | }, |
| 1074 | #endif |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 1075 | #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ |
| 1076 | || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) |
Bernd Schmidt | 37fa242 | 2008-04-24 05:19:02 +0800 | [diff] [blame] | 1077 | { |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 1078 | .modalias = "ad183x", |
Bernd Schmidt | 37fa242 | 2008-04-24 05:19:02 +0800 | [diff] [blame] | 1079 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 1080 | .bus_num = 1, |
Barry Song | 7ba8006 | 2010-01-28 09:37:21 +0000 | [diff] [blame] | 1081 | .chip_select = 4, |
Bernd Schmidt | 37fa242 | 2008-04-24 05:19:02 +0800 | [diff] [blame] | 1082 | }, |
| 1083 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1084 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 1085 | { |
| 1086 | .modalias = "ad7877", |
| 1087 | .platform_data = &bfin_ad7877_ts_info, |
| 1088 | .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ |
| 1089 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ |
| 1090 | .bus_num = 0, |
| 1091 | .chip_select = 2, |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 1092 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1093 | #endif |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 1094 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 1095 | { |
| 1096 | .modalias = "spidev", |
| 1097 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
| 1098 | .bus_num = 0, |
| 1099 | .chip_select = 1, |
Michael Hennerich | 6e66893 | 2008-02-09 01:54:09 +0800 | [diff] [blame] | 1100 | }, |
| 1101 | #endif |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 1102 | #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) |
| 1103 | { |
| 1104 | .modalias = "adxl34x", |
| 1105 | .platform_data = &adxl34x_info, |
| 1106 | .irq = IRQ_PC5, |
| 1107 | .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ |
| 1108 | .bus_num = 1, |
| 1109 | .chip_select = 2, |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 1110 | .mode = SPI_MODE_3, |
| 1111 | }, |
| 1112 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1113 | }; |
Sonic Zhang | 7d157fb | 2011-11-07 18:40:10 +0800 | [diff] [blame] | 1114 | #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1115 | /* SPI (0) */ |
| 1116 | static struct resource bfin_spi0_resource[] = { |
| 1117 | [0] = { |
| 1118 | .start = SPI0_REGBASE, |
| 1119 | .end = SPI0_REGBASE + 0xFF, |
| 1120 | .flags = IORESOURCE_MEM, |
| 1121 | }, |
| 1122 | [1] = { |
| 1123 | .start = CH_SPI0, |
| 1124 | .end = CH_SPI0, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 1125 | .flags = IORESOURCE_DMA, |
| 1126 | }, |
| 1127 | [2] = { |
| 1128 | .start = IRQ_SPI0, |
| 1129 | .end = IRQ_SPI0, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1130 | .flags = IORESOURCE_IRQ, |
| 1131 | } |
| 1132 | }; |
| 1133 | |
| 1134 | /* SPI (1) */ |
| 1135 | static struct resource bfin_spi1_resource[] = { |
| 1136 | [0] = { |
| 1137 | .start = SPI1_REGBASE, |
| 1138 | .end = SPI1_REGBASE + 0xFF, |
| 1139 | .flags = IORESOURCE_MEM, |
| 1140 | }, |
| 1141 | [1] = { |
| 1142 | .start = CH_SPI1, |
| 1143 | .end = CH_SPI1, |
Yi Li | 5312269 | 2009-06-05 12:11:11 +0000 | [diff] [blame] | 1144 | .flags = IORESOURCE_DMA, |
| 1145 | }, |
| 1146 | [2] = { |
| 1147 | .start = IRQ_SPI1, |
| 1148 | .end = IRQ_SPI1, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1149 | .flags = IORESOURCE_IRQ, |
| 1150 | } |
| 1151 | }; |
| 1152 | |
| 1153 | /* SPI controller data */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 1154 | static struct bfin5xx_spi_master bf54x_spi_master_info0 = { |
Mike Frysinger | c5af545 | 2010-06-16 19:29:51 +0000 | [diff] [blame] | 1155 | .num_chipselect = 4, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1156 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 1157 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1158 | }; |
| 1159 | |
| 1160 | static struct platform_device bf54x_spi_master0 = { |
| 1161 | .name = "bfin-spi", |
| 1162 | .id = 0, /* Bus number */ |
| 1163 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
| 1164 | .resource = bfin_spi0_resource, |
| 1165 | .dev = { |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 1166 | .platform_data = &bf54x_spi_master_info0, /* Passed to driver */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1167 | }, |
| 1168 | }; |
| 1169 | |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 1170 | static struct bfin5xx_spi_master bf54x_spi_master_info1 = { |
Mike Frysinger | c5af545 | 2010-06-16 19:29:51 +0000 | [diff] [blame] | 1171 | .num_chipselect = 4, |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 1172 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
| 1173 | .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, |
| 1174 | }; |
| 1175 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1176 | static struct platform_device bf54x_spi_master1 = { |
| 1177 | .name = "bfin-spi", |
| 1178 | .id = 1, /* Bus number */ |
| 1179 | .num_resources = ARRAY_SIZE(bfin_spi1_resource), |
| 1180 | .resource = bfin_spi1_resource, |
| 1181 | .dev = { |
Bryan Wu | 5d448dd | 2007-11-12 23:24:42 +0800 | [diff] [blame] | 1182 | .platform_data = &bf54x_spi_master_info1, /* Passed to driver */ |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1183 | }, |
| 1184 | }; |
| 1185 | #endif /* spi master and devices */ |
| 1186 | |
Scott Jiang | df864c3 | 2011-12-31 14:08:38 -0500 | [diff] [blame] | 1187 | #if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ |
| 1188 | || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE) |
| 1189 | #include <linux/videodev2.h> |
| 1190 | #include <media/blackfin/bfin_capture.h> |
| 1191 | #include <media/blackfin/ppi.h> |
| 1192 | |
| 1193 | static const unsigned short ppi_req[] = { |
| 1194 | P_PPI1_D0, P_PPI1_D1, P_PPI1_D2, P_PPI1_D3, |
| 1195 | P_PPI1_D4, P_PPI1_D5, P_PPI1_D6, P_PPI1_D7, |
| 1196 | P_PPI1_CLK, P_PPI1_FS1, P_PPI1_FS2, |
| 1197 | 0, |
| 1198 | }; |
| 1199 | |
| 1200 | static const struct ppi_info ppi_info = { |
| 1201 | .type = PPI_TYPE_EPPI, |
| 1202 | .dma_ch = CH_EPPI1, |
| 1203 | .irq_err = IRQ_EPPI1_ERROR, |
| 1204 | .base = (void __iomem *)EPPI1_STATUS, |
| 1205 | .pin_req = ppi_req, |
| 1206 | }; |
| 1207 | |
| 1208 | #if defined(CONFIG_VIDEO_VS6624) \ |
| 1209 | || defined(CONFIG_VIDEO_VS6624_MODULE) |
| 1210 | static struct v4l2_input vs6624_inputs[] = { |
| 1211 | { |
| 1212 | .index = 0, |
| 1213 | .name = "Camera", |
| 1214 | .type = V4L2_INPUT_TYPE_CAMERA, |
| 1215 | .std = V4L2_STD_UNKNOWN, |
| 1216 | }, |
| 1217 | }; |
| 1218 | |
| 1219 | static struct bcap_route vs6624_routes[] = { |
| 1220 | { |
| 1221 | .input = 0, |
| 1222 | .output = 0, |
| 1223 | }, |
| 1224 | }; |
| 1225 | |
| 1226 | static const unsigned vs6624_ce_pin = GPIO_PG6; |
| 1227 | |
| 1228 | static struct bfin_capture_config bfin_capture_data = { |
| 1229 | .card_name = "BF548", |
| 1230 | .inputs = vs6624_inputs, |
| 1231 | .num_inputs = ARRAY_SIZE(vs6624_inputs), |
| 1232 | .routes = vs6624_routes, |
| 1233 | .i2c_adapter_id = 0, |
| 1234 | .board_info = { |
| 1235 | .type = "vs6624", |
| 1236 | .addr = 0x10, |
| 1237 | .platform_data = (void *)&vs6624_ce_pin, |
| 1238 | }, |
| 1239 | .ppi_info = &ppi_info, |
| 1240 | .ppi_control = (POLC | PACKEN | DLEN_8 | XFR_TYPE | 0x20), |
Scott Jiang | 4e937ac | 2012-01-09 17:06:56 -0500 | [diff] [blame] | 1241 | .int_mask = 0xFFFFFFFF, /* disable error interrupt on eppi */ |
| 1242 | .blank_clocks = 8, /* 8 clocks as SAV and EAV */ |
Scott Jiang | df864c3 | 2011-12-31 14:08:38 -0500 | [diff] [blame] | 1243 | }; |
| 1244 | #endif |
| 1245 | |
| 1246 | static struct platform_device bfin_capture_device = { |
| 1247 | .name = "bfin_capture", |
| 1248 | .dev = { |
| 1249 | .platform_data = &bfin_capture_data, |
| 1250 | }, |
| 1251 | }; |
| 1252 | #endif |
| 1253 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1254 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
Sonic Zhang | cf93feb | 2012-05-15 15:25:50 +0800 | [diff] [blame] | 1255 | static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; |
| 1256 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1257 | static struct resource bfin_twi0_resource[] = { |
| 1258 | [0] = { |
| 1259 | .start = TWI0_REGBASE, |
| 1260 | .end = TWI0_REGBASE + 0xFF, |
| 1261 | .flags = IORESOURCE_MEM, |
| 1262 | }, |
| 1263 | [1] = { |
| 1264 | .start = IRQ_TWI0, |
| 1265 | .end = IRQ_TWI0, |
| 1266 | .flags = IORESOURCE_IRQ, |
| 1267 | }, |
| 1268 | }; |
| 1269 | |
| 1270 | static struct platform_device i2c_bfin_twi0_device = { |
| 1271 | .name = "i2c-bfin-twi", |
| 1272 | .id = 0, |
| 1273 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), |
| 1274 | .resource = bfin_twi0_resource, |
Sonic Zhang | cf93feb | 2012-05-15 15:25:50 +0800 | [diff] [blame] | 1275 | .dev = { |
| 1276 | .platform_data = &bfin_twi0_pins, |
| 1277 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1278 | }; |
| 1279 | |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 1280 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ |
Sonic Zhang | cf93feb | 2012-05-15 15:25:50 +0800 | [diff] [blame] | 1281 | static const u16 bfin_twi1_pins[] = {P_TWI1_SCL, P_TWI1_SDA, 0}; |
| 1282 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1283 | static struct resource bfin_twi1_resource[] = { |
| 1284 | [0] = { |
| 1285 | .start = TWI1_REGBASE, |
| 1286 | .end = TWI1_REGBASE + 0xFF, |
| 1287 | .flags = IORESOURCE_MEM, |
| 1288 | }, |
| 1289 | [1] = { |
| 1290 | .start = IRQ_TWI1, |
| 1291 | .end = IRQ_TWI1, |
| 1292 | .flags = IORESOURCE_IRQ, |
| 1293 | }, |
| 1294 | }; |
| 1295 | |
| 1296 | static struct platform_device i2c_bfin_twi1_device = { |
| 1297 | .name = "i2c-bfin-twi", |
| 1298 | .id = 1, |
| 1299 | .num_resources = ARRAY_SIZE(bfin_twi1_resource), |
| 1300 | .resource = bfin_twi1_resource, |
Sonic Zhang | cf93feb | 2012-05-15 15:25:50 +0800 | [diff] [blame] | 1301 | .dev = { |
| 1302 | .platform_data = &bfin_twi1_pins, |
| 1303 | }, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1304 | }; |
| 1305 | #endif |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 1306 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1307 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1308 | static struct i2c_board_info __initdata bfin_i2c_board_info0[] = { |
Sonic Zhang | eeec0a1 | 2012-03-16 12:52:34 +0800 | [diff] [blame] | 1309 | #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) |
| 1310 | { |
| 1311 | I2C_BOARD_INFO("ssm2602", 0x1b), |
| 1312 | }, |
| 1313 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1314 | }; |
| 1315 | |
| 1316 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ |
| 1317 | static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { |
Michael Hennerich | ebd5833 | 2009-07-02 11:00:38 +0000 | [diff] [blame] | 1318 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1319 | { |
| 1320 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1321 | }, |
| 1322 | #endif |
Michael Hennerich | 204844e | 2009-06-30 14:57:22 +0000 | [diff] [blame] | 1323 | #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1324 | { |
| 1325 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1326 | .irq = 212, |
| 1327 | }, |
| 1328 | #endif |
Michael Hennerich | ffc4d8b | 2009-05-29 15:41:18 +0000 | [diff] [blame] | 1329 | #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) |
| 1330 | { |
| 1331 | I2C_BOARD_INFO("adxl34x", 0x53), |
| 1332 | .irq = IRQ_PC5, |
| 1333 | .platform_data = (void *)&adxl34x_info, |
| 1334 | }, |
| 1335 | #endif |
steven miao | 39d3c1c | 2010-08-26 08:25:13 +0000 | [diff] [blame] | 1336 | #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) |
| 1337 | { |
| 1338 | I2C_BOARD_INFO("ad5252", 0x2f), |
| 1339 | }, |
| 1340 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1341 | }; |
| 1342 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1343 | |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 1344 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 1345 | #include <linux/gpio_keys.h> |
| 1346 | |
| 1347 | static struct gpio_keys_button bfin_gpio_keys_table[] = { |
| 1348 | {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"}, |
| 1349 | {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"}, |
| 1350 | {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"}, |
| 1351 | {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"}, |
| 1352 | }; |
| 1353 | |
| 1354 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { |
| 1355 | .buttons = bfin_gpio_keys_table, |
| 1356 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), |
| 1357 | }; |
| 1358 | |
| 1359 | static struct platform_device bfin_device_gpiokeys = { |
| 1360 | .name = "gpio-keys", |
| 1361 | .dev = { |
| 1362 | .platform_data = &bfin_gpio_keys_data, |
| 1363 | }, |
| 1364 | }; |
| 1365 | #endif |
| 1366 | |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1367 | static const unsigned int cclk_vlev_datasheet[] = |
| 1368 | { |
| 1369 | /* |
| 1370 | * Internal VLEV BF54XSBBC1533 |
| 1371 | ****temporarily using these values until data sheet is updated |
| 1372 | */ |
| 1373 | VRPAIR(VLEV_085, 150000000), |
| 1374 | VRPAIR(VLEV_090, 250000000), |
| 1375 | VRPAIR(VLEV_110, 276000000), |
| 1376 | VRPAIR(VLEV_115, 301000000), |
| 1377 | VRPAIR(VLEV_120, 525000000), |
| 1378 | VRPAIR(VLEV_125, 550000000), |
| 1379 | VRPAIR(VLEV_130, 600000000), |
| 1380 | }; |
| 1381 | |
| 1382 | static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = { |
| 1383 | .tuple_tab = cclk_vlev_datasheet, |
| 1384 | .tabsize = ARRAY_SIZE(cclk_vlev_datasheet), |
| 1385 | .vr_settling_time = 25 /* us */, |
| 1386 | }; |
| 1387 | |
| 1388 | static struct platform_device bfin_dpmc = { |
| 1389 | .name = "bfin dpmc", |
| 1390 | .dev = { |
| 1391 | .platform_data = &bfin_dmpc_vreg_data, |
| 1392 | }, |
| 1393 | }; |
| 1394 | |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1395 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ |
| 1396 | defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \ |
| 1397 | defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) |
| 1398 | |
| 1399 | #define SPORT_REQ(x) \ |
| 1400 | [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ |
| 1401 | P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0} |
| 1402 | |
| 1403 | static const u16 bfin_snd_pin[][7] = { |
| 1404 | SPORT_REQ(0), |
| 1405 | SPORT_REQ(1), |
Sonic Zhang | eeec0a1 | 2012-03-16 12:52:34 +0800 | [diff] [blame] | 1406 | SPORT_REQ(2), |
| 1407 | SPORT_REQ(3), |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1408 | }; |
| 1409 | |
| 1410 | static struct bfin_snd_platform_data bfin_snd_data[] = { |
| 1411 | { |
| 1412 | .pin_req = &bfin_snd_pin[0][0], |
| 1413 | }, |
| 1414 | { |
| 1415 | .pin_req = &bfin_snd_pin[1][0], |
| 1416 | }, |
Sonic Zhang | eeec0a1 | 2012-03-16 12:52:34 +0800 | [diff] [blame] | 1417 | { |
| 1418 | .pin_req = &bfin_snd_pin[2][0], |
| 1419 | }, |
| 1420 | { |
| 1421 | .pin_req = &bfin_snd_pin[3][0], |
| 1422 | }, |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1423 | }; |
| 1424 | |
| 1425 | #define BFIN_SND_RES(x) \ |
| 1426 | [x] = { \ |
| 1427 | { \ |
| 1428 | .start = SPORT##x##_TCR1, \ |
| 1429 | .end = SPORT##x##_TCR1, \ |
| 1430 | .flags = IORESOURCE_MEM \ |
| 1431 | }, \ |
| 1432 | { \ |
| 1433 | .start = CH_SPORT##x##_RX, \ |
| 1434 | .end = CH_SPORT##x##_RX, \ |
| 1435 | .flags = IORESOURCE_DMA, \ |
| 1436 | }, \ |
| 1437 | { \ |
| 1438 | .start = CH_SPORT##x##_TX, \ |
| 1439 | .end = CH_SPORT##x##_TX, \ |
| 1440 | .flags = IORESOURCE_DMA, \ |
| 1441 | }, \ |
| 1442 | { \ |
| 1443 | .start = IRQ_SPORT##x##_ERROR, \ |
| 1444 | .end = IRQ_SPORT##x##_ERROR, \ |
| 1445 | .flags = IORESOURCE_IRQ, \ |
| 1446 | } \ |
| 1447 | } |
| 1448 | |
| 1449 | static struct resource bfin_snd_resources[][4] = { |
| 1450 | BFIN_SND_RES(0), |
| 1451 | BFIN_SND_RES(1), |
Sonic Zhang | eeec0a1 | 2012-03-16 12:52:34 +0800 | [diff] [blame] | 1452 | BFIN_SND_RES(2), |
| 1453 | BFIN_SND_RES(3), |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1454 | }; |
Sonic Zhang | eeec0a1 | 2012-03-16 12:52:34 +0800 | [diff] [blame] | 1455 | #endif |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1456 | |
Sonic Zhang | eeec0a1 | 2012-03-16 12:52:34 +0800 | [diff] [blame] | 1457 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) |
| 1458 | static struct platform_device bfin_i2s_pcm = { |
| 1459 | .name = "bfin-i2s-pcm-audio", |
| 1460 | .id = -1, |
| 1461 | }; |
| 1462 | #endif |
| 1463 | |
| 1464 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) |
| 1465 | static struct platform_device bfin_tdm_pcm = { |
| 1466 | .name = "bfin-tdm-pcm-audio", |
| 1467 | .id = -1, |
| 1468 | }; |
| 1469 | #endif |
| 1470 | |
| 1471 | #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) |
| 1472 | static struct platform_device bfin_ac97_pcm = { |
| 1473 | .name = "bfin-ac97-pcm-audio", |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1474 | .id = -1, |
| 1475 | }; |
| 1476 | #endif |
| 1477 | |
| 1478 | #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) |
| 1479 | static struct platform_device bfin_ad73311_codec_device = { |
| 1480 | .name = "ad73311", |
| 1481 | .id = -1, |
| 1482 | }; |
| 1483 | #endif |
| 1484 | |
| 1485 | #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) |
| 1486 | static struct platform_device bfin_ad1980_codec_device = { |
| 1487 | .name = "ad1980", |
| 1488 | .id = -1, |
| 1489 | }; |
| 1490 | #endif |
| 1491 | |
| 1492 | #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1493 | static struct platform_device bfin_i2s = { |
| 1494 | .name = "bfin-i2s", |
| 1495 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1496 | .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), |
| 1497 | .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], |
| 1498 | .dev = { |
| 1499 | .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], |
| 1500 | }, |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1501 | }; |
| 1502 | #endif |
| 1503 | |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1504 | #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE) |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1505 | static struct platform_device bfin_tdm = { |
| 1506 | .name = "bfin-tdm", |
| 1507 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1508 | .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), |
| 1509 | .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], |
| 1510 | .dev = { |
| 1511 | .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], |
| 1512 | }, |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1513 | }; |
| 1514 | #endif |
| 1515 | |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1516 | #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1517 | static struct platform_device bfin_ac97 = { |
| 1518 | .name = "bfin-ac97", |
| 1519 | .id = CONFIG_SND_BF5XX_SPORT_NUM, |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1520 | .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]), |
| 1521 | .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM], |
| 1522 | .dev = { |
| 1523 | .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM], |
| 1524 | }, |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1525 | }; |
| 1526 | #endif |
| 1527 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1528 | static struct platform_device *ezkit_devices[] __initdata = { |
Michael Hennerich | 14b0320 | 2008-05-07 11:41:26 +0800 | [diff] [blame] | 1529 | |
| 1530 | &bfin_dpmc, |
| 1531 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1532 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
| 1533 | &rtc_device, |
| 1534 | #endif |
| 1535 | |
| 1536 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
Sonic Zhang | 6bd1fbe | 2009-09-09 10:46:19 +0000 | [diff] [blame] | 1537 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 1538 | &bfin_uart0_device, |
| 1539 | #endif |
| 1540 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 1541 | &bfin_uart1_device, |
| 1542 | #endif |
| 1543 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
| 1544 | &bfin_uart2_device, |
| 1545 | #endif |
| 1546 | #ifdef CONFIG_SERIAL_BFIN_UART3 |
| 1547 | &bfin_uart3_device, |
| 1548 | #endif |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1549 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1550 | |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1551 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
Graf Yang | 42bd8bc | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 1552 | #ifdef CONFIG_BFIN_SIR0 |
| 1553 | &bfin_sir0_device, |
| 1554 | #endif |
| 1555 | #ifdef CONFIG_BFIN_SIR1 |
| 1556 | &bfin_sir1_device, |
| 1557 | #endif |
| 1558 | #ifdef CONFIG_BFIN_SIR2 |
| 1559 | &bfin_sir2_device, |
| 1560 | #endif |
| 1561 | #ifdef CONFIG_BFIN_SIR3 |
| 1562 | &bfin_sir3_device, |
| 1563 | #endif |
Graf Yang | 5be36d2 | 2008-04-25 03:09:15 +0800 | [diff] [blame] | 1564 | #endif |
| 1565 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1566 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) |
| 1567 | &bf54x_lq043_device, |
| 1568 | #endif |
| 1569 | |
| 1570 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
| 1571 | &smsc911x_device, |
| 1572 | #endif |
| 1573 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1574 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
| 1575 | &musb_device, |
| 1576 | #endif |
| 1577 | |
Michael Hennerich | 3f37569 | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 1578 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) |
| 1579 | &bfin_isp1760_device, |
| 1580 | #endif |
| 1581 | |
Sonic Zhang | df5de26 | 2009-09-23 05:01:56 +0000 | [diff] [blame] | 1582 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 1583 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 1584 | &bfin_sport0_uart_device, |
| 1585 | #endif |
| 1586 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 1587 | &bfin_sport1_uart_device, |
| 1588 | #endif |
| 1589 | #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART |
| 1590 | &bfin_sport2_uart_device, |
| 1591 | #endif |
| 1592 | #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART |
| 1593 | &bfin_sport3_uart_device, |
| 1594 | #endif |
| 1595 | #endif |
| 1596 | |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 1597 | #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) |
Aaron Wu | 4c131c8 | 2010-12-22 06:21:03 +0000 | [diff] [blame] | 1598 | &bfin_can0_device, |
| 1599 | &bfin_can1_device, |
Barry Song | 706a01b | 2009-11-02 07:29:07 +0000 | [diff] [blame] | 1600 | #endif |
| 1601 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1602 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) |
| 1603 | &bfin_atapi_device, |
| 1604 | #endif |
| 1605 | |
| 1606 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) |
| 1607 | &bf5xx_nand_device, |
| 1608 | #endif |
| 1609 | |
Michael Hennerich | 3d7e6cf | 2008-03-03 17:40:28 -0700 | [diff] [blame] | 1610 | #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1611 | &bf54x_sdh_device, |
| 1612 | #endif |
| 1613 | |
Sonic Zhang | 7d157fb | 2011-11-07 18:40:10 +0800 | [diff] [blame] | 1614 | #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1615 | &bf54x_spi_master0, |
Bryan Wu | d4b1d27 | 2007-10-21 17:03:55 +0800 | [diff] [blame] | 1616 | &bf54x_spi_master1, |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1617 | #endif |
Scott Jiang | df864c3 | 2011-12-31 14:08:38 -0500 | [diff] [blame] | 1618 | #if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ |
| 1619 | || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE) |
| 1620 | &bfin_capture_device, |
| 1621 | #endif |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1622 | |
| 1623 | #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) |
| 1624 | &bf54x_kpad_device, |
| 1625 | #endif |
| 1626 | |
Michael Hennerich | adfc046 | 2009-10-09 07:37:03 +0000 | [diff] [blame] | 1627 | #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) |
Michael Hennerich | aca5e4a | 2008-10-08 14:27:59 +0800 | [diff] [blame] | 1628 | &bfin_rotary_device, |
| 1629 | #endif |
| 1630 | |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1631 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 1632 | &i2c_bfin_twi0_device, |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 1633 | #if !defined(CONFIG_BF542) |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1634 | &i2c_bfin_twi1_device, |
| 1635 | #endif |
Mike Frysinger | 7160e95 | 2007-11-21 16:03:07 +0800 | [diff] [blame] | 1636 | #endif |
Michael Hennerich | 2463ef2 | 2008-01-27 16:49:48 +0800 | [diff] [blame] | 1637 | |
| 1638 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 1639 | &bfin_device_gpiokeys, |
| 1640 | #endif |
Mike Frysinger | cad2ab6 | 2008-02-22 17:01:31 +0800 | [diff] [blame] | 1641 | |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1642 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
Mike Frysinger | de8c43f | 2008-01-24 17:14:04 +0800 | [diff] [blame] | 1643 | &ezkit_flash_device, |
Mike Frysinger | 793dc27 | 2008-03-26 08:09:12 +0800 | [diff] [blame] | 1644 | #endif |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1645 | |
Sonic Zhang | eeec0a1 | 2012-03-16 12:52:34 +0800 | [diff] [blame] | 1646 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) |
| 1647 | &bfin_i2s_pcm, |
| 1648 | #endif |
| 1649 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) |
| 1650 | &bfin_tdm_pcm, |
| 1651 | #endif |
| 1652 | #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) |
| 1653 | &bfin_ac97_pcm, |
Scott Jiang | 6f53dbb | 2011-03-01 09:43:50 +0000 | [diff] [blame] | 1654 | #endif |
| 1655 | |
| 1656 | #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) |
| 1657 | &bfin_ad1980_codec_device, |
| 1658 | #endif |
| 1659 | |
Barry Song | 439b486 | 2009-11-13 02:41:07 +0000 | [diff] [blame] | 1660 | #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) |
| 1661 | &bfin_i2s, |
| 1662 | #endif |
| 1663 | |
| 1664 | #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) |
| 1665 | &bfin_tdm, |
| 1666 | #endif |
| 1667 | |
| 1668 | #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) |
| 1669 | &bfin_ac97, |
| 1670 | #endif |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1671 | }; |
| 1672 | |
Mike Frysinger | a01d7a7 | 2008-02-02 15:34:56 +0800 | [diff] [blame] | 1673 | static int __init ezkit_init(void) |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1674 | { |
Harvey Harrison | b85d858 | 2008-04-23 09:39:01 +0800 | [diff] [blame] | 1675 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1676 | |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1677 | i2c_register_board_info(0, bfin_i2c_board_info0, |
| 1678 | ARRAY_SIZE(bfin_i2c_board_info0)); |
| 1679 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ |
| 1680 | i2c_register_board_info(1, bfin_i2c_board_info1, |
| 1681 | ARRAY_SIZE(bfin_i2c_board_info1)); |
| 1682 | #endif |
Bryan Wu | 81d9c7f | 2008-03-26 10:02:13 +0800 | [diff] [blame] | 1683 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1684 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
Bryan Wu | c6c4d7b | 2007-10-11 01:20:06 +0800 | [diff] [blame] | 1685 | |
Mike Frysinger | 5bda272 | 2008-06-07 15:03:01 +0800 | [diff] [blame] | 1686 | 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] | 1687 | |
Roy Huang | 24a07a1 | 2007-07-12 22:41:45 +0800 | [diff] [blame] | 1688 | return 0; |
| 1689 | } |
| 1690 | |
Mike Frysinger | a01d7a7 | 2008-02-02 15:34:56 +0800 | [diff] [blame] | 1691 | arch_initcall(ezkit_init); |
Sonic Zhang | c13ce9f | 2009-09-23 09:37:46 +0000 | [diff] [blame] | 1692 | |
| 1693 | static struct platform_device *ezkit_early_devices[] __initdata = { |
| 1694 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) |
| 1695 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| 1696 | &bfin_uart0_device, |
| 1697 | #endif |
| 1698 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 1699 | &bfin_uart1_device, |
| 1700 | #endif |
| 1701 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
| 1702 | &bfin_uart2_device, |
| 1703 | #endif |
| 1704 | #ifdef CONFIG_SERIAL_BFIN_UART3 |
| 1705 | &bfin_uart3_device, |
| 1706 | #endif |
| 1707 | #endif |
| 1708 | |
| 1709 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) |
| 1710 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| 1711 | &bfin_sport0_uart_device, |
| 1712 | #endif |
| 1713 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 1714 | &bfin_sport1_uart_device, |
| 1715 | #endif |
| 1716 | #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART |
| 1717 | &bfin_sport2_uart_device, |
| 1718 | #endif |
| 1719 | #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART |
| 1720 | &bfin_sport3_uart_device, |
| 1721 | #endif |
| 1722 | #endif |
| 1723 | }; |
| 1724 | |
| 1725 | void __init native_machine_early_platform_add_devices(void) |
| 1726 | { |
| 1727 | printk(KERN_INFO "register early platform devices\n"); |
| 1728 | early_platform_add_devices(ezkit_early_devices, |
| 1729 | ARRAY_SIZE(ezkit_early_devices)); |
| 1730 | } |