cm_bf548.c 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261
  1. /*
  2. * Copyright 2004-2009 Analog Devices Inc.
  3. * 2008-2009 Bluetechnix
  4. * 2005 National ICT Australia (NICTA)
  5. * Aidan Williams <aidan@nicta.com.au>
  6. *
  7. * Licensed under the GPL-2 or later.
  8. */
  9. #include <linux/device.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/mtd/mtd.h>
  12. #include <linux/mtd/partitions.h>
  13. #include <linux/mtd/physmap.h>
  14. #include <linux/spi/spi.h>
  15. #include <linux/spi/flash.h>
  16. #include <linux/irq.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/usb/musb.h>
  19. #include <asm/bfin5xx_spi.h>
  20. #include <asm/dma.h>
  21. #include <asm/gpio.h>
  22. #include <asm/nand.h>
  23. #include <asm/portmux.h>
  24. #include <asm/bfin_sdh.h>
  25. #include <mach/bf54x_keys.h>
  26. #include <asm/dpmc.h>
  27. #include <linux/input.h>
  28. #include <linux/spi/ad7877.h>
  29. /*
  30. * Name the Board for the /proc/cpuinfo
  31. */
  32. const char bfin_board_name[] = "Bluetechnix CM-BF548";
  33. /*
  34. * Driver needs to know address, irq and flag pin.
  35. */
  36. #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
  37. #include <mach/bf54x-lq043.h>
  38. static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
  39. .width = 480,
  40. .height = 272,
  41. .xres = {480, 480, 480},
  42. .yres = {272, 272, 272},
  43. .bpp = {24, 24, 24},
  44. .disp = GPIO_PE3,
  45. };
  46. static struct resource bf54x_lq043_resources[] = {
  47. {
  48. .start = IRQ_EPPI0_ERR,
  49. .end = IRQ_EPPI0_ERR,
  50. .flags = IORESOURCE_IRQ,
  51. },
  52. };
  53. static struct platform_device bf54x_lq043_device = {
  54. .name = "bf54x-lq043",
  55. .id = -1,
  56. .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
  57. .resource = bf54x_lq043_resources,
  58. .dev = {
  59. .platform_data = &bf54x_lq043_data,
  60. },
  61. };
  62. #endif
  63. #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
  64. static unsigned int bf548_keymap[] = {
  65. KEYVAL(0, 0, KEY_ENTER),
  66. KEYVAL(0, 1, KEY_HELP),
  67. KEYVAL(0, 2, KEY_0),
  68. KEYVAL(0, 3, KEY_BACKSPACE),
  69. KEYVAL(1, 0, KEY_TAB),
  70. KEYVAL(1, 1, KEY_9),
  71. KEYVAL(1, 2, KEY_8),
  72. KEYVAL(1, 3, KEY_7),
  73. KEYVAL(2, 0, KEY_DOWN),
  74. KEYVAL(2, 1, KEY_6),
  75. KEYVAL(2, 2, KEY_5),
  76. KEYVAL(2, 3, KEY_4),
  77. KEYVAL(3, 0, KEY_UP),
  78. KEYVAL(3, 1, KEY_3),
  79. KEYVAL(3, 2, KEY_2),
  80. KEYVAL(3, 3, KEY_1),
  81. };
  82. static struct bfin_kpad_platform_data bf54x_kpad_data = {
  83. .rows = 4,
  84. .cols = 4,
  85. .keymap = bf548_keymap,
  86. .keymapsize = ARRAY_SIZE(bf548_keymap),
  87. .repeat = 0,
  88. .debounce_time = 5000, /* ns (5ms) */
  89. .coldrive_time = 1000, /* ns (1ms) */
  90. .keyup_test_interval = 50, /* ms (50ms) */
  91. };
  92. static struct resource bf54x_kpad_resources[] = {
  93. {
  94. .start = IRQ_KEY,
  95. .end = IRQ_KEY,
  96. .flags = IORESOURCE_IRQ,
  97. },
  98. };
  99. static struct platform_device bf54x_kpad_device = {
  100. .name = "bf54x-keys",
  101. .id = -1,
  102. .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
  103. .resource = bf54x_kpad_resources,
  104. .dev = {
  105. .platform_data = &bf54x_kpad_data,
  106. },
  107. };
  108. #endif
  109. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  110. static struct platform_device rtc_device = {
  111. .name = "rtc-bfin",
  112. .id = -1,
  113. };
  114. #endif
  115. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  116. #ifdef CONFIG_SERIAL_BFIN_UART0
  117. static struct resource bfin_uart0_resources[] = {
  118. {
  119. .start = UART0_DLL,
  120. .end = UART0_RBR+2,
  121. .flags = IORESOURCE_MEM,
  122. },
  123. {
  124. .start = IRQ_UART0_TX,
  125. .end = IRQ_UART0_TX,
  126. .flags = IORESOURCE_IRQ,
  127. },
  128. {
  129. .start = IRQ_UART0_RX,
  130. .end = IRQ_UART0_RX,
  131. .flags = IORESOURCE_IRQ,
  132. },
  133. {
  134. .start = IRQ_UART0_ERROR,
  135. .end = IRQ_UART0_ERROR,
  136. .flags = IORESOURCE_IRQ,
  137. },
  138. {
  139. .start = CH_UART0_TX,
  140. .end = CH_UART0_TX,
  141. .flags = IORESOURCE_DMA,
  142. },
  143. {
  144. .start = CH_UART0_RX,
  145. .end = CH_UART0_RX,
  146. .flags = IORESOURCE_DMA,
  147. },
  148. };
  149. static unsigned short bfin_uart0_peripherals[] = {
  150. P_UART0_TX, P_UART0_RX, 0
  151. };
  152. static struct platform_device bfin_uart0_device = {
  153. .name = "bfin-uart",
  154. .id = 0,
  155. .num_resources = ARRAY_SIZE(bfin_uart0_resources),
  156. .resource = bfin_uart0_resources,
  157. .dev = {
  158. .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
  159. },
  160. };
  161. #endif
  162. #ifdef CONFIG_SERIAL_BFIN_UART1
  163. static struct resource bfin_uart1_resources[] = {
  164. {
  165. .start = UART1_DLL,
  166. .end = UART1_RBR+2,
  167. .flags = IORESOURCE_MEM,
  168. },
  169. {
  170. .start = IRQ_UART1_TX,
  171. .end = IRQ_UART1_TX,
  172. .flags = IORESOURCE_IRQ,
  173. },
  174. {
  175. .start = IRQ_UART1_RX,
  176. .end = IRQ_UART1_RX,
  177. .flags = IORESOURCE_IRQ,
  178. },
  179. {
  180. .start = IRQ_UART1_ERROR,
  181. .end = IRQ_UART1_ERROR,
  182. .flags = IORESOURCE_IRQ,
  183. },
  184. {
  185. .start = CH_UART1_TX,
  186. .end = CH_UART1_TX,
  187. .flags = IORESOURCE_DMA,
  188. },
  189. {
  190. .start = CH_UART1_RX,
  191. .end = CH_UART1_RX,
  192. .flags = IORESOURCE_DMA,
  193. },
  194. #ifdef CONFIG_BFIN_UART1_CTSRTS
  195. { /* CTS pin -- 0 means not supported */
  196. .start = GPIO_PE10,
  197. .end = GPIO_PE10,
  198. .flags = IORESOURCE_IO,
  199. },
  200. { /* RTS pin -- 0 means not supported */
  201. .start = GPIO_PE9,
  202. .end = GPIO_PE9,
  203. .flags = IORESOURCE_IO,
  204. },
  205. #endif
  206. };
  207. static unsigned short bfin_uart1_peripherals[] = {
  208. P_UART1_TX, P_UART1_RX,
  209. #ifdef CONFIG_BFIN_UART1_CTSRTS
  210. P_UART1_RTS, P_UART1_CTS,
  211. #endif
  212. 0
  213. };
  214. static struct platform_device bfin_uart1_device = {
  215. .name = "bfin-uart",
  216. .id = 1,
  217. .num_resources = ARRAY_SIZE(bfin_uart1_resources),
  218. .resource = bfin_uart1_resources,
  219. .dev = {
  220. .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
  221. },
  222. };
  223. #endif
  224. #ifdef CONFIG_SERIAL_BFIN_UART2
  225. static struct resource bfin_uart2_resources[] = {
  226. {
  227. .start = UART2_DLL,
  228. .end = UART2_RBR+2,
  229. .flags = IORESOURCE_MEM,
  230. },
  231. {
  232. .start = IRQ_UART2_TX,
  233. .end = IRQ_UART2_TX,
  234. .flags = IORESOURCE_IRQ,
  235. },
  236. {
  237. .start = IRQ_UART2_RX,
  238. .end = IRQ_UART2_RX,
  239. .flags = IORESOURCE_IRQ,
  240. },
  241. {
  242. .start = IRQ_UART2_ERROR,
  243. .end = IRQ_UART2_ERROR,
  244. .flags = IORESOURCE_IRQ,
  245. },
  246. {
  247. .start = CH_UART2_TX,
  248. .end = CH_UART2_TX,
  249. .flags = IORESOURCE_DMA,
  250. },
  251. {
  252. .start = CH_UART2_RX,
  253. .end = CH_UART2_RX,
  254. .flags = IORESOURCE_DMA,
  255. },
  256. };
  257. static unsigned short bfin_uart2_peripherals[] = {
  258. P_UART2_TX, P_UART2_RX, 0
  259. };
  260. static struct platform_device bfin_uart2_device = {
  261. .name = "bfin-uart",
  262. .id = 2,
  263. .num_resources = ARRAY_SIZE(bfin_uart2_resources),
  264. .resource = bfin_uart2_resources,
  265. .dev = {
  266. .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
  267. },
  268. };
  269. #endif
  270. #ifdef CONFIG_SERIAL_BFIN_UART3
  271. static struct resource bfin_uart3_resources[] = {
  272. {
  273. .start = UART3_DLL,
  274. .end = UART3_RBR+2,
  275. .flags = IORESOURCE_MEM,
  276. },
  277. {
  278. .start = IRQ_UART3_TX,
  279. .end = IRQ_UART3_TX,
  280. .flags = IORESOURCE_IRQ,
  281. },
  282. {
  283. .start = IRQ_UART3_RX,
  284. .end = IRQ_UART3_RX,
  285. .flags = IORESOURCE_IRQ,
  286. },
  287. {
  288. .start = IRQ_UART3_ERROR,
  289. .end = IRQ_UART3_ERROR,
  290. .flags = IORESOURCE_IRQ,
  291. },
  292. {
  293. .start = CH_UART3_TX,
  294. .end = CH_UART3_TX,
  295. .flags = IORESOURCE_DMA,
  296. },
  297. {
  298. .start = CH_UART3_RX,
  299. .end = CH_UART3_RX,
  300. .flags = IORESOURCE_DMA,
  301. },
  302. #ifdef CONFIG_BFIN_UART3_CTSRTS
  303. { /* CTS pin -- 0 means not supported */
  304. .start = GPIO_PB3,
  305. .end = GPIO_PB3,
  306. .flags = IORESOURCE_IO,
  307. },
  308. { /* RTS pin -- 0 means not supported */
  309. .start = GPIO_PB2,
  310. .end = GPIO_PB2,
  311. .flags = IORESOURCE_IO,
  312. },
  313. #endif
  314. };
  315. static unsigned short bfin_uart3_peripherals[] = {
  316. P_UART3_TX, P_UART3_RX,
  317. #ifdef CONFIG_BFIN_UART3_CTSRTS
  318. P_UART3_RTS, P_UART3_CTS,
  319. #endif
  320. 0
  321. };
  322. static struct platform_device bfin_uart3_device = {
  323. .name = "bfin-uart",
  324. .id = 3,
  325. .num_resources = ARRAY_SIZE(bfin_uart3_resources),
  326. .resource = bfin_uart3_resources,
  327. .dev = {
  328. .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
  329. },
  330. };
  331. #endif
  332. #endif
  333. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  334. #ifdef CONFIG_BFIN_SIR0
  335. static struct resource bfin_sir0_resources[] = {
  336. {
  337. .start = 0xFFC00400,
  338. .end = 0xFFC004FF,
  339. .flags = IORESOURCE_MEM,
  340. },
  341. {
  342. .start = IRQ_UART0_RX,
  343. .end = IRQ_UART0_RX+1,
  344. .flags = IORESOURCE_IRQ,
  345. },
  346. {
  347. .start = CH_UART0_RX,
  348. .end = CH_UART0_RX+1,
  349. .flags = IORESOURCE_DMA,
  350. },
  351. };
  352. static struct platform_device bfin_sir0_device = {
  353. .name = "bfin_sir",
  354. .id = 0,
  355. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  356. .resource = bfin_sir0_resources,
  357. };
  358. #endif
  359. #ifdef CONFIG_BFIN_SIR1
  360. static struct resource bfin_sir1_resources[] = {
  361. {
  362. .start = 0xFFC02000,
  363. .end = 0xFFC020FF,
  364. .flags = IORESOURCE_MEM,
  365. },
  366. {
  367. .start = IRQ_UART1_RX,
  368. .end = IRQ_UART1_RX+1,
  369. .flags = IORESOURCE_IRQ,
  370. },
  371. {
  372. .start = CH_UART1_RX,
  373. .end = CH_UART1_RX+1,
  374. .flags = IORESOURCE_DMA,
  375. },
  376. };
  377. static struct platform_device bfin_sir1_device = {
  378. .name = "bfin_sir",
  379. .id = 1,
  380. .num_resources = ARRAY_SIZE(bfin_sir1_resources),
  381. .resource = bfin_sir1_resources,
  382. };
  383. #endif
  384. #ifdef CONFIG_BFIN_SIR2
  385. static struct resource bfin_sir2_resources[] = {
  386. {
  387. .start = 0xFFC02100,
  388. .end = 0xFFC021FF,
  389. .flags = IORESOURCE_MEM,
  390. },
  391. {
  392. .start = IRQ_UART2_RX,
  393. .end = IRQ_UART2_RX+1,
  394. .flags = IORESOURCE_IRQ,
  395. },
  396. {
  397. .start = CH_UART2_RX,
  398. .end = CH_UART2_RX+1,
  399. .flags = IORESOURCE_DMA,
  400. },
  401. };
  402. static struct platform_device bfin_sir2_device = {
  403. .name = "bfin_sir",
  404. .id = 2,
  405. .num_resources = ARRAY_SIZE(bfin_sir2_resources),
  406. .resource = bfin_sir2_resources,
  407. };
  408. #endif
  409. #ifdef CONFIG_BFIN_SIR3
  410. static struct resource bfin_sir3_resources[] = {
  411. {
  412. .start = 0xFFC03100,
  413. .end = 0xFFC031FF,
  414. .flags = IORESOURCE_MEM,
  415. },
  416. {
  417. .start = IRQ_UART3_RX,
  418. .end = IRQ_UART3_RX+1,
  419. .flags = IORESOURCE_IRQ,
  420. },
  421. {
  422. .start = CH_UART3_RX,
  423. .end = CH_UART3_RX+1,
  424. .flags = IORESOURCE_DMA,
  425. },
  426. };
  427. static struct platform_device bfin_sir3_device = {
  428. .name = "bfin_sir",
  429. .id = 3,
  430. .num_resources = ARRAY_SIZE(bfin_sir3_resources),
  431. .resource = bfin_sir3_resources,
  432. };
  433. #endif
  434. #endif
  435. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  436. #include <linux/smsc911x.h>
  437. static struct resource smsc911x_resources[] = {
  438. {
  439. .name = "smsc911x-memory",
  440. .start = 0x24000000,
  441. .end = 0x24000000 + 0xFF,
  442. .flags = IORESOURCE_MEM,
  443. },
  444. {
  445. .start = IRQ_PE6,
  446. .end = IRQ_PE6,
  447. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  448. },
  449. };
  450. static struct smsc911x_platform_config smsc911x_config = {
  451. .flags = SMSC911X_USE_16BIT,
  452. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  453. .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
  454. .phy_interface = PHY_INTERFACE_MODE_MII,
  455. };
  456. static struct platform_device smsc911x_device = {
  457. .name = "smsc911x",
  458. .id = 0,
  459. .num_resources = ARRAY_SIZE(smsc911x_resources),
  460. .resource = smsc911x_resources,
  461. .dev = {
  462. .platform_data = &smsc911x_config,
  463. },
  464. };
  465. #endif
  466. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  467. static struct resource musb_resources[] = {
  468. [0] = {
  469. .start = 0xFFC03C00,
  470. .end = 0xFFC040FF,
  471. .flags = IORESOURCE_MEM,
  472. },
  473. [1] = { /* general IRQ */
  474. .start = IRQ_USB_INT0,
  475. .end = IRQ_USB_INT0,
  476. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  477. .name = "mc"
  478. },
  479. [2] = { /* DMA IRQ */
  480. .start = IRQ_USB_DMA,
  481. .end = IRQ_USB_DMA,
  482. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  483. .name = "dma"
  484. },
  485. };
  486. static struct musb_hdrc_config musb_config = {
  487. .multipoint = 0,
  488. .dyn_fifo = 0,
  489. .soft_con = 1,
  490. .dma = 1,
  491. .num_eps = 8,
  492. .dma_channels = 8,
  493. .gpio_vrsel = GPIO_PH6,
  494. /* Some custom boards need to be active low, just set it to "0"
  495. * if it is the case.
  496. */
  497. .gpio_vrsel_active = 1,
  498. .clkin = 24, /* musb CLKIN in MHZ */
  499. };
  500. static struct musb_hdrc_platform_data musb_plat = {
  501. #if defined(CONFIG_USB_MUSB_OTG)
  502. .mode = MUSB_OTG,
  503. #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
  504. .mode = MUSB_HOST,
  505. #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
  506. .mode = MUSB_PERIPHERAL,
  507. #endif
  508. .config = &musb_config,
  509. };
  510. static u64 musb_dmamask = ~(u32)0;
  511. static struct platform_device musb_device = {
  512. .name = "musb-blackfin",
  513. .id = 0,
  514. .dev = {
  515. .dma_mask = &musb_dmamask,
  516. .coherent_dma_mask = 0xffffffff,
  517. .platform_data = &musb_plat,
  518. },
  519. .num_resources = ARRAY_SIZE(musb_resources),
  520. .resource = musb_resources,
  521. };
  522. #endif
  523. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  524. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  525. static struct resource bfin_sport0_uart_resources[] = {
  526. {
  527. .start = SPORT0_TCR1,
  528. .end = SPORT0_MRCS3+4,
  529. .flags = IORESOURCE_MEM,
  530. },
  531. {
  532. .start = IRQ_SPORT0_RX,
  533. .end = IRQ_SPORT0_RX+1,
  534. .flags = IORESOURCE_IRQ,
  535. },
  536. {
  537. .start = IRQ_SPORT0_ERROR,
  538. .end = IRQ_SPORT0_ERROR,
  539. .flags = IORESOURCE_IRQ,
  540. },
  541. };
  542. static unsigned short bfin_sport0_peripherals[] = {
  543. P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
  544. P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
  545. };
  546. static struct platform_device bfin_sport0_uart_device = {
  547. .name = "bfin-sport-uart",
  548. .id = 0,
  549. .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
  550. .resource = bfin_sport0_uart_resources,
  551. .dev = {
  552. .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
  553. },
  554. };
  555. #endif
  556. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  557. static struct resource bfin_sport1_uart_resources[] = {
  558. {
  559. .start = SPORT1_TCR1,
  560. .end = SPORT1_MRCS3+4,
  561. .flags = IORESOURCE_MEM,
  562. },
  563. {
  564. .start = IRQ_SPORT1_RX,
  565. .end = IRQ_SPORT1_RX+1,
  566. .flags = IORESOURCE_IRQ,
  567. },
  568. {
  569. .start = IRQ_SPORT1_ERROR,
  570. .end = IRQ_SPORT1_ERROR,
  571. .flags = IORESOURCE_IRQ,
  572. },
  573. };
  574. static unsigned short bfin_sport1_peripherals[] = {
  575. P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
  576. P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
  577. };
  578. static struct platform_device bfin_sport1_uart_device = {
  579. .name = "bfin-sport-uart",
  580. .id = 1,
  581. .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
  582. .resource = bfin_sport1_uart_resources,
  583. .dev = {
  584. .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
  585. },
  586. };
  587. #endif
  588. #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
  589. static struct resource bfin_sport2_uart_resources[] = {
  590. {
  591. .start = SPORT2_TCR1,
  592. .end = SPORT2_MRCS3+4,
  593. .flags = IORESOURCE_MEM,
  594. },
  595. {
  596. .start = IRQ_SPORT2_RX,
  597. .end = IRQ_SPORT2_RX+1,
  598. .flags = IORESOURCE_IRQ,
  599. },
  600. {
  601. .start = IRQ_SPORT2_ERROR,
  602. .end = IRQ_SPORT2_ERROR,
  603. .flags = IORESOURCE_IRQ,
  604. },
  605. };
  606. static unsigned short bfin_sport2_peripherals[] = {
  607. P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,
  608. P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0
  609. };
  610. static struct platform_device bfin_sport2_uart_device = {
  611. .name = "bfin-sport-uart",
  612. .id = 2,
  613. .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),
  614. .resource = bfin_sport2_uart_resources,
  615. .dev = {
  616. .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
  617. },
  618. };
  619. #endif
  620. #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
  621. static struct resource bfin_sport3_uart_resources[] = {
  622. {
  623. .start = SPORT3_TCR1,
  624. .end = SPORT3_MRCS3+4,
  625. .flags = IORESOURCE_MEM,
  626. },
  627. {
  628. .start = IRQ_SPORT3_RX,
  629. .end = IRQ_SPORT3_RX+1,
  630. .flags = IORESOURCE_IRQ,
  631. },
  632. {
  633. .start = IRQ_SPORT3_ERROR,
  634. .end = IRQ_SPORT3_ERROR,
  635. .flags = IORESOURCE_IRQ,
  636. },
  637. };
  638. static unsigned short bfin_sport3_peripherals[] = {
  639. P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,
  640. P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0
  641. };
  642. static struct platform_device bfin_sport3_uart_device = {
  643. .name = "bfin-sport-uart",
  644. .id = 3,
  645. .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),
  646. .resource = bfin_sport3_uart_resources,
  647. .dev = {
  648. .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
  649. },
  650. };
  651. #endif
  652. #endif
  653. #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
  654. static struct resource bfin_atapi_resources[] = {
  655. {
  656. .start = 0xFFC03800,
  657. .end = 0xFFC0386F,
  658. .flags = IORESOURCE_MEM,
  659. },
  660. {
  661. .start = IRQ_ATAPI_ERR,
  662. .end = IRQ_ATAPI_ERR,
  663. .flags = IORESOURCE_IRQ,
  664. },
  665. };
  666. static struct platform_device bfin_atapi_device = {
  667. .name = "pata-bf54x",
  668. .id = -1,
  669. .num_resources = ARRAY_SIZE(bfin_atapi_resources),
  670. .resource = bfin_atapi_resources,
  671. };
  672. #endif
  673. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  674. static struct mtd_partition partition_info[] = {
  675. {
  676. .name = "linux kernel(nand)",
  677. .offset = 0,
  678. .size = 4 * 1024 * 1024,
  679. },
  680. {
  681. .name = "file system(nand)",
  682. .offset = 4 * 1024 * 1024,
  683. .size = (256 - 4) * 1024 * 1024,
  684. },
  685. };
  686. static struct bf5xx_nand_platform bf5xx_nand_platform = {
  687. .data_width = NFC_NWIDTH_8,
  688. .partitions = partition_info,
  689. .nr_partitions = ARRAY_SIZE(partition_info),
  690. .rd_dly = 3,
  691. .wr_dly = 3,
  692. };
  693. static struct resource bf5xx_nand_resources[] = {
  694. {
  695. .start = 0xFFC03B00,
  696. .end = 0xFFC03B4F,
  697. .flags = IORESOURCE_MEM,
  698. },
  699. {
  700. .start = CH_NFC,
  701. .end = CH_NFC,
  702. .flags = IORESOURCE_IRQ,
  703. },
  704. };
  705. static struct platform_device bf5xx_nand_device = {
  706. .name = "bf5xx-nand",
  707. .id = 0,
  708. .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
  709. .resource = bf5xx_nand_resources,
  710. .dev = {
  711. .platform_data = &bf5xx_nand_platform,
  712. },
  713. };
  714. #endif
  715. #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
  716. static struct bfin_sd_host bfin_sdh_data = {
  717. .dma_chan = CH_SDH,
  718. .irq_int0 = IRQ_SDH_MASK0,
  719. .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
  720. };
  721. static struct platform_device bf54x_sdh_device = {
  722. .name = "bfin-sdh",
  723. .id = 0,
  724. .dev = {
  725. .platform_data = &bfin_sdh_data,
  726. },
  727. };
  728. #endif
  729. #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
  730. static unsigned short bfin_can_peripherals[] = {
  731. P_CAN0_RX, P_CAN0_TX, 0
  732. };
  733. static struct resource bfin_can_resources[] = {
  734. {
  735. .start = 0xFFC02A00,
  736. .end = 0xFFC02FFF,
  737. .flags = IORESOURCE_MEM,
  738. },
  739. {
  740. .start = IRQ_CAN0_RX,
  741. .end = IRQ_CAN0_RX,
  742. .flags = IORESOURCE_IRQ,
  743. },
  744. {
  745. .start = IRQ_CAN0_TX,
  746. .end = IRQ_CAN0_TX,
  747. .flags = IORESOURCE_IRQ,
  748. },
  749. {
  750. .start = IRQ_CAN0_ERROR,
  751. .end = IRQ_CAN0_ERROR,
  752. .flags = IORESOURCE_IRQ,
  753. },
  754. };
  755. static struct platform_device bfin_can_device = {
  756. .name = "bfin_can",
  757. .num_resources = ARRAY_SIZE(bfin_can_resources),
  758. .resource = bfin_can_resources,
  759. .dev = {
  760. .platform_data = &bfin_can_peripherals, /* Passed to driver */
  761. },
  762. };
  763. #endif
  764. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  765. static struct mtd_partition para_partitions[] = {
  766. {
  767. .name = "bootloader(nor)",
  768. .size = 0x40000,
  769. .offset = 0,
  770. }, {
  771. .name = "linux kernel(nor)",
  772. .size = 0x100000,
  773. .offset = MTDPART_OFS_APPEND,
  774. }, {
  775. .name = "file system(nor)",
  776. .size = MTDPART_SIZ_FULL,
  777. .offset = MTDPART_OFS_APPEND,
  778. }
  779. };
  780. static struct physmap_flash_data para_flash_data = {
  781. .width = 2,
  782. .parts = para_partitions,
  783. .nr_parts = ARRAY_SIZE(para_partitions),
  784. };
  785. static struct resource para_flash_resource = {
  786. .start = 0x20000000,
  787. .end = 0x207fffff,
  788. .flags = IORESOURCE_MEM,
  789. };
  790. static struct platform_device para_flash_device = {
  791. .name = "physmap-flash",
  792. .id = 0,
  793. .dev = {
  794. .platform_data = &para_flash_data,
  795. },
  796. .num_resources = 1,
  797. .resource = &para_flash_resource,
  798. };
  799. #endif
  800. #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
  801. /* all SPI peripherals info goes here */
  802. #if defined(CONFIG_MTD_M25P80) \
  803. || defined(CONFIG_MTD_M25P80_MODULE)
  804. /* SPI flash chip (m25p16) */
  805. static struct mtd_partition bfin_spi_flash_partitions[] = {
  806. {
  807. .name = "bootloader(spi)",
  808. .size = 0x00040000,
  809. .offset = 0,
  810. .mask_flags = MTD_CAP_ROM
  811. }, {
  812. .name = "linux kernel(spi)",
  813. .size = 0x1c0000,
  814. .offset = 0x40000
  815. }
  816. };
  817. static struct flash_platform_data bfin_spi_flash_data = {
  818. .name = "m25p80",
  819. .parts = bfin_spi_flash_partitions,
  820. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  821. .type = "m25p16",
  822. };
  823. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  824. .enable_dma = 0, /* use dma transfer with this chip*/
  825. };
  826. #endif
  827. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  828. static const struct ad7877_platform_data bfin_ad7877_ts_info = {
  829. .model = 7877,
  830. .vref_delay_usecs = 50, /* internal, no capacitor */
  831. .x_plate_ohms = 419,
  832. .y_plate_ohms = 486,
  833. .pressure_max = 1000,
  834. .pressure_min = 0,
  835. .stopacq_polarity = 1,
  836. .first_conversion_delay = 3,
  837. .acquisition_time = 1,
  838. .averaging = 1,
  839. .pen_down_acc_interval = 1,
  840. };
  841. #endif
  842. static struct spi_board_info bf54x_spi_board_info[] __initdata = {
  843. #if defined(CONFIG_MTD_M25P80) \
  844. || defined(CONFIG_MTD_M25P80_MODULE)
  845. {
  846. /* the modalias must be the same as spi device driver name */
  847. .modalias = "m25p80", /* Name of spi_driver for this device */
  848. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  849. .bus_num = 0, /* Framework bus number */
  850. .chip_select = 1, /* SPI_SSEL1*/
  851. .platform_data = &bfin_spi_flash_data,
  852. .controller_data = &spi_flash_chip_info,
  853. .mode = SPI_MODE_3,
  854. },
  855. #endif
  856. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  857. {
  858. .modalias = "ad7877",
  859. .platform_data = &bfin_ad7877_ts_info,
  860. .irq = IRQ_PJ11,
  861. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  862. .bus_num = 0,
  863. .chip_select = 2,
  864. },
  865. #endif
  866. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  867. {
  868. .modalias = "spidev",
  869. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  870. .bus_num = 0,
  871. .chip_select = 1,
  872. },
  873. #endif
  874. };
  875. /* SPI (0) */
  876. static struct resource bfin_spi0_resource[] = {
  877. [0] = {
  878. .start = SPI0_REGBASE,
  879. .end = SPI0_REGBASE + 0xFF,
  880. .flags = IORESOURCE_MEM,
  881. },
  882. [1] = {
  883. .start = CH_SPI0,
  884. .end = CH_SPI0,
  885. .flags = IORESOURCE_DMA,
  886. },
  887. [2] = {
  888. .start = IRQ_SPI0,
  889. .end = IRQ_SPI0,
  890. .flags = IORESOURCE_IRQ,
  891. }
  892. };
  893. /* SPI (1) */
  894. static struct resource bfin_spi1_resource[] = {
  895. [0] = {
  896. .start = SPI1_REGBASE,
  897. .end = SPI1_REGBASE + 0xFF,
  898. .flags = IORESOURCE_MEM,
  899. },
  900. [1] = {
  901. .start = CH_SPI1,
  902. .end = CH_SPI1,
  903. .flags = IORESOURCE_DMA,
  904. },
  905. [2] = {
  906. .start = IRQ_SPI1,
  907. .end = IRQ_SPI1,
  908. .flags = IORESOURCE_IRQ,
  909. }
  910. };
  911. /* SPI controller data */
  912. static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
  913. .num_chipselect = 4,
  914. .enable_dma = 1, /* master has the ability to do dma transfer */
  915. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  916. };
  917. static struct platform_device bf54x_spi_master0 = {
  918. .name = "bfin-spi",
  919. .id = 0, /* Bus number */
  920. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  921. .resource = bfin_spi0_resource,
  922. .dev = {
  923. .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
  924. },
  925. };
  926. static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
  927. .num_chipselect = 4,
  928. .enable_dma = 1, /* master has the ability to do dma transfer */
  929. .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
  930. };
  931. static struct platform_device bf54x_spi_master1 = {
  932. .name = "bfin-spi",
  933. .id = 1, /* Bus number */
  934. .num_resources = ARRAY_SIZE(bfin_spi1_resource),
  935. .resource = bfin_spi1_resource,
  936. .dev = {
  937. .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
  938. },
  939. };
  940. #endif /* spi master and devices */
  941. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  942. static struct resource bfin_twi0_resource[] = {
  943. [0] = {
  944. .start = TWI0_REGBASE,
  945. .end = TWI0_REGBASE + 0xFF,
  946. .flags = IORESOURCE_MEM,
  947. },
  948. [1] = {
  949. .start = IRQ_TWI0,
  950. .end = IRQ_TWI0,
  951. .flags = IORESOURCE_IRQ,
  952. },
  953. };
  954. static struct platform_device i2c_bfin_twi0_device = {
  955. .name = "i2c-bfin-twi",
  956. .id = 0,
  957. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  958. .resource = bfin_twi0_resource,
  959. };
  960. #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
  961. static struct resource bfin_twi1_resource[] = {
  962. [0] = {
  963. .start = TWI1_REGBASE,
  964. .end = TWI1_REGBASE + 0xFF,
  965. .flags = IORESOURCE_MEM,
  966. },
  967. [1] = {
  968. .start = IRQ_TWI1,
  969. .end = IRQ_TWI1,
  970. .flags = IORESOURCE_IRQ,
  971. },
  972. };
  973. static struct platform_device i2c_bfin_twi1_device = {
  974. .name = "i2c-bfin-twi",
  975. .id = 1,
  976. .num_resources = ARRAY_SIZE(bfin_twi1_resource),
  977. .resource = bfin_twi1_resource,
  978. };
  979. #endif
  980. #endif
  981. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  982. #include <linux/gpio_keys.h>
  983. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  984. {BTN_0, GPIO_PH7, 1, "gpio-keys: BTN0"},
  985. };
  986. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  987. .buttons = bfin_gpio_keys_table,
  988. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  989. };
  990. static struct platform_device bfin_device_gpiokeys = {
  991. .name = "gpio-keys",
  992. .dev = {
  993. .platform_data = &bfin_gpio_keys_data,
  994. },
  995. };
  996. #endif
  997. static const unsigned int cclk_vlev_datasheet[] =
  998. {
  999. /*
  1000. * Internal VLEV BF54XSBBC1533
  1001. ****temporarily using these values until data sheet is updated
  1002. */
  1003. VRPAIR(VLEV_085, 150000000),
  1004. VRPAIR(VLEV_090, 250000000),
  1005. VRPAIR(VLEV_110, 276000000),
  1006. VRPAIR(VLEV_115, 301000000),
  1007. VRPAIR(VLEV_120, 525000000),
  1008. VRPAIR(VLEV_125, 550000000),
  1009. VRPAIR(VLEV_130, 600000000),
  1010. };
  1011. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  1012. .tuple_tab = cclk_vlev_datasheet,
  1013. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  1014. .vr_settling_time = 25 /* us */,
  1015. };
  1016. static struct platform_device bfin_dpmc = {
  1017. .name = "bfin dpmc",
  1018. .dev = {
  1019. .platform_data = &bfin_dmpc_vreg_data,
  1020. },
  1021. };
  1022. static struct platform_device *cm_bf548_devices[] __initdata = {
  1023. &bfin_dpmc,
  1024. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  1025. &rtc_device,
  1026. #endif
  1027. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1028. #ifdef CONFIG_SERIAL_BFIN_UART0
  1029. &bfin_uart0_device,
  1030. #endif
  1031. #ifdef CONFIG_SERIAL_BFIN_UART1
  1032. &bfin_uart1_device,
  1033. #endif
  1034. #ifdef CONFIG_SERIAL_BFIN_UART2
  1035. &bfin_uart2_device,
  1036. #endif
  1037. #ifdef CONFIG_SERIAL_BFIN_UART3
  1038. &bfin_uart3_device,
  1039. #endif
  1040. #endif
  1041. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1042. #ifdef CONFIG_BFIN_SIR0
  1043. &bfin_sir0_device,
  1044. #endif
  1045. #ifdef CONFIG_BFIN_SIR1
  1046. &bfin_sir1_device,
  1047. #endif
  1048. #ifdef CONFIG_BFIN_SIR2
  1049. &bfin_sir2_device,
  1050. #endif
  1051. #ifdef CONFIG_BFIN_SIR3
  1052. &bfin_sir3_device,
  1053. #endif
  1054. #endif
  1055. #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
  1056. &bf54x_lq043_device,
  1057. #endif
  1058. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  1059. &smsc911x_device,
  1060. #endif
  1061. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  1062. &musb_device,
  1063. #endif
  1064. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1065. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  1066. &bfin_sport0_uart_device,
  1067. #endif
  1068. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  1069. &bfin_sport1_uart_device,
  1070. #endif
  1071. #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
  1072. &bfin_sport2_uart_device,
  1073. #endif
  1074. #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
  1075. &bfin_sport3_uart_device,
  1076. #endif
  1077. #endif
  1078. #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
  1079. &bfin_atapi_device,
  1080. #endif
  1081. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  1082. &bf5xx_nand_device,
  1083. #endif
  1084. #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
  1085. &bf54x_sdh_device,
  1086. #endif
  1087. #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
  1088. &bf54x_spi_master0,
  1089. &bf54x_spi_master1,
  1090. #endif
  1091. #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
  1092. &bf54x_kpad_device,
  1093. #endif
  1094. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1095. &i2c_bfin_twi0_device,
  1096. #if !defined(CONFIG_BF542)
  1097. &i2c_bfin_twi1_device,
  1098. #endif
  1099. #endif
  1100. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  1101. &bfin_device_gpiokeys,
  1102. #endif
  1103. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  1104. &para_flash_device,
  1105. #endif
  1106. #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
  1107. &bfin_can_device,
  1108. #endif
  1109. };
  1110. static int __init cm_bf548_init(void)
  1111. {
  1112. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  1113. platform_add_devices(cm_bf548_devices, ARRAY_SIZE(cm_bf548_devices));
  1114. #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
  1115. spi_register_board_info(bf54x_spi_board_info,
  1116. ARRAY_SIZE(bf54x_spi_board_info));
  1117. #endif
  1118. return 0;
  1119. }
  1120. arch_initcall(cm_bf548_init);
  1121. static struct platform_device *cm_bf548_early_devices[] __initdata = {
  1122. #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
  1123. #ifdef CONFIG_SERIAL_BFIN_UART0
  1124. &bfin_uart0_device,
  1125. #endif
  1126. #ifdef CONFIG_SERIAL_BFIN_UART1
  1127. &bfin_uart1_device,
  1128. #endif
  1129. #ifdef CONFIG_SERIAL_BFIN_UART2
  1130. &bfin_uart2_device,
  1131. #endif
  1132. #ifdef CONFIG_SERIAL_BFIN_UART3
  1133. &bfin_uart3_device,
  1134. #endif
  1135. #endif
  1136. #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
  1137. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  1138. &bfin_sport0_uart_device,
  1139. #endif
  1140. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  1141. &bfin_sport1_uart_device,
  1142. #endif
  1143. #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
  1144. &bfin_sport2_uart_device,
  1145. #endif
  1146. #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
  1147. &bfin_sport3_uart_device,
  1148. #endif
  1149. #endif
  1150. };
  1151. void __init native_machine_early_platform_add_devices(void)
  1152. {
  1153. printk(KERN_INFO "register early platform devices\n");
  1154. early_platform_add_devices(cm_bf548_early_devices,
  1155. ARRAY_SIZE(cm_bf548_early_devices));
  1156. }