stamp.c 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768
  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_BLACKFIN_AD1836) \
  483. || defined(CONFIG_SND_BLACKFIN_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_AD9960) || defined(CONFIG_AD9960_MODULE)
  498. static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
  499. .enable_dma = 0,
  500. .bits_per_word = 16,
  501. };
  502. #endif
  503. #if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
  504. #include <linux/input.h>
  505. #include <linux/input/ad714x.h>
  506. static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
  507. .enable_dma = 0,
  508. .bits_per_word = 16,
  509. };
  510. static struct ad714x_slider_plat slider_plat[] = {
  511. {
  512. .start_stage = 0,
  513. .end_stage = 7,
  514. .max_coord = 128,
  515. },
  516. };
  517. static struct ad714x_button_plat button_plat[] = {
  518. {
  519. .keycode = BTN_FORWARD,
  520. .l_mask = 0,
  521. .h_mask = 0x600,
  522. },
  523. {
  524. .keycode = BTN_LEFT,
  525. .l_mask = 0,
  526. .h_mask = 0x500,
  527. },
  528. {
  529. .keycode = BTN_MIDDLE,
  530. .l_mask = 0,
  531. .h_mask = 0x800,
  532. },
  533. {
  534. .keycode = BTN_RIGHT,
  535. .l_mask = 0x100,
  536. .h_mask = 0x400,
  537. },
  538. {
  539. .keycode = BTN_BACK,
  540. .l_mask = 0x200,
  541. .h_mask = 0x400,
  542. },
  543. };
  544. static struct ad714x_platform_data ad7147_platfrom_data = {
  545. .slider_num = 1,
  546. .button_num = 5,
  547. .slider = slider_plat,
  548. .button = button_plat,
  549. .stage_cfg_reg = {
  550. {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
  551. {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
  552. {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
  553. {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
  554. {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
  555. {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
  556. {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
  557. {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
  558. {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
  559. {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
  560. {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
  561. {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
  562. },
  563. .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
  564. };
  565. #endif
  566. #if defined(CONFIG_INPUT_EVAL_AD7142EB)
  567. #include <linux/input.h>
  568. #include <linux/input/ad714x.h>
  569. static struct ad714x_button_plat button_plat[] = {
  570. {
  571. .keycode = BTN_1,
  572. .l_mask = 0,
  573. .h_mask = 0x1,
  574. },
  575. {
  576. .keycode = BTN_2,
  577. .l_mask = 0,
  578. .h_mask = 0x2,
  579. },
  580. {
  581. .keycode = BTN_3,
  582. .l_mask = 0,
  583. .h_mask = 0x4,
  584. },
  585. {
  586. .keycode = BTN_4,
  587. .l_mask = 0x0,
  588. .h_mask = 0x8,
  589. },
  590. };
  591. static struct ad714x_platform_data ad7142_platfrom_data = {
  592. .button_num = 4,
  593. .button = button_plat,
  594. .stage_cfg_reg = {
  595. /* fixme: figure out right setting for all comoponent according
  596. * to hardware feature of EVAL-AD7142EB board */
  597. {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  598. {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  599. {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  600. {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
  601. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  602. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  603. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  604. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  605. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  606. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  607. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  608. {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
  609. },
  610. .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
  611. };
  612. #endif
  613. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  614. #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
  615. static int bfin_mmc_spi_init(struct device *dev,
  616. irqreturn_t (*detect_int)(int, void *), void *data)
  617. {
  618. return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
  619. IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
  620. }
  621. static void bfin_mmc_spi_exit(struct device *dev, void *data)
  622. {
  623. free_irq(MMC_SPI_CARD_DETECT_INT, data);
  624. }
  625. static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
  626. .init = bfin_mmc_spi_init,
  627. .exit = bfin_mmc_spi_exit,
  628. .detect_delay = 100, /* msecs */
  629. };
  630. static struct bfin5xx_spi_chip mmc_spi_chip_info = {
  631. .enable_dma = 0,
  632. .bits_per_word = 8,
  633. .pio_interrupt = 0,
  634. };
  635. #endif
  636. #if defined(CONFIG_PBX)
  637. static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
  638. .ctl_reg = 0x4, /* send zero */
  639. .enable_dma = 0,
  640. .bits_per_word = 8,
  641. .cs_change_per_word = 1,
  642. };
  643. #endif
  644. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  645. #include <linux/spi/ad7877.h>
  646. static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
  647. .enable_dma = 0,
  648. .bits_per_word = 16,
  649. };
  650. static const struct ad7877_platform_data bfin_ad7877_ts_info = {
  651. .model = 7877,
  652. .vref_delay_usecs = 50, /* internal, no capacitor */
  653. .x_plate_ohms = 419,
  654. .y_plate_ohms = 486,
  655. .pressure_max = 1000,
  656. .pressure_min = 0,
  657. .stopacq_polarity = 1,
  658. .first_conversion_delay = 3,
  659. .acquisition_time = 1,
  660. .averaging = 1,
  661. .pen_down_acc_interval = 1,
  662. };
  663. #endif
  664. #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
  665. #include <linux/spi/ad7879.h>
  666. static const struct ad7879_platform_data bfin_ad7879_ts_info = {
  667. .model = 7879, /* Model = AD7879 */
  668. .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
  669. .pressure_max = 10000,
  670. .pressure_min = 0,
  671. .first_conversion_delay = 3, /* wait 512us before do a first conversion */
  672. .acquisition_time = 1, /* 4us acquisition time per sample */
  673. .median = 2, /* do 8 measurements */
  674. .averaging = 1, /* take the average of 4 middle samples */
  675. .pen_down_acc_interval = 255, /* 9.4 ms */
  676. .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */
  677. .gpio_default = 1, /* During initialization set GPIO = HIGH */
  678. };
  679. #endif
  680. #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
  681. #include <linux/input.h>
  682. #include <linux/spi/adxl34x.h>
  683. static const struct adxl34x_platform_data adxl34x_info = {
  684. .x_axis_offset = 0,
  685. .y_axis_offset = 0,
  686. .z_axis_offset = 0,
  687. .tap_threshold = 0x31,
  688. .tap_duration = 0x10,
  689. .tap_latency = 0x60,
  690. .tap_window = 0xF0,
  691. .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
  692. .act_axis_control = 0xFF,
  693. .activity_threshold = 5,
  694. .inactivity_threshold = 3,
  695. .inactivity_time = 4,
  696. .free_fall_threshold = 0x7,
  697. .free_fall_time = 0x20,
  698. .data_rate = 0x8,
  699. .data_range = ADXL_FULL_RES,
  700. .ev_type = EV_ABS,
  701. .ev_code_x = ABS_X, /* EV_REL */
  702. .ev_code_y = ABS_Y, /* EV_REL */
  703. .ev_code_z = ABS_Z, /* EV_REL */
  704. .ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
  705. .ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
  706. .ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
  707. /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
  708. /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
  709. .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
  710. .fifo_mode = ADXL_FIFO_STREAM,
  711. };
  712. #endif
  713. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  714. static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
  715. .enable_dma = 0,
  716. .bits_per_word = 16,
  717. };
  718. #endif
  719. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  720. static struct bfin5xx_spi_chip spidev_chip_info = {
  721. .enable_dma = 0,
  722. .bits_per_word = 8,
  723. };
  724. #endif
  725. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  726. static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
  727. .enable_dma = 0,
  728. .bits_per_word = 8,
  729. };
  730. #endif
  731. #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
  732. static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
  733. .enable_dma = 1,
  734. .bits_per_word = 8,
  735. .cs_gpio = GPIO_PF10,
  736. };
  737. #endif
  738. #if defined(CONFIG_MTD_DATAFLASH) \
  739. || defined(CONFIG_MTD_DATAFLASH_MODULE)
  740. static struct mtd_partition bfin_spi_dataflash_partitions[] = {
  741. {
  742. .name = "bootloader(spi)",
  743. .size = 0x00040000,
  744. .offset = 0,
  745. .mask_flags = MTD_CAP_ROM
  746. }, {
  747. .name = "linux kernel(spi)",
  748. .size = 0x180000,
  749. .offset = MTDPART_OFS_APPEND,
  750. }, {
  751. .name = "file system(spi)",
  752. .size = MTDPART_SIZ_FULL,
  753. .offset = MTDPART_OFS_APPEND,
  754. }
  755. };
  756. static struct flash_platform_data bfin_spi_dataflash_data = {
  757. .name = "SPI Dataflash",
  758. .parts = bfin_spi_dataflash_partitions,
  759. .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
  760. };
  761. /* DataFlash chip */
  762. static struct bfin5xx_spi_chip data_flash_chip_info = {
  763. .enable_dma = 0, /* use dma transfer with this chip*/
  764. .bits_per_word = 8,
  765. };
  766. #endif
  767. static struct spi_board_info bfin_spi_board_info[] __initdata = {
  768. #if defined(CONFIG_MTD_M25P80) \
  769. || defined(CONFIG_MTD_M25P80_MODULE)
  770. {
  771. /* the modalias must be the same as spi device driver name */
  772. .modalias = "m25p80", /* Name of spi_driver for this device */
  773. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  774. .bus_num = 0, /* Framework bus number */
  775. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  776. .platform_data = &bfin_spi_flash_data,
  777. .controller_data = &spi_flash_chip_info,
  778. .mode = SPI_MODE_3,
  779. },
  780. #endif
  781. #if defined(CONFIG_MTD_DATAFLASH) \
  782. || defined(CONFIG_MTD_DATAFLASH_MODULE)
  783. { /* DataFlash chip */
  784. .modalias = "mtd_dataflash",
  785. .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
  786. .bus_num = 0, /* Framework bus number */
  787. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  788. .platform_data = &bfin_spi_dataflash_data,
  789. .controller_data = &data_flash_chip_info,
  790. .mode = SPI_MODE_3,
  791. },
  792. #endif
  793. #if defined(CONFIG_BFIN_SPI_ADC) \
  794. || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  795. {
  796. .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
  797. .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
  798. .bus_num = 0, /* Framework bus number */
  799. .chip_select = 1, /* Framework chip select. */
  800. .platform_data = NULL, /* No spi_driver specific config */
  801. .controller_data = &spi_adc_chip_info,
  802. },
  803. #endif
  804. #if defined(CONFIG_SND_BLACKFIN_AD1836) \
  805. || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
  806. {
  807. .modalias = "ad1836-spi",
  808. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  809. .bus_num = 0,
  810. .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
  811. .controller_data = &ad1836_spi_chip_info,
  812. },
  813. #endif
  814. #if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
  815. {
  816. .modalias = "ad1938-spi",
  817. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  818. .bus_num = 0,
  819. .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
  820. .controller_data = &ad1938_spi_chip_info,
  821. .mode = SPI_MODE_3,
  822. },
  823. #endif
  824. #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
  825. {
  826. .modalias = "ad9960-spi",
  827. .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
  828. .bus_num = 0,
  829. .chip_select = 1,
  830. .controller_data = &ad9960_spi_chip_info,
  831. },
  832. #endif
  833. #if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
  834. {
  835. .modalias = "ad714x_captouch",
  836. .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
  837. .irq = IRQ_PF4,
  838. .bus_num = 0,
  839. .chip_select = 5,
  840. .mode = SPI_MODE_3,
  841. .platform_data = &ad7147_platfrom_data,
  842. .controller_data = &ad7147_spi_chip_info,
  843. },
  844. #endif
  845. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  846. {
  847. .modalias = "mmc_spi",
  848. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  849. .bus_num = 0,
  850. .chip_select = 4,
  851. .platform_data = &bfin_mmc_spi_pdata,
  852. .controller_data = &mmc_spi_chip_info,
  853. .mode = SPI_MODE_3,
  854. },
  855. #endif
  856. #if defined(CONFIG_PBX)
  857. {
  858. .modalias = "fxs-spi",
  859. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  860. .bus_num = 0,
  861. .chip_select = 8 - CONFIG_J11_JUMPER,
  862. .controller_data = &spi_si3xxx_chip_info,
  863. .mode = SPI_MODE_3,
  864. },
  865. {
  866. .modalias = "fxo-spi",
  867. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  868. .bus_num = 0,
  869. .chip_select = 8 - CONFIG_J19_JUMPER,
  870. .controller_data = &spi_si3xxx_chip_info,
  871. .mode = SPI_MODE_3,
  872. },
  873. #endif
  874. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  875. {
  876. .modalias = "ad7877",
  877. .platform_data = &bfin_ad7877_ts_info,
  878. .irq = IRQ_PF6,
  879. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  880. .bus_num = 0,
  881. .chip_select = 1,
  882. .controller_data = &spi_ad7877_chip_info,
  883. },
  884. #endif
  885. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  886. {
  887. .modalias = "ad7879",
  888. .platform_data = &bfin_ad7879_ts_info,
  889. .irq = IRQ_PF7,
  890. .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
  891. .bus_num = 0,
  892. .chip_select = 1,
  893. .controller_data = &spi_ad7879_chip_info,
  894. .mode = SPI_CPHA | SPI_CPOL,
  895. },
  896. #endif
  897. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  898. {
  899. .modalias = "spidev",
  900. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  901. .bus_num = 0,
  902. .chip_select = 1,
  903. .controller_data = &spidev_chip_info,
  904. },
  905. #endif
  906. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  907. {
  908. .modalias = "bfin-lq035q1-spi",
  909. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  910. .bus_num = 0,
  911. .chip_select = 2,
  912. .controller_data = &lq035q1_spi_chip_info,
  913. .mode = SPI_CPHA | SPI_CPOL,
  914. },
  915. #endif
  916. #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
  917. {
  918. .modalias = "enc28j60",
  919. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  920. .irq = IRQ_PF6,
  921. .bus_num = 0,
  922. .chip_select = 0, /* GPIO controlled SSEL */
  923. .controller_data = &enc28j60_spi_chip_info,
  924. .mode = SPI_MODE_0,
  925. },
  926. #endif
  927. };
  928. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  929. /* SPI controller data */
  930. static struct bfin5xx_spi_master bfin_spi0_info = {
  931. .num_chipselect = 8,
  932. .enable_dma = 1, /* master has the ability to do dma transfer */
  933. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  934. };
  935. /* SPI (0) */
  936. static struct resource bfin_spi0_resource[] = {
  937. [0] = {
  938. .start = SPI0_REGBASE,
  939. .end = SPI0_REGBASE + 0xFF,
  940. .flags = IORESOURCE_MEM,
  941. },
  942. [1] = {
  943. .start = CH_SPI,
  944. .end = CH_SPI,
  945. .flags = IORESOURCE_DMA,
  946. },
  947. [2] = {
  948. .start = IRQ_SPI,
  949. .end = IRQ_SPI,
  950. .flags = IORESOURCE_IRQ,
  951. },
  952. };
  953. static struct platform_device bfin_spi0_device = {
  954. .name = "bfin-spi",
  955. .id = 0, /* Bus number */
  956. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  957. .resource = bfin_spi0_resource,
  958. .dev = {
  959. .platform_data = &bfin_spi0_info, /* Passed to driver */
  960. },
  961. };
  962. #endif /* spi master and devices */
  963. #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
  964. /* SPORT SPI controller data */
  965. static struct bfin5xx_spi_master bfin_sport_spi0_info = {
  966. .num_chipselect = 1, /* master only supports one device */
  967. .enable_dma = 0, /* master don't support DMA */
  968. .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
  969. P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
  970. };
  971. static struct resource bfin_sport_spi0_resource[] = {
  972. [0] = {
  973. .start = SPORT0_TCR1,
  974. .end = SPORT0_TCR1 + 0xFF,
  975. .flags = IORESOURCE_MEM,
  976. },
  977. [1] = {
  978. .start = IRQ_SPORT0_ERROR,
  979. .end = IRQ_SPORT0_ERROR,
  980. .flags = IORESOURCE_IRQ,
  981. },
  982. };
  983. static struct platform_device bfin_sport_spi0_device = {
  984. .name = "bfin-sport-spi",
  985. .id = 1, /* Bus number */
  986. .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
  987. .resource = bfin_sport_spi0_resource,
  988. .dev = {
  989. .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
  990. },
  991. };
  992. static struct bfin5xx_spi_master bfin_sport_spi1_info = {
  993. .num_chipselect = 1, /* master only supports one device */
  994. .enable_dma = 0, /* master don't support DMA */
  995. .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
  996. P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
  997. };
  998. static struct resource bfin_sport_spi1_resource[] = {
  999. [0] = {
  1000. .start = SPORT1_TCR1,
  1001. .end = SPORT1_TCR1 + 0xFF,
  1002. .flags = IORESOURCE_MEM,
  1003. },
  1004. [1] = {
  1005. .start = IRQ_SPORT1_ERROR,
  1006. .end = IRQ_SPORT1_ERROR,
  1007. .flags = IORESOURCE_IRQ,
  1008. },
  1009. };
  1010. static struct platform_device bfin_sport_spi1_device = {
  1011. .name = "bfin-sport-spi",
  1012. .id = 2, /* Bus number */
  1013. .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
  1014. .resource = bfin_sport_spi1_resource,
  1015. .dev = {
  1016. .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
  1017. },
  1018. };
  1019. #endif /* sport spi master and devices */
  1020. #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
  1021. static struct platform_device bfin_fb_device = {
  1022. .name = "bf537-lq035",
  1023. };
  1024. #endif
  1025. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  1026. static struct platform_device bfin_fb_adv7393_device = {
  1027. .name = "bfin-adv7393",
  1028. };
  1029. #endif
  1030. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  1031. #include <asm/bfin-lq035q1.h>
  1032. static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
  1033. .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
  1034. .use_bl = 0, /* let something else control the LCD Blacklight */
  1035. .gpio_bl = GPIO_PF7,
  1036. };
  1037. static struct resource bfin_lq035q1_resources[] = {
  1038. {
  1039. .start = IRQ_PPI_ERROR,
  1040. .end = IRQ_PPI_ERROR,
  1041. .flags = IORESOURCE_IRQ,
  1042. },
  1043. };
  1044. static struct platform_device bfin_lq035q1_device = {
  1045. .name = "bfin-lq035q1",
  1046. .id = -1,
  1047. .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
  1048. .resource = bfin_lq035q1_resources,
  1049. .dev = {
  1050. .platform_data = &bfin_lq035q1_data,
  1051. },
  1052. };
  1053. #endif
  1054. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1055. static struct resource bfin_uart_resources[] = {
  1056. #ifdef CONFIG_SERIAL_BFIN_UART0
  1057. {
  1058. .start = 0xFFC00400,
  1059. .end = 0xFFC004FF,
  1060. .flags = IORESOURCE_MEM,
  1061. },
  1062. #endif
  1063. #ifdef CONFIG_SERIAL_BFIN_UART1
  1064. {
  1065. .start = 0xFFC02000,
  1066. .end = 0xFFC020FF,
  1067. .flags = IORESOURCE_MEM,
  1068. },
  1069. #endif
  1070. };
  1071. static struct platform_device bfin_uart_device = {
  1072. .name = "bfin-uart",
  1073. .id = 1,
  1074. .num_resources = ARRAY_SIZE(bfin_uart_resources),
  1075. .resource = bfin_uart_resources,
  1076. };
  1077. #endif
  1078. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1079. #ifdef CONFIG_BFIN_SIR0
  1080. static struct resource bfin_sir0_resources[] = {
  1081. {
  1082. .start = 0xFFC00400,
  1083. .end = 0xFFC004FF,
  1084. .flags = IORESOURCE_MEM,
  1085. },
  1086. {
  1087. .start = IRQ_UART0_RX,
  1088. .end = IRQ_UART0_RX+1,
  1089. .flags = IORESOURCE_IRQ,
  1090. },
  1091. {
  1092. .start = CH_UART0_RX,
  1093. .end = CH_UART0_RX+1,
  1094. .flags = IORESOURCE_DMA,
  1095. },
  1096. };
  1097. static struct platform_device bfin_sir0_device = {
  1098. .name = "bfin_sir",
  1099. .id = 0,
  1100. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  1101. .resource = bfin_sir0_resources,
  1102. };
  1103. #endif
  1104. #ifdef CONFIG_BFIN_SIR1
  1105. static struct resource bfin_sir1_resources[] = {
  1106. {
  1107. .start = 0xFFC02000,
  1108. .end = 0xFFC020FF,
  1109. .flags = IORESOURCE_MEM,
  1110. },
  1111. {
  1112. .start = IRQ_UART1_RX,
  1113. .end = IRQ_UART1_RX+1,
  1114. .flags = IORESOURCE_IRQ,
  1115. },
  1116. {
  1117. .start = CH_UART1_RX,
  1118. .end = CH_UART1_RX+1,
  1119. .flags = IORESOURCE_DMA,
  1120. },
  1121. };
  1122. static struct platform_device bfin_sir1_device = {
  1123. .name = "bfin_sir",
  1124. .id = 1,
  1125. .num_resources = ARRAY_SIZE(bfin_sir1_resources),
  1126. .resource = bfin_sir1_resources,
  1127. };
  1128. #endif
  1129. #endif
  1130. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1131. static struct resource bfin_twi0_resource[] = {
  1132. [0] = {
  1133. .start = TWI0_REGBASE,
  1134. .end = TWI0_REGBASE,
  1135. .flags = IORESOURCE_MEM,
  1136. },
  1137. [1] = {
  1138. .start = IRQ_TWI,
  1139. .end = IRQ_TWI,
  1140. .flags = IORESOURCE_IRQ,
  1141. },
  1142. };
  1143. static struct platform_device i2c_bfin_twi_device = {
  1144. .name = "i2c-bfin-twi",
  1145. .id = 0,
  1146. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  1147. .resource = bfin_twi0_resource,
  1148. };
  1149. #endif
  1150. #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
  1151. #include <linux/input.h>
  1152. #include <linux/i2c/adp5588.h>
  1153. static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
  1154. [0] = KEY_GRAVE,
  1155. [1] = KEY_1,
  1156. [2] = KEY_2,
  1157. [3] = KEY_3,
  1158. [4] = KEY_4,
  1159. [5] = KEY_5,
  1160. [6] = KEY_6,
  1161. [7] = KEY_7,
  1162. [8] = KEY_8,
  1163. [9] = KEY_9,
  1164. [10] = KEY_0,
  1165. [11] = KEY_MINUS,
  1166. [12] = KEY_EQUAL,
  1167. [13] = KEY_BACKSLASH,
  1168. [15] = KEY_KP0,
  1169. [16] = KEY_Q,
  1170. [17] = KEY_W,
  1171. [18] = KEY_E,
  1172. [19] = KEY_R,
  1173. [20] = KEY_T,
  1174. [21] = KEY_Y,
  1175. [22] = KEY_U,
  1176. [23] = KEY_I,
  1177. [24] = KEY_O,
  1178. [25] = KEY_P,
  1179. [26] = KEY_LEFTBRACE,
  1180. [27] = KEY_RIGHTBRACE,
  1181. [29] = KEY_KP1,
  1182. [30] = KEY_KP2,
  1183. [31] = KEY_KP3,
  1184. [32] = KEY_A,
  1185. [33] = KEY_S,
  1186. [34] = KEY_D,
  1187. [35] = KEY_F,
  1188. [36] = KEY_G,
  1189. [37] = KEY_H,
  1190. [38] = KEY_J,
  1191. [39] = KEY_K,
  1192. [40] = KEY_L,
  1193. [41] = KEY_SEMICOLON,
  1194. [42] = KEY_APOSTROPHE,
  1195. [43] = KEY_BACKSLASH,
  1196. [45] = KEY_KP4,
  1197. [46] = KEY_KP5,
  1198. [47] = KEY_KP6,
  1199. [48] = KEY_102ND,
  1200. [49] = KEY_Z,
  1201. [50] = KEY_X,
  1202. [51] = KEY_C,
  1203. [52] = KEY_V,
  1204. [53] = KEY_B,
  1205. [54] = KEY_N,
  1206. [55] = KEY_M,
  1207. [56] = KEY_COMMA,
  1208. [57] = KEY_DOT,
  1209. [58] = KEY_SLASH,
  1210. [60] = KEY_KPDOT,
  1211. [61] = KEY_KP7,
  1212. [62] = KEY_KP8,
  1213. [63] = KEY_KP9,
  1214. [64] = KEY_SPACE,
  1215. [65] = KEY_BACKSPACE,
  1216. [66] = KEY_TAB,
  1217. [67] = KEY_KPENTER,
  1218. [68] = KEY_ENTER,
  1219. [69] = KEY_ESC,
  1220. [70] = KEY_DELETE,
  1221. [74] = KEY_KPMINUS,
  1222. [76] = KEY_UP,
  1223. [77] = KEY_DOWN,
  1224. [78] = KEY_RIGHT,
  1225. [79] = KEY_LEFT,
  1226. };
  1227. static struct adp5588_kpad_platform_data adp5588_kpad_data = {
  1228. .rows = 8,
  1229. .cols = 10,
  1230. .keymap = adp5588_keymap,
  1231. .keymapsize = ARRAY_SIZE(adp5588_keymap),
  1232. .repeat = 0,
  1233. };
  1234. #endif
  1235. #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
  1236. #include <linux/mfd/adp5520.h>
  1237. /*
  1238. * ADP5520/5501 Backlight Data
  1239. */
  1240. static struct adp5520_backlight_platfrom_data adp5520_backlight_data = {
  1241. .fade_in = FADE_T_1200ms,
  1242. .fade_out = FADE_T_1200ms,
  1243. .fade_led_law = BL_LAW_LINEAR,
  1244. .en_ambl_sens = 1,
  1245. .abml_filt = BL_AMBL_FILT_640ms,
  1246. .l1_daylight_max = BL_CUR_mA(15),
  1247. .l1_daylight_dim = BL_CUR_mA(0),
  1248. .l2_office_max = BL_CUR_mA(7),
  1249. .l2_office_dim = BL_CUR_mA(0),
  1250. .l3_dark_max = BL_CUR_mA(3),
  1251. .l3_dark_dim = BL_CUR_mA(0),
  1252. .l2_trip = L2_COMP_CURR_uA(700),
  1253. .l2_hyst = L2_COMP_CURR_uA(50),
  1254. .l3_trip = L3_COMP_CURR_uA(80),
  1255. .l3_hyst = L3_COMP_CURR_uA(20),
  1256. };
  1257. /*
  1258. * ADP5520/5501 LEDs Data
  1259. */
  1260. #include <linux/leds.h>
  1261. static struct led_info adp5520_leds[] = {
  1262. {
  1263. .name = "adp5520-led1",
  1264. .default_trigger = "none",
  1265. .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | LED_OFFT_600ms,
  1266. },
  1267. #ifdef ADP5520_EN_ALL_LEDS
  1268. {
  1269. .name = "adp5520-led2",
  1270. .default_trigger = "none",
  1271. .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
  1272. },
  1273. {
  1274. .name = "adp5520-led3",
  1275. .default_trigger = "none",
  1276. .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
  1277. },
  1278. #endif
  1279. };
  1280. static struct adp5520_leds_platfrom_data adp5520_leds_data = {
  1281. .num_leds = ARRAY_SIZE(adp5520_leds),
  1282. .leds = adp5520_leds,
  1283. .fade_in = FADE_T_600ms,
  1284. .fade_out = FADE_T_600ms,
  1285. .led_on_time = LED_ONT_600ms,
  1286. };
  1287. /*
  1288. * ADP5520 GPIO Data
  1289. */
  1290. static struct adp5520_gpio_platfrom_data adp5520_gpio_data = {
  1291. .gpio_start = 50,
  1292. .gpio_en_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
  1293. .gpio_pullup_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
  1294. };
  1295. /*
  1296. * ADP5520 Keypad Data
  1297. */
  1298. #include <linux/input.h>
  1299. static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
  1300. [KEY(0, 0)] = KEY_GRAVE,
  1301. [KEY(0, 1)] = KEY_1,
  1302. [KEY(0, 2)] = KEY_2,
  1303. [KEY(0, 3)] = KEY_3,
  1304. [KEY(1, 0)] = KEY_4,
  1305. [KEY(1, 1)] = KEY_5,
  1306. [KEY(1, 2)] = KEY_6,
  1307. [KEY(1, 3)] = KEY_7,
  1308. [KEY(2, 0)] = KEY_8,
  1309. [KEY(2, 1)] = KEY_9,
  1310. [KEY(2, 2)] = KEY_0,
  1311. [KEY(2, 3)] = KEY_MINUS,
  1312. [KEY(3, 0)] = KEY_EQUAL,
  1313. [KEY(3, 1)] = KEY_BACKSLASH,
  1314. [KEY(3, 2)] = KEY_BACKSPACE,
  1315. [KEY(3, 3)] = KEY_ENTER,
  1316. };
  1317. static struct adp5520_keys_platfrom_data adp5520_keys_data = {
  1318. .rows_en_mask = ROW_R3 | ROW_R2 | ROW_R1 | ROW_R0,
  1319. .cols_en_mask = COL_C3 | COL_C2 | COL_C1 | COL_C0,
  1320. .keymap = adp5520_keymap,
  1321. .keymapsize = ARRAY_SIZE(adp5520_keymap),
  1322. .repeat = 0,
  1323. };
  1324. /*
  1325. * ADP5520/5501 Multifuction Device Init Data
  1326. */
  1327. static struct adp5520_subdev_info adp5520_subdevs[] = {
  1328. {
  1329. .name = "adp5520-backlight",
  1330. .id = ID_ADP5520,
  1331. .platform_data = &adp5520_backlight_data,
  1332. },
  1333. {
  1334. .name = "adp5520-led",
  1335. .id = ID_ADP5520,
  1336. .platform_data = &adp5520_leds_data,
  1337. },
  1338. {
  1339. .name = "adp5520-gpio",
  1340. .id = ID_ADP5520,
  1341. .platform_data = &adp5520_gpio_data,
  1342. },
  1343. {
  1344. .name = "adp5520-keys",
  1345. .id = ID_ADP5520,
  1346. .platform_data = &adp5520_keys_data,
  1347. },
  1348. };
  1349. static struct adp5520_platform_data adp5520_pdev_data = {
  1350. .num_subdevs = ARRAY_SIZE(adp5520_subdevs),
  1351. .subdevs = adp5520_subdevs,
  1352. };
  1353. #endif
  1354. static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
  1355. #if defined(CONFIG_INPUT_EVAL_AD7142EB)
  1356. {
  1357. I2C_BOARD_INFO("ad7142_captouch", 0x2C),
  1358. .irq = IRQ_PG5,
  1359. .platform_data = (void *)&ad7142_platfrom_data,
  1360. },
  1361. #endif
  1362. #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
  1363. {
  1364. I2C_BOARD_INFO("pcf8574_lcd", 0x22),
  1365. },
  1366. #endif
  1367. #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
  1368. {
  1369. I2C_BOARD_INFO("pcf8574_keypad", 0x27),
  1370. .irq = IRQ_PG6,
  1371. },
  1372. #endif
  1373. #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
  1374. {
  1375. I2C_BOARD_INFO("ad7879", 0x2F),
  1376. .irq = IRQ_PG5,
  1377. .platform_data = (void *)&bfin_ad7879_ts_info,
  1378. },
  1379. #endif
  1380. #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
  1381. {
  1382. I2C_BOARD_INFO("adp5588-keys", 0x34),
  1383. .irq = IRQ_PG0,
  1384. .platform_data = (void *)&adp5588_kpad_data,
  1385. },
  1386. #endif
  1387. #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
  1388. {
  1389. I2C_BOARD_INFO("pmic-adp5520", 0x32),
  1390. .irq = IRQ_PG0,
  1391. .platform_data = (void *)&adp5520_pdev_data,
  1392. },
  1393. #endif
  1394. #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
  1395. {
  1396. I2C_BOARD_INFO("adxl34x", 0x53),
  1397. .irq = IRQ_PG3,
  1398. .platform_data = (void *)&adxl34x_info,
  1399. },
  1400. #endif
  1401. };
  1402. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1403. static struct platform_device bfin_sport0_uart_device = {
  1404. .name = "bfin-sport-uart",
  1405. .id = 0,
  1406. };
  1407. static struct platform_device bfin_sport1_uart_device = {
  1408. .name = "bfin-sport-uart",
  1409. .id = 1,
  1410. };
  1411. #endif
  1412. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  1413. #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
  1414. /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
  1415. #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
  1416. #define PATA_INT IRQ_PF5
  1417. static struct pata_platform_info bfin_pata_platform_data = {
  1418. .ioport_shift = 1,
  1419. .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
  1420. };
  1421. static struct resource bfin_pata_resources[] = {
  1422. {
  1423. .start = 0x20314020,
  1424. .end = 0x2031403F,
  1425. .flags = IORESOURCE_MEM,
  1426. },
  1427. {
  1428. .start = 0x2031401C,
  1429. .end = 0x2031401F,
  1430. .flags = IORESOURCE_MEM,
  1431. },
  1432. {
  1433. .start = PATA_INT,
  1434. .end = PATA_INT,
  1435. .flags = IORESOURCE_IRQ,
  1436. },
  1437. };
  1438. #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
  1439. static struct pata_platform_info bfin_pata_platform_data = {
  1440. .ioport_shift = 0,
  1441. };
  1442. /* CompactFlash Storage Card Memory Mapped Adressing
  1443. * /REG = A11 = 1
  1444. */
  1445. static struct resource bfin_pata_resources[] = {
  1446. {
  1447. .start = 0x20211800,
  1448. .end = 0x20211807,
  1449. .flags = IORESOURCE_MEM,
  1450. },
  1451. {
  1452. .start = 0x2021180E, /* Device Ctl */
  1453. .end = 0x2021180E,
  1454. .flags = IORESOURCE_MEM,
  1455. },
  1456. };
  1457. #endif
  1458. static struct platform_device bfin_pata_device = {
  1459. .name = "pata_platform",
  1460. .id = -1,
  1461. .num_resources = ARRAY_SIZE(bfin_pata_resources),
  1462. .resource = bfin_pata_resources,
  1463. .dev = {
  1464. .platform_data = &bfin_pata_platform_data,
  1465. }
  1466. };
  1467. #endif
  1468. static const unsigned int cclk_vlev_datasheet[] =
  1469. {
  1470. VRPAIR(VLEV_085, 250000000),
  1471. VRPAIR(VLEV_090, 376000000),
  1472. VRPAIR(VLEV_095, 426000000),
  1473. VRPAIR(VLEV_100, 426000000),
  1474. VRPAIR(VLEV_105, 476000000),
  1475. VRPAIR(VLEV_110, 476000000),
  1476. VRPAIR(VLEV_115, 476000000),
  1477. VRPAIR(VLEV_120, 500000000),
  1478. VRPAIR(VLEV_125, 533000000),
  1479. VRPAIR(VLEV_130, 600000000),
  1480. };
  1481. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  1482. .tuple_tab = cclk_vlev_datasheet,
  1483. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  1484. .vr_settling_time = 25 /* us */,
  1485. };
  1486. static struct platform_device bfin_dpmc = {
  1487. .name = "bfin dpmc",
  1488. .dev = {
  1489. .platform_data = &bfin_dmpc_vreg_data,
  1490. },
  1491. };
  1492. static struct platform_device *stamp_devices[] __initdata = {
  1493. &bfin_dpmc,
  1494. #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
  1495. &bfin_pcmcia_cf_device,
  1496. #endif
  1497. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  1498. &rtc_device,
  1499. #endif
  1500. #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
  1501. &sl811_hcd_device,
  1502. #endif
  1503. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  1504. &isp1362_hcd_device,
  1505. #endif
  1506. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  1507. &bfin_isp1760_device,
  1508. #endif
  1509. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  1510. &smc91x_device,
  1511. #endif
  1512. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  1513. &dm9000_device,
  1514. #endif
  1515. #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
  1516. &ax88180_device,
  1517. #endif
  1518. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  1519. &bfin_mii_bus,
  1520. &bfin_mac_device,
  1521. #endif
  1522. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  1523. &net2272_bfin_device,
  1524. #endif
  1525. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  1526. &bfin_spi0_device,
  1527. #endif
  1528. #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
  1529. &bfin_sport_spi0_device,
  1530. &bfin_sport_spi1_device,
  1531. #endif
  1532. #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
  1533. &bfin_fb_device,
  1534. #endif
  1535. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  1536. &bfin_lq035q1_device,
  1537. #endif
  1538. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  1539. &bfin_fb_adv7393_device,
  1540. #endif
  1541. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1542. &bfin_uart_device,
  1543. #endif
  1544. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1545. #ifdef CONFIG_BFIN_SIR0
  1546. &bfin_sir0_device,
  1547. #endif
  1548. #ifdef CONFIG_BFIN_SIR1
  1549. &bfin_sir1_device,
  1550. #endif
  1551. #endif
  1552. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1553. &i2c_bfin_twi_device,
  1554. #endif
  1555. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1556. &bfin_sport0_uart_device,
  1557. &bfin_sport1_uart_device,
  1558. #endif
  1559. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  1560. &bfin_pata_device,
  1561. #endif
  1562. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  1563. &bfin_device_gpiokeys,
  1564. #endif
  1565. &bfin_gpios_device,
  1566. #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
  1567. &bfin_async_nand_device,
  1568. #endif
  1569. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  1570. &stamp_flash_device,
  1571. #endif
  1572. };
  1573. static int __init stamp_init(void)
  1574. {
  1575. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  1576. i2c_register_board_info(0, bfin_i2c_board_info,
  1577. ARRAY_SIZE(bfin_i2c_board_info));
  1578. bfin_plat_nand_init();
  1579. platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
  1580. spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
  1581. return 0;
  1582. }
  1583. arch_initcall(stamp_init);
  1584. void native_machine_restart(char *cmd)
  1585. {
  1586. /* workaround reboot hang when booting from SPI */
  1587. if ((bfin_read_SYSCR() & 0x7) == 0x3)
  1588. bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
  1589. }
  1590. /*
  1591. * Currently the MAC address is saved in Flash by U-Boot
  1592. */
  1593. #define FLASH_MAC 0x203f0000
  1594. void bfin_get_ether_addr(char *addr)
  1595. {
  1596. *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
  1597. *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
  1598. }
  1599. EXPORT_SYMBOL(bfin_get_ether_addr);