blob: 4ef2fb0e48d58ccbea3561b58331f317e4d0f348 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2008-2009 Bluetechnix
4 * 2005 National ICT Australia (NICTA)
5 * Aidan Williams <aidan@nicta.com.au>
Bryan Wu1394f032007-05-06 14:50:22 -07006 *
Robin Getz96f10502009-09-24 14:11:24 +00007 * Licensed under the GPL-2 or later.
Bryan Wu1394f032007-05-06 14:50:22 -07008 */
9
10#include <linux/device.h>
11#include <linux/platform_device.h>
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
Harald Krapfenbauer9c214532009-09-10 15:30:03 +000014#include <linux/mtd/physmap.h>
Bryan Wu1394f032007-05-06 14:50:22 -070015#include <linux/spi/spi.h>
16#include <linux/spi/flash.h>
Harald Krapfenbauer9c214532009-09-10 15:30:03 +000017#include <linux/spi/mmc_spi.h>
Steven Miaoc4a2c582014-04-12 02:07:27 +080018#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080019#include <linux/usb/isp1362.h>
Mike Frysingerb964c592008-05-10 00:06:10 +080020#endif
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080021#include <linux/irq.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080022#include <asm/dma.h>
Bryan Wu1394f032007-05-06 14:50:22 -070023#include <asm/bfin5xx_spi.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080024#include <asm/portmux.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080025#include <asm/dpmc.h>
Bryan Wu1394f032007-05-06 14:50:22 -070026
27/*
28 * Name the Board for the /proc/cpuinfo
29 */
Mike Frysinger066954a2007-10-21 22:36:06 +080030const char bfin_board_name[] = "Bluetechnix CM BF533";
Bryan Wu1394f032007-05-06 14:50:22 -070031
Steven Miaoc4a2c582014-04-12 02:07:27 +080032#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
Bryan Wu1394f032007-05-06 14:50:22 -070033/* all SPI peripherals info goes here */
Steven Miaoc4a2c582014-04-12 02:07:27 +080034#if IS_ENABLED(CONFIG_MTD_M25P80)
Bryan Wu1394f032007-05-06 14:50:22 -070035static struct mtd_partition bfin_spi_flash_partitions[] = {
36 {
Robin Getzaa582972008-08-05 17:47:29 +080037 .name = "bootloader(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070038 .size = 0x00020000,
39 .offset = 0,
40 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080041 }, {
Robin Getzaa582972008-08-05 17:47:29 +080042 .name = "linux kernel(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070043 .size = 0xe0000,
44 .offset = 0x20000
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080045 }, {
Robin Getzaa582972008-08-05 17:47:29 +080046 .name = "file system(spi)",
Bryan Wu1394f032007-05-06 14:50:22 -070047 .size = 0x700000,
48 .offset = 0x00100000,
49 }
50};
51
52static struct flash_platform_data bfin_spi_flash_data = {
53 .name = "m25p80",
54 .parts = bfin_spi_flash_partitions,
55 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
56 .type = "m25p64",
57};
58
59/* SPI flash chip (m25p64) */
60static struct bfin5xx_spi_chip spi_flash_chip_info = {
61 .enable_dma = 0, /* use dma transfer with this chip*/
Bryan Wu1394f032007-05-06 14:50:22 -070062};
63#endif
64
Steven Miaoc4a2c582014-04-12 02:07:27 +080065#if IS_ENABLED(CONFIG_MMC_SPI)
Michael Hennerichf3f704d2009-03-06 00:27:57 +080066static struct bfin5xx_spi_chip mmc_spi_chip_info = {
67 .enable_dma = 0,
Michael Hennericha15c2dc2007-10-29 17:31:18 +080068};
69#endif
70
Bryan Wu1394f032007-05-06 14:50:22 -070071static struct spi_board_info bfin_spi_board_info[] __initdata = {
Steven Miaoc4a2c582014-04-12 02:07:27 +080072#if IS_ENABLED(CONFIG_MTD_M25P80)
Bryan Wu1394f032007-05-06 14:50:22 -070073 {
74 /* the modalias must be the same as spi device driver name */
75 .modalias = "m25p80", /* Name of spi_driver for this device */
76 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080077 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -070078 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
79 .platform_data = &bfin_spi_flash_data,
80 .controller_data = &spi_flash_chip_info,
81 .mode = SPI_MODE_3,
Michael Hennericha15c2dc2007-10-29 17:31:18 +080082 },
83#endif
84
Steven Miaoc4a2c582014-04-12 02:07:27 +080085#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
Bryan Wu1394f032007-05-06 14:50:22 -070086 {
Barry Song7ba80062010-01-28 09:37:21 +000087 .modalias = "ad183x",
Bryan Wu1394f032007-05-06 14:50:22 -070088 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080089 .bus_num = 0,
Barry Song7ba80062010-01-28 09:37:21 +000090 .chip_select = 4,
Bryan Wu1394f032007-05-06 14:50:22 -070091 },
92#endif
Michael Hennericha15c2dc2007-10-29 17:31:18 +080093
Steven Miaoc4a2c582014-04-12 02:07:27 +080094#if IS_ENABLED(CONFIG_MMC_SPI)
Michael Hennericha15c2dc2007-10-29 17:31:18 +080095 {
Michael Hennerichf3f704d2009-03-06 00:27:57 +080096 .modalias = "mmc_spi",
Harald Krapfenbauer9c214532009-09-10 15:30:03 +000097 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
Michael Hennericha15c2dc2007-10-29 17:31:18 +080098 .bus_num = 0,
Harald Krapfenbauer9c214532009-09-10 15:30:03 +000099 .chip_select = 1,
Michael Hennerichf3f704d2009-03-06 00:27:57 +0800100 .controller_data = &mmc_spi_chip_info,
Michael Hennericha15c2dc2007-10-29 17:31:18 +0800101 .mode = SPI_MODE_3,
102 },
103#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700104};
105
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800106/* SPI (0) */
107static struct resource bfin_spi0_resource[] = {
108 [0] = {
109 .start = SPI0_REGBASE,
110 .end = SPI0_REGBASE + 0xFF,
111 .flags = IORESOURCE_MEM,
112 },
113 [1] = {
114 .start = CH_SPI,
115 .end = CH_SPI,
Yi Li53122692009-06-05 12:11:11 +0000116 .flags = IORESOURCE_DMA,
117 },
118 [2] = {
119 .start = IRQ_SPI,
120 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800121 .flags = IORESOURCE_IRQ,
122 }
123};
124
Bryan Wu1394f032007-05-06 14:50:22 -0700125/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800126static struct bfin5xx_spi_master bfin_spi0_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700127 .num_chipselect = 8,
128 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +0800129 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -0700130};
131
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800132static struct platform_device bfin_spi0_device = {
133 .name = "bfin-spi",
134 .id = 0, /* Bus number */
135 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
136 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -0700137 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800138 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -0700139 },
140};
141#endif /* spi master and devices */
142
Steven Miaoc4a2c582014-04-12 02:07:27 +0800143#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
Bryan Wu1394f032007-05-06 14:50:22 -0700144static struct platform_device rtc_device = {
145 .name = "rtc-bfin",
146 .id = -1,
147};
148#endif
149
Steven Miaoc4a2c582014-04-12 02:07:27 +0800150#if IS_ENABLED(CONFIG_SMC91X)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000151#include <linux/smc91x.h>
152
153static struct smc91x_platdata smc91x_info = {
154 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
155 .leda = RPC_LED_100_10,
156 .ledb = RPC_LED_TX_RX,
157};
158
Bryan Wu1394f032007-05-06 14:50:22 -0700159static struct resource smc91x_resources[] = {
160 {
161 .start = 0x20200300,
162 .end = 0x20200300 + 16,
163 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800164 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700165 .start = IRQ_PF0,
166 .end = IRQ_PF0,
167 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
168 },
169};
170static struct platform_device smc91x_device = {
171 .name = "smc91x",
172 .id = 0,
173 .num_resources = ARRAY_SIZE(smc91x_resources),
174 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000175 .dev = {
176 .platform_data = &smc91x_info,
177 },
Bryan Wu1394f032007-05-06 14:50:22 -0700178};
179#endif
180
Steven Miaoc4a2c582014-04-12 02:07:27 +0800181#if IS_ENABLED(CONFIG_SMSC911X)
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000182#include <linux/smsc911x.h>
183
184static struct resource smsc911x_resources[] = {
185 {
186 .name = "smsc911x-memory",
187 .start = 0x20308000,
188 .end = 0x20308000 + 0xFF,
189 .flags = IORESOURCE_MEM,
190 }, {
191 .start = IRQ_PF8,
192 .end = IRQ_PF8,
193 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
194 },
195};
196
197static struct smsc911x_platform_config smsc911x_config = {
198 .flags = SMSC911X_USE_16BIT,
199 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
200 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
201 .phy_interface = PHY_INTERFACE_MODE_MII,
202};
203
204static struct platform_device smsc911x_device = {
205 .name = "smsc911x",
206 .id = 0,
207 .num_resources = ARRAY_SIZE(smsc911x_resources),
208 .resource = smsc911x_resources,
209 .dev = {
210 .platform_data = &smsc911x_config,
211 },
212};
213#endif
214
Steven Miaoc4a2c582014-04-12 02:07:27 +0800215#if IS_ENABLED(CONFIG_SERIAL_BFIN)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000216#ifdef CONFIG_SERIAL_BFIN_UART0
217static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -0700218 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000219 .start = BFIN_UART_THR,
220 .end = BFIN_UART_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -0700221 .flags = IORESOURCE_MEM,
222 },
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000223 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800224 .start = IRQ_UART0_TX,
225 .end = IRQ_UART0_TX,
226 .flags = IORESOURCE_IRQ,
227 },
228 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000229 .start = IRQ_UART0_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800230 .end = IRQ_UART0_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000231 .flags = IORESOURCE_IRQ,
232 },
233 {
234 .start = IRQ_UART0_ERROR,
235 .end = IRQ_UART0_ERROR,
236 .flags = IORESOURCE_IRQ,
237 },
238 {
239 .start = CH_UART0_TX,
240 .end = CH_UART0_TX,
241 .flags = IORESOURCE_DMA,
242 },
243 {
244 .start = CH_UART0_RX,
245 .end = CH_UART0_RX,
246 .flags = IORESOURCE_DMA,
247 },
Bryan Wu1394f032007-05-06 14:50:22 -0700248};
249
Mike Frysingera8b19882010-11-24 09:23:04 +0000250static unsigned short bfin_uart0_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000251 P_UART0_TX, P_UART0_RX, 0
Bryan Wu1394f032007-05-06 14:50:22 -0700252};
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000253
254static struct platform_device bfin_uart0_device = {
255 .name = "bfin-uart",
256 .id = 0,
257 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
258 .resource = bfin_uart0_resources,
259 .dev = {
260 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
261 },
262};
263#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700264#endif
265
Steven Miaoc4a2c582014-04-12 02:07:27 +0800266#if IS_ENABLED(CONFIG_BFIN_SIR)
Graf Yang5be36d22008-04-25 03:09:15 +0800267#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800268static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800269 {
270 .start = 0xFFC00400,
271 .end = 0xFFC004FF,
272 .flags = IORESOURCE_MEM,
273 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800274 {
275 .start = IRQ_UART0_RX,
276 .end = IRQ_UART0_RX+1,
277 .flags = IORESOURCE_IRQ,
278 },
279 {
280 .start = CH_UART0_RX,
281 .end = CH_UART0_RX+1,
282 .flags = IORESOURCE_DMA,
283 },
Graf Yang5be36d22008-04-25 03:09:15 +0800284};
285
Graf Yang42bd8bc2009-01-07 23:14:39 +0800286static struct platform_device bfin_sir0_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800287 .name = "bfin_sir",
288 .id = 0,
Graf Yang42bd8bc2009-01-07 23:14:39 +0800289 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
290 .resource = bfin_sir0_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800291};
292#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800293#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800294
Steven Miaoc4a2c582014-04-12 02:07:27 +0800295#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
Sonic Zhangdf5de262009-09-23 05:01:56 +0000296#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
297static struct resource bfin_sport0_uart_resources[] = {
298 {
299 .start = SPORT0_TCR1,
300 .end = SPORT0_MRCS3+4,
301 .flags = IORESOURCE_MEM,
302 },
303 {
304 .start = IRQ_SPORT0_RX,
305 .end = IRQ_SPORT0_RX+1,
306 .flags = IORESOURCE_IRQ,
307 },
308 {
309 .start = IRQ_SPORT0_ERROR,
310 .end = IRQ_SPORT0_ERROR,
311 .flags = IORESOURCE_IRQ,
312 },
313};
314
Mike Frysingera8b19882010-11-24 09:23:04 +0000315static unsigned short bfin_sport0_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000316 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000317 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
Sonic Zhangdf5de262009-09-23 05:01:56 +0000318};
319
Bryan Wu1394f032007-05-06 14:50:22 -0700320static struct platform_device bfin_sport0_uart_device = {
321 .name = "bfin-sport-uart",
322 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +0000323 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
324 .resource = bfin_sport0_uart_resources,
325 .dev = {
326 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
327 },
328};
329#endif
330#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
331static struct resource bfin_sport1_uart_resources[] = {
332 {
333 .start = SPORT1_TCR1,
334 .end = SPORT1_MRCS3+4,
335 .flags = IORESOURCE_MEM,
336 },
337 {
338 .start = IRQ_SPORT1_RX,
339 .end = IRQ_SPORT1_RX+1,
340 .flags = IORESOURCE_IRQ,
341 },
342 {
343 .start = IRQ_SPORT1_ERROR,
344 .end = IRQ_SPORT1_ERROR,
345 .flags = IORESOURCE_IRQ,
346 },
347};
348
Mike Frysingera8b19882010-11-24 09:23:04 +0000349static unsigned short bfin_sport1_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000350 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000351 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
Bryan Wu1394f032007-05-06 14:50:22 -0700352};
353
354static struct platform_device bfin_sport1_uart_device = {
355 .name = "bfin-sport-uart",
356 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +0000357 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
358 .resource = bfin_sport1_uart_resources,
359 .dev = {
360 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
361 },
Bryan Wu1394f032007-05-06 14:50:22 -0700362};
363#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +0000364#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700365
Steven Miaoc4a2c582014-04-12 02:07:27 +0800366#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
Bryan Wu1394f032007-05-06 14:50:22 -0700367static struct resource isp1362_hcd_resources[] = {
368 {
369 .start = 0x20308000,
370 .end = 0x20308000,
371 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800372 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700373 .start = 0x20308004,
374 .end = 0x20308004,
375 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800376 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700377 .start = IRQ_PF4,
378 .end = IRQ_PF4,
Michael Hennerich9e758942010-03-18 12:51:49 +0000379 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
Bryan Wu1394f032007-05-06 14:50:22 -0700380 },
381};
382
383static struct isp1362_platform_data isp1362_priv = {
384 .sel15Kres = 1,
385 .clknotstop = 0,
386 .oc_enable = 0,
387 .int_act_high = 0,
388 .int_edge_triggered = 0,
389 .remote_wakeup_connected = 0,
390 .no_power_switching = 1,
391 .power_switching_mode = 0,
392};
393
394static struct platform_device isp1362_hcd_device = {
395 .name = "isp1362-hcd",
396 .id = 0,
397 .dev = {
398 .platform_data = &isp1362_priv,
399 },
400 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
401 .resource = isp1362_hcd_resources,
402};
403#endif
404
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000405
Steven Miaoc4a2c582014-04-12 02:07:27 +0800406#if IS_ENABLED(CONFIG_USB_NET2272)
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000407static struct resource net2272_bfin_resources[] = {
408 {
409 .start = 0x20300000,
410 .end = 0x20300000 + 0x100,
411 .flags = IORESOURCE_MEM,
412 }, {
413 .start = IRQ_PF6,
414 .end = IRQ_PF6,
415 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
416 },
417};
418
419static struct platform_device net2272_bfin_device = {
420 .name = "net2272",
421 .id = -1,
422 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
423 .resource = net2272_bfin_resources,
424};
425#endif
426
427
428
Steven Miaoc4a2c582014-04-12 02:07:27 +0800429#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000430static struct mtd_partition para_partitions[] = {
431 {
432 .name = "bootloader(nor)",
433 .size = 0x40000,
434 .offset = 0,
435 }, {
436 .name = "linux+rootfs(nor)",
437 .size = MTDPART_SIZ_FULL,
438 .offset = MTDPART_OFS_APPEND,
439 },
440};
441
442static struct physmap_flash_data para_flash_data = {
443 .width = 2,
444 .parts = para_partitions,
445 .nr_parts = ARRAY_SIZE(para_partitions),
446};
447
448static struct resource para_flash_resource = {
449 .start = 0x20000000,
450 .end = 0x201fffff,
451 .flags = IORESOURCE_MEM,
452};
453
454static struct platform_device para_flash_device = {
455 .name = "physmap-flash",
456 .id = 0,
457 .dev = {
458 .platform_data = &para_flash_data,
459 },
460 .num_resources = 1,
461 .resource = &para_flash_resource,
462};
463#endif
464
465
466
Michael Hennerich14b03202008-05-07 11:41:26 +0800467static const unsigned int cclk_vlev_datasheet[] =
468{
469 VRPAIR(VLEV_085, 250000000),
470 VRPAIR(VLEV_090, 376000000),
471 VRPAIR(VLEV_095, 426000000),
472 VRPAIR(VLEV_100, 426000000),
473 VRPAIR(VLEV_105, 476000000),
474 VRPAIR(VLEV_110, 476000000),
475 VRPAIR(VLEV_115, 476000000),
476 VRPAIR(VLEV_120, 600000000),
477 VRPAIR(VLEV_125, 600000000),
478 VRPAIR(VLEV_130, 600000000),
479};
480
481static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
482 .tuple_tab = cclk_vlev_datasheet,
483 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
484 .vr_settling_time = 25 /* us */,
485};
486
487static struct platform_device bfin_dpmc = {
488 .name = "bfin dpmc",
489 .dev = {
490 .platform_data = &bfin_dmpc_vreg_data,
491 },
492};
493
Bryan Wu1394f032007-05-06 14:50:22 -0700494static struct platform_device *cm_bf533_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +0800495
496 &bfin_dpmc,
497
Steven Miaoc4a2c582014-04-12 02:07:27 +0800498#if IS_ENABLED(CONFIG_SERIAL_BFIN)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000499#ifdef CONFIG_SERIAL_BFIN_UART0
500 &bfin_uart0_device,
501#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700502#endif
503
Steven Miaoc4a2c582014-04-12 02:07:27 +0800504#if IS_ENABLED(CONFIG_BFIN_SIR)
Graf Yang42bd8bc2009-01-07 23:14:39 +0800505#ifdef CONFIG_BFIN_SIR0
506 &bfin_sir0_device,
507#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800508#endif
509
Steven Miaoc4a2c582014-04-12 02:07:27 +0800510#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
Sonic Zhangdf5de262009-09-23 05:01:56 +0000511#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Bryan Wu1394f032007-05-06 14:50:22 -0700512 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +0000513#endif
514#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Bryan Wu1394f032007-05-06 14:50:22 -0700515 &bfin_sport1_uart_device,
516#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +0000517#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700518
Steven Miaoc4a2c582014-04-12 02:07:27 +0800519#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
Bryan Wu1394f032007-05-06 14:50:22 -0700520 &rtc_device,
521#endif
522
Steven Miaoc4a2c582014-04-12 02:07:27 +0800523#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
Bryan Wu1394f032007-05-06 14:50:22 -0700524 &isp1362_hcd_device,
525#endif
526
Steven Miaoc4a2c582014-04-12 02:07:27 +0800527#if IS_ENABLED(CONFIG_SMC91X)
Bryan Wu1394f032007-05-06 14:50:22 -0700528 &smc91x_device,
529#endif
530
Steven Miaoc4a2c582014-04-12 02:07:27 +0800531#if IS_ENABLED(CONFIG_SMSC911X)
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000532 &smsc911x_device,
533#endif
534
Steven Miaoc4a2c582014-04-12 02:07:27 +0800535#if IS_ENABLED(CONFIG_USB_NET2272)
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000536 &net2272_bfin_device,
537#endif
538
Steven Miaoc4a2c582014-04-12 02:07:27 +0800539#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800540 &bfin_spi0_device,
541#endif
Mike Frysingerc97618d2009-01-07 23:14:38 +0800542
Steven Miaoc4a2c582014-04-12 02:07:27 +0800543#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
Harald Krapfenbauer9c214532009-09-10 15:30:03 +0000544 &para_flash_device,
545#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700546};
547
548static int __init cm_bf533_init(void)
549{
Harvey Harrisonb85d8582008-04-23 09:39:01 +0800550 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu1394f032007-05-06 14:50:22 -0700551 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices));
Steven Miaoc4a2c582014-04-12 02:07:27 +0800552#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
Bryan Wu1394f032007-05-06 14:50:22 -0700553 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
554#endif
Bryan Wu1394f032007-05-06 14:50:22 -0700555 return 0;
556}
557
558arch_initcall(cm_bf533_init);
Sonic Zhangc13ce9f2009-09-23 09:37:46 +0000559
560static struct platform_device *cm_bf533_early_devices[] __initdata = {
561#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
562#ifdef CONFIG_SERIAL_BFIN_UART0
563 &bfin_uart0_device,
564#endif
565#endif
566
567#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
568#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
569 &bfin_sport0_uart_device,
570#endif
571#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
572 &bfin_sport1_uart_device,
573#endif
574#endif
575};
576
577void __init native_machine_early_platform_add_devices(void)
578{
579 printk(KERN_INFO "register early platform devices\n");
580 early_platform_add_devices(cm_bf533_early_devices,
581 ARRAY_SIZE(cm_bf533_early_devices));
582}