ezkit.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  1. /*
  2. * Copyright 2004-2009 Analog Devices Inc.
  3. * 2005 National ICT Australia (NICTA)
  4. * Aidan Williams <aidan@nicta.com.au>
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #include <linux/device.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/mtd/mtd.h>
  11. #include <linux/mtd/partitions.h>
  12. #include <linux/mtd/physmap.h>
  13. #include <linux/spi/spi.h>
  14. #include <linux/spi/flash.h>
  15. #include <linux/i2c.h>
  16. #include <linux/irq.h>
  17. #include <linux/interrupt.h>
  18. #include <linux/usb/musb.h>
  19. #include <linux/leds.h>
  20. #include <linux/input.h>
  21. #include <asm/dma.h>
  22. #include <asm/bfin5xx_spi.h>
  23. #include <asm/reboot.h>
  24. #include <asm/nand.h>
  25. #include <asm/portmux.h>
  26. #include <asm/dpmc.h>
  27. #include <linux/spi/ad7877.h>
  28. /*
  29. * Name the Board for the /proc/cpuinfo
  30. */
  31. #ifdef CONFIG_BFIN527_EZKIT_V2
  32. const char bfin_board_name[] = "ADI BF527-EZKIT V2";
  33. #else
  34. const char bfin_board_name[] = "ADI BF527-EZKIT";
  35. #endif
  36. /*
  37. * Driver needs to know address, irq and flag pin.
  38. */
  39. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  40. #include <linux/usb/isp1760.h>
  41. static struct resource bfin_isp1760_resources[] = {
  42. [0] = {
  43. .start = 0x203C0000,
  44. .end = 0x203C0000 + 0x000fffff,
  45. .flags = IORESOURCE_MEM,
  46. },
  47. [1] = {
  48. .start = IRQ_PF7,
  49. .end = IRQ_PF7,
  50. .flags = IORESOURCE_IRQ,
  51. },
  52. };
  53. static struct isp1760_platform_data isp1760_priv = {
  54. .is_isp1761 = 0,
  55. .bus_width_16 = 1,
  56. .port1_otg = 0,
  57. .analog_oc = 0,
  58. .dack_polarity_high = 0,
  59. .dreq_polarity_high = 0,
  60. };
  61. static struct platform_device bfin_isp1760_device = {
  62. .name = "isp1760",
  63. .id = 0,
  64. .dev = {
  65. .platform_data = &isp1760_priv,
  66. },
  67. .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
  68. .resource = bfin_isp1760_resources,
  69. };
  70. #endif
  71. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  72. static struct resource musb_resources[] = {
  73. [0] = {
  74. .start = 0xffc03800,
  75. .end = 0xffc03cff,
  76. .flags = IORESOURCE_MEM,
  77. },
  78. [1] = { /* general IRQ */
  79. .start = IRQ_USB_INT0,
  80. .end = IRQ_USB_INT0,
  81. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  82. },
  83. [2] = { /* DMA IRQ */
  84. .start = IRQ_USB_DMA,
  85. .end = IRQ_USB_DMA,
  86. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  87. },
  88. };
  89. static struct musb_hdrc_config musb_config = {
  90. .multipoint = 0,
  91. .dyn_fifo = 0,
  92. .soft_con = 1,
  93. .dma = 1,
  94. .num_eps = 8,
  95. .dma_channels = 8,
  96. .gpio_vrsel = GPIO_PG13,
  97. /* Some custom boards need to be active low, just set it to "0"
  98. * if it is the case.
  99. */
  100. .gpio_vrsel_active = 1,
  101. };
  102. static struct musb_hdrc_platform_data musb_plat = {
  103. #if defined(CONFIG_USB_MUSB_OTG)
  104. .mode = MUSB_OTG,
  105. #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
  106. .mode = MUSB_HOST,
  107. #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
  108. .mode = MUSB_PERIPHERAL,
  109. #endif
  110. .config = &musb_config,
  111. };
  112. static u64 musb_dmamask = ~(u32)0;
  113. static struct platform_device musb_device = {
  114. .name = "musb_hdrc",
  115. .id = 0,
  116. .dev = {
  117. .dma_mask = &musb_dmamask,
  118. .coherent_dma_mask = 0xffffffff,
  119. .platform_data = &musb_plat,
  120. },
  121. .num_resources = ARRAY_SIZE(musb_resources),
  122. .resource = musb_resources,
  123. };
  124. #endif
  125. #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
  126. static struct resource bf52x_t350mcqb_resources[] = {
  127. {
  128. .start = IRQ_PPI_ERROR,
  129. .end = IRQ_PPI_ERROR,
  130. .flags = IORESOURCE_IRQ,
  131. },
  132. };
  133. static struct platform_device bf52x_t350mcqb_device = {
  134. .name = "bfin-t350mcqb",
  135. .id = -1,
  136. .num_resources = ARRAY_SIZE(bf52x_t350mcqb_resources),
  137. .resource = bf52x_t350mcqb_resources,
  138. };
  139. #endif
  140. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  141. #include <asm/bfin-lq035q1.h>
  142. static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
  143. .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
  144. .ppi_mode = USE_RGB565_8_BIT_PPI,
  145. };
  146. static struct resource bfin_lq035q1_resources[] = {
  147. {
  148. .start = IRQ_PPI_ERROR,
  149. .end = IRQ_PPI_ERROR,
  150. .flags = IORESOURCE_IRQ,
  151. },
  152. };
  153. static struct platform_device bfin_lq035q1_device = {
  154. .name = "bfin-lq035q1",
  155. .id = -1,
  156. .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
  157. .resource = bfin_lq035q1_resources,
  158. .dev = {
  159. .platform_data = &bfin_lq035q1_data,
  160. },
  161. };
  162. #endif
  163. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  164. static struct mtd_partition ezkit_partitions[] = {
  165. {
  166. .name = "bootloader(nor)",
  167. .size = 0x40000,
  168. .offset = 0,
  169. }, {
  170. .name = "linux kernel(nor)",
  171. .size = 0x1C0000,
  172. .offset = MTDPART_OFS_APPEND,
  173. }, {
  174. .name = "file system(nor)",
  175. .size = MTDPART_SIZ_FULL,
  176. .offset = MTDPART_OFS_APPEND,
  177. }
  178. };
  179. static struct physmap_flash_data ezkit_flash_data = {
  180. .width = 2,
  181. .parts = ezkit_partitions,
  182. .nr_parts = ARRAY_SIZE(ezkit_partitions),
  183. };
  184. static struct resource ezkit_flash_resource = {
  185. .start = 0x20000000,
  186. .end = 0x203fffff,
  187. .flags = IORESOURCE_MEM,
  188. };
  189. static struct platform_device ezkit_flash_device = {
  190. .name = "physmap-flash",
  191. .id = 0,
  192. .dev = {
  193. .platform_data = &ezkit_flash_data,
  194. },
  195. .num_resources = 1,
  196. .resource = &ezkit_flash_resource,
  197. };
  198. #endif
  199. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  200. static struct mtd_partition partition_info[] = {
  201. {
  202. .name = "linux kernel(nand)",
  203. .offset = 0,
  204. .size = 4 * 1024 * 1024,
  205. },
  206. {
  207. .name = "file system(nand)",
  208. .offset = MTDPART_OFS_APPEND,
  209. .size = MTDPART_SIZ_FULL,
  210. },
  211. };
  212. static struct bf5xx_nand_platform bf5xx_nand_platform = {
  213. .page_size = NFC_PG_SIZE_256,
  214. .data_width = NFC_NWIDTH_8,
  215. .partitions = partition_info,
  216. .nr_partitions = ARRAY_SIZE(partition_info),
  217. .rd_dly = 3,
  218. .wr_dly = 3,
  219. };
  220. static struct resource bf5xx_nand_resources[] = {
  221. {
  222. .start = NFC_CTL,
  223. .end = NFC_DATA_RD + 2,
  224. .flags = IORESOURCE_MEM,
  225. },
  226. {
  227. .start = CH_NFC,
  228. .end = CH_NFC,
  229. .flags = IORESOURCE_IRQ,
  230. },
  231. };
  232. static struct platform_device bf5xx_nand_device = {
  233. .name = "bf5xx-nand",
  234. .id = 0,
  235. .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
  236. .resource = bf5xx_nand_resources,
  237. .dev = {
  238. .platform_data = &bf5xx_nand_platform,
  239. },
  240. };
  241. #endif
  242. #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
  243. static struct resource bfin_pcmcia_cf_resources[] = {
  244. {
  245. .start = 0x20310000, /* IO PORT */
  246. .end = 0x20312000,
  247. .flags = IORESOURCE_MEM,
  248. }, {
  249. .start = 0x20311000, /* Attribute Memory */
  250. .end = 0x20311FFF,
  251. .flags = IORESOURCE_MEM,
  252. }, {
  253. .start = IRQ_PF4,
  254. .end = IRQ_PF4,
  255. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  256. }, {
  257. .start = 6, /* Card Detect PF6 */
  258. .end = 6,
  259. .flags = IORESOURCE_IRQ,
  260. },
  261. };
  262. static struct platform_device bfin_pcmcia_cf_device = {
  263. .name = "bfin_cf_pcmcia",
  264. .id = -1,
  265. .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
  266. .resource = bfin_pcmcia_cf_resources,
  267. };
  268. #endif
  269. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  270. static struct platform_device rtc_device = {
  271. .name = "rtc-bfin",
  272. .id = -1,
  273. };
  274. #endif
  275. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  276. #include <linux/smc91x.h>
  277. static struct smc91x_platdata smc91x_info = {
  278. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  279. .leda = RPC_LED_100_10,
  280. .ledb = RPC_LED_TX_RX,
  281. };
  282. static struct resource smc91x_resources[] = {
  283. {
  284. .name = "smc91x-regs",
  285. .start = 0x20300300,
  286. .end = 0x20300300 + 16,
  287. .flags = IORESOURCE_MEM,
  288. }, {
  289. .start = IRQ_PF7,
  290. .end = IRQ_PF7,
  291. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  292. },
  293. };
  294. static struct platform_device smc91x_device = {
  295. .name = "smc91x",
  296. .id = 0,
  297. .num_resources = ARRAY_SIZE(smc91x_resources),
  298. .resource = smc91x_resources,
  299. .dev = {
  300. .platform_data = &smc91x_info,
  301. },
  302. };
  303. #endif
  304. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  305. static struct resource dm9000_resources[] = {
  306. [0] = {
  307. .start = 0x203FB800,
  308. .end = 0x203FB800 + 1,
  309. .flags = IORESOURCE_MEM,
  310. },
  311. [1] = {
  312. .start = 0x203FB800 + 4,
  313. .end = 0x203FB800 + 5,
  314. .flags = IORESOURCE_MEM,
  315. },
  316. [2] = {
  317. .start = IRQ_PF9,
  318. .end = IRQ_PF9,
  319. .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
  320. },
  321. };
  322. static struct platform_device dm9000_device = {
  323. .name = "dm9000",
  324. .id = -1,
  325. .num_resources = ARRAY_SIZE(dm9000_resources),
  326. .resource = dm9000_resources,
  327. };
  328. #endif
  329. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  330. static struct platform_device bfin_mii_bus = {
  331. .name = "bfin_mii_bus",
  332. };
  333. static struct platform_device bfin_mac_device = {
  334. .name = "bfin_mac",
  335. .dev.platform_data = &bfin_mii_bus,
  336. };
  337. #endif
  338. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  339. static struct resource net2272_bfin_resources[] = {
  340. {
  341. .start = 0x20300000,
  342. .end = 0x20300000 + 0x100,
  343. .flags = IORESOURCE_MEM,
  344. }, {
  345. .start = IRQ_PF7,
  346. .end = IRQ_PF7,
  347. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  348. },
  349. };
  350. static struct platform_device net2272_bfin_device = {
  351. .name = "net2272",
  352. .id = -1,
  353. .num_resources = ARRAY_SIZE(net2272_bfin_resources),
  354. .resource = net2272_bfin_resources,
  355. };
  356. #endif
  357. #if defined(CONFIG_MTD_M25P80) \
  358. || defined(CONFIG_MTD_M25P80_MODULE)
  359. static struct mtd_partition bfin_spi_flash_partitions[] = {
  360. {
  361. .name = "bootloader(spi)",
  362. .size = 0x00040000,
  363. .offset = 0,
  364. .mask_flags = MTD_CAP_ROM
  365. }, {
  366. .name = "linux kernel(spi)",
  367. .size = MTDPART_SIZ_FULL,
  368. .offset = MTDPART_OFS_APPEND,
  369. }
  370. };
  371. static struct flash_platform_data bfin_spi_flash_data = {
  372. .name = "m25p80",
  373. .parts = bfin_spi_flash_partitions,
  374. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  375. .type = "m25p16",
  376. };
  377. /* SPI flash chip (m25p64) */
  378. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  379. .enable_dma = 0, /* use dma transfer with this chip*/
  380. .bits_per_word = 8,
  381. };
  382. #endif
  383. #if defined(CONFIG_BFIN_SPI_ADC) \
  384. || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  385. /* SPI ADC chip */
  386. static struct bfin5xx_spi_chip spi_adc_chip_info = {
  387. .enable_dma = 1, /* use dma transfer with this chip*/
  388. .bits_per_word = 16,
  389. };
  390. #endif
  391. #if defined(CONFIG_SND_BLACKFIN_AD183X) \
  392. || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
  393. static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
  394. .enable_dma = 0,
  395. .bits_per_word = 16,
  396. };
  397. #endif
  398. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  399. static struct bfin5xx_spi_chip mmc_spi_chip_info = {
  400. .enable_dma = 0,
  401. .bits_per_word = 8,
  402. };
  403. #endif
  404. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  405. static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
  406. .enable_dma = 0,
  407. .bits_per_word = 16,
  408. };
  409. static const struct ad7877_platform_data bfin_ad7877_ts_info = {
  410. .model = 7877,
  411. .vref_delay_usecs = 50, /* internal, no capacitor */
  412. .x_plate_ohms = 419,
  413. .y_plate_ohms = 486,
  414. .pressure_max = 1000,
  415. .pressure_min = 0,
  416. .stopacq_polarity = 1,
  417. .first_conversion_delay = 3,
  418. .acquisition_time = 1,
  419. .averaging = 1,
  420. .pen_down_acc_interval = 1,
  421. };
  422. #endif
  423. #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
  424. #include <linux/spi/ad7879.h>
  425. static const struct ad7879_platform_data bfin_ad7879_ts_info = {
  426. .model = 7879, /* Model = AD7879 */
  427. .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
  428. .pressure_max = 10000,
  429. .pressure_min = 0,
  430. .first_conversion_delay = 3, /* wait 512us before do a first conversion */
  431. .acquisition_time = 1, /* 4us acquisition time per sample */
  432. .median = 2, /* do 8 measurements */
  433. .averaging = 1, /* take the average of 4 middle samples */
  434. .pen_down_acc_interval = 255, /* 9.4 ms */
  435. .gpio_export = 0, /* Export GPIO to gpiolib */
  436. };
  437. #endif
  438. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  439. static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
  440. .enable_dma = 0,
  441. .bits_per_word = 16,
  442. };
  443. #endif
  444. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  445. static struct bfin5xx_spi_chip spidev_chip_info = {
  446. .enable_dma = 0,
  447. .bits_per_word = 8,
  448. };
  449. #endif
  450. #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
  451. static struct platform_device bfin_i2s = {
  452. .name = "bfin-i2s",
  453. .id = CONFIG_SND_BF5XX_SPORT_NUM,
  454. /* TODO: add platform data here */
  455. };
  456. #endif
  457. #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
  458. static struct platform_device bfin_tdm = {
  459. .name = "bfin-tdm",
  460. .id = CONFIG_SND_BF5XX_SPORT_NUM,
  461. /* TODO: add platform data here */
  462. };
  463. #endif
  464. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  465. static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
  466. .enable_dma = 0,
  467. .bits_per_word = 8,
  468. };
  469. #endif
  470. static struct spi_board_info bfin_spi_board_info[] __initdata = {
  471. #if defined(CONFIG_MTD_M25P80) \
  472. || defined(CONFIG_MTD_M25P80_MODULE)
  473. {
  474. /* the modalias must be the same as spi device driver name */
  475. .modalias = "m25p80", /* Name of spi_driver for this device */
  476. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  477. .bus_num = 0, /* Framework bus number */
  478. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  479. .platform_data = &bfin_spi_flash_data,
  480. .controller_data = &spi_flash_chip_info,
  481. .mode = SPI_MODE_3,
  482. },
  483. #endif
  484. #if defined(CONFIG_BFIN_SPI_ADC) \
  485. || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  486. {
  487. .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
  488. .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
  489. .bus_num = 0, /* Framework bus number */
  490. .chip_select = 1, /* Framework chip select. */
  491. .platform_data = NULL, /* No spi_driver specific config */
  492. .controller_data = &spi_adc_chip_info,
  493. },
  494. #endif
  495. #if defined(CONFIG_SND_BLACKFIN_AD183X) \
  496. || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE)
  497. {
  498. .modalias = "ad1836",
  499. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  500. .bus_num = 0,
  501. .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
  502. .controller_data = &ad1836_spi_chip_info,
  503. },
  504. #endif
  505. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  506. {
  507. .modalias = "mmc_spi",
  508. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  509. .bus_num = 0,
  510. .chip_select = 3,
  511. .controller_data = &mmc_spi_chip_info,
  512. .mode = SPI_MODE_0,
  513. },
  514. #endif
  515. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  516. {
  517. .modalias = "ad7877",
  518. .platform_data = &bfin_ad7877_ts_info,
  519. .irq = IRQ_PF8,
  520. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  521. .bus_num = 0,
  522. .chip_select = 2,
  523. .controller_data = &spi_ad7877_chip_info,
  524. },
  525. #endif
  526. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  527. {
  528. .modalias = "ad7879",
  529. .platform_data = &bfin_ad7879_ts_info,
  530. .irq = IRQ_PF8,
  531. .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
  532. .bus_num = 0,
  533. .chip_select = 3,
  534. .controller_data = &spi_ad7879_chip_info,
  535. .mode = SPI_CPHA | SPI_CPOL,
  536. },
  537. #endif
  538. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  539. {
  540. .modalias = "spidev",
  541. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  542. .bus_num = 0,
  543. .chip_select = 1,
  544. .controller_data = &spidev_chip_info,
  545. },
  546. #endif
  547. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  548. {
  549. .modalias = "bfin-lq035q1-spi",
  550. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  551. .bus_num = 0,
  552. .chip_select = 7,
  553. .controller_data = &lq035q1_spi_chip_info,
  554. .mode = SPI_CPHA | SPI_CPOL,
  555. },
  556. #endif
  557. };
  558. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  559. /* SPI controller data */
  560. static struct bfin5xx_spi_master bfin_spi0_info = {
  561. .num_chipselect = 8,
  562. .enable_dma = 1, /* master has the ability to do dma transfer */
  563. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  564. };
  565. /* SPI (0) */
  566. static struct resource bfin_spi0_resource[] = {
  567. [0] = {
  568. .start = SPI0_REGBASE,
  569. .end = SPI0_REGBASE + 0xFF,
  570. .flags = IORESOURCE_MEM,
  571. },
  572. [1] = {
  573. .start = CH_SPI,
  574. .end = CH_SPI,
  575. .flags = IORESOURCE_DMA,
  576. },
  577. [2] = {
  578. .start = IRQ_SPI,
  579. .end = IRQ_SPI,
  580. .flags = IORESOURCE_IRQ,
  581. },
  582. };
  583. static struct platform_device bfin_spi0_device = {
  584. .name = "bfin-spi",
  585. .id = 0, /* Bus number */
  586. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  587. .resource = bfin_spi0_resource,
  588. .dev = {
  589. .platform_data = &bfin_spi0_info, /* Passed to driver */
  590. },
  591. };
  592. #endif /* spi master and devices */
  593. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  594. #ifdef CONFIG_SERIAL_BFIN_UART0
  595. static struct resource bfin_uart0_resources[] = {
  596. {
  597. .start = UART0_THR,
  598. .end = UART0_GCTL+2,
  599. .flags = IORESOURCE_MEM,
  600. },
  601. {
  602. .start = IRQ_UART0_RX,
  603. .end = IRQ_UART0_RX+1,
  604. .flags = IORESOURCE_IRQ,
  605. },
  606. {
  607. .start = IRQ_UART0_ERROR,
  608. .end = IRQ_UART0_ERROR,
  609. .flags = IORESOURCE_IRQ,
  610. },
  611. {
  612. .start = CH_UART0_TX,
  613. .end = CH_UART0_TX,
  614. .flags = IORESOURCE_DMA,
  615. },
  616. {
  617. .start = CH_UART0_RX,
  618. .end = CH_UART0_RX,
  619. .flags = IORESOURCE_DMA,
  620. },
  621. };
  622. unsigned short bfin_uart0_peripherals[] = {
  623. P_UART0_TX, P_UART0_RX, 0
  624. };
  625. static struct platform_device bfin_uart0_device = {
  626. .name = "bfin-uart",
  627. .id = 0,
  628. .num_resources = ARRAY_SIZE(bfin_uart0_resources),
  629. .resource = bfin_uart0_resources,
  630. .dev = {
  631. .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
  632. },
  633. };
  634. #endif
  635. #ifdef CONFIG_SERIAL_BFIN_UART1
  636. static struct resource bfin_uart1_resources[] = {
  637. {
  638. .start = UART1_THR,
  639. .end = UART1_GCTL+2,
  640. .flags = IORESOURCE_MEM,
  641. },
  642. {
  643. .start = IRQ_UART1_RX,
  644. .end = IRQ_UART1_RX+1,
  645. .flags = IORESOURCE_IRQ,
  646. },
  647. {
  648. .start = IRQ_UART1_ERROR,
  649. .end = IRQ_UART1_ERROR,
  650. .flags = IORESOURCE_IRQ,
  651. },
  652. {
  653. .start = CH_UART1_TX,
  654. .end = CH_UART1_TX,
  655. .flags = IORESOURCE_DMA,
  656. },
  657. {
  658. .start = CH_UART1_RX,
  659. .end = CH_UART1_RX,
  660. .flags = IORESOURCE_DMA,
  661. },
  662. #ifdef CONFIG_BFIN_UART1_CTSRTS
  663. { /* CTS pin */
  664. .start = GPIO_PF9,
  665. .end = GPIO_PF9,
  666. .flags = IORESOURCE_IO,
  667. },
  668. { /* RTS pin */
  669. .start = GPIO_PF10,
  670. .end = GPIO_PF10,
  671. .flags = IORESOURCE_IO,
  672. },
  673. #endif
  674. };
  675. unsigned short bfin_uart1_peripherals[] = {
  676. P_UART1_TX, P_UART1_RX, 0
  677. };
  678. static struct platform_device bfin_uart1_device = {
  679. .name = "bfin-uart",
  680. .id = 1,
  681. .num_resources = ARRAY_SIZE(bfin_uart1_resources),
  682. .resource = bfin_uart1_resources,
  683. .dev = {
  684. .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
  685. },
  686. };
  687. #endif
  688. #endif
  689. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  690. #ifdef CONFIG_BFIN_SIR0
  691. static struct resource bfin_sir0_resources[] = {
  692. {
  693. .start = 0xFFC00400,
  694. .end = 0xFFC004FF,
  695. .flags = IORESOURCE_MEM,
  696. },
  697. {
  698. .start = IRQ_UART0_RX,
  699. .end = IRQ_UART0_RX+1,
  700. .flags = IORESOURCE_IRQ,
  701. },
  702. {
  703. .start = CH_UART0_RX,
  704. .end = CH_UART0_RX+1,
  705. .flags = IORESOURCE_DMA,
  706. },
  707. };
  708. static struct platform_device bfin_sir0_device = {
  709. .name = "bfin_sir",
  710. .id = 0,
  711. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  712. .resource = bfin_sir0_resources,
  713. };
  714. #endif
  715. #ifdef CONFIG_BFIN_SIR1
  716. static struct resource bfin_sir1_resources[] = {
  717. {
  718. .start = 0xFFC02000,
  719. .end = 0xFFC020FF,
  720. .flags = IORESOURCE_MEM,
  721. },
  722. {
  723. .start = IRQ_UART1_RX,
  724. .end = IRQ_UART1_RX+1,
  725. .flags = IORESOURCE_IRQ,
  726. },
  727. {
  728. .start = CH_UART1_RX,
  729. .end = CH_UART1_RX+1,
  730. .flags = IORESOURCE_DMA,
  731. },
  732. };
  733. static struct platform_device bfin_sir1_device = {
  734. .name = "bfin_sir",
  735. .id = 1,
  736. .num_resources = ARRAY_SIZE(bfin_sir1_resources),
  737. .resource = bfin_sir1_resources,
  738. };
  739. #endif
  740. #endif
  741. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  742. static struct resource bfin_twi0_resource[] = {
  743. [0] = {
  744. .start = TWI0_REGBASE,
  745. .end = TWI0_REGBASE,
  746. .flags = IORESOURCE_MEM,
  747. },
  748. [1] = {
  749. .start = IRQ_TWI,
  750. .end = IRQ_TWI,
  751. .flags = IORESOURCE_IRQ,
  752. },
  753. };
  754. static struct platform_device i2c_bfin_twi_device = {
  755. .name = "i2c-bfin-twi",
  756. .id = 0,
  757. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  758. .resource = bfin_twi0_resource,
  759. };
  760. #endif
  761. #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
  762. #include <linux/mfd/adp5520.h>
  763. /*
  764. * ADP5520/5501 LEDs Data
  765. */
  766. static struct led_info adp5520_leds[] = {
  767. {
  768. .name = "adp5520-led1",
  769. .default_trigger = "none",
  770. .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
  771. },
  772. };
  773. static struct adp5520_leds_platform_data adp5520_leds_data = {
  774. .num_leds = ARRAY_SIZE(adp5520_leds),
  775. .leds = adp5520_leds,
  776. .fade_in = ADP5520_FADE_T_600ms,
  777. .fade_out = ADP5520_FADE_T_600ms,
  778. .led_on_time = ADP5520_LED_ONT_600ms,
  779. };
  780. /*
  781. * ADP5520 Keypad Data
  782. */
  783. static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
  784. [ADP5520_KEY(3, 3)] = KEY_1,
  785. [ADP5520_KEY(2, 3)] = KEY_2,
  786. [ADP5520_KEY(1, 3)] = KEY_3,
  787. [ADP5520_KEY(0, 3)] = KEY_UP,
  788. [ADP5520_KEY(3, 2)] = KEY_4,
  789. [ADP5520_KEY(2, 2)] = KEY_5,
  790. [ADP5520_KEY(1, 2)] = KEY_6,
  791. [ADP5520_KEY(0, 2)] = KEY_DOWN,
  792. [ADP5520_KEY(3, 1)] = KEY_7,
  793. [ADP5520_KEY(2, 1)] = KEY_8,
  794. [ADP5520_KEY(1, 1)] = KEY_9,
  795. [ADP5520_KEY(0, 1)] = KEY_DOT,
  796. [ADP5520_KEY(3, 0)] = KEY_BACKSPACE,
  797. [ADP5520_KEY(2, 0)] = KEY_0,
  798. [ADP5520_KEY(1, 0)] = KEY_HELP,
  799. [ADP5520_KEY(0, 0)] = KEY_ENTER,
  800. };
  801. static struct adp5520_keys_platform_data adp5520_keys_data = {
  802. .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
  803. .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
  804. .keymap = adp5520_keymap,
  805. .keymapsize = ARRAY_SIZE(adp5520_keymap),
  806. .repeat = 0,
  807. };
  808. /*
  809. * ADP5520/5501 Multifuction Device Init Data
  810. */
  811. static struct adp5520_platform_data adp5520_pdev_data = {
  812. .leds = &adp5520_leds_data,
  813. .keys = &adp5520_keys_data,
  814. };
  815. #endif
  816. static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
  817. #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
  818. {
  819. I2C_BOARD_INFO("pcf8574_lcd", 0x22),
  820. },
  821. #endif
  822. #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
  823. {
  824. I2C_BOARD_INFO("pcf8574_keypad", 0x27),
  825. .irq = IRQ_PF8,
  826. },
  827. #endif
  828. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  829. {
  830. I2C_BOARD_INFO("bfin-adv7393", 0x2B),
  831. },
  832. #endif
  833. #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
  834. {
  835. I2C_BOARD_INFO("ad7879", 0x2C),
  836. .irq = IRQ_PF8,
  837. .platform_data = (void *)&bfin_ad7879_ts_info,
  838. },
  839. #endif
  840. #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
  841. {
  842. I2C_BOARD_INFO("pmic-adp5520", 0x32),
  843. .irq = IRQ_PF9,
  844. .platform_data = (void *)&adp5520_pdev_data,
  845. },
  846. #endif
  847. #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
  848. {
  849. I2C_BOARD_INFO("ssm2602", 0x1b),
  850. },
  851. #endif
  852. };
  853. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  854. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  855. static struct resource bfin_sport0_uart_resources[] = {
  856. {
  857. .start = SPORT0_TCR1,
  858. .end = SPORT0_MRCS3+4,
  859. .flags = IORESOURCE_MEM,
  860. },
  861. {
  862. .start = IRQ_SPORT0_RX,
  863. .end = IRQ_SPORT0_RX+1,
  864. .flags = IORESOURCE_IRQ,
  865. },
  866. {
  867. .start = IRQ_SPORT0_ERROR,
  868. .end = IRQ_SPORT0_ERROR,
  869. .flags = IORESOURCE_IRQ,
  870. },
  871. };
  872. unsigned short bfin_sport0_peripherals[] = {
  873. P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
  874. P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
  875. };
  876. static struct platform_device bfin_sport0_uart_device = {
  877. .name = "bfin-sport-uart",
  878. .id = 0,
  879. .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
  880. .resource = bfin_sport0_uart_resources,
  881. .dev = {
  882. .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
  883. },
  884. };
  885. #endif
  886. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  887. static struct resource bfin_sport1_uart_resources[] = {
  888. {
  889. .start = SPORT1_TCR1,
  890. .end = SPORT1_MRCS3+4,
  891. .flags = IORESOURCE_MEM,
  892. },
  893. {
  894. .start = IRQ_SPORT1_RX,
  895. .end = IRQ_SPORT1_RX+1,
  896. .flags = IORESOURCE_IRQ,
  897. },
  898. {
  899. .start = IRQ_SPORT1_ERROR,
  900. .end = IRQ_SPORT1_ERROR,
  901. .flags = IORESOURCE_IRQ,
  902. },
  903. };
  904. unsigned short bfin_sport1_peripherals[] = {
  905. P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
  906. P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
  907. };
  908. static struct platform_device bfin_sport1_uart_device = {
  909. .name = "bfin-sport-uart",
  910. .id = 1,
  911. .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
  912. .resource = bfin_sport1_uart_resources,
  913. .dev = {
  914. .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
  915. },
  916. };
  917. #endif
  918. #endif
  919. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  920. #include <linux/gpio_keys.h>
  921. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  922. {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
  923. {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
  924. };
  925. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  926. .buttons = bfin_gpio_keys_table,
  927. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  928. };
  929. static struct platform_device bfin_device_gpiokeys = {
  930. .name = "gpio-keys",
  931. .dev = {
  932. .platform_data = &bfin_gpio_keys_data,
  933. },
  934. };
  935. #endif
  936. #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
  937. #include <asm/bfin_rotary.h>
  938. static struct bfin_rotary_platform_data bfin_rotary_data = {
  939. /*.rotary_up_key = KEY_UP,*/
  940. /*.rotary_down_key = KEY_DOWN,*/
  941. .rotary_rel_code = REL_WHEEL,
  942. .rotary_button_key = KEY_ENTER,
  943. .debounce = 10, /* 0..17 */
  944. .mode = ROT_QUAD_ENC | ROT_DEBE,
  945. };
  946. static struct resource bfin_rotary_resources[] = {
  947. {
  948. .start = IRQ_CNT,
  949. .end = IRQ_CNT,
  950. .flags = IORESOURCE_IRQ,
  951. },
  952. };
  953. static struct platform_device bfin_rotary_device = {
  954. .name = "bfin-rotary",
  955. .id = -1,
  956. .num_resources = ARRAY_SIZE(bfin_rotary_resources),
  957. .resource = bfin_rotary_resources,
  958. .dev = {
  959. .platform_data = &bfin_rotary_data,
  960. },
  961. };
  962. #endif
  963. static const unsigned int cclk_vlev_datasheet[] =
  964. {
  965. VRPAIR(VLEV_100, 400000000),
  966. VRPAIR(VLEV_105, 426000000),
  967. VRPAIR(VLEV_110, 500000000),
  968. VRPAIR(VLEV_115, 533000000),
  969. VRPAIR(VLEV_120, 600000000),
  970. };
  971. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  972. .tuple_tab = cclk_vlev_datasheet,
  973. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  974. .vr_settling_time = 25 /* us */,
  975. };
  976. static struct platform_device bfin_dpmc = {
  977. .name = "bfin dpmc",
  978. .dev = {
  979. .platform_data = &bfin_dmpc_vreg_data,
  980. },
  981. };
  982. static struct platform_device *stamp_devices[] __initdata = {
  983. &bfin_dpmc,
  984. #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
  985. &bf5xx_nand_device,
  986. #endif
  987. #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
  988. &bfin_pcmcia_cf_device,
  989. #endif
  990. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  991. &rtc_device,
  992. #endif
  993. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  994. &bfin_isp1760_device,
  995. #endif
  996. #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
  997. &musb_device,
  998. #endif
  999. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  1000. &smc91x_device,
  1001. #endif
  1002. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  1003. &dm9000_device,
  1004. #endif
  1005. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  1006. &bfin_mii_bus,
  1007. &bfin_mac_device,
  1008. #endif
  1009. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  1010. &net2272_bfin_device,
  1011. #endif
  1012. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  1013. &bfin_spi0_device,
  1014. #endif
  1015. #if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE)
  1016. &bf52x_t350mcqb_device,
  1017. #endif
  1018. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  1019. &bfin_lq035q1_device,
  1020. #endif
  1021. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1022. #ifdef CONFIG_SERIAL_BFIN_UART0
  1023. &bfin_uart0_device,
  1024. #endif
  1025. #ifdef CONFIG_SERIAL_BFIN_UART1
  1026. &bfin_uart1_device,
  1027. #endif
  1028. #endif
  1029. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1030. #ifdef CONFIG_BFIN_SIR0
  1031. &bfin_sir0_device,
  1032. #endif
  1033. #ifdef CONFIG_BFIN_SIR1
  1034. &bfin_sir1_device,
  1035. #endif
  1036. #endif
  1037. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1038. &i2c_bfin_twi_device,
  1039. #endif
  1040. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1041. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  1042. &bfin_sport0_uart_device,
  1043. #endif
  1044. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  1045. &bfin_sport1_uart_device,
  1046. #endif
  1047. #endif
  1048. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  1049. &bfin_device_gpiokeys,
  1050. #endif
  1051. #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
  1052. &bfin_rotary_device,
  1053. #endif
  1054. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  1055. &ezkit_flash_device,
  1056. #endif
  1057. #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
  1058. &bfin_i2s,
  1059. #endif
  1060. #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
  1061. &bfin_tdm,
  1062. #endif
  1063. };
  1064. static int __init ezkit_init(void)
  1065. {
  1066. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  1067. i2c_register_board_info(0, bfin_i2c_board_info,
  1068. ARRAY_SIZE(bfin_i2c_board_info));
  1069. platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
  1070. spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
  1071. return 0;
  1072. }
  1073. arch_initcall(ezkit_init);
  1074. static struct platform_device *ezkit_early_devices[] __initdata = {
  1075. #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
  1076. #ifdef CONFIG_SERIAL_BFIN_UART0
  1077. &bfin_uart0_device,
  1078. #endif
  1079. #ifdef CONFIG_SERIAL_BFIN_UART1
  1080. &bfin_uart1_device,
  1081. #endif
  1082. #endif
  1083. #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
  1084. #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
  1085. &bfin_sport0_uart_device,
  1086. #endif
  1087. #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
  1088. &bfin_sport1_uart_device,
  1089. #endif
  1090. #endif
  1091. };
  1092. void __init native_machine_early_platform_add_devices(void)
  1093. {
  1094. printk(KERN_INFO "register early platform devices\n");
  1095. early_platform_add_devices(ezkit_early_devices,
  1096. ARRAY_SIZE(ezkit_early_devices));
  1097. }
  1098. void native_machine_restart(char *cmd)
  1099. {
  1100. /* workaround reboot hang when booting from SPI */
  1101. if ((bfin_read_SYSCR() & 0x7) == 0x3)
  1102. bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
  1103. }
  1104. void bfin_get_ether_addr(char *addr)
  1105. {
  1106. /* the MAC is stored in OTP memory page 0xDF */
  1107. u32 ret;
  1108. u64 otp_mac;
  1109. u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
  1110. ret = otp_read(0xDF, 0x00, &otp_mac);
  1111. if (!(ret & 0x1)) {
  1112. char *otp_mac_p = (char *)&otp_mac;
  1113. for (ret = 0; ret < 6; ++ret)
  1114. addr[ret] = otp_mac_p[5 - ret];
  1115. }
  1116. }
  1117. EXPORT_SYMBOL(bfin_get_ether_addr);