blob: dae6d0ff0a702051078bc6158a45ada06b665ff0 [file] [log] [blame]
Roy Huang24a07a12007-07-12 22:41:45 +08001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
Roy Huang24a07a12007-07-12 22:41:45 +08005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2 or later.
Roy Huang24a07a12007-07-12 22:41:45 +08007 */
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 Frysingerde8c43f2008-01-24 17:14:04 +080013#include <linux/mtd/physmap.h>
Roy Huang24a07a12007-07-12 22:41:45 +080014#include <linux/spi/spi.h>
15#include <linux/spi/flash.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080016#include <linux/irq.h>
Bryan Wu81d9c7f2008-03-26 10:02:13 +080017#include <linux/i2c.h>
Roy Huang24a07a12007-07-12 22:41:45 +080018#include <linux/interrupt.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080019#include <linux/usb/musb.h>
Roy Huang24a07a12007-07-12 22:41:45 +080020#include <asm/bfin5xx_spi.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080021#include <asm/dma.h>
22#include <asm/gpio.h>
23#include <asm/nand.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080024#include <asm/dpmc.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080025#include <asm/portmux.h>
Cliff Cai501674a2009-01-07 23:14:38 +080026#include <asm/bfin_sdh.h>
Bryan Wu639f6572008-08-27 10:51:02 +080027#include <mach/bf54x_keys.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080028#include <linux/input.h>
29#include <linux/spi/ad7877.h>
Roy Huang24a07a12007-07-12 22:41:45 +080030
31/*
32 * Name the Board for the /proc/cpuinfo
33 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080034const char bfin_board_name[] = "ADI BF548-EZKIT";
Roy Huang24a07a12007-07-12 22:41:45 +080035
36/*
37 * Driver needs to know address, irq and flag pin.
38 */
39
Michael Hennerich0a6304a2008-07-26 16:14:57 +080040#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080041#include <linux/usb/isp1760.h>
42static struct resource bfin_isp1760_resources[] = {
Michael Hennerich0a6304a2008-07-26 16:14:57 +080043 [0] = {
Michael Hennerich0a6304a2008-07-26 16:14:57 +080044 .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 Hennerich3f375692008-11-18 17:48:22 +080055static struct isp1760_platform_data isp1760_priv = {
56 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080057 .bus_width_16 = 1,
58 .port1_otg = 0,
59 .analog_oc = 0,
60 .dack_polarity_high = 0,
61 .dreq_polarity_high = 0,
62};
63
64static struct platform_device bfin_isp1760_device = {
65 .name = "isp1760-hcd",
Michael Hennerich0a6304a2008-07-26 16:14:57 +080066 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080067 .dev = {
68 .platform_data = &isp1760_priv,
69 },
70 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
71 .resource = bfin_isp1760_resources,
Michael Hennerich0a6304a2008-07-26 16:14:57 +080072};
Michael Hennerich0a6304a2008-07-26 16:14:57 +080073#endif
74
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080075#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
76
Bryan Wu639f6572008-08-27 10:51:02 +080077#include <mach/bf54x-lq043.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080078
79static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
Stefan Pledl0e101ec2009-07-29 08:09:45 +000080 .width = 95,
81 .height = 54,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080082 .xres = {480, 480, 480},
83 .yres = {272, 272, 272},
84 .bpp = {24, 24, 24},
85 .disp = GPIO_PE3,
86};
87
88static struct resource bf54x_lq043_resources[] = {
89 {
90 .start = IRQ_EPPI0_ERR,
91 .end = IRQ_EPPI0_ERR,
92 .flags = IORESOURCE_IRQ,
93 },
94};
95
96static 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 Hennerich8f740ef2007-10-13 00:36:46 -0400108static const unsigned int bf548_keymap[] = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800109 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
127static struct bfin_kpad_platform_data bf54x_kpad_data = {
128 .rows = 4,
129 .cols = 4,
Michael Hennerich8f740ef2007-10-13 00:36:46 -0400130 .keymap = bf548_keymap,
131 .keymapsize = ARRAY_SIZE(bf548_keymap),
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800132 .repeat = 0,
133 .debounce_time = 5000, /* ns (5ms) */
134 .coldrive_time = 1000, /* ns (1ms) */
135 .keyup_test_interval = 50, /* ms (50ms) */
136};
137
138static struct resource bf54x_kpad_resources[] = {
139 {
140 .start = IRQ_KEY,
141 .end = IRQ_KEY,
142 .flags = IORESOURCE_IRQ,
143 },
144};
145
146static 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 Hennerichaca5e4a2008-10-08 14:27:59 +0800157#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
158#include <asm/bfin_rotary.h>
159
160static 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
169static struct resource bfin_rotary_resources[] = {
170 {
171 .start = IRQ_CNT,
172 .end = IRQ_CNT,
173 .flags = IORESOURCE_IRQ,
174 },
175};
176
177static 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 Hennerichffc4d8b2009-05-29 15:41:18 +0000188#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
189#include <linux/input.h>
190#include <linux/spi/adxl34x.h>
191static const struct adxl34x_platform_data adxl34x_info = {
192 .x_axis_offset = 0,
193 .y_axis_offset = 0,
194 .z_axis_offset = 0,
195 .tap_threshold = 0x31,
196 .tap_duration = 0x10,
197 .tap_latency = 0x60,
198 .tap_window = 0xF0,
199 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
200 .act_axis_control = 0xFF,
201 .activity_threshold = 5,
202 .inactivity_threshold = 3,
203 .inactivity_time = 4,
204 .free_fall_threshold = 0x7,
205 .free_fall_time = 0x20,
206 .data_rate = 0x8,
207 .data_range = ADXL_FULL_RES,
208
209 .ev_type = EV_ABS,
210 .ev_code_x = ABS_X, /* EV_REL */
211 .ev_code_y = ABS_Y, /* EV_REL */
212 .ev_code_z = ABS_Z, /* EV_REL */
213
214 .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
215 .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
216 .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
217
218/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
219/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
220 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
221 .fifo_mode = ADXL_FIFO_STREAM,
222};
223#endif
224
Roy Huang24a07a12007-07-12 22:41:45 +0800225#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
226static struct platform_device rtc_device = {
227 .name = "rtc-bfin",
228 .id = -1,
229};
230#endif
231
232#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
233static struct resource bfin_uart_resources[] = {
234#ifdef CONFIG_SERIAL_BFIN_UART0
235 {
236 .start = 0xFFC00400,
237 .end = 0xFFC004FF,
238 .flags = IORESOURCE_MEM,
239 },
240#endif
241#ifdef CONFIG_SERIAL_BFIN_UART1
242 {
243 .start = 0xFFC02000,
244 .end = 0xFFC020FF,
245 .flags = IORESOURCE_MEM,
246 },
247#endif
248#ifdef CONFIG_SERIAL_BFIN_UART2
249 {
250 .start = 0xFFC02100,
251 .end = 0xFFC021FF,
252 .flags = IORESOURCE_MEM,
253 },
254#endif
255#ifdef CONFIG_SERIAL_BFIN_UART3
256 {
257 .start = 0xFFC03100,
258 .end = 0xFFC031FF,
Mike Frysingercc2e16b2008-07-19 16:43:51 +0800259 .flags = IORESOURCE_MEM,
Roy Huang24a07a12007-07-12 22:41:45 +0800260 },
261#endif
262};
263
264static struct platform_device bfin_uart_device = {
265 .name = "bfin-uart",
266 .id = 1,
267 .num_resources = ARRAY_SIZE(bfin_uart_resources),
268 .resource = bfin_uart_resources,
269};
270#endif
271
Graf Yang5be36d22008-04-25 03:09:15 +0800272#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800273#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800274static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800275 {
276 .start = 0xFFC00400,
277 .end = 0xFFC004FF,
278 .flags = IORESOURCE_MEM,
279 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800280 {
281 .start = IRQ_UART0_RX,
282 .end = IRQ_UART0_RX+1,
283 .flags = IORESOURCE_IRQ,
284 },
285 {
286 .start = CH_UART0_RX,
287 .end = CH_UART0_RX+1,
288 .flags = IORESOURCE_DMA,
289 },
290};
291static struct platform_device bfin_sir0_device = {
292 .name = "bfin_sir",
293 .id = 0,
294 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
295 .resource = bfin_sir0_resources,
296};
Graf Yang5be36d22008-04-25 03:09:15 +0800297#endif
298#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800299static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800300 {
301 .start = 0xFFC02000,
302 .end = 0xFFC020FF,
303 .flags = IORESOURCE_MEM,
304 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800305 {
306 .start = IRQ_UART1_RX,
307 .end = IRQ_UART1_RX+1,
308 .flags = IORESOURCE_IRQ,
309 },
310 {
311 .start = CH_UART1_RX,
312 .end = CH_UART1_RX+1,
313 .flags = IORESOURCE_DMA,
314 },
315};
316static struct platform_device bfin_sir1_device = {
317 .name = "bfin_sir",
318 .id = 1,
319 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
320 .resource = bfin_sir1_resources,
321};
Graf Yang5be36d22008-04-25 03:09:15 +0800322#endif
323#ifdef CONFIG_BFIN_SIR2
Graf Yang42bd8bc2009-01-07 23:14:39 +0800324static struct resource bfin_sir2_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800325 {
326 .start = 0xFFC02100,
327 .end = 0xFFC021FF,
328 .flags = IORESOURCE_MEM,
329 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800330 {
331 .start = IRQ_UART2_RX,
332 .end = IRQ_UART2_RX+1,
333 .flags = IORESOURCE_IRQ,
334 },
335 {
336 .start = CH_UART2_RX,
337 .end = CH_UART2_RX+1,
338 .flags = IORESOURCE_DMA,
339 },
340};
341static struct platform_device bfin_sir2_device = {
342 .name = "bfin_sir",
343 .id = 2,
344 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
345 .resource = bfin_sir2_resources,
346};
Graf Yang5be36d22008-04-25 03:09:15 +0800347#endif
348#ifdef CONFIG_BFIN_SIR3
Graf Yang42bd8bc2009-01-07 23:14:39 +0800349static struct resource bfin_sir3_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800350 {
351 .start = 0xFFC03100,
352 .end = 0xFFC031FF,
353 .flags = IORESOURCE_MEM,
354 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800355 {
356 .start = IRQ_UART3_RX,
357 .end = IRQ_UART3_RX+1,
358 .flags = IORESOURCE_IRQ,
359 },
360 {
361 .start = CH_UART3_RX,
362 .end = CH_UART3_RX+1,
363 .flags = IORESOURCE_DMA,
364 },
Graf Yang5be36d22008-04-25 03:09:15 +0800365};
Graf Yang42bd8bc2009-01-07 23:14:39 +0800366static struct platform_device bfin_sir3_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800367 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800368 .id = 3,
369 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
370 .resource = bfin_sir3_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800371};
372#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800373#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800374
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800375#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400376#include <linux/smsc911x.h>
377
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800378static struct resource smsc911x_resources[] = {
379 {
380 .name = "smsc911x-memory",
381 .start = 0x24000000,
382 .end = 0x24000000 + 0xFF,
383 .flags = IORESOURCE_MEM,
384 },
385 {
386 .start = IRQ_PE8,
387 .end = IRQ_PE8,
388 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
389 },
390};
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400391
392static struct smsc911x_platform_config smsc911x_config = {
393 .flags = SMSC911X_USE_32BIT,
394 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
395 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
396 .phy_interface = PHY_INTERFACE_MODE_MII,
397};
398
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800399static struct platform_device smsc911x_device = {
400 .name = "smsc911x",
401 .id = 0,
402 .num_resources = ARRAY_SIZE(smsc911x_resources),
403 .resource = smsc911x_resources,
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400404 .dev = {
405 .platform_data = &smsc911x_config,
406 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800407};
408#endif
409
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800410#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
411static struct resource musb_resources[] = {
412 [0] = {
413 .start = 0xFFC03C00,
414 .end = 0xFFC040FF,
415 .flags = IORESOURCE_MEM,
416 },
417 [1] = { /* general IRQ */
418 .start = IRQ_USB_INT0,
419 .end = IRQ_USB_INT0,
420 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
421 },
422 [2] = { /* DMA IRQ */
423 .start = IRQ_USB_DMA,
424 .end = IRQ_USB_DMA,
425 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
426 },
427};
428
Bryan Wu50041ac2008-10-08 13:39:40 +0800429static struct musb_hdrc_config musb_config = {
430 .multipoint = 0,
431 .dyn_fifo = 0,
432 .soft_con = 1,
433 .dma = 1,
Bryan Wufea05da2009-01-07 23:14:39 +0800434 .num_eps = 8,
435 .dma_channels = 8,
Bryan Wu50041ac2008-10-08 13:39:40 +0800436 .gpio_vrsel = GPIO_PE7,
437};
438
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800439static struct musb_hdrc_platform_data musb_plat = {
Bryan Wu29350772007-12-24 12:20:19 +0800440#if defined(CONFIG_USB_MUSB_OTG)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800441 .mode = MUSB_OTG,
Bryan Wu29350772007-12-24 12:20:19 +0800442#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800443 .mode = MUSB_HOST,
Bryan Wu29350772007-12-24 12:20:19 +0800444#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800445 .mode = MUSB_PERIPHERAL,
446#endif
Bryan Wu50041ac2008-10-08 13:39:40 +0800447 .config = &musb_config,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800448};
449
450static u64 musb_dmamask = ~(u32)0;
451
452static struct platform_device musb_device = {
453 .name = "musb_hdrc",
454 .id = 0,
455 .dev = {
456 .dma_mask = &musb_dmamask,
457 .coherent_dma_mask = 0xffffffff,
458 .platform_data = &musb_plat,
459 },
460 .num_resources = ARRAY_SIZE(musb_resources),
461 .resource = musb_resources,
462};
463#endif
464
465#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
466static struct resource bfin_atapi_resources[] = {
467 {
468 .start = 0xFFC03800,
469 .end = 0xFFC0386F,
470 .flags = IORESOURCE_MEM,
471 },
472 {
473 .start = IRQ_ATAPI_ERR,
474 .end = IRQ_ATAPI_ERR,
475 .flags = IORESOURCE_IRQ,
476 },
477};
478
479static struct platform_device bfin_atapi_device = {
480 .name = "pata-bf54x",
481 .id = -1,
482 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
483 .resource = bfin_atapi_resources,
484};
485#endif
486
487#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
488static struct mtd_partition partition_info[] = {
489 {
Robin Getzaa582972008-08-05 17:47:29 +0800490 .name = "linux kernel(nand)",
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800491 .offset = 0,
Mike Frysingerf4585a02008-10-13 14:45:21 +0800492 .size = 4 * 1024 * 1024,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800493 },
494 {
Robin Getzaa582972008-08-05 17:47:29 +0800495 .name = "file system(nand)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800496 .offset = MTDPART_OFS_APPEND,
497 .size = MTDPART_SIZ_FULL,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800498 },
499};
500
501static struct bf5xx_nand_platform bf5xx_nand_platform = {
502 .page_size = NFC_PG_SIZE_256,
503 .data_width = NFC_NWIDTH_8,
504 .partitions = partition_info,
505 .nr_partitions = ARRAY_SIZE(partition_info),
506 .rd_dly = 3,
507 .wr_dly = 3,
508};
509
510static struct resource bf5xx_nand_resources[] = {
511 {
512 .start = 0xFFC03B00,
513 .end = 0xFFC03B4F,
514 .flags = IORESOURCE_MEM,
515 },
516 {
517 .start = CH_NFC,
518 .end = CH_NFC,
519 .flags = IORESOURCE_IRQ,
520 },
521};
522
523static struct platform_device bf5xx_nand_device = {
524 .name = "bf5xx-nand",
525 .id = 0,
526 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
527 .resource = bf5xx_nand_resources,
528 .dev = {
529 .platform_data = &bf5xx_nand_platform,
530 },
531};
532#endif
533
Michael Hennerich3d7e6cf2008-03-03 17:40:28 -0700534#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
Cliff Cai501674a2009-01-07 23:14:38 +0800535
536static struct bfin_sd_host bfin_sdh_data = {
537 .dma_chan = CH_SDH,
538 .irq_int0 = IRQ_SDH_MASK0,
539 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
540};
541
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800542static struct platform_device bf54x_sdh_device = {
543 .name = "bfin-sdh",
544 .id = 0,
Cliff Cai501674a2009-01-07 23:14:38 +0800545 .dev = {
546 .platform_data = &bfin_sdh_data,
547 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800548};
549#endif
550
Mike Frysinger793dc272008-03-26 08:09:12 +0800551#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800552static struct mtd_partition ezkit_partitions[] = {
553 {
Robin Getzaa582972008-08-05 17:47:29 +0800554 .name = "bootloader(nor)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800555 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800556 .offset = 0,
557 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800558 .name = "linux kernel(nor)",
Mike Frysinger664d0402008-10-09 17:28:36 +0800559 .size = 0x400000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800560 .offset = MTDPART_OFS_APPEND,
561 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800562 .name = "file system(nor)",
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800563 .size = MTDPART_SIZ_FULL,
564 .offset = MTDPART_OFS_APPEND,
565 }
566};
567
568static struct physmap_flash_data ezkit_flash_data = {
569 .width = 2,
570 .parts = ezkit_partitions,
571 .nr_parts = ARRAY_SIZE(ezkit_partitions),
572};
573
574static struct resource ezkit_flash_resource = {
575 .start = 0x20000000,
Mike Frysinger664d0402008-10-09 17:28:36 +0800576 .end = 0x21ffffff,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800577 .flags = IORESOURCE_MEM,
578};
579
580static struct platform_device ezkit_flash_device = {
581 .name = "physmap-flash",
582 .id = 0,
583 .dev = {
584 .platform_data = &ezkit_flash_data,
585 },
586 .num_resources = 1,
587 .resource = &ezkit_flash_resource,
588};
Mike Frysinger793dc272008-03-26 08:09:12 +0800589#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800590
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800591#if defined(CONFIG_MTD_M25P80) \
592 || defined(CONFIG_MTD_M25P80_MODULE)
593/* SPI flash chip (m25p16) */
594static struct mtd_partition bfin_spi_flash_partitions[] = {
595 {
Robin Getzaa582972008-08-05 17:47:29 +0800596 .name = "bootloader(spi)",
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800597 .size = 0x00040000,
598 .offset = 0,
599 .mask_flags = MTD_CAP_ROM
600 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800601 .name = "linux kernel(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800602 .size = MTDPART_SIZ_FULL,
603 .offset = MTDPART_OFS_APPEND,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800604 }
605};
606
607static struct flash_platform_data bfin_spi_flash_data = {
608 .name = "m25p80",
609 .parts = bfin_spi_flash_partitions,
610 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
611 .type = "m25p16",
612};
613
614static struct bfin5xx_spi_chip spi_flash_chip_info = {
615 .enable_dma = 0, /* use dma transfer with this chip*/
616 .bits_per_word = 8,
617 .cs_change_per_word = 0,
618};
619#endif
620
Bernd Schmidt37fa2422008-04-24 05:19:02 +0800621#if defined(CONFIG_SND_BLACKFIN_AD1836) \
622 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
623static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
624 .enable_dma = 0,
625 .bits_per_word = 16,
626};
627#endif
628
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800629#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
630static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Michael Hennerichc7d48962007-11-15 21:33:31 +0800631 .cs_change_per_word = 0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800632 .enable_dma = 0,
633 .bits_per_word = 16,
634};
635
636static const struct ad7877_platform_data bfin_ad7877_ts_info = {
637 .model = 7877,
638 .vref_delay_usecs = 50, /* internal, no capacitor */
639 .x_plate_ohms = 419,
640 .y_plate_ohms = 486,
641 .pressure_max = 1000,
642 .pressure_min = 0,
643 .stopacq_polarity = 1,
644 .first_conversion_delay = 3,
645 .acquisition_time = 1,
646 .averaging = 1,
647 .pen_down_acc_interval = 1,
648};
649#endif
650
Michael Hennerich6e668932008-02-09 01:54:09 +0800651#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
652static struct bfin5xx_spi_chip spidev_chip_info = {
653 .enable_dma = 0,
654 .bits_per_word = 8,
655};
656#endif
657
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000658#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
659static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
660 .enable_dma = 0, /* use dma transfer with this chip*/
661 .bits_per_word = 8,
662 .cs_change_per_word = 0,
663};
664#endif
665
Mike Frysinger5bda2722008-06-07 15:03:01 +0800666static struct spi_board_info bfin_spi_board_info[] __initdata = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800667#if defined(CONFIG_MTD_M25P80) \
668 || defined(CONFIG_MTD_M25P80_MODULE)
669 {
670 /* the modalias must be the same as spi device driver name */
671 .modalias = "m25p80", /* Name of spi_driver for this device */
672 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
673 .bus_num = 0, /* Framework bus number */
674 .chip_select = 1, /* SPI_SSEL1*/
675 .platform_data = &bfin_spi_flash_data,
676 .controller_data = &spi_flash_chip_info,
677 .mode = SPI_MODE_3,
678 },
679#endif
Bernd Schmidt37fa2422008-04-24 05:19:02 +0800680#if defined(CONFIG_SND_BLACKFIN_AD1836) \
681 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
682 {
Barry Songdac98172009-08-13 21:07:37 +0000683 .modalias = "ad1836",
Bernd Schmidt37fa2422008-04-24 05:19:02 +0800684 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
685 .bus_num = 1,
686 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
687 .controller_data = &ad1836_spi_chip_info,
688 },
689#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800690#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000691 {
692 .modalias = "ad7877",
693 .platform_data = &bfin_ad7877_ts_info,
694 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
695 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
696 .bus_num = 0,
697 .chip_select = 2,
698 .controller_data = &spi_ad7877_chip_info,
699 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800700#endif
Michael Hennerich6e668932008-02-09 01:54:09 +0800701#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
702 {
703 .modalias = "spidev",
704 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
705 .bus_num = 0,
706 .chip_select = 1,
707 .controller_data = &spidev_chip_info,
708 },
709#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000710#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
711 {
712 .modalias = "adxl34x",
713 .platform_data = &adxl34x_info,
714 .irq = IRQ_PC5,
715 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
716 .bus_num = 1,
717 .chip_select = 2,
718 .controller_data = &spi_adxl34x_chip_info,
719 .mode = SPI_MODE_3,
720 },
721#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800722};
Mike Frysinger5bda2722008-06-07 15:03:01 +0800723#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800724/* SPI (0) */
725static struct resource bfin_spi0_resource[] = {
726 [0] = {
727 .start = SPI0_REGBASE,
728 .end = SPI0_REGBASE + 0xFF,
729 .flags = IORESOURCE_MEM,
730 },
731 [1] = {
732 .start = CH_SPI0,
733 .end = CH_SPI0,
Yi Li53122692009-06-05 12:11:11 +0000734 .flags = IORESOURCE_DMA,
735 },
736 [2] = {
737 .start = IRQ_SPI0,
738 .end = IRQ_SPI0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800739 .flags = IORESOURCE_IRQ,
740 }
741};
742
743/* SPI (1) */
744static struct resource bfin_spi1_resource[] = {
745 [0] = {
746 .start = SPI1_REGBASE,
747 .end = SPI1_REGBASE + 0xFF,
748 .flags = IORESOURCE_MEM,
749 },
750 [1] = {
751 .start = CH_SPI1,
752 .end = CH_SPI1,
Yi Li53122692009-06-05 12:11:11 +0000753 .flags = IORESOURCE_DMA,
754 },
755 [2] = {
756 .start = IRQ_SPI1,
757 .end = IRQ_SPI1,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800758 .flags = IORESOURCE_IRQ,
759 }
760};
761
762/* SPI controller data */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800763static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
Yi Li4e4d4962009-08-30 20:45:50 +0000764 .num_chipselect = 3,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800765 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800766 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800767};
768
769static struct platform_device bf54x_spi_master0 = {
770 .name = "bfin-spi",
771 .id = 0, /* Bus number */
772 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
773 .resource = bfin_spi0_resource,
774 .dev = {
Bryan Wu5d448dd2007-11-12 23:24:42 +0800775 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800776 },
777};
778
Bryan Wu5d448dd2007-11-12 23:24:42 +0800779static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
Yi Li4e4d4962009-08-30 20:45:50 +0000780 .num_chipselect = 3,
Bryan Wu5d448dd2007-11-12 23:24:42 +0800781 .enable_dma = 1, /* master has the ability to do dma transfer */
782 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
783};
784
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800785static struct platform_device bf54x_spi_master1 = {
786 .name = "bfin-spi",
787 .id = 1, /* Bus number */
788 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
789 .resource = bfin_spi1_resource,
790 .dev = {
Bryan Wu5d448dd2007-11-12 23:24:42 +0800791 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800792 },
793};
794#endif /* spi master and devices */
795
796#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
797static struct resource bfin_twi0_resource[] = {
798 [0] = {
799 .start = TWI0_REGBASE,
800 .end = TWI0_REGBASE + 0xFF,
801 .flags = IORESOURCE_MEM,
802 },
803 [1] = {
804 .start = IRQ_TWI0,
805 .end = IRQ_TWI0,
806 .flags = IORESOURCE_IRQ,
807 },
808};
809
810static struct platform_device i2c_bfin_twi0_device = {
811 .name = "i2c-bfin-twi",
812 .id = 0,
813 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
814 .resource = bfin_twi0_resource,
815};
816
Mike Frysinger7160e952007-11-21 16:03:07 +0800817#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800818static struct resource bfin_twi1_resource[] = {
819 [0] = {
820 .start = TWI1_REGBASE,
821 .end = TWI1_REGBASE + 0xFF,
822 .flags = IORESOURCE_MEM,
823 },
824 [1] = {
825 .start = IRQ_TWI1,
826 .end = IRQ_TWI1,
827 .flags = IORESOURCE_IRQ,
828 },
829};
830
831static struct platform_device i2c_bfin_twi1_device = {
832 .name = "i2c-bfin-twi",
833 .id = 1,
834 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
835 .resource = bfin_twi1_resource,
836};
837#endif
Mike Frysinger7160e952007-11-21 16:03:07 +0800838#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800839
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800840static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
841};
842
843#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
844static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
Michael Hennerichebd58332009-07-02 11:00:38 +0000845#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800846 {
847 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800848 },
849#endif
Michael Hennerich204844e2009-06-30 14:57:22 +0000850#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800851 {
852 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800853 .irq = 212,
854 },
855#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000856#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
857 {
858 I2C_BOARD_INFO("adxl34x", 0x53),
859 .irq = IRQ_PC5,
860 .platform_data = (void *)&adxl34x_info,
861 },
862#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800863};
864#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +0800865
Michael Hennerich2463ef22008-01-27 16:49:48 +0800866#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
867#include <linux/gpio_keys.h>
868
869static struct gpio_keys_button bfin_gpio_keys_table[] = {
870 {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
871 {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
872 {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
873 {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
874};
875
876static struct gpio_keys_platform_data bfin_gpio_keys_data = {
877 .buttons = bfin_gpio_keys_table,
878 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
879};
880
881static struct platform_device bfin_device_gpiokeys = {
882 .name = "gpio-keys",
883 .dev = {
884 .platform_data = &bfin_gpio_keys_data,
885 },
886};
887#endif
888
Mike Frysingercad2ab62008-02-22 17:01:31 +0800889static struct resource bfin_gpios_resources = {
890 .start = 0,
891 .end = MAX_BLACKFIN_GPIOS - 1,
892 .flags = IORESOURCE_IRQ,
893};
894
895static struct platform_device bfin_gpios_device = {
896 .name = "simple-gpio",
897 .id = -1,
898 .num_resources = 1,
899 .resource = &bfin_gpios_resources,
900};
901
Michael Hennerich14b03202008-05-07 11:41:26 +0800902static const unsigned int cclk_vlev_datasheet[] =
903{
904/*
905 * Internal VLEV BF54XSBBC1533
906 ****temporarily using these values until data sheet is updated
907 */
908 VRPAIR(VLEV_085, 150000000),
909 VRPAIR(VLEV_090, 250000000),
910 VRPAIR(VLEV_110, 276000000),
911 VRPAIR(VLEV_115, 301000000),
912 VRPAIR(VLEV_120, 525000000),
913 VRPAIR(VLEV_125, 550000000),
914 VRPAIR(VLEV_130, 600000000),
915};
916
917static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
918 .tuple_tab = cclk_vlev_datasheet,
919 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
920 .vr_settling_time = 25 /* us */,
921};
922
923static struct platform_device bfin_dpmc = {
924 .name = "bfin dpmc",
925 .dev = {
926 .platform_data = &bfin_dmpc_vreg_data,
927 },
928};
929
Roy Huang24a07a12007-07-12 22:41:45 +0800930static struct platform_device *ezkit_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +0800931
932 &bfin_dpmc,
933
Roy Huang24a07a12007-07-12 22:41:45 +0800934#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
935 &rtc_device,
936#endif
937
938#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
939 &bfin_uart_device,
940#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800941
Graf Yang5be36d22008-04-25 03:09:15 +0800942#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800943#ifdef CONFIG_BFIN_SIR0
944 &bfin_sir0_device,
945#endif
946#ifdef CONFIG_BFIN_SIR1
947 &bfin_sir1_device,
948#endif
949#ifdef CONFIG_BFIN_SIR2
950 &bfin_sir2_device,
951#endif
952#ifdef CONFIG_BFIN_SIR3
953 &bfin_sir3_device,
954#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800955#endif
956
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800957#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
958 &bf54x_lq043_device,
959#endif
960
961#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
962 &smsc911x_device,
963#endif
964
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800965#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
966 &musb_device,
967#endif
968
Michael Hennerich3f375692008-11-18 17:48:22 +0800969#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
970 &bfin_isp1760_device,
971#endif
972
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800973#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
974 &bfin_atapi_device,
975#endif
976
977#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
978 &bf5xx_nand_device,
979#endif
980
Michael Hennerich3d7e6cf2008-03-03 17:40:28 -0700981#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800982 &bf54x_sdh_device,
983#endif
984
985#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
986 &bf54x_spi_master0,
Bryan Wud4b1d272007-10-21 17:03:55 +0800987 &bf54x_spi_master1,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800988#endif
989
990#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
991 &bf54x_kpad_device,
992#endif
993
Michael Hennerichaca5e4a2008-10-08 14:27:59 +0800994#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
995 &bfin_rotary_device,
996#endif
997
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800998#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
999 &i2c_bfin_twi0_device,
Mike Frysinger7160e952007-11-21 16:03:07 +08001000#if !defined(CONFIG_BF542)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001001 &i2c_bfin_twi1_device,
1002#endif
Mike Frysinger7160e952007-11-21 16:03:07 +08001003#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08001004
1005#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1006 &bfin_device_gpiokeys,
1007#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08001008
1009 &bfin_gpios_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08001010
1011#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08001012 &ezkit_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08001013#endif
Roy Huang24a07a12007-07-12 22:41:45 +08001014};
1015
Mike Frysingera01d7a72008-02-02 15:34:56 +08001016static int __init ezkit_init(void)
Roy Huang24a07a12007-07-12 22:41:45 +08001017{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08001018 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001019
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001020 i2c_register_board_info(0, bfin_i2c_board_info0,
1021 ARRAY_SIZE(bfin_i2c_board_info0));
1022#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1023 i2c_register_board_info(1, bfin_i2c_board_info1,
1024 ARRAY_SIZE(bfin_i2c_board_info1));
1025#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001026
Roy Huang24a07a12007-07-12 22:41:45 +08001027 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001028
Mike Frysinger5bda2722008-06-07 15:03:01 +08001029 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001030
Roy Huang24a07a12007-07-12 22:41:45 +08001031 return 0;
1032}
1033
Mike Frysingera01d7a72008-02-02 15:34:56 +08001034arch_initcall(ezkit_init);