blob: 220cfda60f043bb3bc1ae919e912106c3b1327d6 [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
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800104#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
105static struct bfin5xx_spi_chip mmc_spi_chip_info = {
106 .enable_dma = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700107 .bits_per_word = 8,
108};
109#endif
110
111static struct spi_board_info bfin_spi_board_info[] __initdata = {
112#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
113 {
114 /* the modalias must be the same as spi device driver name */
115 .modalias = "m25p80", /* Name of spi_driver for this device */
116 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800117 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700118 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
119 .platform_data = &bfin_spi_flash_data,
120 .controller_data = &spi_flash_chip_info,
121 .mode = SPI_MODE_3,
122 },
123#endif
124
Mike Frysingera261eec2009-05-20 14:05:36 +0000125#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700126 {
127 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
128 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800129 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -0700130 .chip_select = 1, /* Framework chip select. */
131 .platform_data = NULL, /* No spi_driver specific config */
132 .controller_data = &spi_adc_chip_info,
133 },
134#endif
135
136#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
137 {
Barry Songdac98172009-08-13 21:07:37 +0000138 .modalias = "ad1836",
Bryan Wu1394f032007-05-06 14:50:22 -0700139 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800140 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -0700141 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
142 .controller_data = &ad1836_spi_chip_info,
143 },
144#endif
145
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800146#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700147 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800148 .modalias = "mmc_spi",
149 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800150 .bus_num = 0,
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800151 .chip_select = 1,
152 .controller_data = &mmc_spi_chip_info,
Bryan Wu1394f032007-05-06 14:50:22 -0700153 .mode = SPI_MODE_3,
154 },
155#endif
156};
157
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800158/* SPI (0) */
159static struct resource bfin_spi0_resource[] = {
160 [0] = {
161 .start = SPI0_REGBASE,
162 .end = SPI0_REGBASE + 0xFF,
163 .flags = IORESOURCE_MEM,
164 },
165 [1] = {
166 .start = CH_SPI,
167 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000168 .flags = IORESOURCE_DMA,
169 },
170 [2] = {
171 .start = IRQ_SPI,
172 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800173 .flags = IORESOURCE_IRQ,
Yi Li53122692009-06-05 12:11:11 +0000174 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800175};
176
Bryan Wu1394f032007-05-06 14:50:22 -0700177/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800178static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700179 .num_chipselect = 8,
180 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800181 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700182};
183
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800184static struct platform_device bfin_spi0_device = {
185 .name = "bfin-spi",
186 .id = 0, /* Bus number */
187 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
188 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700189 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800190 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700191 },
192};
193#endif /* spi master and devices */
194
195#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
196static struct platform_device rtc_device = {
197 .name = "rtc-bfin",
198 .id = -1,
199};
200#endif
201
Michael Hennerich0d4a89b2008-01-27 19:58:46 +0800202#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
203static struct platform_device hitachi_fb_device = {
204 .name = "hitachi-tx09",
205};
206#endif
207
Bryan Wu1394f032007-05-06 14:50:22 -0700208#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000209#include <linux/smc91x.h>
210
211static struct smc91x_platdata smc91x_info = {
212 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
213 .leda = RPC_LED_100_10,
214 .ledb = RPC_LED_TX_RX,
215};
216
Bryan Wu1394f032007-05-06 14:50:22 -0700217static struct resource smc91x_resources[] = {
218 {
219 .start = 0x20200300,
220 .end = 0x20200300 + 16,
221 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800222 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700223 .start = IRQ_PF14,
224 .end = IRQ_PF14,
225 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
226 },
227};
228
229static struct platform_device smc91x_device = {
230 .name = "smc91x",
231 .id = 0,
232 .num_resources = ARRAY_SIZE(smc91x_resources),
233 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000234 .dev = {
235 .platform_data = &smc91x_info,
236 },
Bryan Wu1394f032007-05-06 14:50:22 -0700237};
238#endif
239
240#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
241static struct resource isp1362_hcd_resources[] = {
242 {
243 .start = 0x20308000,
244 .end = 0x20308000,
245 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800246 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700247 .start = 0x20308004,
248 .end = 0x20308004,
249 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800250 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700251 .start = IRQ_PG15,
252 .end = IRQ_PG15,
253 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
254 },
255};
256
257static struct isp1362_platform_data isp1362_priv = {
258 .sel15Kres = 1,
259 .clknotstop = 0,
260 .oc_enable = 0,
261 .int_act_high = 0,
262 .int_edge_triggered = 0,
263 .remote_wakeup_connected = 0,
264 .no_power_switching = 1,
265 .power_switching_mode = 0,
266};
267
268static struct platform_device isp1362_hcd_device = {
269 .name = "isp1362-hcd",
270 .id = 0,
271 .dev = {
272 .platform_data = &isp1362_priv,
273 },
274 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
275 .resource = isp1362_hcd_resources,
276};
277#endif
278
279#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
280static struct resource net2272_bfin_resources[] = {
281 {
282 .start = 0x20200000,
283 .end = 0x20200000 + 0x100,
284 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800285 }, {
Michael Hennerich8ecc7362007-10-29 17:24:23 +0800286 .start = IRQ_PH14,
287 .end = IRQ_PH14,
Bryan Wu1394f032007-05-06 14:50:22 -0700288 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
289 },
290};
291
292static struct platform_device net2272_bfin_device = {
293 .name = "net2272",
294 .id = -1,
295 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
296 .resource = net2272_bfin_resources,
297};
298#endif
299
Mike Frysingerc97618d2009-01-07 23:14:38 +0800300static struct resource bfin_gpios_resources = {
301 .start = 0,
302 .end = MAX_BLACKFIN_GPIOS - 1,
303 .flags = IORESOURCE_IRQ,
304};
305
306static struct platform_device bfin_gpios_device = {
307 .name = "simple-gpio",
308 .id = -1,
309 .num_resources = 1,
310 .resource = &bfin_gpios_resources,
311};
312
Mike Frysinger8ea89492008-08-05 18:14:44 +0800313#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
314static struct mtd_partition cm_partitions[] = {
315 {
316 .name = "bootloader(nor)",
317 .size = 0x40000,
318 .offset = 0,
319 }, {
320 .name = "linux kernel(nor)",
321 .size = 0xE0000,
322 .offset = MTDPART_OFS_APPEND,
323 }, {
324 .name = "file system(nor)",
325 .size = MTDPART_SIZ_FULL,
326 .offset = MTDPART_OFS_APPEND,
327 }
328};
329
330static struct physmap_flash_data cm_flash_data = {
331 .width = 2,
332 .parts = cm_partitions,
333 .nr_parts = ARRAY_SIZE(cm_partitions),
334};
335
336static unsigned cm_flash_gpios[] = { GPIO_PF4 };
337
338static struct resource cm_flash_resource[] = {
339 {
340 .name = "cfi_probe",
341 .start = 0x20000000,
342 .end = 0x201fffff,
343 .flags = IORESOURCE_MEM,
344 }, {
345 .start = (unsigned long)cm_flash_gpios,
346 .end = ARRAY_SIZE(cm_flash_gpios),
347 .flags = IORESOURCE_IRQ,
348 }
349};
350
351static struct platform_device cm_flash_device = {
352 .name = "gpio-addr-flash",
353 .id = 0,
354 .dev = {
355 .platform_data = &cm_flash_data,
356 },
357 .num_resources = ARRAY_SIZE(cm_flash_resource),
358 .resource = cm_flash_resource,
359};
360#endif
361
Bryan Wu1394f032007-05-06 14:50:22 -0700362#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
363static struct resource bfin_uart_resources[] = {
364 {
365 .start = 0xFFC00400,
366 .end = 0xFFC004FF,
367 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800368 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700369 .start = 0xFFC02000,
370 .end = 0xFFC020FF,
371 .flags = IORESOURCE_MEM,
372 },
373};
374
375static struct platform_device bfin_uart_device = {
376 .name = "bfin-uart",
377 .id = 1,
378 .num_resources = ARRAY_SIZE(bfin_uart_resources),
379 .resource = bfin_uart_resources,
380};
381#endif
382
Graf Yang5be36d22008-04-25 03:09:15 +0800383#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800384#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800385static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800386 {
387 .start = 0xFFC00400,
388 .end = 0xFFC004FF,
389 .flags = IORESOURCE_MEM,
390 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800391 {
392 .start = IRQ_UART0_RX,
393 .end = IRQ_UART0_RX+1,
394 .flags = IORESOURCE_IRQ,
395 },
396 {
397 .start = CH_UART0_RX,
398 .end = CH_UART0_RX+1,
399 .flags = IORESOURCE_DMA,
400 },
401};
402static struct platform_device bfin_sir0_device = {
403 .name = "bfin_sir",
404 .id = 0,
405 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
406 .resource = bfin_sir0_resources,
407};
Graf Yang5be36d22008-04-25 03:09:15 +0800408#endif
409#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800410static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800411 {
412 .start = 0xFFC02000,
413 .end = 0xFFC020FF,
414 .flags = IORESOURCE_MEM,
415 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800416 {
417 .start = IRQ_UART1_RX,
418 .end = IRQ_UART1_RX+1,
419 .flags = IORESOURCE_IRQ,
420 },
421 {
422 .start = CH_UART1_RX,
423 .end = CH_UART1_RX+1,
424 .flags = IORESOURCE_DMA,
425 },
Graf Yang5be36d22008-04-25 03:09:15 +0800426};
Graf Yang42bd8bc2009-01-07 23:14:39 +0800427static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800428 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800429 .id = 1,
430 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
431 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800432};
433#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800434#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800435
Mike Frysinger56ce8352008-03-26 06:00:18 +0800436#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
437static struct resource bfin_twi0_resource[] = {
438 [0] = {
439 .start = TWI0_REGBASE,
440 .end = TWI0_REGBASE,
441 .flags = IORESOURCE_MEM,
442 },
443 [1] = {
444 .start = IRQ_TWI,
445 .end = IRQ_TWI,
446 .flags = IORESOURCE_IRQ,
447 },
448};
449
450static struct platform_device i2c_bfin_twi_device = {
451 .name = "i2c-bfin-twi",
452 .id = 0,
453 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
454 .resource = bfin_twi0_resource,
455};
456#endif
457
Bryan Wu1394f032007-05-06 14:50:22 -0700458#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
459static struct platform_device bfin_sport0_uart_device = {
460 .name = "bfin-sport-uart",
461 .id = 0,
462};
463
464static struct platform_device bfin_sport1_uart_device = {
465 .name = "bfin-sport-uart",
466 .id = 1,
467};
468#endif
469
470#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800471static struct platform_device bfin_mii_bus = {
472 .name = "bfin_mii_bus",
473};
474
Bryan Wu1394f032007-05-06 14:50:22 -0700475static struct platform_device bfin_mac_device = {
476 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800477 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700478};
479#endif
480
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800481#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Mike Frysingerfe5aeb92008-08-05 18:29:56 +0800482#define PATA_INT IRQ_PF14
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800483
484static struct pata_platform_info bfin_pata_platform_data = {
485 .ioport_shift = 2,
486 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
487};
488
489static struct resource bfin_pata_resources[] = {
490 {
491 .start = 0x2030C000,
492 .end = 0x2030C01F,
493 .flags = IORESOURCE_MEM,
494 },
495 {
496 .start = 0x2030D018,
497 .end = 0x2030D01B,
498 .flags = IORESOURCE_MEM,
499 },
500 {
501 .start = PATA_INT,
502 .end = PATA_INT,
503 .flags = IORESOURCE_IRQ,
504 },
505};
506
507static struct platform_device bfin_pata_device = {
508 .name = "pata_platform",
509 .id = -1,
510 .num_resources = ARRAY_SIZE(bfin_pata_resources),
511 .resource = bfin_pata_resources,
512 .dev = {
513 .platform_data = &bfin_pata_platform_data,
514 }
515};
516#endif
517
Michael Hennerich14b03202008-05-07 11:41:26 +0800518static const unsigned int cclk_vlev_datasheet[] =
519{
520 VRPAIR(VLEV_085, 250000000),
521 VRPAIR(VLEV_090, 376000000),
522 VRPAIR(VLEV_095, 426000000),
523 VRPAIR(VLEV_100, 426000000),
524 VRPAIR(VLEV_105, 476000000),
525 VRPAIR(VLEV_110, 476000000),
526 VRPAIR(VLEV_115, 476000000),
527 VRPAIR(VLEV_120, 500000000),
528 VRPAIR(VLEV_125, 533000000),
529 VRPAIR(VLEV_130, 600000000),
530};
531
532static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
533 .tuple_tab = cclk_vlev_datasheet,
534 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
535 .vr_settling_time = 25 /* us */,
536};
537
538static struct platform_device bfin_dpmc = {
539 .name = "bfin dpmc",
540 .dev = {
541 .platform_data = &bfin_dmpc_vreg_data,
542 },
543};
544
Bryan Wu1394f032007-05-06 14:50:22 -0700545static struct platform_device *cm_bf537_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +0800546
547 &bfin_dpmc,
548
Michael Hennerich0d4a89b2008-01-27 19:58:46 +0800549#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
550 &hitachi_fb_device,
551#endif
552
Bryan Wu1394f032007-05-06 14:50:22 -0700553#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
554 &rtc_device,
555#endif
556
557#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
558 &bfin_uart_device,
559#endif
560
Graf Yang5be36d22008-04-25 03:09:15 +0800561#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800562#ifdef CONFIG_BFIN_SIR0
563 &bfin_sir0_device,
564#endif
565#ifdef CONFIG_BFIN_SIR1
566 &bfin_sir1_device,
567#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800568#endif
569
Mike Frysinger56ce8352008-03-26 06:00:18 +0800570#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
571 &i2c_bfin_twi_device,
572#endif
573
Bryan Wu1394f032007-05-06 14:50:22 -0700574#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
575 &bfin_sport0_uart_device,
576 &bfin_sport1_uart_device,
577#endif
578
579#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
580 &isp1362_hcd_device,
581#endif
582
583#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
584 &smc91x_device,
585#endif
586
587#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800588 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700589 &bfin_mac_device,
590#endif
591
592#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
593 &net2272_bfin_device,
594#endif
595
596#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800597 &bfin_spi0_device,
598#endif
599
600#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
601 &bfin_pata_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700602#endif
Mike Frysinger8ea89492008-08-05 18:14:44 +0800603
604#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
605 &cm_flash_device,
606#endif
Mike Frysingerc97618d2009-01-07 23:14:38 +0800607
608 &bfin_gpios_device,
Bryan Wu1394f032007-05-06 14:50:22 -0700609};
610
611static int __init cm_bf537_init(void)
612{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800613 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700614 platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
615#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
616 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
617#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800618
619#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
620 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
621#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700622 return 0;
623}
624
625arch_initcall(cm_bf537_init);
Mike Frysinger137b1522007-11-22 16:07:03 +0800626
Mike Frysinger9862cc52007-11-15 21:21:20 +0800627void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +0800628{
629 random_ether_addr(addr);
630 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
631}
Mike Frysinger9862cc52007-11-15 21:21:20 +0800632EXPORT_SYMBOL(bfin_get_ether_addr);