cm_bf548.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  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. #include <linux/device.h>
  31. #include <linux/platform_device.h>
  32. #include <linux/mtd/mtd.h>
  33. #include <linux/mtd/partitions.h>
  34. #include <linux/spi/spi.h>
  35. #include <linux/spi/flash.h>
  36. #include <linux/irq.h>
  37. #include <linux/interrupt.h>
  38. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  39. #include <linux/usb/musb.h>
  40. #endif
  41. #include <asm/bfin5xx_spi.h>
  42. #include <asm/cplb.h>
  43. #include <asm/dma.h>
  44. #include <asm/gpio.h>
  45. #include <asm/nand.h>
  46. #include <asm/portmux.h>
  47. #include <asm/mach/bf54x_keys.h>
  48. #include <asm/dpmc.h>
  49. #include <linux/input.h>
  50. #include <linux/spi/ad7877.h>
  51. /*
  52. * Name the Board for the /proc/cpuinfo
  53. */
  54. const char bfin_board_name[] = "Bluetechnix CM-BF548";
  55. /*
  56. * Driver needs to know address, irq and flag pin.
  57. */
  58. #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
  59. #include <asm/mach/bf54x-lq043.h>
  60. static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
  61. .width = 480,
  62. .height = 272,
  63. .xres = {480, 480, 480},
  64. .yres = {272, 272, 272},
  65. .bpp = {24, 24, 24},
  66. .disp = GPIO_PE3,
  67. };
  68. static struct resource bf54x_lq043_resources[] = {
  69. {
  70. .start = IRQ_EPPI0_ERR,
  71. .end = IRQ_EPPI0_ERR,
  72. .flags = IORESOURCE_IRQ,
  73. },
  74. };
  75. static struct platform_device bf54x_lq043_device = {
  76. .name = "bf54x-lq043",
  77. .id = -1,
  78. .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
  79. .resource = bf54x_lq043_resources,
  80. .dev = {
  81. .platform_data = &bf54x_lq043_data,
  82. },
  83. };
  84. #endif
  85. #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
  86. static unsigned int bf548_keymap[] = {
  87. KEYVAL(0, 0, KEY_ENTER),
  88. KEYVAL(0, 1, KEY_HELP),
  89. KEYVAL(0, 2, KEY_0),
  90. KEYVAL(0, 3, KEY_BACKSPACE),
  91. KEYVAL(1, 0, KEY_TAB),
  92. KEYVAL(1, 1, KEY_9),
  93. KEYVAL(1, 2, KEY_8),
  94. KEYVAL(1, 3, KEY_7),
  95. KEYVAL(2, 0, KEY_DOWN),
  96. KEYVAL(2, 1, KEY_6),
  97. KEYVAL(2, 2, KEY_5),
  98. KEYVAL(2, 3, KEY_4),
  99. KEYVAL(3, 0, KEY_UP),
  100. KEYVAL(3, 1, KEY_3),
  101. KEYVAL(3, 2, KEY_2),
  102. KEYVAL(3, 3, KEY_1),
  103. };
  104. static struct bfin_kpad_platform_data bf54x_kpad_data = {
  105. .rows = 4,
  106. .cols = 4,
  107. .keymap = bf548_keymap,
  108. .keymapsize = ARRAY_SIZE(bf548_keymap),
  109. .repeat = 0,
  110. .debounce_time = 5000, /* ns (5ms) */
  111. .coldrive_time = 1000, /* ns (1ms) */
  112. .keyup_test_interval = 50, /* ms (50ms) */
  113. };
  114. static struct resource bf54x_kpad_resources[] = {
  115. {
  116. .start = IRQ_KEY,
  117. .end = IRQ_KEY,
  118. .flags = IORESOURCE_IRQ,
  119. },
  120. };
  121. static struct platform_device bf54x_kpad_device = {
  122. .name = "bf54x-keys",
  123. .id = -1,
  124. .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
  125. .resource = bf54x_kpad_resources,
  126. .dev = {
  127. .platform_data = &bf54x_kpad_data,
  128. },
  129. };
  130. #endif
  131. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  132. static struct platform_device rtc_device = {
  133. .name = "rtc-bfin",
  134. .id = -1,
  135. };
  136. #endif
  137. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  138. static struct resource bfin_uart_resources[] = {
  139. #ifdef CONFIG_SERIAL_BFIN_UART0
  140. {
  141. .start = 0xFFC00400,
  142. .end = 0xFFC004FF,
  143. .flags = IORESOURCE_MEM,
  144. },
  145. #endif
  146. #ifdef CONFIG_SERIAL_BFIN_UART1
  147. {
  148. .start = 0xFFC02000,
  149. .end = 0xFFC020FF,
  150. .flags = IORESOURCE_MEM,
  151. },
  152. #endif
  153. #ifdef CONFIG_SERIAL_BFIN_UART2
  154. {
  155. .start = 0xFFC02100,
  156. .end = 0xFFC021FF,
  157. .flags = IORESOURCE_MEM,
  158. },
  159. #endif
  160. #ifdef CONFIG_SERIAL_BFIN_UART3
  161. {
  162. .start = 0xFFC03100,
  163. .end = 0xFFC031FF,
  164. },
  165. #endif
  166. };
  167. static struct platform_device bfin_uart_device = {
  168. .name = "bfin-uart",
  169. .id = 1,
  170. .num_resources = ARRAY_SIZE(bfin_uart_resources),
  171. .resource = bfin_uart_resources,
  172. };
  173. #endif
  174. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  175. static struct resource bfin_sir_resources[] = {
  176. #ifdef CONFIG_BFIN_SIR0
  177. {
  178. .start = 0xFFC00400,
  179. .end = 0xFFC004FF,
  180. .flags = IORESOURCE_MEM,
  181. },
  182. #endif
  183. #ifdef CONFIG_BFIN_SIR1
  184. {
  185. .start = 0xFFC02000,
  186. .end = 0xFFC020FF,
  187. .flags = IORESOURCE_MEM,
  188. },
  189. #endif
  190. #ifdef CONFIG_BFIN_SIR2
  191. {
  192. .start = 0xFFC02100,
  193. .end = 0xFFC021FF,
  194. .flags = IORESOURCE_MEM,
  195. },
  196. #endif
  197. #ifdef CONFIG_BFIN_SIR3
  198. {
  199. .start = 0xFFC03100,
  200. .end = 0xFFC031FF,
  201. .flags = IORESOURCE_MEM,
  202. },
  203. #endif
  204. };
  205. static struct platform_device bfin_sir_device = {
  206. .name = "bfin_sir",
  207. .id = 0,
  208. .num_resources = ARRAY_SIZE(bfin_sir_resources),
  209. .resource = bfin_sir_resources,
  210. };
  211. #endif
  212. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  213. static struct resource smsc911x_resources[] = {
  214. {
  215. .name = "smsc911x-memory",
  216. .start = 0x24000000,
  217. .end = 0x24000000 + 0xFF,
  218. .flags = IORESOURCE_MEM,
  219. },
  220. {
  221. .start = IRQ_PE6,
  222. .end = IRQ_PE6,
  223. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  224. },
  225. };
  226. static struct platform_device smsc911x_device = {
  227. .name = "smsc911x",
  228. .id = 0,
  229. .num_resources = ARRAY_SIZE(smsc911x_resources),
  230. .resource = smsc911x_resources,
  231. };
  232. #endif
  233. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  234. static struct resource musb_resources[] = {
  235. [0] = {
  236. .start = 0xFFC03C00,
  237. .end = 0xFFC040FF,
  238. .flags = IORESOURCE_MEM,
  239. },
  240. [1] = { /* general IRQ */
  241. .start = IRQ_USB_INT0,
  242. .end = IRQ_USB_INT0,
  243. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  244. },
  245. [2] = { /* DMA IRQ */
  246. .start = IRQ_USB_DMA,
  247. .end = IRQ_USB_DMA,
  248. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  249. },
  250. };
  251. static struct musb_hdrc_platform_data musb_plat = {
  252. #if defined(CONFIG_USB_MUSB_OTG)
  253. .mode = MUSB_OTG,
  254. #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
  255. .mode = MUSB_HOST,
  256. #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
  257. .mode = MUSB_PERIPHERAL,
  258. #endif
  259. .multipoint = 0,
  260. };
  261. static u64 musb_dmamask = ~(u32)0;
  262. static struct platform_device musb_device = {
  263. .name = "musb_hdrc",
  264. .id = 0,
  265. .dev = {
  266. .dma_mask = &musb_dmamask,
  267. .coherent_dma_mask = 0xffffffff,
  268. .platform_data = &musb_plat,
  269. },
  270. .num_resources = ARRAY_SIZE(musb_resources),
  271. .resource = musb_resources,
  272. };
  273. #endif
  274. #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
  275. static struct resource bfin_atapi_resources[] = {
  276. {
  277. .start = 0xFFC03800,
  278. .end = 0xFFC0386F,
  279. .flags = IORESOURCE_MEM,
  280. },
  281. {
  282. .start = IRQ_ATAPI_ERR,
  283. .end = IRQ_ATAPI_ERR,
  284. .flags = IORESOURCE_IRQ,
  285. },
  286. };
  287. static struct platform_device bfin_atapi_device = {
  288. .name = "pata-bf54x",
  289. .id = -1,
  290. .num_resources = ARRAY_SIZE(bfin_atapi_resources),
  291. .resource = bfin_atapi_resources,
  292. };
  293. #endif
  294. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  295. static struct mtd_partition partition_info[] = {
  296. {
  297. .name = "Linux Kernel",
  298. .offset = 0,
  299. .size = 4 * SIZE_1M,
  300. },
  301. {
  302. .name = "File System",
  303. .offset = 4 * SIZE_1M,
  304. .size = (256 - 4) * SIZE_1M,
  305. },
  306. };
  307. static struct bf5xx_nand_platform bf5xx_nand_platform = {
  308. .page_size = NFC_PG_SIZE_256,
  309. .data_width = NFC_NWIDTH_8,
  310. .partitions = partition_info,
  311. .nr_partitions = ARRAY_SIZE(partition_info),
  312. .rd_dly = 3,
  313. .wr_dly = 3,
  314. };
  315. static struct resource bf5xx_nand_resources[] = {
  316. {
  317. .start = 0xFFC03B00,
  318. .end = 0xFFC03B4F,
  319. .flags = IORESOURCE_MEM,
  320. },
  321. {
  322. .start = CH_NFC,
  323. .end = CH_NFC,
  324. .flags = IORESOURCE_IRQ,
  325. },
  326. };
  327. static struct platform_device bf5xx_nand_device = {
  328. .name = "bf5xx-nand",
  329. .id = 0,
  330. .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
  331. .resource = bf5xx_nand_resources,
  332. .dev = {
  333. .platform_data = &bf5xx_nand_platform,
  334. },
  335. };
  336. #endif
  337. #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
  338. static struct platform_device bf54x_sdh_device = {
  339. .name = "bfin-sdh",
  340. .id = 0,
  341. };
  342. #endif
  343. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  344. /* all SPI peripherals info goes here */
  345. #if defined(CONFIG_MTD_M25P80) \
  346. || defined(CONFIG_MTD_M25P80_MODULE)
  347. /* SPI flash chip (m25p16) */
  348. static struct mtd_partition bfin_spi_flash_partitions[] = {
  349. {
  350. .name = "bootloader",
  351. .size = 0x00040000,
  352. .offset = 0,
  353. .mask_flags = MTD_CAP_ROM
  354. }, {
  355. .name = "linux kernel",
  356. .size = 0x1c0000,
  357. .offset = 0x40000
  358. }
  359. };
  360. static struct flash_platform_data bfin_spi_flash_data = {
  361. .name = "m25p80",
  362. .parts = bfin_spi_flash_partitions,
  363. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  364. .type = "m25p16",
  365. };
  366. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  367. .enable_dma = 0, /* use dma transfer with this chip*/
  368. .bits_per_word = 8,
  369. .cs_change_per_word = 0,
  370. };
  371. #endif
  372. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  373. static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
  374. .cs_change_per_word = 0,
  375. .enable_dma = 0,
  376. .bits_per_word = 16,
  377. };
  378. static const struct ad7877_platform_data bfin_ad7877_ts_info = {
  379. .model = 7877,
  380. .vref_delay_usecs = 50, /* internal, no capacitor */
  381. .x_plate_ohms = 419,
  382. .y_plate_ohms = 486,
  383. .pressure_max = 1000,
  384. .pressure_min = 0,
  385. .stopacq_polarity = 1,
  386. .first_conversion_delay = 3,
  387. .acquisition_time = 1,
  388. .averaging = 1,
  389. .pen_down_acc_interval = 1,
  390. };
  391. #endif
  392. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  393. static struct bfin5xx_spi_chip spidev_chip_info = {
  394. .enable_dma = 0,
  395. .bits_per_word = 8,
  396. };
  397. #endif
  398. static struct spi_board_info bf54x_spi_board_info[] __initdata = {
  399. #if defined(CONFIG_MTD_M25P80) \
  400. || defined(CONFIG_MTD_M25P80_MODULE)
  401. {
  402. /* the modalias must be the same as spi device driver name */
  403. .modalias = "m25p80", /* Name of spi_driver for this device */
  404. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  405. .bus_num = 0, /* Framework bus number */
  406. .chip_select = 1, /* SPI_SSEL1*/
  407. .platform_data = &bfin_spi_flash_data,
  408. .controller_data = &spi_flash_chip_info,
  409. .mode = SPI_MODE_3,
  410. },
  411. #endif
  412. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  413. {
  414. .modalias = "ad7877",
  415. .platform_data = &bfin_ad7877_ts_info,
  416. .irq = IRQ_PJ11,
  417. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  418. .bus_num = 0,
  419. .chip_select = 2,
  420. .controller_data = &spi_ad7877_chip_info,
  421. },
  422. #endif
  423. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  424. {
  425. .modalias = "spidev",
  426. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  427. .bus_num = 0,
  428. .chip_select = 1,
  429. .controller_data = &spidev_chip_info,
  430. },
  431. #endif
  432. };
  433. /* SPI (0) */
  434. static struct resource bfin_spi0_resource[] = {
  435. [0] = {
  436. .start = SPI0_REGBASE,
  437. .end = SPI0_REGBASE + 0xFF,
  438. .flags = IORESOURCE_MEM,
  439. },
  440. [1] = {
  441. .start = CH_SPI0,
  442. .end = CH_SPI0,
  443. .flags = IORESOURCE_IRQ,
  444. }
  445. };
  446. /* SPI (1) */
  447. static struct resource bfin_spi1_resource[] = {
  448. [0] = {
  449. .start = SPI1_REGBASE,
  450. .end = SPI1_REGBASE + 0xFF,
  451. .flags = IORESOURCE_MEM,
  452. },
  453. [1] = {
  454. .start = CH_SPI1,
  455. .end = CH_SPI1,
  456. .flags = IORESOURCE_IRQ,
  457. }
  458. };
  459. /* SPI controller data */
  460. static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
  461. .num_chipselect = 8,
  462. .enable_dma = 1, /* master has the ability to do dma transfer */
  463. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  464. };
  465. static struct platform_device bf54x_spi_master0 = {
  466. .name = "bfin-spi",
  467. .id = 0, /* Bus number */
  468. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  469. .resource = bfin_spi0_resource,
  470. .dev = {
  471. .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
  472. },
  473. };
  474. static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
  475. .num_chipselect = 8,
  476. .enable_dma = 1, /* master has the ability to do dma transfer */
  477. .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
  478. };
  479. static struct platform_device bf54x_spi_master1 = {
  480. .name = "bfin-spi",
  481. .id = 1, /* Bus number */
  482. .num_resources = ARRAY_SIZE(bfin_spi1_resource),
  483. .resource = bfin_spi1_resource,
  484. .dev = {
  485. .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
  486. },
  487. };
  488. #endif /* spi master and devices */
  489. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  490. static struct resource bfin_twi0_resource[] = {
  491. [0] = {
  492. .start = TWI0_REGBASE,
  493. .end = TWI0_REGBASE + 0xFF,
  494. .flags = IORESOURCE_MEM,
  495. },
  496. [1] = {
  497. .start = IRQ_TWI0,
  498. .end = IRQ_TWI0,
  499. .flags = IORESOURCE_IRQ,
  500. },
  501. };
  502. static struct platform_device i2c_bfin_twi0_device = {
  503. .name = "i2c-bfin-twi",
  504. .id = 0,
  505. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  506. .resource = bfin_twi0_resource,
  507. };
  508. #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
  509. static struct resource bfin_twi1_resource[] = {
  510. [0] = {
  511. .start = TWI1_REGBASE,
  512. .end = TWI1_REGBASE + 0xFF,
  513. .flags = IORESOURCE_MEM,
  514. },
  515. [1] = {
  516. .start = IRQ_TWI1,
  517. .end = IRQ_TWI1,
  518. .flags = IORESOURCE_IRQ,
  519. },
  520. };
  521. static struct platform_device i2c_bfin_twi1_device = {
  522. .name = "i2c-bfin-twi",
  523. .id = 1,
  524. .num_resources = ARRAY_SIZE(bfin_twi1_resource),
  525. .resource = bfin_twi1_resource,
  526. };
  527. #endif
  528. #endif
  529. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  530. #include <linux/gpio_keys.h>
  531. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  532. {BTN_0, GPIO_PH7, 1, "gpio-keys: BTN0"},
  533. };
  534. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  535. .buttons = bfin_gpio_keys_table,
  536. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  537. };
  538. static struct platform_device bfin_device_gpiokeys = {
  539. .name = "gpio-keys",
  540. .dev = {
  541. .platform_data = &bfin_gpio_keys_data,
  542. },
  543. };
  544. #endif
  545. static const unsigned int cclk_vlev_datasheet[] =
  546. {
  547. /*
  548. * Internal VLEV BF54XSBBC1533
  549. ****temporarily using these values until data sheet is updated
  550. */
  551. VRPAIR(VLEV_085, 150000000),
  552. VRPAIR(VLEV_090, 250000000),
  553. VRPAIR(VLEV_110, 276000000),
  554. VRPAIR(VLEV_115, 301000000),
  555. VRPAIR(VLEV_120, 525000000),
  556. VRPAIR(VLEV_125, 550000000),
  557. VRPAIR(VLEV_130, 600000000),
  558. };
  559. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  560. .tuple_tab = cclk_vlev_datasheet,
  561. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  562. .vr_settling_time = 25 /* us */,
  563. };
  564. static struct platform_device bfin_dpmc = {
  565. .name = "bfin dpmc",
  566. .dev = {
  567. .platform_data = &bfin_dmpc_vreg_data,
  568. },
  569. };
  570. static struct platform_device *cm_bf548_devices[] __initdata = {
  571. &bfin_dpmc,
  572. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  573. &rtc_device,
  574. #endif
  575. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  576. &bfin_uart_device,
  577. #endif
  578. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  579. &bfin_sir_device,
  580. #endif
  581. #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
  582. &bf54x_lq043_device,
  583. #endif
  584. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  585. &smsc911x_device,
  586. #endif
  587. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  588. &musb_device,
  589. #endif
  590. #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
  591. &bfin_atapi_device,
  592. #endif
  593. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  594. &bf5xx_nand_device,
  595. #endif
  596. #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
  597. &bf54x_sdh_device,
  598. #endif
  599. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  600. &bf54x_spi_master0,
  601. &bf54x_spi_master1,
  602. #endif
  603. #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
  604. &bf54x_kpad_device,
  605. #endif
  606. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  607. /* &i2c_bfin_twi0_device, */
  608. #if !defined(CONFIG_BF542)
  609. &i2c_bfin_twi1_device,
  610. #endif
  611. #endif
  612. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  613. &bfin_device_gpiokeys,
  614. #endif
  615. };
  616. static int __init cm_bf548_init(void)
  617. {
  618. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  619. platform_add_devices(cm_bf548_devices, ARRAY_SIZE(cm_bf548_devices));
  620. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  621. spi_register_board_info(bf54x_spi_board_info,
  622. ARRAY_SIZE(bf54x_spi_board_info));
  623. #endif
  624. return 0;
  625. }
  626. arch_initcall(cm_bf548_init);