blob: 2a87d1cfcd06661f6d7307cd7d8e07362033a0fd [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
2 * File: arch/blackfin/mach-bf537/boards/cm_bf537.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created: 2005
7 * Description: Board description file
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 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>
Mike Frysinger43f73fe2007-12-24 19:35:35 +080032#include <linux/etherdevice.h>
Bryan Wu1394f032007-05-06 14:50:22 -070033#include <linux/platform_device.h>
34#include <linux/mtd/mtd.h>
35#include <linux/mtd/partitions.h>
Mike Frysinger8ea89492008-08-05 18:14:44 +080036#include <linux/mtd/physmap.h>
Bryan Wu1394f032007-05-06 14:50:22 -070037#include <linux/spi/spi.h>
38#include <linux/spi/flash.h>
Mike Frysingerb964c592008-05-10 00:06:10 +080039#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080040#include <linux/usb/isp1362.h>
Mike Frysingerb964c592008-05-10 00:06:10 +080041#endif
Jeff Garzik0a87e3e2008-02-01 18:02:30 -050042#include <linux/ata_platform.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080043#include <linux/irq.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080044#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070045#include <asm/bfin5xx_spi.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080046#include <asm/portmux.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080047#include <asm/dpmc.h>
Bryan Wu1394f032007-05-06 14:50:22 -070048
49/*
50 * Name the Board for the /proc/cpuinfo
51 */
Mike Frysinger066954a2007-10-21 22:36:06 +080052const char bfin_board_name[] = "Bluetechnix CM BF537";
Bryan Wu1394f032007-05-06 14:50:22 -070053
54#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
55/* all SPI peripherals info goes here */
56
57#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
58static struct mtd_partition bfin_spi_flash_partitions[] = {
59 {
Robin Getzaa582972008-08-05 17:47:29 +080060 .name = "bootloader(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070061 .size = 0x00020000,
62 .offset = 0,
63 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080064 }, {
Robin Getzaa582972008-08-05 17:47:29 +080065 .name = "linux kernel(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070066 .size = 0xe0000,
67 .offset = 0x20000
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080068 }, {
Robin Getzaa582972008-08-05 17:47:29 +080069 .name = "file system(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070070 .size = 0x700000,
71 .offset = 0x00100000,
72 }
73};
74
75static struct flash_platform_data bfin_spi_flash_data = {
76 .name = "m25p80",
77 .parts = bfin_spi_flash_partitions,
78 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
79 .type = "m25p64",
80};
81
82/* SPI flash chip (m25p64) */
83static struct bfin5xx_spi_chip spi_flash_chip_info = {
84 .enable_dma = 0, /* use dma transfer with this chip*/
85 .bits_per_word = 8,
86};
87#endif
88
Mike Frysingera261eec2009-05-20 14:05:36 +000089#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -070090/* SPI ADC chip */
91static struct bfin5xx_spi_chip spi_adc_chip_info = {
92 .enable_dma = 1, /* use dma transfer with this chip*/
93 .bits_per_word = 16,
94};
95#endif
96
97#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
98static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
99 .enable_dma = 0,
100 .bits_per_word = 16,
101};
102#endif
103
104#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
105static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
106 .enable_dma = 0,
107 .bits_per_word = 16,
108};
109#endif
110
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800111#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
112static struct bfin5xx_spi_chip mmc_spi_chip_info = {
113 .enable_dma = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700114 .bits_per_word = 8,
115};
116#endif
117
118static struct spi_board_info bfin_spi_board_info[] __initdata = {
119#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
120 {
121 /* the modalias must be the same as spi device driver name */
122 .modalias = "m25p80", /* Name of spi_driver for this device */
123 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800124 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700125 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
126 .platform_data = &bfin_spi_flash_data,
127 .controller_data = &spi_flash_chip_info,
128 .mode = SPI_MODE_3,
129 },
130#endif
131
Mike Frysingera261eec2009-05-20 14:05:36 +0000132#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700133 {
134 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
135 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800136 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700137 .chip_select = 1, /* Framework chip select. */
138 .platform_data = NULL, /* No spi_driver specific config */
139 .controller_data = &spi_adc_chip_info,
140 },
141#endif
142
143#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
144 {
145 .modalias = "ad1836-spi",
146 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800147 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700148 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
149 .controller_data = &ad1836_spi_chip_info,
150 },
151#endif
152
153#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
154 {
155 .modalias = "ad9960-spi",
156 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800157 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700158 .chip_select = 1,
159 .controller_data = &ad9960_spi_chip_info,
160 },
161#endif
162
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800163#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700164 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800165 .modalias = "mmc_spi",
166 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800167 .bus_num = 0,
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800168 .chip_select = 1,
169 .controller_data = &mmc_spi_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700170 .mode = SPI_MODE_3,
171 },
172#endif
173};
174
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800175/* SPI (0) */
176static struct resource bfin_spi0_resource[] = {
177 [0] = {
178 .start = SPI0_REGBASE,
179 .end = SPI0_REGBASE + 0xFF,
180 .flags = IORESOURCE_MEM,
181 },
182 [1] = {
183 .start = CH_SPI,
184 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000185 .flags = IORESOURCE_DMA,
186 },
187 [2] = {
188 .start = IRQ_SPI,
189 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800190 .flags = IORESOURCE_IRQ,
Yi Li53122692009-06-05 12:11:11 +0000191 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800192};
193
Bryan Wu1394f032007-05-06 14:50:22 -0700194/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800195static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700196 .num_chipselect = 8,
197 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800198 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700199};
200
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800201static struct platform_device bfin_spi0_device = {
202 .name = "bfin-spi",
203 .id = 0, /* Bus number */
204 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
205 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700206 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800207 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700208 },
209};
210#endif /* spi master and devices */
211
212#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
213static struct platform_device rtc_device = {
214 .name = "rtc-bfin",
215 .id = -1,
216};
217#endif
218
Michael Hennerich0d4a89b2008-01-27 19:58:46 +0800219#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
220static struct platform_device hitachi_fb_device = {
221 .name = "hitachi-tx09",
222};
223#endif
224
Bryan Wu1394f032007-05-06 14:50:22 -0700225#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
226static struct resource smc91x_resources[] = {
227 {
228 .start = 0x20200300,
229 .end = 0x20200300 + 16,
230 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800231 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700232 .start = IRQ_PF14,
233 .end = IRQ_PF14,
234 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
235 },
236};
237
238static struct platform_device smc91x_device = {
239 .name = "smc91x",
240 .id = 0,
241 .num_resources = ARRAY_SIZE(smc91x_resources),
242 .resource = smc91x_resources,
243};
244#endif
245
246#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
247static struct resource isp1362_hcd_resources[] = {
248 {
249 .start = 0x20308000,
250 .end = 0x20308000,
251 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800252 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700253 .start = 0x20308004,
254 .end = 0x20308004,
255 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800256 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700257 .start = IRQ_PG15,
258 .end = IRQ_PG15,
259 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
260 },
261};
262
263static struct isp1362_platform_data isp1362_priv = {
264 .sel15Kres = 1,
265 .clknotstop = 0,
266 .oc_enable = 0,
267 .int_act_high = 0,
268 .int_edge_triggered = 0,
269 .remote_wakeup_connected = 0,
270 .no_power_switching = 1,
271 .power_switching_mode = 0,
272};
273
274static struct platform_device isp1362_hcd_device = {
275 .name = "isp1362-hcd",
276 .id = 0,
277 .dev = {
278 .platform_data = &isp1362_priv,
279 },
280 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
281 .resource = isp1362_hcd_resources,
282};
283#endif
284
285#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
286static struct resource net2272_bfin_resources[] = {
287 {
288 .start = 0x20200000,
289 .end = 0x20200000 + 0x100,
290 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800291 }, {
Michael Hennerich8ecc7362007-10-29 17:24:23 +0800292 .start = IRQ_PH14,
293 .end = IRQ_PH14,
Bryan Wu1394f032007-05-06 14:50:22 -0700294 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
295 },
296};
297
298static struct platform_device net2272_bfin_device = {
299 .name = "net2272",
300 .id = -1,
301 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
302 .resource = net2272_bfin_resources,
303};
304#endif
305
Mike Frysingerc97618d2009-01-07 23:14:38 +0800306static struct resource bfin_gpios_resources = {
307 .start = 0,
308 .end = MAX_BLACKFIN_GPIOS - 1,
309 .flags = IORESOURCE_IRQ,
310};
311
312static struct platform_device bfin_gpios_device = {
313 .name = "simple-gpio",
314 .id = -1,
315 .num_resources = 1,
316 .resource = &bfin_gpios_resources,
317};
318
Mike Frysinger8ea89492008-08-05 18:14:44 +0800319#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
320static struct mtd_partition cm_partitions[] = {
321 {
322 .name = "bootloader(nor)",
323 .size = 0x40000,
324 .offset = 0,
325 }, {
326 .name = "linux kernel(nor)",
327 .size = 0xE0000,
328 .offset = MTDPART_OFS_APPEND,
329 }, {
330 .name = "file system(nor)",
331 .size = MTDPART_SIZ_FULL,
332 .offset = MTDPART_OFS_APPEND,
333 }
334};
335
336static struct physmap_flash_data cm_flash_data = {
337 .width = 2,
338 .parts = cm_partitions,
339 .nr_parts = ARRAY_SIZE(cm_partitions),
340};
341
342static unsigned cm_flash_gpios[] = { GPIO_PF4 };
343
344static struct resource cm_flash_resource[] = {
345 {
346 .name = "cfi_probe",
347 .start = 0x20000000,
348 .end = 0x201fffff,
349 .flags = IORESOURCE_MEM,
350 }, {
351 .start = (unsigned long)cm_flash_gpios,
352 .end = ARRAY_SIZE(cm_flash_gpios),
353 .flags = IORESOURCE_IRQ,
354 }
355};
356
357static struct platform_device cm_flash_device = {
358 .name = "gpio-addr-flash",
359 .id = 0,
360 .dev = {
361 .platform_data = &cm_flash_data,
362 },
363 .num_resources = ARRAY_SIZE(cm_flash_resource),
364 .resource = cm_flash_resource,
365};
366#endif
367
Bryan Wu1394f032007-05-06 14:50:22 -0700368#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
369static struct resource bfin_uart_resources[] = {
370 {
371 .start = 0xFFC00400,
372 .end = 0xFFC004FF,
373 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800374 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700375 .start = 0xFFC02000,
376 .end = 0xFFC020FF,
377 .flags = IORESOURCE_MEM,
378 },
379};
380
381static struct platform_device bfin_uart_device = {
382 .name = "bfin-uart",
383 .id = 1,
384 .num_resources = ARRAY_SIZE(bfin_uart_resources),
385 .resource = bfin_uart_resources,
386};
387#endif
388
Graf Yang5be36d22008-04-25 03:09:15 +0800389#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800390#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800391static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800392 {
393 .start = 0xFFC00400,
394 .end = 0xFFC004FF,
395 .flags = IORESOURCE_MEM,
396 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800397 {
398 .start = IRQ_UART0_RX,
399 .end = IRQ_UART0_RX+1,
400 .flags = IORESOURCE_IRQ,
401 },
402 {
403 .start = CH_UART0_RX,
404 .end = CH_UART0_RX+1,
405 .flags = IORESOURCE_DMA,
406 },
407};
408static struct platform_device bfin_sir0_device = {
409 .name = "bfin_sir",
410 .id = 0,
411 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
412 .resource = bfin_sir0_resources,
413};
Graf Yang5be36d22008-04-25 03:09:15 +0800414#endif
415#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800416static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800417 {
418 .start = 0xFFC02000,
419 .end = 0xFFC020FF,
420 .flags = IORESOURCE_MEM,
421 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800422 {
423 .start = IRQ_UART1_RX,
424 .end = IRQ_UART1_RX+1,
425 .flags = IORESOURCE_IRQ,
426 },
427 {
428 .start = CH_UART1_RX,
429 .end = CH_UART1_RX+1,
430 .flags = IORESOURCE_DMA,
431 },
Graf Yang5be36d22008-04-25 03:09:15 +0800432};
Graf Yang42bd8bc2009-01-07 23:14:39 +0800433static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800434 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800435 .id = 1,
436 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
437 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800438};
439#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800440#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800441
Mike Frysinger56ce8352008-03-26 06:00:18 +0800442#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
443static struct resource bfin_twi0_resource[] = {
444 [0] = {
445 .start = TWI0_REGBASE,
446 .end = TWI0_REGBASE,
447 .flags = IORESOURCE_MEM,
448 },
449 [1] = {
450 .start = IRQ_TWI,
451 .end = IRQ_TWI,
452 .flags = IORESOURCE_IRQ,
453 },
454};
455
456static struct platform_device i2c_bfin_twi_device = {
457 .name = "i2c-bfin-twi",
458 .id = 0,
459 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
460 .resource = bfin_twi0_resource,
461};
462#endif
463
Bryan Wu1394f032007-05-06 14:50:22 -0700464#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
465static struct platform_device bfin_sport0_uart_device = {
466 .name = "bfin-sport-uart",
467 .id = 0,
468};
469
470static struct platform_device bfin_sport1_uart_device = {
471 .name = "bfin-sport-uart",
472 .id = 1,
473};
474#endif
475
476#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800477static struct platform_device bfin_mii_bus = {
478 .name = "bfin_mii_bus",
479};
480
Bryan Wu1394f032007-05-06 14:50:22 -0700481static struct platform_device bfin_mac_device = {
482 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800483 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700484};
485#endif
486
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800487#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Mike Frysingerfe5aeb92008-08-05 18:29:56 +0800488#define PATA_INT IRQ_PF14
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800489
490static struct pata_platform_info bfin_pata_platform_data = {
491 .ioport_shift = 2,
492 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
493};
494
495static struct resource bfin_pata_resources[] = {
496 {
497 .start = 0x2030C000,
498 .end = 0x2030C01F,
499 .flags = IORESOURCE_MEM,
500 },
501 {
502 .start = 0x2030D018,
503 .end = 0x2030D01B,
504 .flags = IORESOURCE_MEM,
505 },
506 {
507 .start = PATA_INT,
508 .end = PATA_INT,
509 .flags = IORESOURCE_IRQ,
510 },
511};
512
513static struct platform_device bfin_pata_device = {
514 .name = "pata_platform",
515 .id = -1,
516 .num_resources = ARRAY_SIZE(bfin_pata_resources),
517 .resource = bfin_pata_resources,
518 .dev = {
519 .platform_data = &bfin_pata_platform_data,
520 }
521};
522#endif
523
Michael Hennerich14b03202008-05-07 11:41:26 +0800524static const unsigned int cclk_vlev_datasheet[] =
525{
526 VRPAIR(VLEV_085, 250000000),
527 VRPAIR(VLEV_090, 376000000),
528 VRPAIR(VLEV_095, 426000000),
529 VRPAIR(VLEV_100, 426000000),
530 VRPAIR(VLEV_105, 476000000),
531 VRPAIR(VLEV_110, 476000000),
532 VRPAIR(VLEV_115, 476000000),
533 VRPAIR(VLEV_120, 500000000),
534 VRPAIR(VLEV_125, 533000000),
535 VRPAIR(VLEV_130, 600000000),
536};
537
538static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
539 .tuple_tab = cclk_vlev_datasheet,
540 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
541 .vr_settling_time = 25 /* us */,
542};
543
544static struct platform_device bfin_dpmc = {
545 .name = "bfin dpmc",
546 .dev = {
547 .platform_data = &bfin_dmpc_vreg_data,
548 },
549};
550
Bryan Wu1394f032007-05-06 14:50:22 -0700551static struct platform_device *cm_bf537_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +0800552
553 &bfin_dpmc,
554
Michael Hennerich0d4a89b2008-01-27 19:58:46 +0800555#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
556 &hitachi_fb_device,
557#endif
558
Bryan Wu1394f032007-05-06 14:50:22 -0700559#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
560 &rtc_device,
561#endif
562
563#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
564 &bfin_uart_device,
565#endif
566
Graf Yang5be36d22008-04-25 03:09:15 +0800567#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800568#ifdef CONFIG_BFIN_SIR0
569 &bfin_sir0_device,
570#endif
571#ifdef CONFIG_BFIN_SIR1
572 &bfin_sir1_device,
573#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800574#endif
575
Mike Frysinger56ce8352008-03-26 06:00:18 +0800576#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
577 &i2c_bfin_twi_device,
578#endif
579
Bryan Wu1394f032007-05-06 14:50:22 -0700580#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
581 &bfin_sport0_uart_device,
582 &bfin_sport1_uart_device,
583#endif
584
585#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
586 &isp1362_hcd_device,
587#endif
588
589#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
590 &smc91x_device,
591#endif
592
593#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800594 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700595 &bfin_mac_device,
596#endif
597
598#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
599 &net2272_bfin_device,
600#endif
601
602#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800603 &bfin_spi0_device,
604#endif
605
606#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
607 &bfin_pata_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700608#endif
Mike Frysinger8ea89492008-08-05 18:14:44 +0800609
610#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
611 &cm_flash_device,
612#endif
Mike Frysingerc97618d2009-01-07 23:14:38 +0800613
614 &bfin_gpios_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700615};
616
617static int __init cm_bf537_init(void)
618{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800619 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700620 platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
621#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
622 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
623#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800624
625#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
626 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
627#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700628 return 0;
629}
630
631arch_initcall(cm_bf537_init);
Mike Frysinger137b1522007-11-22 16:07:03 +0800632
Mike Frysinger9862cc52007-11-15 21:21:20 +0800633void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +0800634{
635 random_ether_addr(addr);
636 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
637}
Mike Frysinger9862cc52007-11-15 21:21:20 +0800638EXPORT_SYMBOL(bfin_get_ether_addr);