cm_bf537.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /*
  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. #include <linux/device.h>
  31. #include <linux/etherdevice.h>
  32. #include <linux/platform_device.h>
  33. #include <linux/mtd/mtd.h>
  34. #include <linux/mtd/partitions.h>
  35. #include <linux/mtd/physmap.h>
  36. #include <linux/spi/spi.h>
  37. #include <linux/spi/flash.h>
  38. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  39. #include <linux/usb/isp1362.h>
  40. #endif
  41. #include <linux/ata_platform.h>
  42. #include <linux/irq.h>
  43. #include <asm/dma.h>
  44. #include <asm/bfin5xx_spi.h>
  45. #include <asm/portmux.h>
  46. #include <asm/dpmc.h>
  47. /*
  48. * Name the Board for the /proc/cpuinfo
  49. */
  50. const char bfin_board_name[] = "Bluetechnix CM BF537";
  51. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  52. /* all SPI peripherals info goes here */
  53. #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
  54. static struct mtd_partition bfin_spi_flash_partitions[] = {
  55. {
  56. .name = "bootloader(spi)",
  57. .size = 0x00020000,
  58. .offset = 0,
  59. .mask_flags = MTD_CAP_ROM
  60. }, {
  61. .name = "linux kernel(spi)",
  62. .size = 0xe0000,
  63. .offset = 0x20000
  64. }, {
  65. .name = "file system(spi)",
  66. .size = 0x700000,
  67. .offset = 0x00100000,
  68. }
  69. };
  70. static struct flash_platform_data bfin_spi_flash_data = {
  71. .name = "m25p80",
  72. .parts = bfin_spi_flash_partitions,
  73. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  74. .type = "m25p64",
  75. };
  76. /* SPI flash chip (m25p64) */
  77. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  78. .enable_dma = 0, /* use dma transfer with this chip*/
  79. .bits_per_word = 8,
  80. };
  81. #endif
  82. #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  83. /* SPI ADC chip */
  84. static struct bfin5xx_spi_chip spi_adc_chip_info = {
  85. .enable_dma = 1, /* use dma transfer with this chip*/
  86. .bits_per_word = 16,
  87. };
  88. #endif
  89. #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
  90. static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
  91. .enable_dma = 0,
  92. .bits_per_word = 16,
  93. };
  94. #endif
  95. #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
  96. static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
  97. .enable_dma = 0,
  98. .bits_per_word = 16,
  99. };
  100. #endif
  101. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  102. static struct bfin5xx_spi_chip mmc_spi_chip_info = {
  103. .enable_dma = 0,
  104. .bits_per_word = 8,
  105. };
  106. #endif
  107. static struct spi_board_info bfin_spi_board_info[] __initdata = {
  108. #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
  109. {
  110. /* the modalias must be the same as spi device driver name */
  111. .modalias = "m25p80", /* Name of spi_driver for this device */
  112. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  113. .bus_num = 0, /* Framework bus number */
  114. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  115. .platform_data = &bfin_spi_flash_data,
  116. .controller_data = &spi_flash_chip_info,
  117. .mode = SPI_MODE_3,
  118. },
  119. #endif
  120. #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  121. {
  122. .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
  123. .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
  124. .bus_num = 0, /* Framework bus number */
  125. .chip_select = 1, /* Framework chip select. */
  126. .platform_data = NULL, /* No spi_driver specific config */
  127. .controller_data = &spi_adc_chip_info,
  128. },
  129. #endif
  130. #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
  131. {
  132. .modalias = "ad1836-spi",
  133. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  134. .bus_num = 0,
  135. .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
  136. .controller_data = &ad1836_spi_chip_info,
  137. },
  138. #endif
  139. #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
  140. {
  141. .modalias = "ad9960-spi",
  142. .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
  143. .bus_num = 0,
  144. .chip_select = 1,
  145. .controller_data = &ad9960_spi_chip_info,
  146. },
  147. #endif
  148. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  149. {
  150. .modalias = "mmc_spi",
  151. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  152. .bus_num = 0,
  153. .chip_select = 1,
  154. .controller_data = &mmc_spi_chip_info,
  155. .mode = SPI_MODE_3,
  156. },
  157. #endif
  158. };
  159. /* SPI (0) */
  160. static struct resource bfin_spi0_resource[] = {
  161. [0] = {
  162. .start = SPI0_REGBASE,
  163. .end = SPI0_REGBASE + 0xFF,
  164. .flags = IORESOURCE_MEM,
  165. },
  166. [1] = {
  167. .start = CH_SPI,
  168. .end = CH_SPI,
  169. .flags = IORESOURCE_DMA,
  170. },
  171. [2] = {
  172. .start = IRQ_SPI,
  173. .end = IRQ_SPI,
  174. .flags = IORESOURCE_IRQ,
  175. },
  176. };
  177. /* SPI controller data */
  178. static struct bfin5xx_spi_master bfin_spi0_info = {
  179. .num_chipselect = 8,
  180. .enable_dma = 1, /* master has the ability to do dma transfer */
  181. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  182. };
  183. static struct platform_device bfin_spi0_device = {
  184. .name = "bfin-spi",
  185. .id = 0, /* Bus number */
  186. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  187. .resource = bfin_spi0_resource,
  188. .dev = {
  189. .platform_data = &bfin_spi0_info, /* Passed to driver */
  190. },
  191. };
  192. #endif /* spi master and devices */
  193. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  194. static struct platform_device rtc_device = {
  195. .name = "rtc-bfin",
  196. .id = -1,
  197. };
  198. #endif
  199. #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
  200. static struct platform_device hitachi_fb_device = {
  201. .name = "hitachi-tx09",
  202. };
  203. #endif
  204. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  205. #include <linux/smc91x.h>
  206. static struct smc91x_platdata smc91x_info = {
  207. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  208. .leda = RPC_LED_100_10,
  209. .ledb = RPC_LED_TX_RX,
  210. };
  211. static struct resource smc91x_resources[] = {
  212. {
  213. .start = 0x20200300,
  214. .end = 0x20200300 + 16,
  215. .flags = IORESOURCE_MEM,
  216. }, {
  217. .start = IRQ_PF14,
  218. .end = IRQ_PF14,
  219. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  220. },
  221. };
  222. static struct platform_device smc91x_device = {
  223. .name = "smc91x",
  224. .id = 0,
  225. .num_resources = ARRAY_SIZE(smc91x_resources),
  226. .resource = smc91x_resources,
  227. .dev = {
  228. .platform_data = &smc91x_info,
  229. },
  230. };
  231. #endif
  232. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  233. static struct resource isp1362_hcd_resources[] = {
  234. {
  235. .start = 0x20308000,
  236. .end = 0x20308000,
  237. .flags = IORESOURCE_MEM,
  238. }, {
  239. .start = 0x20308004,
  240. .end = 0x20308004,
  241. .flags = IORESOURCE_MEM,
  242. }, {
  243. .start = IRQ_PG15,
  244. .end = IRQ_PG15,
  245. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  246. },
  247. };
  248. static struct isp1362_platform_data isp1362_priv = {
  249. .sel15Kres = 1,
  250. .clknotstop = 0,
  251. .oc_enable = 0,
  252. .int_act_high = 0,
  253. .int_edge_triggered = 0,
  254. .remote_wakeup_connected = 0,
  255. .no_power_switching = 1,
  256. .power_switching_mode = 0,
  257. };
  258. static struct platform_device isp1362_hcd_device = {
  259. .name = "isp1362-hcd",
  260. .id = 0,
  261. .dev = {
  262. .platform_data = &isp1362_priv,
  263. },
  264. .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
  265. .resource = isp1362_hcd_resources,
  266. };
  267. #endif
  268. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  269. static struct resource net2272_bfin_resources[] = {
  270. {
  271. .start = 0x20200000,
  272. .end = 0x20200000 + 0x100,
  273. .flags = IORESOURCE_MEM,
  274. }, {
  275. .start = IRQ_PH14,
  276. .end = IRQ_PH14,
  277. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  278. },
  279. };
  280. static struct platform_device net2272_bfin_device = {
  281. .name = "net2272",
  282. .id = -1,
  283. .num_resources = ARRAY_SIZE(net2272_bfin_resources),
  284. .resource = net2272_bfin_resources,
  285. };
  286. #endif
  287. static struct resource bfin_gpios_resources = {
  288. .start = 0,
  289. .end = MAX_BLACKFIN_GPIOS - 1,
  290. .flags = IORESOURCE_IRQ,
  291. };
  292. static struct platform_device bfin_gpios_device = {
  293. .name = "simple-gpio",
  294. .id = -1,
  295. .num_resources = 1,
  296. .resource = &bfin_gpios_resources,
  297. };
  298. #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
  299. static struct mtd_partition cm_partitions[] = {
  300. {
  301. .name = "bootloader(nor)",
  302. .size = 0x40000,
  303. .offset = 0,
  304. }, {
  305. .name = "linux kernel(nor)",
  306. .size = 0xE0000,
  307. .offset = MTDPART_OFS_APPEND,
  308. }, {
  309. .name = "file system(nor)",
  310. .size = MTDPART_SIZ_FULL,
  311. .offset = MTDPART_OFS_APPEND,
  312. }
  313. };
  314. static struct physmap_flash_data cm_flash_data = {
  315. .width = 2,
  316. .parts = cm_partitions,
  317. .nr_parts = ARRAY_SIZE(cm_partitions),
  318. };
  319. static unsigned cm_flash_gpios[] = { GPIO_PF4 };
  320. static struct resource cm_flash_resource[] = {
  321. {
  322. .name = "cfi_probe",
  323. .start = 0x20000000,
  324. .end = 0x201fffff,
  325. .flags = IORESOURCE_MEM,
  326. }, {
  327. .start = (unsigned long)cm_flash_gpios,
  328. .end = ARRAY_SIZE(cm_flash_gpios),
  329. .flags = IORESOURCE_IRQ,
  330. }
  331. };
  332. static struct platform_device cm_flash_device = {
  333. .name = "gpio-addr-flash",
  334. .id = 0,
  335. .dev = {
  336. .platform_data = &cm_flash_data,
  337. },
  338. .num_resources = ARRAY_SIZE(cm_flash_resource),
  339. .resource = cm_flash_resource,
  340. };
  341. #endif
  342. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  343. static struct resource bfin_uart_resources[] = {
  344. {
  345. .start = 0xFFC00400,
  346. .end = 0xFFC004FF,
  347. .flags = IORESOURCE_MEM,
  348. }, {
  349. .start = 0xFFC02000,
  350. .end = 0xFFC020FF,
  351. .flags = IORESOURCE_MEM,
  352. },
  353. };
  354. static struct platform_device bfin_uart_device = {
  355. .name = "bfin-uart",
  356. .id = 1,
  357. .num_resources = ARRAY_SIZE(bfin_uart_resources),
  358. .resource = bfin_uart_resources,
  359. };
  360. #endif
  361. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  362. #ifdef CONFIG_BFIN_SIR0
  363. static struct resource bfin_sir0_resources[] = {
  364. {
  365. .start = 0xFFC00400,
  366. .end = 0xFFC004FF,
  367. .flags = IORESOURCE_MEM,
  368. },
  369. {
  370. .start = IRQ_UART0_RX,
  371. .end = IRQ_UART0_RX+1,
  372. .flags = IORESOURCE_IRQ,
  373. },
  374. {
  375. .start = CH_UART0_RX,
  376. .end = CH_UART0_RX+1,
  377. .flags = IORESOURCE_DMA,
  378. },
  379. };
  380. static struct platform_device bfin_sir0_device = {
  381. .name = "bfin_sir",
  382. .id = 0,
  383. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  384. .resource = bfin_sir0_resources,
  385. };
  386. #endif
  387. #ifdef CONFIG_BFIN_SIR1
  388. static struct resource bfin_sir1_resources[] = {
  389. {
  390. .start = 0xFFC02000,
  391. .end = 0xFFC020FF,
  392. .flags = IORESOURCE_MEM,
  393. },
  394. {
  395. .start = IRQ_UART1_RX,
  396. .end = IRQ_UART1_RX+1,
  397. .flags = IORESOURCE_IRQ,
  398. },
  399. {
  400. .start = CH_UART1_RX,
  401. .end = CH_UART1_RX+1,
  402. .flags = IORESOURCE_DMA,
  403. },
  404. };
  405. static struct platform_device bfin_sir1_device = {
  406. .name = "bfin_sir",
  407. .id = 1,
  408. .num_resources = ARRAY_SIZE(bfin_sir1_resources),
  409. .resource = bfin_sir1_resources,
  410. };
  411. #endif
  412. #endif
  413. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  414. static struct resource bfin_twi0_resource[] = {
  415. [0] = {
  416. .start = TWI0_REGBASE,
  417. .end = TWI0_REGBASE,
  418. .flags = IORESOURCE_MEM,
  419. },
  420. [1] = {
  421. .start = IRQ_TWI,
  422. .end = IRQ_TWI,
  423. .flags = IORESOURCE_IRQ,
  424. },
  425. };
  426. static struct platform_device i2c_bfin_twi_device = {
  427. .name = "i2c-bfin-twi",
  428. .id = 0,
  429. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  430. .resource = bfin_twi0_resource,
  431. };
  432. #endif
  433. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  434. static struct platform_device bfin_sport0_uart_device = {
  435. .name = "bfin-sport-uart",
  436. .id = 0,
  437. };
  438. static struct platform_device bfin_sport1_uart_device = {
  439. .name = "bfin-sport-uart",
  440. .id = 1,
  441. };
  442. #endif
  443. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  444. static struct platform_device bfin_mii_bus = {
  445. .name = "bfin_mii_bus",
  446. };
  447. static struct platform_device bfin_mac_device = {
  448. .name = "bfin_mac",
  449. .dev.platform_data = &bfin_mii_bus,
  450. };
  451. #endif
  452. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  453. #define PATA_INT IRQ_PF14
  454. static struct pata_platform_info bfin_pata_platform_data = {
  455. .ioport_shift = 2,
  456. .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
  457. };
  458. static struct resource bfin_pata_resources[] = {
  459. {
  460. .start = 0x2030C000,
  461. .end = 0x2030C01F,
  462. .flags = IORESOURCE_MEM,
  463. },
  464. {
  465. .start = 0x2030D018,
  466. .end = 0x2030D01B,
  467. .flags = IORESOURCE_MEM,
  468. },
  469. {
  470. .start = PATA_INT,
  471. .end = PATA_INT,
  472. .flags = IORESOURCE_IRQ,
  473. },
  474. };
  475. static struct platform_device bfin_pata_device = {
  476. .name = "pata_platform",
  477. .id = -1,
  478. .num_resources = ARRAY_SIZE(bfin_pata_resources),
  479. .resource = bfin_pata_resources,
  480. .dev = {
  481. .platform_data = &bfin_pata_platform_data,
  482. }
  483. };
  484. #endif
  485. static const unsigned int cclk_vlev_datasheet[] =
  486. {
  487. VRPAIR(VLEV_085, 250000000),
  488. VRPAIR(VLEV_090, 376000000),
  489. VRPAIR(VLEV_095, 426000000),
  490. VRPAIR(VLEV_100, 426000000),
  491. VRPAIR(VLEV_105, 476000000),
  492. VRPAIR(VLEV_110, 476000000),
  493. VRPAIR(VLEV_115, 476000000),
  494. VRPAIR(VLEV_120, 500000000),
  495. VRPAIR(VLEV_125, 533000000),
  496. VRPAIR(VLEV_130, 600000000),
  497. };
  498. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  499. .tuple_tab = cclk_vlev_datasheet,
  500. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  501. .vr_settling_time = 25 /* us */,
  502. };
  503. static struct platform_device bfin_dpmc = {
  504. .name = "bfin dpmc",
  505. .dev = {
  506. .platform_data = &bfin_dmpc_vreg_data,
  507. },
  508. };
  509. static struct platform_device *cm_bf537_devices[] __initdata = {
  510. &bfin_dpmc,
  511. #if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
  512. &hitachi_fb_device,
  513. #endif
  514. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  515. &rtc_device,
  516. #endif
  517. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  518. &bfin_uart_device,
  519. #endif
  520. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  521. #ifdef CONFIG_BFIN_SIR0
  522. &bfin_sir0_device,
  523. #endif
  524. #ifdef CONFIG_BFIN_SIR1
  525. &bfin_sir1_device,
  526. #endif
  527. #endif
  528. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  529. &i2c_bfin_twi_device,
  530. #endif
  531. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  532. &bfin_sport0_uart_device,
  533. &bfin_sport1_uart_device,
  534. #endif
  535. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  536. &isp1362_hcd_device,
  537. #endif
  538. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  539. &smc91x_device,
  540. #endif
  541. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  542. &bfin_mii_bus,
  543. &bfin_mac_device,
  544. #endif
  545. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  546. &net2272_bfin_device,
  547. #endif
  548. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  549. &bfin_spi0_device,
  550. #endif
  551. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  552. &bfin_pata_device,
  553. #endif
  554. #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
  555. &cm_flash_device,
  556. #endif
  557. &bfin_gpios_device,
  558. };
  559. static int __init cm_bf537_init(void)
  560. {
  561. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  562. platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
  563. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  564. spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
  565. #endif
  566. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  567. irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
  568. #endif
  569. return 0;
  570. }
  571. arch_initcall(cm_bf537_init);
  572. void bfin_get_ether_addr(char *addr)
  573. {
  574. random_ether_addr(addr);
  575. printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
  576. }
  577. EXPORT_SYMBOL(bfin_get_ether_addr);