stamp.c 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750
  1. /*
  2. * File: arch/blackfin/mach-bf537/boards/stamp.c
  3. * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
  4. * Author: Aidan Williams <aidan@nicta.com.au>
  5. *
  6. * Created:
  7. * Description:
  8. *
  9. * Modified:
  10. * Copyright 2005 National ICT Australia (NICTA)
  11. * Copyright 2004-2006 Analog Devices Inc.
  12. *
  13. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2 of the License, or
  18. * (at your option) any later version.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU General Public License
  26. * along with this program; if not, see the file COPYING, or write
  27. * to the Free Software Foundation, Inc.,
  28. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  29. */
  30. #include <linux/device.h>
  31. #include <linux/kernel.h>
  32. #include <linux/platform_device.h>
  33. #include <linux/mtd/mtd.h>
  34. #include <linux/mtd/nand.h>
  35. #include <linux/mtd/partitions.h>
  36. #include <linux/mtd/plat-ram.h>
  37. #include <linux/mtd/physmap.h>
  38. #include <linux/spi/spi.h>
  39. #include <linux/spi/flash.h>
  40. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  41. #include <linux/usb/isp1362.h>
  42. #endif
  43. #include <linux/ata_platform.h>
  44. #include <linux/irq.h>
  45. #include <linux/interrupt.h>
  46. #include <linux/i2c.h>
  47. #include <linux/usb/sl811.h>
  48. #include <linux/spi/mmc_spi.h>
  49. #include <asm/dma.h>
  50. #include <asm/bfin5xx_spi.h>
  51. #include <asm/reboot.h>
  52. #include <asm/portmux.h>
  53. #include <asm/dpmc.h>
  54. /*
  55. * Name the Board for the /proc/cpuinfo
  56. */
  57. const char bfin_board_name[] = "ADI BF537-STAMP";
  58. /*
  59. * Driver needs to know address, irq and flag pin.
  60. */
  61. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  62. #include <linux/usb/isp1760.h>
  63. static struct resource bfin_isp1760_resources[] = {
  64. [0] = {
  65. .start = 0x203C0000,
  66. .end = 0x203C0000 + 0x000fffff,
  67. .flags = IORESOURCE_MEM,
  68. },
  69. [1] = {
  70. .start = IRQ_PF7,
  71. .end = IRQ_PF7,
  72. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  73. },
  74. };
  75. static struct isp1760_platform_data isp1760_priv = {
  76. .is_isp1761 = 0,
  77. .bus_width_16 = 1,
  78. .port1_otg = 0,
  79. .analog_oc = 0,
  80. .dack_polarity_high = 0,
  81. .dreq_polarity_high = 0,
  82. };
  83. static struct platform_device bfin_isp1760_device = {
  84. .name = "isp1760-hcd",
  85. .id = 0,
  86. .dev = {
  87. .platform_data = &isp1760_priv,
  88. },
  89. .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
  90. .resource = bfin_isp1760_resources,
  91. };
  92. #endif
  93. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  94. #include <linux/input.h>
  95. #include <linux/gpio_keys.h>
  96. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  97. {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
  98. {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
  99. {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
  100. {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
  101. };
  102. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  103. .buttons = bfin_gpio_keys_table,
  104. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  105. };
  106. static struct platform_device bfin_device_gpiokeys = {
  107. .name = "gpio-keys",
  108. .dev = {
  109. .platform_data = &bfin_gpio_keys_data,
  110. },
  111. };
  112. #endif
  113. static struct resource bfin_gpios_resources = {
  114. .start = 0,
  115. .end = MAX_BLACKFIN_GPIOS - 1,
  116. .flags = IORESOURCE_IRQ,
  117. };
  118. static struct platform_device bfin_gpios_device = {
  119. .name = "simple-gpio",
  120. .id = -1,
  121. .num_resources = 1,
  122. .resource = &bfin_gpios_resources,
  123. };
  124. #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
  125. static struct resource bfin_pcmcia_cf_resources[] = {
  126. {
  127. .start = 0x20310000, /* IO PORT */
  128. .end = 0x20312000,
  129. .flags = IORESOURCE_MEM,
  130. }, {
  131. .start = 0x20311000, /* Attribute Memory */
  132. .end = 0x20311FFF,
  133. .flags = IORESOURCE_MEM,
  134. }, {
  135. .start = IRQ_PF4,
  136. .end = IRQ_PF4,
  137. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  138. }, {
  139. .start = 6, /* Card Detect PF6 */
  140. .end = 6,
  141. .flags = IORESOURCE_IRQ,
  142. },
  143. };
  144. static struct platform_device bfin_pcmcia_cf_device = {
  145. .name = "bfin_cf_pcmcia",
  146. .id = -1,
  147. .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
  148. .resource = bfin_pcmcia_cf_resources,
  149. };
  150. #endif
  151. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  152. static struct platform_device rtc_device = {
  153. .name = "rtc-bfin",
  154. .id = -1,
  155. };
  156. #endif
  157. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  158. #include <linux/smc91x.h>
  159. static struct smc91x_platdata smc91x_info = {
  160. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  161. .leda = RPC_LED_100_10,
  162. .ledb = RPC_LED_TX_RX,
  163. };
  164. static struct resource smc91x_resources[] = {
  165. {
  166. .name = "smc91x-regs",
  167. .start = 0x20300300,
  168. .end = 0x20300300 + 16,
  169. .flags = IORESOURCE_MEM,
  170. }, {
  171. .start = IRQ_PF7,
  172. .end = IRQ_PF7,
  173. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  174. },
  175. };
  176. static struct platform_device smc91x_device = {
  177. .name = "smc91x",
  178. .id = 0,
  179. .num_resources = ARRAY_SIZE(smc91x_resources),
  180. .resource = smc91x_resources,
  181. .dev = {
  182. .platform_data = &smc91x_info,
  183. },
  184. };
  185. #endif
  186. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  187. static struct resource dm9000_resources[] = {
  188. [0] = {
  189. .start = 0x203FB800,
  190. .end = 0x203FB800 + 1,
  191. .flags = IORESOURCE_MEM,
  192. },
  193. [1] = {
  194. .start = 0x203FB804,
  195. .end = 0x203FB804 + 1,
  196. .flags = IORESOURCE_MEM,
  197. },
  198. [2] = {
  199. .start = IRQ_PF9,
  200. .end = IRQ_PF9,
  201. .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
  202. },
  203. };
  204. static struct platform_device dm9000_device = {
  205. .name = "dm9000",
  206. .id = -1,
  207. .num_resources = ARRAY_SIZE(dm9000_resources),
  208. .resource = dm9000_resources,
  209. };
  210. #endif
  211. #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
  212. static struct resource ax88180_resources[] = {
  213. [0] = {
  214. .start = 0x20300000,
  215. .end = 0x20300000 + 0x8000,
  216. .flags = IORESOURCE_MEM,
  217. },
  218. [1] = {
  219. .start = IRQ_PF7,
  220. .end = IRQ_PF7,
  221. .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
  222. },
  223. };
  224. static struct platform_device ax88180_device = {
  225. .name = "ax88180",
  226. .id = -1,
  227. .num_resources = ARRAY_SIZE(ax88180_resources),
  228. .resource = ax88180_resources,
  229. };
  230. #endif
  231. #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
  232. static struct resource sl811_hcd_resources[] = {
  233. {
  234. .start = 0x20340000,
  235. .end = 0x20340000,
  236. .flags = IORESOURCE_MEM,
  237. }, {
  238. .start = 0x20340004,
  239. .end = 0x20340004,
  240. .flags = IORESOURCE_MEM,
  241. }, {
  242. .start = CONFIG_USB_SL811_BFIN_IRQ,
  243. .end = CONFIG_USB_SL811_BFIN_IRQ,
  244. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  245. },
  246. };
  247. #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
  248. void sl811_port_power(struct device *dev, int is_on)
  249. {
  250. gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
  251. gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
  252. }
  253. #endif
  254. static struct sl811_platform_data sl811_priv = {
  255. .potpg = 10,
  256. .power = 250, /* == 500mA */
  257. #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
  258. .port_power = &sl811_port_power,
  259. #endif
  260. };
  261. static struct platform_device sl811_hcd_device = {
  262. .name = "sl811-hcd",
  263. .id = 0,
  264. .dev = {
  265. .platform_data = &sl811_priv,
  266. },
  267. .num_resources = ARRAY_SIZE(sl811_hcd_resources),
  268. .resource = sl811_hcd_resources,
  269. };
  270. #endif
  271. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  272. static struct resource isp1362_hcd_resources[] = {
  273. {
  274. .start = 0x20360000,
  275. .end = 0x20360000,
  276. .flags = IORESOURCE_MEM,
  277. }, {
  278. .start = 0x20360004,
  279. .end = 0x20360004,
  280. .flags = IORESOURCE_MEM,
  281. }, {
  282. .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
  283. .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
  284. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  285. },
  286. };
  287. static struct isp1362_platform_data isp1362_priv = {
  288. .sel15Kres = 1,
  289. .clknotstop = 0,
  290. .oc_enable = 0,
  291. .int_act_high = 0,
  292. .int_edge_triggered = 0,
  293. .remote_wakeup_connected = 0,
  294. .no_power_switching = 1,
  295. .power_switching_mode = 0,
  296. };
  297. static struct platform_device isp1362_hcd_device = {
  298. .name = "isp1362-hcd",
  299. .id = 0,
  300. .dev = {
  301. .platform_data = &isp1362_priv,
  302. },
  303. .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
  304. .resource = isp1362_hcd_resources,
  305. };
  306. #endif
  307. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  308. static struct platform_device bfin_mii_bus = {
  309. .name = "bfin_mii_bus",
  310. };
  311. static struct platform_device bfin_mac_device = {
  312. .name = "bfin_mac",
  313. .dev.platform_data = &bfin_mii_bus,
  314. };
  315. #endif
  316. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  317. static struct resource net2272_bfin_resources[] = {
  318. {
  319. .start = 0x20300000,
  320. .end = 0x20300000 + 0x100,
  321. .flags = IORESOURCE_MEM,
  322. }, {
  323. .start = IRQ_PF7,
  324. .end = IRQ_PF7,
  325. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  326. },
  327. };
  328. static struct platform_device net2272_bfin_device = {
  329. .name = "net2272",
  330. .id = -1,
  331. .num_resources = ARRAY_SIZE(net2272_bfin_resources),
  332. .resource = net2272_bfin_resources,
  333. };
  334. #endif
  335. #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
  336. #ifdef CONFIG_MTD_PARTITIONS
  337. const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
  338. static struct mtd_partition bfin_plat_nand_partitions[] = {
  339. {
  340. .name = "linux kernel(nand)",
  341. .size = 0x400000,
  342. .offset = 0,
  343. }, {
  344. .name = "file system(nand)",
  345. .size = MTDPART_SIZ_FULL,
  346. .offset = MTDPART_OFS_APPEND,
  347. },
  348. };
  349. #endif
  350. #define BFIN_NAND_PLAT_CLE 2
  351. #define BFIN_NAND_PLAT_ALE 1
  352. static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
  353. {
  354. struct nand_chip *this = mtd->priv;
  355. if (cmd == NAND_CMD_NONE)
  356. return;
  357. if (ctrl & NAND_CLE)
  358. writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
  359. else
  360. writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
  361. }
  362. #define BFIN_NAND_PLAT_READY GPIO_PF3
  363. static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
  364. {
  365. return gpio_get_value(BFIN_NAND_PLAT_READY);
  366. }
  367. static struct platform_nand_data bfin_plat_nand_data = {
  368. .chip = {
  369. .chip_delay = 30,
  370. #ifdef CONFIG_MTD_PARTITIONS
  371. .part_probe_types = part_probes,
  372. .partitions = bfin_plat_nand_partitions,
  373. .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
  374. #endif
  375. },
  376. .ctrl = {
  377. .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
  378. .dev_ready = bfin_plat_nand_dev_ready,
  379. },
  380. };
  381. #define MAX(x, y) (x > y ? x : y)
  382. static struct resource bfin_plat_nand_resources = {
  383. .start = 0x20212000,
  384. .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
  385. .flags = IORESOURCE_IO,
  386. };
  387. static struct platform_device bfin_async_nand_device = {
  388. .name = "gen_nand",
  389. .id = -1,
  390. .num_resources = 1,
  391. .resource = &bfin_plat_nand_resources,
  392. .dev = {
  393. .platform_data = &bfin_plat_nand_data,
  394. },
  395. };
  396. static void bfin_plat_nand_init(void)
  397. {
  398. gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
  399. }
  400. #else
  401. static void bfin_plat_nand_init(void) {}
  402. #endif
  403. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  404. static struct mtd_partition stamp_partitions[] = {
  405. {
  406. .name = "bootloader(nor)",
  407. .size = 0x40000,
  408. .offset = 0,
  409. }, {
  410. .name = "linux kernel(nor)",
  411. .size = 0x180000,
  412. .offset = MTDPART_OFS_APPEND,
  413. }, {
  414. .name = "file system(nor)",
  415. .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
  416. .offset = MTDPART_OFS_APPEND,
  417. }, {
  418. .name = "MAC Address(nor)",
  419. .size = MTDPART_SIZ_FULL,
  420. .offset = 0x3F0000,
  421. .mask_flags = MTD_WRITEABLE,
  422. }
  423. };
  424. static struct physmap_flash_data stamp_flash_data = {
  425. .width = 2,
  426. .parts = stamp_partitions,
  427. .nr_parts = ARRAY_SIZE(stamp_partitions),
  428. };
  429. static struct resource stamp_flash_resource = {
  430. .start = 0x20000000,
  431. .end = 0x203fffff,
  432. .flags = IORESOURCE_MEM,
  433. };
  434. static struct platform_device stamp_flash_device = {
  435. .name = "physmap-flash",
  436. .id = 0,
  437. .dev = {
  438. .platform_data = &stamp_flash_data,
  439. },
  440. .num_resources = 1,
  441. .resource = &stamp_flash_resource,
  442. };
  443. #endif
  444. #if defined(CONFIG_MTD_M25P80) \
  445. || defined(CONFIG_MTD_M25P80_MODULE)
  446. static struct mtd_partition bfin_spi_flash_partitions[] = {
  447. {
  448. .name = "bootloader(spi)",
  449. .size = 0x00040000,
  450. .offset = 0,
  451. .mask_flags = MTD_CAP_ROM
  452. }, {
  453. .name = "linux kernel(spi)",
  454. .size = 0x180000,
  455. .offset = MTDPART_OFS_APPEND,
  456. }, {
  457. .name = "file system(spi)",
  458. .size = MTDPART_SIZ_FULL,
  459. .offset = MTDPART_OFS_APPEND,
  460. }
  461. };
  462. static struct flash_platform_data bfin_spi_flash_data = {
  463. .name = "m25p80",
  464. .parts = bfin_spi_flash_partitions,
  465. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  466. /* .type = "m25p64", */
  467. };
  468. /* SPI flash chip (m25p64) */
  469. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  470. .enable_dma = 0, /* use dma transfer with this chip*/
  471. .bits_per_word = 8,
  472. };
  473. #endif
  474. #if defined(CONFIG_BFIN_SPI_ADC) \
  475. || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  476. /* SPI ADC chip */
  477. static struct bfin5xx_spi_chip spi_adc_chip_info = {
  478. .enable_dma = 1, /* use dma transfer with this chip*/
  479. .bits_per_word = 16,
  480. };
  481. #endif
  482. #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
  483. || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
  484. static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
  485. .enable_dma = 0,
  486. .bits_per_word = 16,
  487. };
  488. #endif
  489. #if defined(CONFIG_SND_BF5XX_SOC_AD1938) \
  490. || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
  491. static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
  492. .enable_dma = 0,
  493. .bits_per_word = 8,
  494. .cs_gpio = GPIO_PF5,
  495. };
  496. #endif
  497. #if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
  498. #include <linux/input.h>
  499. #include <linux/input/ad714x.h>
  500. static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
  501. .enable_dma = 0,
  502. .bits_per_word = 16,
  503. };
  504. static struct ad714x_slider_plat slider_plat[] = {
  505. {
  506. .start_stage = 0,
  507. .end_stage = 7,
  508. .max_coord = 128,
  509. },
  510. };
  511. static struct ad714x_button_plat button_plat[] = {
  512. {
  513. .keycode = BTN_FORWARD,
  514. .l_mask = 0,
  515. .h_mask = 0x600,
  516. },
  517. {
  518. .keycode = BTN_LEFT,
  519. .l_mask = 0,
  520. .h_mask = 0x500,
  521. },
  522. {
  523. .keycode = BTN_MIDDLE,
  524. .l_mask = 0,
  525. .h_mask = 0x800,
  526. },
  527. {
  528. .keycode = BTN_RIGHT,
  529. .l_mask = 0x100,
  530. .h_mask = 0x400,
  531. },
  532. {
  533. .keycode = BTN_BACK,
  534. .l_mask = 0x200,
  535. .h_mask = 0x400,
  536. },
  537. };
  538. static struct ad714x_platform_data ad7147_platfrom_data = {
  539. .slider_num = 1,
  540. .button_num = 5,
  541. .slider = slider_plat,
  542. .button = button_plat,
  543. .stage_cfg_reg = {
  544. {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
  545. {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
  546. {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
  547. {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
  548. {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
  549. {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
  550. {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
  551. {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
  552. {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
  553. {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
  554. {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
  555. {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
  556. },
  557. .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
  558. };
  559. #endif
  560. #if defined(CONFIG_INPUT_EVAL_AD7142EB)
  561. #include <linux/input.h>
  562. #include <linux/input/ad714x.h>
  563. static struct ad714x_button_plat button_plat[] = {
  564. {
  565. .keycode = BTN_1,
  566. .l_mask = 0,
  567. .h_mask = 0x1,
  568. },
  569. {
  570. .keycode = BTN_2,
  571. .l_mask = 0,
  572. .h_mask = 0x2,
  573. },
  574. {
  575. .keycode = BTN_3,
  576. .l_mask = 0,
  577. .h_mask = 0x4,
  578. },
  579. {
  580. .keycode = BTN_4,
  581. .l_mask = 0x0,
  582. .h_mask = 0x8,
  583. },
  584. };
  585. static struct ad714x_platform_data ad7142_platfrom_data = {
  586. .button_num = 4,
  587. .button = button_plat,
  588. .stage_cfg_reg = {
  589. /* fixme: figure out right setting for all comoponent according
  590. * to hardware feature of EVAL-AD7142EB board */
  591. {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  592. {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  593. {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  594. {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  595. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  596. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  597. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  598. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  599. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  600. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  601. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  602. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  603. },
  604. .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
  605. };
  606. #endif
  607. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  608. #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
  609. static int bfin_mmc_spi_init(struct device *dev,
  610. irqreturn_t (*detect_int)(int, void *), void *data)
  611. {
  612. return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
  613. IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
  614. }
  615. static void bfin_mmc_spi_exit(struct device *dev, void *data)
  616. {
  617. free_irq(MMC_SPI_CARD_DETECT_INT, data);
  618. }
  619. static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
  620. .init = bfin_mmc_spi_init,
  621. .exit = bfin_mmc_spi_exit,
  622. .detect_delay = 100, /* msecs */
  623. };
  624. static struct bfin5xx_spi_chip mmc_spi_chip_info = {
  625. .enable_dma = 0,
  626. .bits_per_word = 8,
  627. .pio_interrupt = 0,
  628. };
  629. #endif
  630. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  631. #include <linux/spi/ad7877.h>
  632. static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
  633. .enable_dma = 0,
  634. .bits_per_word = 16,
  635. };
  636. static const struct ad7877_platform_data bfin_ad7877_ts_info = {
  637. .model = 7877,
  638. .vref_delay_usecs = 50, /* internal, no capacitor */
  639. .x_plate_ohms = 419,
  640. .y_plate_ohms = 486,
  641. .pressure_max = 1000,
  642. .pressure_min = 0,
  643. .stopacq_polarity = 1,
  644. .first_conversion_delay = 3,
  645. .acquisition_time = 1,
  646. .averaging = 1,
  647. .pen_down_acc_interval = 1,
  648. };
  649. #endif
  650. #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
  651. #include <linux/spi/ad7879.h>
  652. static const struct ad7879_platform_data bfin_ad7879_ts_info = {
  653. .model = 7879, /* Model = AD7879 */
  654. .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
  655. .pressure_max = 10000,
  656. .pressure_min = 0,
  657. .first_conversion_delay = 3, /* wait 512us before do a first conversion */
  658. .acquisition_time = 1, /* 4us acquisition time per sample */
  659. .median = 2, /* do 8 measurements */
  660. .averaging = 1, /* take the average of 4 middle samples */
  661. .pen_down_acc_interval = 255, /* 9.4 ms */
  662. .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */
  663. .gpio_default = 1, /* During initialization set GPIO = HIGH */
  664. };
  665. #endif
  666. #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
  667. #include <linux/input.h>
  668. #include <linux/spi/adxl34x.h>
  669. static const struct adxl34x_platform_data adxl34x_info = {
  670. .x_axis_offset = 0,
  671. .y_axis_offset = 0,
  672. .z_axis_offset = 0,
  673. .tap_threshold = 0x31,
  674. .tap_duration = 0x10,
  675. .tap_latency = 0x60,
  676. .tap_window = 0xF0,
  677. .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
  678. .act_axis_control = 0xFF,
  679. .activity_threshold = 5,
  680. .inactivity_threshold = 3,
  681. .inactivity_time = 4,
  682. .free_fall_threshold = 0x7,
  683. .free_fall_time = 0x20,
  684. .data_rate = 0x8,
  685. .data_range = ADXL_FULL_RES,
  686. .ev_type = EV_ABS,
  687. .ev_code_x = ABS_X, /* EV_REL */
  688. .ev_code_y = ABS_Y, /* EV_REL */
  689. .ev_code_z = ABS_Z, /* EV_REL */
  690. .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
  691. .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
  692. .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
  693. /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
  694. /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
  695. .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
  696. .fifo_mode = ADXL_FIFO_STREAM,
  697. };
  698. #endif
  699. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  700. static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
  701. .enable_dma = 0,
  702. .bits_per_word = 16,
  703. };
  704. #endif
  705. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  706. static struct bfin5xx_spi_chip spidev_chip_info = {
  707. .enable_dma = 0,
  708. .bits_per_word = 8,
  709. };
  710. #endif
  711. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  712. static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
  713. .enable_dma = 0,
  714. .bits_per_word = 8,
  715. };
  716. #endif
  717. #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
  718. static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
  719. .enable_dma = 1,
  720. .bits_per_word = 8,
  721. .cs_gpio = GPIO_PF10,
  722. };
  723. #endif
  724. #if defined(CONFIG_MTD_DATAFLASH) \
  725. || defined(CONFIG_MTD_DATAFLASH_MODULE)
  726. static struct mtd_partition bfin_spi_dataflash_partitions[] = {
  727. {
  728. .name = "bootloader(spi)",
  729. .size = 0x00040000,
  730. .offset = 0,
  731. .mask_flags = MTD_CAP_ROM
  732. }, {
  733. .name = "linux kernel(spi)",
  734. .size = 0x180000,
  735. .offset = MTDPART_OFS_APPEND,
  736. }, {
  737. .name = "file system(spi)",
  738. .size = MTDPART_SIZ_FULL,
  739. .offset = MTDPART_OFS_APPEND,
  740. }
  741. };
  742. static struct flash_platform_data bfin_spi_dataflash_data = {
  743. .name = "SPI Dataflash",
  744. .parts = bfin_spi_dataflash_partitions,
  745. .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
  746. };
  747. /* DataFlash chip */
  748. static struct bfin5xx_spi_chip data_flash_chip_info = {
  749. .enable_dma = 0, /* use dma transfer with this chip*/
  750. .bits_per_word = 8,
  751. };
  752. #endif
  753. static struct spi_board_info bfin_spi_board_info[] __initdata = {
  754. #if defined(CONFIG_MTD_M25P80) \
  755. || defined(CONFIG_MTD_M25P80_MODULE)
  756. {
  757. /* the modalias must be the same as spi device driver name */
  758. .modalias = "m25p80", /* Name of spi_driver for this device */
  759. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  760. .bus_num = 0, /* Framework bus number */
  761. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  762. .platform_data = &bfin_spi_flash_data,
  763. .controller_data = &spi_flash_chip_info,
  764. .mode = SPI_MODE_3,
  765. },
  766. #endif
  767. #if defined(CONFIG_MTD_DATAFLASH) \
  768. || defined(CONFIG_MTD_DATAFLASH_MODULE)
  769. { /* DataFlash chip */
  770. .modalias = "mtd_dataflash",
  771. .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
  772. .bus_num = 0, /* Framework bus number */
  773. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  774. .platform_data = &bfin_spi_dataflash_data,
  775. .controller_data = &data_flash_chip_info,
  776. .mode = SPI_MODE_3,
  777. },
  778. #endif
  779. #if defined(CONFIG_BFIN_SPI_ADC) \
  780. || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  781. {
  782. .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
  783. .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
  784. .bus_num = 0, /* Framework bus number */
  785. .chip_select = 1, /* Framework chip select. */
  786. .platform_data = NULL, /* No spi_driver specific config */
  787. .controller_data = &spi_adc_chip_info,
  788. },
  789. #endif
  790. #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
  791. || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
  792. {
  793. .modalias = "ad1836",
  794. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  795. .bus_num = 0,
  796. .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
  797. .controller_data = &ad1836_spi_chip_info,
  798. .mode = SPI_MODE_3,
  799. },
  800. #endif
  801. #if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
  802. {
  803. .modalias = "ad1938",
  804. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  805. .bus_num = 0,
  806. .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
  807. .controller_data = &ad1938_spi_chip_info,
  808. .mode = SPI_MODE_3,
  809. },
  810. #endif
  811. #if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
  812. {
  813. .modalias = "ad714x_captouch",
  814. .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
  815. .irq = IRQ_PF4,
  816. .bus_num = 0,
  817. .chip_select = 5,
  818. .mode = SPI_MODE_3,
  819. .platform_data = &ad7147_platfrom_data,
  820. .controller_data = &ad7147_spi_chip_info,
  821. },
  822. #endif
  823. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  824. {
  825. .modalias = "mmc_spi",
  826. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  827. .bus_num = 0,
  828. .chip_select = 4,
  829. .platform_data = &bfin_mmc_spi_pdata,
  830. .controller_data = &mmc_spi_chip_info,
  831. .mode = SPI_MODE_3,
  832. },
  833. #endif
  834. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  835. {
  836. .modalias = "ad7877",
  837. .platform_data = &bfin_ad7877_ts_info,
  838. .irq = IRQ_PF6,
  839. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  840. .bus_num = 0,
  841. .chip_select = 1,
  842. .controller_data = &spi_ad7877_chip_info,
  843. },
  844. #endif
  845. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  846. {
  847. .modalias = "ad7879",
  848. .platform_data = &bfin_ad7879_ts_info,
  849. .irq = IRQ_PF7,
  850. .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
  851. .bus_num = 0,
  852. .chip_select = 1,
  853. .controller_data = &spi_ad7879_chip_info,
  854. .mode = SPI_CPHA | SPI_CPOL,
  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. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  867. {
  868. .modalias = "bfin-lq035q1-spi",
  869. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  870. .bus_num = 0,
  871. .chip_select = 2,
  872. .controller_data = &lq035q1_spi_chip_info,
  873. .mode = SPI_CPHA | SPI_CPOL,
  874. },
  875. #endif
  876. #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
  877. {
  878. .modalias = "enc28j60",
  879. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  880. .irq = IRQ_PF6,
  881. .bus_num = 0,
  882. .chip_select = 0, /* GPIO controlled SSEL */
  883. .controller_data = &enc28j60_spi_chip_info,
  884. .mode = SPI_MODE_0,
  885. },
  886. #endif
  887. };
  888. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  889. /* SPI controller data */
  890. static struct bfin5xx_spi_master bfin_spi0_info = {
  891. .num_chipselect = 8,
  892. .enable_dma = 1, /* master has the ability to do dma transfer */
  893. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  894. };
  895. /* SPI (0) */
  896. static struct resource bfin_spi0_resource[] = {
  897. [0] = {
  898. .start = SPI0_REGBASE,
  899. .end = SPI0_REGBASE + 0xFF,
  900. .flags = IORESOURCE_MEM,
  901. },
  902. [1] = {
  903. .start = CH_SPI,
  904. .end = CH_SPI,
  905. .flags = IORESOURCE_DMA,
  906. },
  907. [2] = {
  908. .start = IRQ_SPI,
  909. .end = IRQ_SPI,
  910. .flags = IORESOURCE_IRQ,
  911. },
  912. };
  913. static struct platform_device bfin_spi0_device = {
  914. .name = "bfin-spi",
  915. .id = 0, /* Bus number */
  916. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  917. .resource = bfin_spi0_resource,
  918. .dev = {
  919. .platform_data = &bfin_spi0_info, /* Passed to driver */
  920. },
  921. };
  922. #endif /* spi master and devices */
  923. #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
  924. /* SPORT SPI controller data */
  925. static struct bfin5xx_spi_master bfin_sport_spi0_info = {
  926. .num_chipselect = 1, /* master only supports one device */
  927. .enable_dma = 0, /* master don't support DMA */
  928. .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
  929. P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
  930. };
  931. static struct resource bfin_sport_spi0_resource[] = {
  932. [0] = {
  933. .start = SPORT0_TCR1,
  934. .end = SPORT0_TCR1 + 0xFF,
  935. .flags = IORESOURCE_MEM,
  936. },
  937. [1] = {
  938. .start = IRQ_SPORT0_ERROR,
  939. .end = IRQ_SPORT0_ERROR,
  940. .flags = IORESOURCE_IRQ,
  941. },
  942. };
  943. static struct platform_device bfin_sport_spi0_device = {
  944. .name = "bfin-sport-spi",
  945. .id = 1, /* Bus number */
  946. .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
  947. .resource = bfin_sport_spi0_resource,
  948. .dev = {
  949. .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
  950. },
  951. };
  952. static struct bfin5xx_spi_master bfin_sport_spi1_info = {
  953. .num_chipselect = 1, /* master only supports one device */
  954. .enable_dma = 0, /* master don't support DMA */
  955. .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
  956. P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
  957. };
  958. static struct resource bfin_sport_spi1_resource[] = {
  959. [0] = {
  960. .start = SPORT1_TCR1,
  961. .end = SPORT1_TCR1 + 0xFF,
  962. .flags = IORESOURCE_MEM,
  963. },
  964. [1] = {
  965. .start = IRQ_SPORT1_ERROR,
  966. .end = IRQ_SPORT1_ERROR,
  967. .flags = IORESOURCE_IRQ,
  968. },
  969. };
  970. static struct platform_device bfin_sport_spi1_device = {
  971. .name = "bfin-sport-spi",
  972. .id = 2, /* Bus number */
  973. .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
  974. .resource = bfin_sport_spi1_resource,
  975. .dev = {
  976. .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
  977. },
  978. };
  979. #endif /* sport spi master and devices */
  980. #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
  981. static struct platform_device bfin_fb_device = {
  982. .name = "bf537-lq035",
  983. };
  984. #endif
  985. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  986. static struct platform_device bfin_fb_adv7393_device = {
  987. .name = "bfin-adv7393",
  988. };
  989. #endif
  990. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  991. #include <asm/bfin-lq035q1.h>
  992. static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
  993. .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
  994. .use_bl = 0, /* let something else control the LCD Blacklight */
  995. .gpio_bl = GPIO_PF7,
  996. };
  997. static struct resource bfin_lq035q1_resources[] = {
  998. {
  999. .start = IRQ_PPI_ERROR,
  1000. .end = IRQ_PPI_ERROR,
  1001. .flags = IORESOURCE_IRQ,
  1002. },
  1003. };
  1004. static struct platform_device bfin_lq035q1_device = {
  1005. .name = "bfin-lq035q1",
  1006. .id = -1,
  1007. .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
  1008. .resource = bfin_lq035q1_resources,
  1009. .dev = {
  1010. .platform_data = &bfin_lq035q1_data,
  1011. },
  1012. };
  1013. #endif
  1014. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1015. static struct resource bfin_uart_resources[] = {
  1016. #ifdef CONFIG_SERIAL_BFIN_UART0
  1017. {
  1018. .start = 0xFFC00400,
  1019. .end = 0xFFC004FF,
  1020. .flags = IORESOURCE_MEM,
  1021. },
  1022. #endif
  1023. #ifdef CONFIG_SERIAL_BFIN_UART1
  1024. {
  1025. .start = 0xFFC02000,
  1026. .end = 0xFFC020FF,
  1027. .flags = IORESOURCE_MEM,
  1028. },
  1029. #endif
  1030. };
  1031. static struct platform_device bfin_uart_device = {
  1032. .name = "bfin-uart",
  1033. .id = 1,
  1034. .num_resources = ARRAY_SIZE(bfin_uart_resources),
  1035. .resource = bfin_uart_resources,
  1036. };
  1037. #endif
  1038. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1039. #ifdef CONFIG_BFIN_SIR0
  1040. static struct resource bfin_sir0_resources[] = {
  1041. {
  1042. .start = 0xFFC00400,
  1043. .end = 0xFFC004FF,
  1044. .flags = IORESOURCE_MEM,
  1045. },
  1046. {
  1047. .start = IRQ_UART0_RX,
  1048. .end = IRQ_UART0_RX+1,
  1049. .flags = IORESOURCE_IRQ,
  1050. },
  1051. {
  1052. .start = CH_UART0_RX,
  1053. .end = CH_UART0_RX+1,
  1054. .flags = IORESOURCE_DMA,
  1055. },
  1056. };
  1057. static struct platform_device bfin_sir0_device = {
  1058. .name = "bfin_sir",
  1059. .id = 0,
  1060. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  1061. .resource = bfin_sir0_resources,
  1062. };
  1063. #endif
  1064. #ifdef CONFIG_BFIN_SIR1
  1065. static struct resource bfin_sir1_resources[] = {
  1066. {
  1067. .start = 0xFFC02000,
  1068. .end = 0xFFC020FF,
  1069. .flags = IORESOURCE_MEM,
  1070. },
  1071. {
  1072. .start = IRQ_UART1_RX,
  1073. .end = IRQ_UART1_RX+1,
  1074. .flags = IORESOURCE_IRQ,
  1075. },
  1076. {
  1077. .start = CH_UART1_RX,
  1078. .end = CH_UART1_RX+1,
  1079. .flags = IORESOURCE_DMA,
  1080. },
  1081. };
  1082. static struct platform_device bfin_sir1_device = {
  1083. .name = "bfin_sir",
  1084. .id = 1,
  1085. .num_resources = ARRAY_SIZE(bfin_sir1_resources),
  1086. .resource = bfin_sir1_resources,
  1087. };
  1088. #endif
  1089. #endif
  1090. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1091. static struct resource bfin_twi0_resource[] = {
  1092. [0] = {
  1093. .start = TWI0_REGBASE,
  1094. .end = TWI0_REGBASE,
  1095. .flags = IORESOURCE_MEM,
  1096. },
  1097. [1] = {
  1098. .start = IRQ_TWI,
  1099. .end = IRQ_TWI,
  1100. .flags = IORESOURCE_IRQ,
  1101. },
  1102. };
  1103. static struct platform_device i2c_bfin_twi_device = {
  1104. .name = "i2c-bfin-twi",
  1105. .id = 0,
  1106. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  1107. .resource = bfin_twi0_resource,
  1108. };
  1109. #endif
  1110. #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
  1111. #include <linux/input.h>
  1112. #include <linux/i2c/adp5588.h>
  1113. static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
  1114. [0] = KEY_GRAVE,
  1115. [1] = KEY_1,
  1116. [2] = KEY_2,
  1117. [3] = KEY_3,
  1118. [4] = KEY_4,
  1119. [5] = KEY_5,
  1120. [6] = KEY_6,
  1121. [7] = KEY_7,
  1122. [8] = KEY_8,
  1123. [9] = KEY_9,
  1124. [10] = KEY_0,
  1125. [11] = KEY_MINUS,
  1126. [12] = KEY_EQUAL,
  1127. [13] = KEY_BACKSLASH,
  1128. [15] = KEY_KP0,
  1129. [16] = KEY_Q,
  1130. [17] = KEY_W,
  1131. [18] = KEY_E,
  1132. [19] = KEY_R,
  1133. [20] = KEY_T,
  1134. [21] = KEY_Y,
  1135. [22] = KEY_U,
  1136. [23] = KEY_I,
  1137. [24] = KEY_O,
  1138. [25] = KEY_P,
  1139. [26] = KEY_LEFTBRACE,
  1140. [27] = KEY_RIGHTBRACE,
  1141. [29] = KEY_KP1,
  1142. [30] = KEY_KP2,
  1143. [31] = KEY_KP3,
  1144. [32] = KEY_A,
  1145. [33] = KEY_S,
  1146. [34] = KEY_D,
  1147. [35] = KEY_F,
  1148. [36] = KEY_G,
  1149. [37] = KEY_H,
  1150. [38] = KEY_J,
  1151. [39] = KEY_K,
  1152. [40] = KEY_L,
  1153. [41] = KEY_SEMICOLON,
  1154. [42] = KEY_APOSTROPHE,
  1155. [43] = KEY_BACKSLASH,
  1156. [45] = KEY_KP4,
  1157. [46] = KEY_KP5,
  1158. [47] = KEY_KP6,
  1159. [48] = KEY_102ND,
  1160. [49] = KEY_Z,
  1161. [50] = KEY_X,
  1162. [51] = KEY_C,
  1163. [52] = KEY_V,
  1164. [53] = KEY_B,
  1165. [54] = KEY_N,
  1166. [55] = KEY_M,
  1167. [56] = KEY_COMMA,
  1168. [57] = KEY_DOT,
  1169. [58] = KEY_SLASH,
  1170. [60] = KEY_KPDOT,
  1171. [61] = KEY_KP7,
  1172. [62] = KEY_KP8,
  1173. [63] = KEY_KP9,
  1174. [64] = KEY_SPACE,
  1175. [65] = KEY_BACKSPACE,
  1176. [66] = KEY_TAB,
  1177. [67] = KEY_KPENTER,
  1178. [68] = KEY_ENTER,
  1179. [69] = KEY_ESC,
  1180. [70] = KEY_DELETE,
  1181. [74] = KEY_KPMINUS,
  1182. [76] = KEY_UP,
  1183. [77] = KEY_DOWN,
  1184. [78] = KEY_RIGHT,
  1185. [79] = KEY_LEFT,
  1186. };
  1187. static struct adp5588_kpad_platform_data adp5588_kpad_data = {
  1188. .rows = 8,
  1189. .cols = 10,
  1190. .keymap = adp5588_keymap,
  1191. .keymapsize = ARRAY_SIZE(adp5588_keymap),
  1192. .repeat = 0,
  1193. };
  1194. #endif
  1195. #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
  1196. #include <linux/mfd/adp5520.h>
  1197. /*
  1198. * ADP5520/5501 Backlight Data
  1199. */
  1200. static struct adp5520_backlight_platfrom_data adp5520_backlight_data = {
  1201. .fade_in = FADE_T_1200ms,
  1202. .fade_out = FADE_T_1200ms,
  1203. .fade_led_law = BL_LAW_LINEAR,
  1204. .en_ambl_sens = 1,
  1205. .abml_filt = BL_AMBL_FILT_640ms,
  1206. .l1_daylight_max = BL_CUR_mA(15),
  1207. .l1_daylight_dim = BL_CUR_mA(0),
  1208. .l2_office_max = BL_CUR_mA(7),
  1209. .l2_office_dim = BL_CUR_mA(0),
  1210. .l3_dark_max = BL_CUR_mA(3),
  1211. .l3_dark_dim = BL_CUR_mA(0),
  1212. .l2_trip = L2_COMP_CURR_uA(700),
  1213. .l2_hyst = L2_COMP_CURR_uA(50),
  1214. .l3_trip = L3_COMP_CURR_uA(80),
  1215. .l3_hyst = L3_COMP_CURR_uA(20),
  1216. };
  1217. /*
  1218. * ADP5520/5501 LEDs Data
  1219. */
  1220. #include <linux/leds.h>
  1221. static struct led_info adp5520_leds[] = {
  1222. {
  1223. .name = "adp5520-led1",
  1224. .default_trigger = "none",
  1225. .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | LED_OFFT_600ms,
  1226. },
  1227. #ifdef ADP5520_EN_ALL_LEDS
  1228. {
  1229. .name = "adp5520-led2",
  1230. .default_trigger = "none",
  1231. .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
  1232. },
  1233. {
  1234. .name = "adp5520-led3",
  1235. .default_trigger = "none",
  1236. .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
  1237. },
  1238. #endif
  1239. };
  1240. static struct adp5520_leds_platfrom_data adp5520_leds_data = {
  1241. .num_leds = ARRAY_SIZE(adp5520_leds),
  1242. .leds = adp5520_leds,
  1243. .fade_in = FADE_T_600ms,
  1244. .fade_out = FADE_T_600ms,
  1245. .led_on_time = LED_ONT_600ms,
  1246. };
  1247. /*
  1248. * ADP5520 GPIO Data
  1249. */
  1250. static struct adp5520_gpio_platfrom_data adp5520_gpio_data = {
  1251. .gpio_start = 50,
  1252. .gpio_en_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
  1253. .gpio_pullup_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
  1254. };
  1255. /*
  1256. * ADP5520 Keypad Data
  1257. */
  1258. #include <linux/input.h>
  1259. static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
  1260. [KEY(0, 0)] = KEY_GRAVE,
  1261. [KEY(0, 1)] = KEY_1,
  1262. [KEY(0, 2)] = KEY_2,
  1263. [KEY(0, 3)] = KEY_3,
  1264. [KEY(1, 0)] = KEY_4,
  1265. [KEY(1, 1)] = KEY_5,
  1266. [KEY(1, 2)] = KEY_6,
  1267. [KEY(1, 3)] = KEY_7,
  1268. [KEY(2, 0)] = KEY_8,
  1269. [KEY(2, 1)] = KEY_9,
  1270. [KEY(2, 2)] = KEY_0,
  1271. [KEY(2, 3)] = KEY_MINUS,
  1272. [KEY(3, 0)] = KEY_EQUAL,
  1273. [KEY(3, 1)] = KEY_BACKSLASH,
  1274. [KEY(3, 2)] = KEY_BACKSPACE,
  1275. [KEY(3, 3)] = KEY_ENTER,
  1276. };
  1277. static struct adp5520_keys_platfrom_data adp5520_keys_data = {
  1278. .rows_en_mask = ROW_R3 | ROW_R2 | ROW_R1 | ROW_R0,
  1279. .cols_en_mask = COL_C3 | COL_C2 | COL_C1 | COL_C0,
  1280. .keymap = adp5520_keymap,
  1281. .keymapsize = ARRAY_SIZE(adp5520_keymap),
  1282. .repeat = 0,
  1283. };
  1284. /*
  1285. * ADP5520/5501 Multifuction Device Init Data
  1286. */
  1287. static struct adp5520_subdev_info adp5520_subdevs[] = {
  1288. {
  1289. .name = "adp5520-backlight",
  1290. .id = ID_ADP5520,
  1291. .platform_data = &adp5520_backlight_data,
  1292. },
  1293. {
  1294. .name = "adp5520-led",
  1295. .id = ID_ADP5520,
  1296. .platform_data = &adp5520_leds_data,
  1297. },
  1298. {
  1299. .name = "adp5520-gpio",
  1300. .id = ID_ADP5520,
  1301. .platform_data = &adp5520_gpio_data,
  1302. },
  1303. {
  1304. .name = "adp5520-keys",
  1305. .id = ID_ADP5520,
  1306. .platform_data = &adp5520_keys_data,
  1307. },
  1308. };
  1309. static struct adp5520_platform_data adp5520_pdev_data = {
  1310. .num_subdevs = ARRAY_SIZE(adp5520_subdevs),
  1311. .subdevs = adp5520_subdevs,
  1312. };
  1313. #endif
  1314. #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
  1315. #include <linux/i2c/adp5588.h>
  1316. static struct adp5588_gpio_platfrom_data adp5588_gpio_data = {
  1317. .gpio_start = 50,
  1318. .pullup_dis_mask = 0,
  1319. };
  1320. #endif
  1321. static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
  1322. #if defined(CONFIG_INPUT_EVAL_AD7142EB)
  1323. {
  1324. I2C_BOARD_INFO("ad7142_captouch", 0x2C),
  1325. .irq = IRQ_PG5,
  1326. .platform_data = (void *)&ad7142_platfrom_data,
  1327. },
  1328. #endif
  1329. #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
  1330. {
  1331. I2C_BOARD_INFO("pcf8574_lcd", 0x22),
  1332. },
  1333. #endif
  1334. #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
  1335. {
  1336. I2C_BOARD_INFO("pcf8574_keypad", 0x27),
  1337. .irq = IRQ_PG6,
  1338. },
  1339. #endif
  1340. #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
  1341. {
  1342. I2C_BOARD_INFO("ad7879", 0x2F),
  1343. .irq = IRQ_PG5,
  1344. .platform_data = (void *)&bfin_ad7879_ts_info,
  1345. },
  1346. #endif
  1347. #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
  1348. {
  1349. I2C_BOARD_INFO("adp5588-keys", 0x34),
  1350. .irq = IRQ_PG0,
  1351. .platform_data = (void *)&adp5588_kpad_data,
  1352. },
  1353. #endif
  1354. #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
  1355. {
  1356. I2C_BOARD_INFO("pmic-adp5520", 0x32),
  1357. .irq = IRQ_PG0,
  1358. .platform_data = (void *)&adp5520_pdev_data,
  1359. },
  1360. #endif
  1361. #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
  1362. {
  1363. I2C_BOARD_INFO("adxl34x", 0x53),
  1364. .irq = IRQ_PG3,
  1365. .platform_data = (void *)&adxl34x_info,
  1366. },
  1367. #endif
  1368. #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
  1369. {
  1370. I2C_BOARD_INFO("adp5588-gpio", 0x34),
  1371. .platform_data = (void *)&adp5588_gpio_data,
  1372. },
  1373. #endif
  1374. };
  1375. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1376. static struct platform_device bfin_sport0_uart_device = {
  1377. .name = "bfin-sport-uart",
  1378. .id = 0,
  1379. };
  1380. static struct platform_device bfin_sport1_uart_device = {
  1381. .name = "bfin-sport-uart",
  1382. .id = 1,
  1383. };
  1384. #endif
  1385. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  1386. #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
  1387. /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
  1388. #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
  1389. #define PATA_INT IRQ_PF5
  1390. static struct pata_platform_info bfin_pata_platform_data = {
  1391. .ioport_shift = 1,
  1392. .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
  1393. };
  1394. static struct resource bfin_pata_resources[] = {
  1395. {
  1396. .start = 0x20314020,
  1397. .end = 0x2031403F,
  1398. .flags = IORESOURCE_MEM,
  1399. },
  1400. {
  1401. .start = 0x2031401C,
  1402. .end = 0x2031401F,
  1403. .flags = IORESOURCE_MEM,
  1404. },
  1405. {
  1406. .start = PATA_INT,
  1407. .end = PATA_INT,
  1408. .flags = IORESOURCE_IRQ,
  1409. },
  1410. };
  1411. #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
  1412. static struct pata_platform_info bfin_pata_platform_data = {
  1413. .ioport_shift = 0,
  1414. };
  1415. /* CompactFlash Storage Card Memory Mapped Adressing
  1416. * /REG = A11 = 1
  1417. */
  1418. static struct resource bfin_pata_resources[] = {
  1419. {
  1420. .start = 0x20211800,
  1421. .end = 0x20211807,
  1422. .flags = IORESOURCE_MEM,
  1423. },
  1424. {
  1425. .start = 0x2021180E, /* Device Ctl */
  1426. .end = 0x2021180E,
  1427. .flags = IORESOURCE_MEM,
  1428. },
  1429. };
  1430. #endif
  1431. static struct platform_device bfin_pata_device = {
  1432. .name = "pata_platform",
  1433. .id = -1,
  1434. .num_resources = ARRAY_SIZE(bfin_pata_resources),
  1435. .resource = bfin_pata_resources,
  1436. .dev = {
  1437. .platform_data = &bfin_pata_platform_data,
  1438. }
  1439. };
  1440. #endif
  1441. static const unsigned int cclk_vlev_datasheet[] =
  1442. {
  1443. VRPAIR(VLEV_085, 250000000),
  1444. VRPAIR(VLEV_090, 376000000),
  1445. VRPAIR(VLEV_095, 426000000),
  1446. VRPAIR(VLEV_100, 426000000),
  1447. VRPAIR(VLEV_105, 476000000),
  1448. VRPAIR(VLEV_110, 476000000),
  1449. VRPAIR(VLEV_115, 476000000),
  1450. VRPAIR(VLEV_120, 500000000),
  1451. VRPAIR(VLEV_125, 533000000),
  1452. VRPAIR(VLEV_130, 600000000),
  1453. };
  1454. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  1455. .tuple_tab = cclk_vlev_datasheet,
  1456. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  1457. .vr_settling_time = 25 /* us */,
  1458. };
  1459. static struct platform_device bfin_dpmc = {
  1460. .name = "bfin dpmc",
  1461. .dev = {
  1462. .platform_data = &bfin_dmpc_vreg_data,
  1463. },
  1464. };
  1465. #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
  1466. static struct platform_device bfin_tdm = {
  1467. .name = "bfin-tdm",
  1468. /* TODO: add platform data here */
  1469. };
  1470. #endif
  1471. static struct platform_device *stamp_devices[] __initdata = {
  1472. &bfin_dpmc,
  1473. #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
  1474. &bfin_pcmcia_cf_device,
  1475. #endif
  1476. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  1477. &rtc_device,
  1478. #endif
  1479. #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
  1480. &sl811_hcd_device,
  1481. #endif
  1482. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  1483. &isp1362_hcd_device,
  1484. #endif
  1485. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  1486. &bfin_isp1760_device,
  1487. #endif
  1488. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  1489. &smc91x_device,
  1490. #endif
  1491. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  1492. &dm9000_device,
  1493. #endif
  1494. #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
  1495. &ax88180_device,
  1496. #endif
  1497. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  1498. &bfin_mii_bus,
  1499. &bfin_mac_device,
  1500. #endif
  1501. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  1502. &net2272_bfin_device,
  1503. #endif
  1504. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  1505. &bfin_spi0_device,
  1506. #endif
  1507. #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
  1508. &bfin_sport_spi0_device,
  1509. &bfin_sport_spi1_device,
  1510. #endif
  1511. #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
  1512. &bfin_fb_device,
  1513. #endif
  1514. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  1515. &bfin_lq035q1_device,
  1516. #endif
  1517. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  1518. &bfin_fb_adv7393_device,
  1519. #endif
  1520. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1521. &bfin_uart_device,
  1522. #endif
  1523. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1524. #ifdef CONFIG_BFIN_SIR0
  1525. &bfin_sir0_device,
  1526. #endif
  1527. #ifdef CONFIG_BFIN_SIR1
  1528. &bfin_sir1_device,
  1529. #endif
  1530. #endif
  1531. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1532. &i2c_bfin_twi_device,
  1533. #endif
  1534. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1535. &bfin_sport0_uart_device,
  1536. &bfin_sport1_uart_device,
  1537. #endif
  1538. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  1539. &bfin_pata_device,
  1540. #endif
  1541. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  1542. &bfin_device_gpiokeys,
  1543. #endif
  1544. &bfin_gpios_device,
  1545. #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
  1546. &bfin_async_nand_device,
  1547. #endif
  1548. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  1549. &stamp_flash_device,
  1550. #endif
  1551. #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
  1552. &bfin_tdm,
  1553. #endif
  1554. };
  1555. static int __init stamp_init(void)
  1556. {
  1557. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  1558. i2c_register_board_info(0, bfin_i2c_board_info,
  1559. ARRAY_SIZE(bfin_i2c_board_info));
  1560. bfin_plat_nand_init();
  1561. platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
  1562. spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
  1563. return 0;
  1564. }
  1565. arch_initcall(stamp_init);
  1566. void native_machine_restart(char *cmd)
  1567. {
  1568. /* workaround reboot hang when booting from SPI */
  1569. if ((bfin_read_SYSCR() & 0x7) == 0x3)
  1570. bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
  1571. }
  1572. /*
  1573. * Currently the MAC address is saved in Flash by U-Boot
  1574. */
  1575. #define FLASH_MAC 0x203f0000
  1576. void bfin_get_ether_addr(char *addr)
  1577. {
  1578. *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
  1579. *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
  1580. }
  1581. EXPORT_SYMBOL(bfin_get_ether_addr);