cm_bf548.c 16 KB

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