cm_bf548.c 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  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. 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. 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. 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. 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. };
  479. static struct musb_hdrc_platform_data musb_plat = {
  480. #if defined(CONFIG_USB_MUSB_OTG)
  481. .mode = MUSB_OTG,
  482. #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
  483. .mode = MUSB_HOST,
  484. #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
  485. .mode = MUSB_PERIPHERAL,
  486. #endif
  487. .config = &musb_config,
  488. };
  489. static u64 musb_dmamask = ~(u32)0;
  490. static struct platform_device musb_device = {
  491. .name = "musb_hdrc",
  492. .id = 0,
  493. .dev = {
  494. .dma_mask = &musb_dmamask,
  495. .coherent_dma_mask = 0xffffffff,
  496. .platform_data = &musb_plat,
  497. },
  498. .num_resources = ARRAY_SIZE(musb_resources),
  499. .resource = musb_resources,
  500. };
  501. #endif
  502. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  503. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  504. static struct resource bfin_sport0_uart_resources[] = {
  505. {
  506. .start = SPORT0_TCR1,
  507. .end = SPORT0_MRCS3+4,
  508. .flags = IORESOURCE_MEM,
  509. },
  510. {
  511. .start = IRQ_SPORT0_RX,
  512. .end = IRQ_SPORT0_RX+1,
  513. .flags = IORESOURCE_IRQ,
  514. },
  515. {
  516. .start = IRQ_SPORT0_ERROR,
  517. .end = IRQ_SPORT0_ERROR,
  518. .flags = IORESOURCE_IRQ,
  519. },
  520. };
  521. unsigned short bfin_sport0_peripherals[] = {
  522. P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
  523. P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
  524. };
  525. static struct platform_device bfin_sport0_uart_device = {
  526. .name = "bfin-sport-uart",
  527. .id = 0,
  528. .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
  529. .resource = bfin_sport0_uart_resources,
  530. .dev = {
  531. .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
  532. },
  533. };
  534. #endif
  535. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  536. static struct resource bfin_sport1_uart_resources[] = {
  537. {
  538. .start = SPORT1_TCR1,
  539. .end = SPORT1_MRCS3+4,
  540. .flags = IORESOURCE_MEM,
  541. },
  542. {
  543. .start = IRQ_SPORT1_RX,
  544. .end = IRQ_SPORT1_RX+1,
  545. .flags = IORESOURCE_IRQ,
  546. },
  547. {
  548. .start = IRQ_SPORT1_ERROR,
  549. .end = IRQ_SPORT1_ERROR,
  550. .flags = IORESOURCE_IRQ,
  551. },
  552. };
  553. unsigned short bfin_sport1_peripherals[] = {
  554. P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
  555. P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
  556. };
  557. static struct platform_device bfin_sport1_uart_device = {
  558. .name = "bfin-sport-uart",
  559. .id = 1,
  560. .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
  561. .resource = bfin_sport1_uart_resources,
  562. .dev = {
  563. .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
  564. },
  565. };
  566. #endif
  567. #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
  568. static struct resource bfin_sport2_uart_resources[] = {
  569. {
  570. .start = SPORT2_TCR1,
  571. .end = SPORT2_MRCS3+4,
  572. .flags = IORESOURCE_MEM,
  573. },
  574. {
  575. .start = IRQ_SPORT2_RX,
  576. .end = IRQ_SPORT2_RX+1,
  577. .flags = IORESOURCE_IRQ,
  578. },
  579. {
  580. .start = IRQ_SPORT2_ERROR,
  581. .end = IRQ_SPORT2_ERROR,
  582. .flags = IORESOURCE_IRQ,
  583. },
  584. };
  585. unsigned short bfin_sport2_peripherals[] = {
  586. P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,
  587. P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0
  588. };
  589. static struct platform_device bfin_sport2_uart_device = {
  590. .name = "bfin-sport-uart",
  591. .id = 2,
  592. .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),
  593. .resource = bfin_sport2_uart_resources,
  594. .dev = {
  595. .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
  596. },
  597. };
  598. #endif
  599. #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
  600. static struct resource bfin_sport3_uart_resources[] = {
  601. {
  602. .start = SPORT3_TCR1,
  603. .end = SPORT3_MRCS3+4,
  604. .flags = IORESOURCE_MEM,
  605. },
  606. {
  607. .start = IRQ_SPORT3_RX,
  608. .end = IRQ_SPORT3_RX+1,
  609. .flags = IORESOURCE_IRQ,
  610. },
  611. {
  612. .start = IRQ_SPORT3_ERROR,
  613. .end = IRQ_SPORT3_ERROR,
  614. .flags = IORESOURCE_IRQ,
  615. },
  616. };
  617. unsigned short bfin_sport3_peripherals[] = {
  618. P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,
  619. P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0
  620. };
  621. static struct platform_device bfin_sport3_uart_device = {
  622. .name = "bfin-sport-uart",
  623. .id = 3,
  624. .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),
  625. .resource = bfin_sport3_uart_resources,
  626. .dev = {
  627. .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
  628. },
  629. };
  630. #endif
  631. #endif
  632. #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
  633. static struct resource bfin_atapi_resources[] = {
  634. {
  635. .start = 0xFFC03800,
  636. .end = 0xFFC0386F,
  637. .flags = IORESOURCE_MEM,
  638. },
  639. {
  640. .start = IRQ_ATAPI_ERR,
  641. .end = IRQ_ATAPI_ERR,
  642. .flags = IORESOURCE_IRQ,
  643. },
  644. };
  645. static struct platform_device bfin_atapi_device = {
  646. .name = "pata-bf54x",
  647. .id = -1,
  648. .num_resources = ARRAY_SIZE(bfin_atapi_resources),
  649. .resource = bfin_atapi_resources,
  650. };
  651. #endif
  652. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  653. static struct mtd_partition partition_info[] = {
  654. {
  655. .name = "linux kernel(nand)",
  656. .offset = 0,
  657. .size = 4 * 1024 * 1024,
  658. },
  659. {
  660. .name = "file system(nand)",
  661. .offset = 4 * 1024 * 1024,
  662. .size = (256 - 4) * 1024 * 1024,
  663. },
  664. };
  665. static struct bf5xx_nand_platform bf5xx_nand_platform = {
  666. .data_width = NFC_NWIDTH_8,
  667. .partitions = partition_info,
  668. .nr_partitions = ARRAY_SIZE(partition_info),
  669. .rd_dly = 3,
  670. .wr_dly = 3,
  671. };
  672. static struct resource bf5xx_nand_resources[] = {
  673. {
  674. .start = 0xFFC03B00,
  675. .end = 0xFFC03B4F,
  676. .flags = IORESOURCE_MEM,
  677. },
  678. {
  679. .start = CH_NFC,
  680. .end = CH_NFC,
  681. .flags = IORESOURCE_IRQ,
  682. },
  683. };
  684. static struct platform_device bf5xx_nand_device = {
  685. .name = "bf5xx-nand",
  686. .id = 0,
  687. .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
  688. .resource = bf5xx_nand_resources,
  689. .dev = {
  690. .platform_data = &bf5xx_nand_platform,
  691. },
  692. };
  693. #endif
  694. #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
  695. static struct bfin_sd_host bfin_sdh_data = {
  696. .dma_chan = CH_SDH,
  697. .irq_int0 = IRQ_SDH_MASK0,
  698. .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
  699. };
  700. static struct platform_device bf54x_sdh_device = {
  701. .name = "bfin-sdh",
  702. .id = 0,
  703. .dev = {
  704. .platform_data = &bfin_sdh_data,
  705. },
  706. };
  707. #endif
  708. #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
  709. unsigned short bfin_can_peripherals[] = {
  710. P_CAN0_RX, P_CAN0_TX, 0
  711. };
  712. static struct resource bfin_can_resources[] = {
  713. {
  714. .start = 0xFFC02A00,
  715. .end = 0xFFC02FFF,
  716. .flags = IORESOURCE_MEM,
  717. },
  718. {
  719. .start = IRQ_CAN0_RX,
  720. .end = IRQ_CAN0_RX,
  721. .flags = IORESOURCE_IRQ,
  722. },
  723. {
  724. .start = IRQ_CAN0_TX,
  725. .end = IRQ_CAN0_TX,
  726. .flags = IORESOURCE_IRQ,
  727. },
  728. {
  729. .start = IRQ_CAN0_ERROR,
  730. .end = IRQ_CAN0_ERROR,
  731. .flags = IORESOURCE_IRQ,
  732. },
  733. };
  734. static struct platform_device bfin_can_device = {
  735. .name = "bfin_can",
  736. .num_resources = ARRAY_SIZE(bfin_can_resources),
  737. .resource = bfin_can_resources,
  738. .dev = {
  739. .platform_data = &bfin_can_peripherals, /* Passed to driver */
  740. },
  741. };
  742. #endif
  743. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  744. static struct mtd_partition para_partitions[] = {
  745. {
  746. .name = "bootloader(nor)",
  747. .size = 0x40000,
  748. .offset = 0,
  749. }, {
  750. .name = "linux kernel(nor)",
  751. .size = 0x100000,
  752. .offset = MTDPART_OFS_APPEND,
  753. }, {
  754. .name = "file system(nor)",
  755. .size = MTDPART_SIZ_FULL,
  756. .offset = MTDPART_OFS_APPEND,
  757. }
  758. };
  759. static struct physmap_flash_data para_flash_data = {
  760. .width = 2,
  761. .parts = para_partitions,
  762. .nr_parts = ARRAY_SIZE(para_partitions),
  763. };
  764. static struct resource para_flash_resource = {
  765. .start = 0x20000000,
  766. .end = 0x207fffff,
  767. .flags = IORESOURCE_MEM,
  768. };
  769. static struct platform_device para_flash_device = {
  770. .name = "physmap-flash",
  771. .id = 0,
  772. .dev = {
  773. .platform_data = &para_flash_data,
  774. },
  775. .num_resources = 1,
  776. .resource = &para_flash_resource,
  777. };
  778. #endif
  779. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  780. /* all SPI peripherals info goes here */
  781. #if defined(CONFIG_MTD_M25P80) \
  782. || defined(CONFIG_MTD_M25P80_MODULE)
  783. /* SPI flash chip (m25p16) */
  784. static struct mtd_partition bfin_spi_flash_partitions[] = {
  785. {
  786. .name = "bootloader(spi)",
  787. .size = 0x00040000,
  788. .offset = 0,
  789. .mask_flags = MTD_CAP_ROM
  790. }, {
  791. .name = "linux kernel(spi)",
  792. .size = 0x1c0000,
  793. .offset = 0x40000
  794. }
  795. };
  796. static struct flash_platform_data bfin_spi_flash_data = {
  797. .name = "m25p80",
  798. .parts = bfin_spi_flash_partitions,
  799. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  800. .type = "m25p16",
  801. };
  802. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  803. .enable_dma = 0, /* use dma transfer with this chip*/
  804. .bits_per_word = 8,
  805. };
  806. #endif
  807. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  808. static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
  809. .enable_dma = 0,
  810. .bits_per_word = 16,
  811. };
  812. static const struct ad7877_platform_data bfin_ad7877_ts_info = {
  813. .model = 7877,
  814. .vref_delay_usecs = 50, /* internal, no capacitor */
  815. .x_plate_ohms = 419,
  816. .y_plate_ohms = 486,
  817. .pressure_max = 1000,
  818. .pressure_min = 0,
  819. .stopacq_polarity = 1,
  820. .first_conversion_delay = 3,
  821. .acquisition_time = 1,
  822. .averaging = 1,
  823. .pen_down_acc_interval = 1,
  824. };
  825. #endif
  826. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  827. static struct bfin5xx_spi_chip spidev_chip_info = {
  828. .enable_dma = 0,
  829. .bits_per_word = 8,
  830. };
  831. #endif
  832. static struct spi_board_info bf54x_spi_board_info[] __initdata = {
  833. #if defined(CONFIG_MTD_M25P80) \
  834. || defined(CONFIG_MTD_M25P80_MODULE)
  835. {
  836. /* the modalias must be the same as spi device driver name */
  837. .modalias = "m25p80", /* Name of spi_driver for this device */
  838. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  839. .bus_num = 0, /* Framework bus number */
  840. .chip_select = 1, /* SPI_SSEL1*/
  841. .platform_data = &bfin_spi_flash_data,
  842. .controller_data = &spi_flash_chip_info,
  843. .mode = SPI_MODE_3,
  844. },
  845. #endif
  846. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  847. {
  848. .modalias = "ad7877",
  849. .platform_data = &bfin_ad7877_ts_info,
  850. .irq = IRQ_PJ11,
  851. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  852. .bus_num = 0,
  853. .chip_select = 2,
  854. .controller_data = &spi_ad7877_chip_info,
  855. },
  856. #endif
  857. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  858. {
  859. .modalias = "spidev",
  860. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  861. .bus_num = 0,
  862. .chip_select = 1,
  863. .controller_data = &spidev_chip_info,
  864. },
  865. #endif
  866. };
  867. /* SPI (0) */
  868. static struct resource bfin_spi0_resource[] = {
  869. [0] = {
  870. .start = SPI0_REGBASE,
  871. .end = SPI0_REGBASE + 0xFF,
  872. .flags = IORESOURCE_MEM,
  873. },
  874. [1] = {
  875. .start = CH_SPI0,
  876. .end = CH_SPI0,
  877. .flags = IORESOURCE_DMA,
  878. },
  879. [2] = {
  880. .start = IRQ_SPI0,
  881. .end = IRQ_SPI0,
  882. .flags = IORESOURCE_IRQ,
  883. }
  884. };
  885. /* SPI (1) */
  886. static struct resource bfin_spi1_resource[] = {
  887. [0] = {
  888. .start = SPI1_REGBASE,
  889. .end = SPI1_REGBASE + 0xFF,
  890. .flags = IORESOURCE_MEM,
  891. },
  892. [1] = {
  893. .start = CH_SPI1,
  894. .end = CH_SPI1,
  895. .flags = IORESOURCE_DMA,
  896. },
  897. [2] = {
  898. .start = IRQ_SPI1,
  899. .end = IRQ_SPI1,
  900. .flags = IORESOURCE_IRQ,
  901. }
  902. };
  903. /* SPI controller data */
  904. static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
  905. .num_chipselect = 4,
  906. .enable_dma = 1, /* master has the ability to do dma transfer */
  907. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  908. };
  909. static struct platform_device bf54x_spi_master0 = {
  910. .name = "bfin-spi",
  911. .id = 0, /* Bus number */
  912. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  913. .resource = bfin_spi0_resource,
  914. .dev = {
  915. .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
  916. },
  917. };
  918. static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
  919. .num_chipselect = 4,
  920. .enable_dma = 1, /* master has the ability to do dma transfer */
  921. .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
  922. };
  923. static struct platform_device bf54x_spi_master1 = {
  924. .name = "bfin-spi",
  925. .id = 1, /* Bus number */
  926. .num_resources = ARRAY_SIZE(bfin_spi1_resource),
  927. .resource = bfin_spi1_resource,
  928. .dev = {
  929. .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
  930. },
  931. };
  932. #endif /* spi master and devices */
  933. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  934. static struct resource bfin_twi0_resource[] = {
  935. [0] = {
  936. .start = TWI0_REGBASE,
  937. .end = TWI0_REGBASE + 0xFF,
  938. .flags = IORESOURCE_MEM,
  939. },
  940. [1] = {
  941. .start = IRQ_TWI0,
  942. .end = IRQ_TWI0,
  943. .flags = IORESOURCE_IRQ,
  944. },
  945. };
  946. static struct platform_device i2c_bfin_twi0_device = {
  947. .name = "i2c-bfin-twi",
  948. .id = 0,
  949. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  950. .resource = bfin_twi0_resource,
  951. };
  952. #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
  953. static struct resource bfin_twi1_resource[] = {
  954. [0] = {
  955. .start = TWI1_REGBASE,
  956. .end = TWI1_REGBASE + 0xFF,
  957. .flags = IORESOURCE_MEM,
  958. },
  959. [1] = {
  960. .start = IRQ_TWI1,
  961. .end = IRQ_TWI1,
  962. .flags = IORESOURCE_IRQ,
  963. },
  964. };
  965. static struct platform_device i2c_bfin_twi1_device = {
  966. .name = "i2c-bfin-twi",
  967. .id = 1,
  968. .num_resources = ARRAY_SIZE(bfin_twi1_resource),
  969. .resource = bfin_twi1_resource,
  970. };
  971. #endif
  972. #endif
  973. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  974. #include <linux/gpio_keys.h>
  975. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  976. {BTN_0, GPIO_PH7, 1, "gpio-keys: BTN0"},
  977. };
  978. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  979. .buttons = bfin_gpio_keys_table,
  980. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  981. };
  982. static struct platform_device bfin_device_gpiokeys = {
  983. .name = "gpio-keys",
  984. .dev = {
  985. .platform_data = &bfin_gpio_keys_data,
  986. },
  987. };
  988. #endif
  989. static const unsigned int cclk_vlev_datasheet[] =
  990. {
  991. /*
  992. * Internal VLEV BF54XSBBC1533
  993. ****temporarily using these values until data sheet is updated
  994. */
  995. VRPAIR(VLEV_085, 150000000),
  996. VRPAIR(VLEV_090, 250000000),
  997. VRPAIR(VLEV_110, 276000000),
  998. VRPAIR(VLEV_115, 301000000),
  999. VRPAIR(VLEV_120, 525000000),
  1000. VRPAIR(VLEV_125, 550000000),
  1001. VRPAIR(VLEV_130, 600000000),
  1002. };
  1003. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  1004. .tuple_tab = cclk_vlev_datasheet,
  1005. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  1006. .vr_settling_time = 25 /* us */,
  1007. };
  1008. static struct platform_device bfin_dpmc = {
  1009. .name = "bfin dpmc",
  1010. .dev = {
  1011. .platform_data = &bfin_dmpc_vreg_data,
  1012. },
  1013. };
  1014. static struct platform_device *cm_bf548_devices[] __initdata = {
  1015. &bfin_dpmc,
  1016. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  1017. &rtc_device,
  1018. #endif
  1019. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1020. #ifdef CONFIG_SERIAL_BFIN_UART0
  1021. &bfin_uart0_device,
  1022. #endif
  1023. #ifdef CONFIG_SERIAL_BFIN_UART1
  1024. &bfin_uart1_device,
  1025. #endif
  1026. #ifdef CONFIG_SERIAL_BFIN_UART2
  1027. &bfin_uart2_device,
  1028. #endif
  1029. #ifdef CONFIG_SERIAL_BFIN_UART3
  1030. &bfin_uart3_device,
  1031. #endif
  1032. #endif
  1033. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1034. #ifdef CONFIG_BFIN_SIR0
  1035. &bfin_sir0_device,
  1036. #endif
  1037. #ifdef CONFIG_BFIN_SIR1
  1038. &bfin_sir1_device,
  1039. #endif
  1040. #ifdef CONFIG_BFIN_SIR2
  1041. &bfin_sir2_device,
  1042. #endif
  1043. #ifdef CONFIG_BFIN_SIR3
  1044. &bfin_sir3_device,
  1045. #endif
  1046. #endif
  1047. #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
  1048. &bf54x_lq043_device,
  1049. #endif
  1050. #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
  1051. &smsc911x_device,
  1052. #endif
  1053. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  1054. &musb_device,
  1055. #endif
  1056. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1057. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  1058. &bfin_sport0_uart_device,
  1059. #endif
  1060. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  1061. &bfin_sport1_uart_device,
  1062. #endif
  1063. #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
  1064. &bfin_sport2_uart_device,
  1065. #endif
  1066. #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
  1067. &bfin_sport3_uart_device,
  1068. #endif
  1069. #endif
  1070. #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
  1071. &bfin_atapi_device,
  1072. #endif
  1073. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  1074. &bf5xx_nand_device,
  1075. #endif
  1076. #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
  1077. &bf54x_sdh_device,
  1078. #endif
  1079. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  1080. &bf54x_spi_master0,
  1081. &bf54x_spi_master1,
  1082. #endif
  1083. #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
  1084. &bf54x_kpad_device,
  1085. #endif
  1086. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1087. &i2c_bfin_twi0_device,
  1088. #if !defined(CONFIG_BF542)
  1089. &i2c_bfin_twi1_device,
  1090. #endif
  1091. #endif
  1092. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  1093. &bfin_device_gpiokeys,
  1094. #endif
  1095. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  1096. &para_flash_device,
  1097. #endif
  1098. #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
  1099. &bfin_can_device,
  1100. #endif
  1101. };
  1102. static int __init cm_bf548_init(void)
  1103. {
  1104. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  1105. platform_add_devices(cm_bf548_devices, ARRAY_SIZE(cm_bf548_devices));
  1106. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  1107. spi_register_board_info(bf54x_spi_board_info,
  1108. ARRAY_SIZE(bf54x_spi_board_info));
  1109. #endif
  1110. return 0;
  1111. }
  1112. arch_initcall(cm_bf548_init);
  1113. static struct platform_device *cm_bf548_early_devices[] __initdata = {
  1114. #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
  1115. #ifdef CONFIG_SERIAL_BFIN_UART0
  1116. &bfin_uart0_device,
  1117. #endif
  1118. #ifdef CONFIG_SERIAL_BFIN_UART1
  1119. &bfin_uart1_device,
  1120. #endif
  1121. #ifdef CONFIG_SERIAL_BFIN_UART2
  1122. &bfin_uart2_device,
  1123. #endif
  1124. #ifdef CONFIG_SERIAL_BFIN_UART3
  1125. &bfin_uart3_device,
  1126. #endif
  1127. #endif
  1128. #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
  1129. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  1130. &bfin_sport0_uart_device,
  1131. #endif
  1132. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  1133. &bfin_sport1_uart_device,
  1134. #endif
  1135. #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
  1136. &bfin_sport2_uart_device,
  1137. #endif
  1138. #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
  1139. &bfin_sport3_uart_device,
  1140. #endif
  1141. #endif
  1142. };
  1143. void __init native_machine_early_platform_add_devices(void)
  1144. {
  1145. printk(KERN_INFO "register early platform devices\n");
  1146. early_platform_add_devices(cm_bf548_early_devices,
  1147. ARRAY_SIZE(cm_bf548_early_devices));
  1148. }