diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-24 12:33:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-24 12:33:34 -0400 |
commit | 346ad4b7fe392571f19314f153db9151dbc1d82b (patch) | |
tree | 2d4085338c9044bca2f6472893da60387db3c96f /arch/blackfin/mach-bf548/boards | |
parent | 845199f194306dbd69ca42d3b40a5125cdb50b89 (diff) | |
parent | 2dc63a84b2db23b9680646aff93917211613bf1a (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (85 commits)
Blackfin char driver for Blackfin on-chip OTP memory (v3)
Blackfin Serial Driver: fix bug - use mod_timer to replace only add_timer.
Blackfin Serial Driver: the uart break anomaly has been given its own number, so switch to it
Blackfin Serial Driver: use BFIN_UART_NR_PORTS to help SIR driver in uart port.
Blackfin Serial Driver: Fix bug - kernel hangs when accessing uart 0 on bf537 when booting u-boot and linux on uart 1
Blackfin Serial Driver: punt unused lsr variable
Blackfin Serial Driver: Enable IR function when user application (irattach /dev/ttyBFx -s) call TIOCSETD ioctl with line discipline N_IRDA
[Blackfin] arch: add include/boot .gitignore files
[Blackfin] arch: Functional power management support: Add support for cpu frequency scaling
[Blackfin] arch: Functional power management support: Remove broken cpu frequency scaling drivers
[Blackfin] arch: Equalize include files: Add PLL_DIV Masks
[Blackfin] arch: Add a warning about the value of CLKIN.
[Blackfin] arch: take DDR DEVWD into consideration as well for BF548
[Blackfin] arch: Remove the circular buffering mechanism for exceptions
[Blackfin] arch: lose unnecessary dependency on CONFIG_BFIN_ICACHE for MPU
[Blackfin] arch: fix bug - before assign new channel to the map register, need clear the bits first.
[Blackfin] arch: add Blackfin on-chip SIR IrDA driver support
[Blackfin] arch: BF54x memsizes are in mbits, not mbytes
[Blackfin] arch: try to remove condition that causes double fault, by checking current before it gets dereferenced
[Blackfin] arch: Update anomaly list.
...
Diffstat (limited to 'arch/blackfin/mach-bf548/boards')
-rw-r--r-- | arch/blackfin/mach-bf548/boards/Kconfig | 6 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/Makefile | 1 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/cm_bf548.c | 664 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/ezkit.c | 105 |
4 files changed, 774 insertions, 2 deletions
diff --git a/arch/blackfin/mach-bf548/boards/Kconfig b/arch/blackfin/mach-bf548/boards/Kconfig index 057129064037..d38e52671853 100644 --- a/arch/blackfin/mach-bf548/boards/Kconfig +++ b/arch/blackfin/mach-bf548/boards/Kconfig | |||
@@ -8,5 +8,11 @@ config BFIN548_EZKIT | |||
8 | bool "BF548-EZKIT" | 8 | bool "BF548-EZKIT" |
9 | help | 9 | help |
10 | BFIN548-EZKIT board support. | 10 | BFIN548-EZKIT board support. |
11 | |||
12 | config BFIN548_BLUETECHNIX_CM | ||
13 | bool "Bluetechnix CM-BF548" | ||
14 | depends on (BF548) | ||
15 | help | ||
16 | CM-BF548 support for DEV-Board. | ||
11 | 17 | ||
12 | endchoice | 18 | endchoice |
diff --git a/arch/blackfin/mach-bf548/boards/Makefile b/arch/blackfin/mach-bf548/boards/Makefile index a444cc739578..eed161dd7845 100644 --- a/arch/blackfin/mach-bf548/boards/Makefile +++ b/arch/blackfin/mach-bf548/boards/Makefile | |||
@@ -3,3 +3,4 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_BFIN548_EZKIT) += ezkit.o led.o | 5 | obj-$(CONFIG_BFIN548_EZKIT) += ezkit.o led.o |
6 | obj-$(CONFIG_BFIN548_BLUETECHNIX_CM) += cm_bf548.o | ||
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c new file mode 100644 index 000000000000..e3e8479fffb5 --- /dev/null +++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c | |||
@@ -0,0 +1,664 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf548/boards/cm_bf548.c | ||
3 | * Based on: arch/blackfin/mach-bf537/boards/ezkit.c | ||
4 | * Author: Aidan Williams <aidan@nicta.com.au> | ||
5 | * | ||
6 | * Created: | ||
7 | * Description: | ||
8 | * | ||
9 | * Modified: | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2008 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | ||
30 | |||
31 | #include <linux/device.h> | ||
32 | #include <linux/platform_device.h> | ||
33 | #include <linux/mtd/mtd.h> | ||
34 | #include <linux/mtd/partitions.h> | ||
35 | #include <linux/spi/spi.h> | ||
36 | #include <linux/spi/flash.h> | ||
37 | #include <linux/irq.h> | ||
38 | #include <linux/interrupt.h> | ||
39 | #include <linux/usb/musb.h> | ||
40 | #include <asm/bfin5xx_spi.h> | ||
41 | #include <asm/cplb.h> | ||
42 | #include <asm/dma.h> | ||
43 | #include <asm/gpio.h> | ||
44 | #include <asm/nand.h> | ||
45 | #include <asm/portmux.h> | ||
46 | #include <asm/mach/bf54x_keys.h> | ||
47 | #include <linux/input.h> | ||
48 | #include <linux/spi/ad7877.h> | ||
49 | |||
50 | /* | ||
51 | * Name the Board for the /proc/cpuinfo | ||
52 | */ | ||
53 | const char bfin_board_name[] = "Bluetechnix CM-BF548"; | ||
54 | |||
55 | /* | ||
56 | * Driver needs to know address, irq and flag pin. | ||
57 | */ | ||
58 | |||
59 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) | ||
60 | |||
61 | #include <asm/mach/bf54x-lq043.h> | ||
62 | |||
63 | static struct bfin_bf54xfb_mach_info bf54x_lq043_data = { | ||
64 | .width = 480, | ||
65 | .height = 272, | ||
66 | .xres = {480, 480, 480}, | ||
67 | .yres = {272, 272, 272}, | ||
68 | .bpp = {24, 24, 24}, | ||
69 | .disp = GPIO_PE3, | ||
70 | }; | ||
71 | |||
72 | static struct resource bf54x_lq043_resources[] = { | ||
73 | { | ||
74 | .start = IRQ_EPPI0_ERR, | ||
75 | .end = IRQ_EPPI0_ERR, | ||
76 | .flags = IORESOURCE_IRQ, | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | static struct platform_device bf54x_lq043_device = { | ||
81 | .name = "bf54x-lq043", | ||
82 | .id = -1, | ||
83 | .num_resources = ARRAY_SIZE(bf54x_lq043_resources), | ||
84 | .resource = bf54x_lq043_resources, | ||
85 | .dev = { | ||
86 | .platform_data = &bf54x_lq043_data, | ||
87 | }, | ||
88 | }; | ||
89 | #endif | ||
90 | |||
91 | #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) | ||
92 | static unsigned int bf548_keymap[] = { | ||
93 | KEYVAL(0, 0, KEY_ENTER), | ||
94 | KEYVAL(0, 1, KEY_HELP), | ||
95 | KEYVAL(0, 2, KEY_0), | ||
96 | KEYVAL(0, 3, KEY_BACKSPACE), | ||
97 | KEYVAL(1, 0, KEY_TAB), | ||
98 | KEYVAL(1, 1, KEY_9), | ||
99 | KEYVAL(1, 2, KEY_8), | ||
100 | KEYVAL(1, 3, KEY_7), | ||
101 | KEYVAL(2, 0, KEY_DOWN), | ||
102 | KEYVAL(2, 1, KEY_6), | ||
103 | KEYVAL(2, 2, KEY_5), | ||
104 | KEYVAL(2, 3, KEY_4), | ||
105 | KEYVAL(3, 0, KEY_UP), | ||
106 | KEYVAL(3, 1, KEY_3), | ||
107 | KEYVAL(3, 2, KEY_2), | ||
108 | KEYVAL(3, 3, KEY_1), | ||
109 | }; | ||
110 | |||
111 | static struct bfin_kpad_platform_data bf54x_kpad_data = { | ||
112 | .rows = 4, | ||
113 | .cols = 4, | ||
114 | .keymap = bf548_keymap, | ||
115 | .keymapsize = ARRAY_SIZE(bf548_keymap), | ||
116 | .repeat = 0, | ||
117 | .debounce_time = 5000, /* ns (5ms) */ | ||
118 | .coldrive_time = 1000, /* ns (1ms) */ | ||
119 | .keyup_test_interval = 50, /* ms (50ms) */ | ||
120 | }; | ||
121 | |||
122 | static struct resource bf54x_kpad_resources[] = { | ||
123 | { | ||
124 | .start = IRQ_KEY, | ||
125 | .end = IRQ_KEY, | ||
126 | .flags = IORESOURCE_IRQ, | ||
127 | }, | ||
128 | }; | ||
129 | |||
130 | static struct platform_device bf54x_kpad_device = { | ||
131 | .name = "bf54x-keys", | ||
132 | .id = -1, | ||
133 | .num_resources = ARRAY_SIZE(bf54x_kpad_resources), | ||
134 | .resource = bf54x_kpad_resources, | ||
135 | .dev = { | ||
136 | .platform_data = &bf54x_kpad_data, | ||
137 | }, | ||
138 | }; | ||
139 | #endif | ||
140 | |||
141 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
142 | static struct platform_device rtc_device = { | ||
143 | .name = "rtc-bfin", | ||
144 | .id = -1, | ||
145 | }; | ||
146 | #endif | ||
147 | |||
148 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
149 | static struct resource bfin_uart_resources[] = { | ||
150 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
151 | { | ||
152 | .start = 0xFFC00400, | ||
153 | .end = 0xFFC004FF, | ||
154 | .flags = IORESOURCE_MEM, | ||
155 | }, | ||
156 | #endif | ||
157 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
158 | { | ||
159 | .start = 0xFFC02000, | ||
160 | .end = 0xFFC020FF, | ||
161 | .flags = IORESOURCE_MEM, | ||
162 | }, | ||
163 | #endif | ||
164 | #ifdef CONFIG_SERIAL_BFIN_UART2 | ||
165 | { | ||
166 | .start = 0xFFC02100, | ||
167 | .end = 0xFFC021FF, | ||
168 | .flags = IORESOURCE_MEM, | ||
169 | }, | ||
170 | #endif | ||
171 | #ifdef CONFIG_SERIAL_BFIN_UART3 | ||
172 | { | ||
173 | .start = 0xFFC03100, | ||
174 | .end = 0xFFC031FF, | ||
175 | }, | ||
176 | #endif | ||
177 | }; | ||
178 | |||
179 | static struct platform_device bfin_uart_device = { | ||
180 | .name = "bfin-uart", | ||
181 | .id = 1, | ||
182 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | ||
183 | .resource = bfin_uart_resources, | ||
184 | }; | ||
185 | #endif | ||
186 | |||
187 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
188 | static struct resource bfin_sir_resources[] = { | ||
189 | #ifdef CONFIG_BFIN_SIR0 | ||
190 | { | ||
191 | .start = 0xFFC00400, | ||
192 | .end = 0xFFC004FF, | ||
193 | .flags = IORESOURCE_MEM, | ||
194 | }, | ||
195 | #endif | ||
196 | #ifdef CONFIG_BFIN_SIR1 | ||
197 | { | ||
198 | .start = 0xFFC02000, | ||
199 | .end = 0xFFC020FF, | ||
200 | .flags = IORESOURCE_MEM, | ||
201 | }, | ||
202 | #endif | ||
203 | #ifdef CONFIG_BFIN_SIR2 | ||
204 | { | ||
205 | .start = 0xFFC02100, | ||
206 | .end = 0xFFC021FF, | ||
207 | .flags = IORESOURCE_MEM, | ||
208 | }, | ||
209 | #endif | ||
210 | #ifdef CONFIG_BFIN_SIR3 | ||
211 | { | ||
212 | .start = 0xFFC03100, | ||
213 | .end = 0xFFC031FF, | ||
214 | .flags = IORESOURCE_MEM, | ||
215 | }, | ||
216 | #endif | ||
217 | }; | ||
218 | |||
219 | static struct platform_device bfin_sir_device = { | ||
220 | .name = "bfin_sir", | ||
221 | .id = 0, | ||
222 | .num_resources = ARRAY_SIZE(bfin_sir_resources), | ||
223 | .resource = bfin_sir_resources, | ||
224 | }; | ||
225 | #endif | ||
226 | |||
227 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | ||
228 | static struct resource smsc911x_resources[] = { | ||
229 | { | ||
230 | .name = "smsc911x-memory", | ||
231 | .start = 0x24000000, | ||
232 | .end = 0x24000000 + 0xFF, | ||
233 | .flags = IORESOURCE_MEM, | ||
234 | }, | ||
235 | { | ||
236 | .start = IRQ_PE6, | ||
237 | .end = IRQ_PE6, | ||
238 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | ||
239 | }, | ||
240 | }; | ||
241 | static struct platform_device smsc911x_device = { | ||
242 | .name = "smsc911x", | ||
243 | .id = 0, | ||
244 | .num_resources = ARRAY_SIZE(smsc911x_resources), | ||
245 | .resource = smsc911x_resources, | ||
246 | }; | ||
247 | #endif | ||
248 | |||
249 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) | ||
250 | static struct resource musb_resources[] = { | ||
251 | [0] = { | ||
252 | .start = 0xFFC03C00, | ||
253 | .end = 0xFFC040FF, | ||
254 | .flags = IORESOURCE_MEM, | ||
255 | }, | ||
256 | [1] = { /* general IRQ */ | ||
257 | .start = IRQ_USB_INT0, | ||
258 | .end = IRQ_USB_INT0, | ||
259 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
260 | }, | ||
261 | [2] = { /* DMA IRQ */ | ||
262 | .start = IRQ_USB_DMA, | ||
263 | .end = IRQ_USB_DMA, | ||
264 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
265 | }, | ||
266 | }; | ||
267 | |||
268 | static struct musb_hdrc_platform_data musb_plat = { | ||
269 | #if defined(CONFIG_USB_MUSB_OTG) | ||
270 | .mode = MUSB_OTG, | ||
271 | #elif defined(CONFIG_USB_MUSB_HDRC_HCD) | ||
272 | .mode = MUSB_HOST, | ||
273 | #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) | ||
274 | .mode = MUSB_PERIPHERAL, | ||
275 | #endif | ||
276 | .multipoint = 0, | ||
277 | }; | ||
278 | |||
279 | static u64 musb_dmamask = ~(u32)0; | ||
280 | |||
281 | static struct platform_device musb_device = { | ||
282 | .name = "musb_hdrc", | ||
283 | .id = 0, | ||
284 | .dev = { | ||
285 | .dma_mask = &musb_dmamask, | ||
286 | .coherent_dma_mask = 0xffffffff, | ||
287 | .platform_data = &musb_plat, | ||
288 | }, | ||
289 | .num_resources = ARRAY_SIZE(musb_resources), | ||
290 | .resource = musb_resources, | ||
291 | }; | ||
292 | #endif | ||
293 | |||
294 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) | ||
295 | static struct resource bfin_atapi_resources[] = { | ||
296 | { | ||
297 | .start = 0xFFC03800, | ||
298 | .end = 0xFFC0386F, | ||
299 | .flags = IORESOURCE_MEM, | ||
300 | }, | ||
301 | { | ||
302 | .start = IRQ_ATAPI_ERR, | ||
303 | .end = IRQ_ATAPI_ERR, | ||
304 | .flags = IORESOURCE_IRQ, | ||
305 | }, | ||
306 | }; | ||
307 | |||
308 | static struct platform_device bfin_atapi_device = { | ||
309 | .name = "pata-bf54x", | ||
310 | .id = -1, | ||
311 | .num_resources = ARRAY_SIZE(bfin_atapi_resources), | ||
312 | .resource = bfin_atapi_resources, | ||
313 | }; | ||
314 | #endif | ||
315 | |||
316 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) | ||
317 | static struct mtd_partition partition_info[] = { | ||
318 | { | ||
319 | .name = "Linux Kernel", | ||
320 | .offset = 0, | ||
321 | .size = 4 * SIZE_1M, | ||
322 | }, | ||
323 | { | ||
324 | .name = "File System", | ||
325 | .offset = 4 * SIZE_1M, | ||
326 | .size = (256 - 4) * SIZE_1M, | ||
327 | }, | ||
328 | }; | ||
329 | |||
330 | static struct bf5xx_nand_platform bf5xx_nand_platform = { | ||
331 | .page_size = NFC_PG_SIZE_256, | ||
332 | .data_width = NFC_NWIDTH_8, | ||
333 | .partitions = partition_info, | ||
334 | .nr_partitions = ARRAY_SIZE(partition_info), | ||
335 | .rd_dly = 3, | ||
336 | .wr_dly = 3, | ||
337 | }; | ||
338 | |||
339 | static struct resource bf5xx_nand_resources[] = { | ||
340 | { | ||
341 | .start = 0xFFC03B00, | ||
342 | .end = 0xFFC03B4F, | ||
343 | .flags = IORESOURCE_MEM, | ||
344 | }, | ||
345 | { | ||
346 | .start = CH_NFC, | ||
347 | .end = CH_NFC, | ||
348 | .flags = IORESOURCE_IRQ, | ||
349 | }, | ||
350 | }; | ||
351 | |||
352 | static struct platform_device bf5xx_nand_device = { | ||
353 | .name = "bf5xx-nand", | ||
354 | .id = 0, | ||
355 | .num_resources = ARRAY_SIZE(bf5xx_nand_resources), | ||
356 | .resource = bf5xx_nand_resources, | ||
357 | .dev = { | ||
358 | .platform_data = &bf5xx_nand_platform, | ||
359 | }, | ||
360 | }; | ||
361 | #endif | ||
362 | |||
363 | #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) | ||
364 | static struct platform_device bf54x_sdh_device = { | ||
365 | .name = "bfin-sdh", | ||
366 | .id = 0, | ||
367 | }; | ||
368 | #endif | ||
369 | |||
370 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
371 | /* all SPI peripherals info goes here */ | ||
372 | #if defined(CONFIG_MTD_M25P80) \ | ||
373 | || defined(CONFIG_MTD_M25P80_MODULE) | ||
374 | /* SPI flash chip (m25p16) */ | ||
375 | static struct mtd_partition bfin_spi_flash_partitions[] = { | ||
376 | { | ||
377 | .name = "bootloader", | ||
378 | .size = 0x00040000, | ||
379 | .offset = 0, | ||
380 | .mask_flags = MTD_CAP_ROM | ||
381 | }, { | ||
382 | .name = "linux kernel", | ||
383 | .size = 0x1c0000, | ||
384 | .offset = 0x40000 | ||
385 | } | ||
386 | }; | ||
387 | |||
388 | static struct flash_platform_data bfin_spi_flash_data = { | ||
389 | .name = "m25p80", | ||
390 | .parts = bfin_spi_flash_partitions, | ||
391 | .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), | ||
392 | .type = "m25p16", | ||
393 | }; | ||
394 | |||
395 | static struct bfin5xx_spi_chip spi_flash_chip_info = { | ||
396 | .enable_dma = 0, /* use dma transfer with this chip*/ | ||
397 | .bits_per_word = 8, | ||
398 | .cs_change_per_word = 0, | ||
399 | }; | ||
400 | #endif | ||
401 | |||
402 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | ||
403 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { | ||
404 | .cs_change_per_word = 0, | ||
405 | .enable_dma = 0, | ||
406 | .bits_per_word = 16, | ||
407 | }; | ||
408 | |||
409 | static const struct ad7877_platform_data bfin_ad7877_ts_info = { | ||
410 | .model = 7877, | ||
411 | .vref_delay_usecs = 50, /* internal, no capacitor */ | ||
412 | .x_plate_ohms = 419, | ||
413 | .y_plate_ohms = 486, | ||
414 | .pressure_max = 1000, | ||
415 | .pressure_min = 0, | ||
416 | .stopacq_polarity = 1, | ||
417 | .first_conversion_delay = 3, | ||
418 | .acquisition_time = 1, | ||
419 | .averaging = 1, | ||
420 | .pen_down_acc_interval = 1, | ||
421 | }; | ||
422 | #endif | ||
423 | |||
424 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) | ||
425 | static struct bfin5xx_spi_chip spidev_chip_info = { | ||
426 | .enable_dma = 0, | ||
427 | .bits_per_word = 8, | ||
428 | }; | ||
429 | #endif | ||
430 | |||
431 | static struct spi_board_info bf54x_spi_board_info[] __initdata = { | ||
432 | #if defined(CONFIG_MTD_M25P80) \ | ||
433 | || defined(CONFIG_MTD_M25P80_MODULE) | ||
434 | { | ||
435 | /* the modalias must be the same as spi device driver name */ | ||
436 | .modalias = "m25p80", /* Name of spi_driver for this device */ | ||
437 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | ||
438 | .bus_num = 0, /* Framework bus number */ | ||
439 | .chip_select = 1, /* SPI_SSEL1*/ | ||
440 | .platform_data = &bfin_spi_flash_data, | ||
441 | .controller_data = &spi_flash_chip_info, | ||
442 | .mode = SPI_MODE_3, | ||
443 | }, | ||
444 | #endif | ||
445 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | ||
446 | { | ||
447 | .modalias = "ad7877", | ||
448 | .platform_data = &bfin_ad7877_ts_info, | ||
449 | .irq = IRQ_PJ11, | ||
450 | .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ | ||
451 | .bus_num = 0, | ||
452 | .chip_select = 2, | ||
453 | .controller_data = &spi_ad7877_chip_info, | ||
454 | }, | ||
455 | #endif | ||
456 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) | ||
457 | { | ||
458 | .modalias = "spidev", | ||
459 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | ||
460 | .bus_num = 0, | ||
461 | .chip_select = 1, | ||
462 | .controller_data = &spidev_chip_info, | ||
463 | }, | ||
464 | #endif | ||
465 | }; | ||
466 | |||
467 | /* SPI (0) */ | ||
468 | static struct resource bfin_spi0_resource[] = { | ||
469 | [0] = { | ||
470 | .start = SPI0_REGBASE, | ||
471 | .end = SPI0_REGBASE + 0xFF, | ||
472 | .flags = IORESOURCE_MEM, | ||
473 | }, | ||
474 | [1] = { | ||
475 | .start = CH_SPI0, | ||
476 | .end = CH_SPI0, | ||
477 | .flags = IORESOURCE_IRQ, | ||
478 | } | ||
479 | }; | ||
480 | |||
481 | /* SPI (1) */ | ||
482 | static struct resource bfin_spi1_resource[] = { | ||
483 | [0] = { | ||
484 | .start = SPI1_REGBASE, | ||
485 | .end = SPI1_REGBASE + 0xFF, | ||
486 | .flags = IORESOURCE_MEM, | ||
487 | }, | ||
488 | [1] = { | ||
489 | .start = CH_SPI1, | ||
490 | .end = CH_SPI1, | ||
491 | .flags = IORESOURCE_IRQ, | ||
492 | } | ||
493 | }; | ||
494 | |||
495 | /* SPI controller data */ | ||
496 | static struct bfin5xx_spi_master bf54x_spi_master_info0 = { | ||
497 | .num_chipselect = 8, | ||
498 | .enable_dma = 1, /* master has the ability to do dma transfer */ | ||
499 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | ||
500 | }; | ||
501 | |||
502 | static struct platform_device bf54x_spi_master0 = { | ||
503 | .name = "bfin-spi", | ||
504 | .id = 0, /* Bus number */ | ||
505 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
506 | .resource = bfin_spi0_resource, | ||
507 | .dev = { | ||
508 | .platform_data = &bf54x_spi_master_info0, /* Passed to driver */ | ||
509 | }, | ||
510 | }; | ||
511 | |||
512 | static struct bfin5xx_spi_master bf54x_spi_master_info1 = { | ||
513 | .num_chipselect = 8, | ||
514 | .enable_dma = 1, /* master has the ability to do dma transfer */ | ||
515 | .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, | ||
516 | }; | ||
517 | |||
518 | static struct platform_device bf54x_spi_master1 = { | ||
519 | .name = "bfin-spi", | ||
520 | .id = 1, /* Bus number */ | ||
521 | .num_resources = ARRAY_SIZE(bfin_spi1_resource), | ||
522 | .resource = bfin_spi1_resource, | ||
523 | .dev = { | ||
524 | .platform_data = &bf54x_spi_master_info1, /* Passed to driver */ | ||
525 | }, | ||
526 | }; | ||
527 | #endif /* spi master and devices */ | ||
528 | |||
529 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) | ||
530 | static struct resource bfin_twi0_resource[] = { | ||
531 | [0] = { | ||
532 | .start = TWI0_REGBASE, | ||
533 | .end = TWI0_REGBASE + 0xFF, | ||
534 | .flags = IORESOURCE_MEM, | ||
535 | }, | ||
536 | [1] = { | ||
537 | .start = IRQ_TWI0, | ||
538 | .end = IRQ_TWI0, | ||
539 | .flags = IORESOURCE_IRQ, | ||
540 | }, | ||
541 | }; | ||
542 | |||
543 | static struct platform_device i2c_bfin_twi0_device = { | ||
544 | .name = "i2c-bfin-twi", | ||
545 | .id = 0, | ||
546 | .num_resources = ARRAY_SIZE(bfin_twi0_resource), | ||
547 | .resource = bfin_twi0_resource, | ||
548 | }; | ||
549 | |||
550 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ | ||
551 | static struct resource bfin_twi1_resource[] = { | ||
552 | [0] = { | ||
553 | .start = TWI1_REGBASE, | ||
554 | .end = TWI1_REGBASE + 0xFF, | ||
555 | .flags = IORESOURCE_MEM, | ||
556 | }, | ||
557 | [1] = { | ||
558 | .start = IRQ_TWI1, | ||
559 | .end = IRQ_TWI1, | ||
560 | .flags = IORESOURCE_IRQ, | ||
561 | }, | ||
562 | }; | ||
563 | |||
564 | static struct platform_device i2c_bfin_twi1_device = { | ||
565 | .name = "i2c-bfin-twi", | ||
566 | .id = 1, | ||
567 | .num_resources = ARRAY_SIZE(bfin_twi1_resource), | ||
568 | .resource = bfin_twi1_resource, | ||
569 | }; | ||
570 | #endif | ||
571 | #endif | ||
572 | |||
573 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
574 | #include <linux/gpio_keys.h> | ||
575 | |||
576 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | ||
577 | {BTN_0, GPIO_PH7, 1, "gpio-keys: BTN0"}, | ||
578 | }; | ||
579 | |||
580 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | ||
581 | .buttons = bfin_gpio_keys_table, | ||
582 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | ||
583 | }; | ||
584 | |||
585 | static struct platform_device bfin_device_gpiokeys = { | ||
586 | .name = "gpio-keys", | ||
587 | .dev = { | ||
588 | .platform_data = &bfin_gpio_keys_data, | ||
589 | }, | ||
590 | }; | ||
591 | #endif | ||
592 | |||
593 | static struct platform_device *cm_bf548_devices[] __initdata = { | ||
594 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | ||
595 | &rtc_device, | ||
596 | #endif | ||
597 | |||
598 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | ||
599 | &bfin_uart_device, | ||
600 | #endif | ||
601 | |||
602 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
603 | &bfin_sir_device, | ||
604 | #endif | ||
605 | |||
606 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) | ||
607 | &bf54x_lq043_device, | ||
608 | #endif | ||
609 | |||
610 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | ||
611 | &smsc911x_device, | ||
612 | #endif | ||
613 | |||
614 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) | ||
615 | &musb_device, | ||
616 | #endif | ||
617 | |||
618 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) | ||
619 | &bfin_atapi_device, | ||
620 | #endif | ||
621 | |||
622 | #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) | ||
623 | &bf5xx_nand_device, | ||
624 | #endif | ||
625 | |||
626 | #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) | ||
627 | &bf54x_sdh_device, | ||
628 | #endif | ||
629 | |||
630 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
631 | &bf54x_spi_master0, | ||
632 | &bf54x_spi_master1, | ||
633 | #endif | ||
634 | |||
635 | #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) | ||
636 | &bf54x_kpad_device, | ||
637 | #endif | ||
638 | |||
639 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) | ||
640 | /* &i2c_bfin_twi0_device, */ | ||
641 | #if !defined(CONFIG_BF542) | ||
642 | &i2c_bfin_twi1_device, | ||
643 | #endif | ||
644 | #endif | ||
645 | |||
646 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
647 | &bfin_device_gpiokeys, | ||
648 | #endif | ||
649 | }; | ||
650 | |||
651 | static int __init cm_bf548_init(void) | ||
652 | { | ||
653 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
654 | platform_add_devices(cm_bf548_devices, ARRAY_SIZE(cm_bf548_devices)); | ||
655 | |||
656 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | ||
657 | spi_register_board_info(bf54x_spi_board_info, | ||
658 | ARRAY_SIZE(bf54x_spi_board_info)); | ||
659 | #endif | ||
660 | |||
661 | return 0; | ||
662 | } | ||
663 | |||
664 | arch_initcall(cm_bf548_init); | ||
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 40846aa034c4..231dfbd3bc1f 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
37 | #include <linux/spi/flash.h> | 37 | #include <linux/spi/flash.h> |
38 | #include <linux/irq.h> | 38 | #include <linux/irq.h> |
39 | #include <linux/i2c.h> | ||
39 | #include <linux/interrupt.h> | 40 | #include <linux/interrupt.h> |
40 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) | 41 | #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) |
41 | #include <linux/usb/musb.h> | 42 | #include <linux/usb/musb.h> |
@@ -187,6 +188,46 @@ static struct platform_device bfin_uart_device = { | |||
187 | }; | 188 | }; |
188 | #endif | 189 | #endif |
189 | 190 | ||
191 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
192 | static struct resource bfin_sir_resources[] = { | ||
193 | #ifdef CONFIG_BFIN_SIR0 | ||
194 | { | ||
195 | .start = 0xFFC00400, | ||
196 | .end = 0xFFC004FF, | ||
197 | .flags = IORESOURCE_MEM, | ||
198 | }, | ||
199 | #endif | ||
200 | #ifdef CONFIG_BFIN_SIR1 | ||
201 | { | ||
202 | .start = 0xFFC02000, | ||
203 | .end = 0xFFC020FF, | ||
204 | .flags = IORESOURCE_MEM, | ||
205 | }, | ||
206 | #endif | ||
207 | #ifdef CONFIG_BFIN_SIR2 | ||
208 | { | ||
209 | .start = 0xFFC02100, | ||
210 | .end = 0xFFC021FF, | ||
211 | .flags = IORESOURCE_MEM, | ||
212 | }, | ||
213 | #endif | ||
214 | #ifdef CONFIG_BFIN_SIR3 | ||
215 | { | ||
216 | .start = 0xFFC03100, | ||
217 | .end = 0xFFC031FF, | ||
218 | .flags = IORESOURCE_MEM, | ||
219 | }, | ||
220 | #endif | ||
221 | }; | ||
222 | |||
223 | static struct platform_device bfin_sir_device = { | ||
224 | .name = "bfin_sir", | ||
225 | .id = 0, | ||
226 | .num_resources = ARRAY_SIZE(bfin_sir_resources), | ||
227 | .resource = bfin_sir_resources, | ||
228 | }; | ||
229 | #endif | ||
230 | |||
190 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 231 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
191 | static struct resource smsc911x_resources[] = { | 232 | static struct resource smsc911x_resources[] = { |
192 | { | 233 | { |
@@ -330,6 +371,7 @@ static struct platform_device bf54x_sdh_device = { | |||
330 | }; | 371 | }; |
331 | #endif | 372 | #endif |
332 | 373 | ||
374 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
333 | static struct mtd_partition ezkit_partitions[] = { | 375 | static struct mtd_partition ezkit_partitions[] = { |
334 | { | 376 | { |
335 | .name = "Bootloader", | 377 | .name = "Bootloader", |
@@ -337,7 +379,7 @@ static struct mtd_partition ezkit_partitions[] = { | |||
337 | .offset = 0, | 379 | .offset = 0, |
338 | }, { | 380 | }, { |
339 | .name = "Kernel", | 381 | .name = "Kernel", |
340 | .size = 0xE0000, | 382 | .size = 0x1C0000, |
341 | .offset = MTDPART_OFS_APPEND, | 383 | .offset = MTDPART_OFS_APPEND, |
342 | }, { | 384 | }, { |
343 | .name = "RootFS", | 385 | .name = "RootFS", |
@@ -367,6 +409,7 @@ static struct platform_device ezkit_flash_device = { | |||
367 | .num_resources = 1, | 409 | .num_resources = 1, |
368 | .resource = &ezkit_flash_resource, | 410 | .resource = &ezkit_flash_resource, |
369 | }; | 411 | }; |
412 | #endif | ||
370 | 413 | ||
371 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 414 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
372 | /* all SPI peripherals info goes here */ | 415 | /* all SPI peripherals info goes here */ |
@@ -400,6 +443,14 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = { | |||
400 | }; | 443 | }; |
401 | #endif | 444 | #endif |
402 | 445 | ||
446 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | ||
447 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
448 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | ||
449 | .enable_dma = 0, | ||
450 | .bits_per_word = 16, | ||
451 | }; | ||
452 | #endif | ||
453 | |||
403 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | 454 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
404 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { | 455 | static struct bfin5xx_spi_chip spi_ad7877_chip_info = { |
405 | .cs_change_per_word = 0, | 456 | .cs_change_per_word = 0, |
@@ -443,6 +494,16 @@ static struct spi_board_info bf54x_spi_board_info[] __initdata = { | |||
443 | .mode = SPI_MODE_3, | 494 | .mode = SPI_MODE_3, |
444 | }, | 495 | }, |
445 | #endif | 496 | #endif |
497 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | ||
498 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | ||
499 | { | ||
500 | .modalias = "ad1836-spi", | ||
501 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | ||
502 | .bus_num = 1, | ||
503 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | ||
504 | .controller_data = &ad1836_spi_chip_info, | ||
505 | }, | ||
506 | #endif | ||
446 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) | 507 | #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) |
447 | { | 508 | { |
448 | .modalias = "ad7877", | 509 | .modalias = "ad7877", |
@@ -571,6 +632,29 @@ static struct platform_device i2c_bfin_twi1_device = { | |||
571 | #endif | 632 | #endif |
572 | #endif | 633 | #endif |
573 | 634 | ||
635 | #ifdef CONFIG_I2C_BOARDINFO | ||
636 | static struct i2c_board_info __initdata bfin_i2c_board_info0[] = { | ||
637 | }; | ||
638 | |||
639 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ | ||
640 | static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { | ||
641 | #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) | ||
642 | { | ||
643 | I2C_BOARD_INFO("pcf8574_lcd", 0x22), | ||
644 | .type = "pcf8574_lcd", | ||
645 | }, | ||
646 | #endif | ||
647 | #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) | ||
648 | { | ||
649 | I2C_BOARD_INFO("pcf8574_keypad", 0x27), | ||
650 | .type = "pcf8574_keypad", | ||
651 | .irq = 212, | ||
652 | }, | ||
653 | #endif | ||
654 | }; | ||
655 | #endif | ||
656 | #endif | ||
657 | |||
574 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 658 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
575 | #include <linux/gpio_keys.h> | 659 | #include <linux/gpio_keys.h> |
576 | 660 | ||
@@ -616,6 +700,10 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
616 | &bfin_uart_device, | 700 | &bfin_uart_device, |
617 | #endif | 701 | #endif |
618 | 702 | ||
703 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | ||
704 | &bfin_sir_device, | ||
705 | #endif | ||
706 | |||
619 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) | 707 | #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) |
620 | &bf54x_lq043_device, | 708 | &bf54x_lq043_device, |
621 | #endif | 709 | #endif |
@@ -661,12 +749,25 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
661 | #endif | 749 | #endif |
662 | 750 | ||
663 | &bfin_gpios_device, | 751 | &bfin_gpios_device, |
752 | |||
753 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
664 | &ezkit_flash_device, | 754 | &ezkit_flash_device, |
755 | #endif | ||
665 | }; | 756 | }; |
666 | 757 | ||
667 | static int __init ezkit_init(void) | 758 | static int __init ezkit_init(void) |
668 | { | 759 | { |
669 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | 760 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
761 | |||
762 | #ifdef CONFIG_I2C_BOARDINFO | ||
763 | i2c_register_board_info(0, bfin_i2c_board_info0, | ||
764 | ARRAY_SIZE(bfin_i2c_board_info0)); | ||
765 | #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ | ||
766 | i2c_register_board_info(1, bfin_i2c_board_info1, | ||
767 | ARRAY_SIZE(bfin_i2c_board_info1)); | ||
768 | #endif | ||
769 | #endif | ||
770 | |||
670 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); | 771 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
671 | 772 | ||
672 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 773 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |