cm_bf548.c 28 KB

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