stamp.c 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288
  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,
  73. },
  74. };
  75. static struct isp1760_platform_data isp1760_priv = {
  76. .is_isp1761 = 0,
  77. .port1_disable = 0,
  78. .bus_width_16 = 1,
  79. .port1_otg = 0,
  80. .analog_oc = 0,
  81. .dack_polarity_high = 0,
  82. .dreq_polarity_high = 0,
  83. };
  84. static struct platform_device bfin_isp1760_device = {
  85. .name = "isp1760-hcd",
  86. .id = 0,
  87. .dev = {
  88. .platform_data = &isp1760_priv,
  89. },
  90. .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
  91. .resource = bfin_isp1760_resources,
  92. };
  93. #endif
  94. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  95. #include <linux/input.h>
  96. #include <linux/gpio_keys.h>
  97. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  98. {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
  99. {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
  100. {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
  101. {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
  102. };
  103. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  104. .buttons = bfin_gpio_keys_table,
  105. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  106. };
  107. static struct platform_device bfin_device_gpiokeys = {
  108. .name = "gpio-keys",
  109. .dev = {
  110. .platform_data = &bfin_gpio_keys_data,
  111. },
  112. };
  113. #endif
  114. static struct resource bfin_gpios_resources = {
  115. .start = 0,
  116. .end = MAX_BLACKFIN_GPIOS - 1,
  117. .flags = IORESOURCE_IRQ,
  118. };
  119. static struct platform_device bfin_gpios_device = {
  120. .name = "simple-gpio",
  121. .id = -1,
  122. .num_resources = 1,
  123. .resource = &bfin_gpios_resources,
  124. };
  125. #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
  126. static struct resource bfin_pcmcia_cf_resources[] = {
  127. {
  128. .start = 0x20310000, /* IO PORT */
  129. .end = 0x20312000,
  130. .flags = IORESOURCE_MEM,
  131. }, {
  132. .start = 0x20311000, /* Attribute Memory */
  133. .end = 0x20311FFF,
  134. .flags = IORESOURCE_MEM,
  135. }, {
  136. .start = IRQ_PF4,
  137. .end = IRQ_PF4,
  138. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  139. }, {
  140. .start = 6, /* Card Detect PF6 */
  141. .end = 6,
  142. .flags = IORESOURCE_IRQ,
  143. },
  144. };
  145. static struct platform_device bfin_pcmcia_cf_device = {
  146. .name = "bfin_cf_pcmcia",
  147. .id = -1,
  148. .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
  149. .resource = bfin_pcmcia_cf_resources,
  150. };
  151. #endif
  152. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  153. static struct platform_device rtc_device = {
  154. .name = "rtc-bfin",
  155. .id = -1,
  156. };
  157. #endif
  158. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  159. static struct resource smc91x_resources[] = {
  160. {
  161. .name = "smc91x-regs",
  162. .start = 0x20300300,
  163. .end = 0x20300300 + 16,
  164. .flags = IORESOURCE_MEM,
  165. }, {
  166. .start = IRQ_PF7,
  167. .end = IRQ_PF7,
  168. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  169. },
  170. };
  171. static struct platform_device smc91x_device = {
  172. .name = "smc91x",
  173. .id = 0,
  174. .num_resources = ARRAY_SIZE(smc91x_resources),
  175. .resource = smc91x_resources,
  176. };
  177. #endif
  178. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  179. static struct resource dm9000_resources[] = {
  180. [0] = {
  181. .start = 0x203FB800,
  182. .end = 0x203FB800 + 8,
  183. .flags = IORESOURCE_MEM,
  184. },
  185. [1] = {
  186. .start = IRQ_PF9,
  187. .end = IRQ_PF9,
  188. .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
  189. },
  190. };
  191. static struct platform_device dm9000_device = {
  192. .name = "dm9000",
  193. .id = -1,
  194. .num_resources = ARRAY_SIZE(dm9000_resources),
  195. .resource = dm9000_resources,
  196. };
  197. #endif
  198. #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
  199. static struct resource ax88180_resources[] = {
  200. [0] = {
  201. .start = 0x20300000,
  202. .end = 0x20300000 + 0x8000,
  203. .flags = IORESOURCE_MEM,
  204. },
  205. [1] = {
  206. .start = IRQ_PF7,
  207. .end = IRQ_PF7,
  208. .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL),
  209. },
  210. };
  211. static struct platform_device ax88180_device = {
  212. .name = "ax88180",
  213. .id = -1,
  214. .num_resources = ARRAY_SIZE(ax88180_resources),
  215. .resource = ax88180_resources,
  216. };
  217. #endif
  218. #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
  219. static struct resource sl811_hcd_resources[] = {
  220. {
  221. .start = 0x20340000,
  222. .end = 0x20340000,
  223. .flags = IORESOURCE_MEM,
  224. }, {
  225. .start = 0x20340004,
  226. .end = 0x20340004,
  227. .flags = IORESOURCE_MEM,
  228. }, {
  229. .start = CONFIG_USB_SL811_BFIN_IRQ,
  230. .end = CONFIG_USB_SL811_BFIN_IRQ,
  231. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  232. },
  233. };
  234. #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
  235. void sl811_port_power(struct device *dev, int is_on)
  236. {
  237. gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
  238. gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
  239. }
  240. #endif
  241. static struct sl811_platform_data sl811_priv = {
  242. .potpg = 10,
  243. .power = 250, /* == 500mA */
  244. #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
  245. .port_power = &sl811_port_power,
  246. #endif
  247. };
  248. static struct platform_device sl811_hcd_device = {
  249. .name = "sl811-hcd",
  250. .id = 0,
  251. .dev = {
  252. .platform_data = &sl811_priv,
  253. },
  254. .num_resources = ARRAY_SIZE(sl811_hcd_resources),
  255. .resource = sl811_hcd_resources,
  256. };
  257. #endif
  258. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  259. static struct resource isp1362_hcd_resources[] = {
  260. {
  261. .start = 0x20360000,
  262. .end = 0x20360000,
  263. .flags = IORESOURCE_MEM,
  264. }, {
  265. .start = 0x20360004,
  266. .end = 0x20360004,
  267. .flags = IORESOURCE_MEM,
  268. }, {
  269. .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
  270. .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
  271. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  272. },
  273. };
  274. static struct isp1362_platform_data isp1362_priv = {
  275. .sel15Kres = 1,
  276. .clknotstop = 0,
  277. .oc_enable = 0,
  278. .int_act_high = 0,
  279. .int_edge_triggered = 0,
  280. .remote_wakeup_connected = 0,
  281. .no_power_switching = 1,
  282. .power_switching_mode = 0,
  283. };
  284. static struct platform_device isp1362_hcd_device = {
  285. .name = "isp1362-hcd",
  286. .id = 0,
  287. .dev = {
  288. .platform_data = &isp1362_priv,
  289. },
  290. .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
  291. .resource = isp1362_hcd_resources,
  292. };
  293. #endif
  294. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  295. static struct platform_device bfin_mac_device = {
  296. .name = "bfin_mac",
  297. };
  298. #endif
  299. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  300. static struct resource net2272_bfin_resources[] = {
  301. {
  302. .start = 0x20300000,
  303. .end = 0x20300000 + 0x100,
  304. .flags = IORESOURCE_MEM,
  305. }, {
  306. .start = IRQ_PF7,
  307. .end = IRQ_PF7,
  308. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  309. },
  310. };
  311. static struct platform_device net2272_bfin_device = {
  312. .name = "net2272",
  313. .id = -1,
  314. .num_resources = ARRAY_SIZE(net2272_bfin_resources),
  315. .resource = net2272_bfin_resources,
  316. };
  317. #endif
  318. #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
  319. #ifdef CONFIG_MTD_PARTITIONS
  320. const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
  321. static struct mtd_partition bfin_plat_nand_partitions[] = {
  322. {
  323. .name = "linux kernel(nand)",
  324. .size = 0x400000,
  325. .offset = 0,
  326. }, {
  327. .name = "file system(nand)",
  328. .size = MTDPART_SIZ_FULL,
  329. .offset = MTDPART_OFS_APPEND,
  330. },
  331. };
  332. #endif
  333. #define BFIN_NAND_PLAT_CLE 2
  334. #define BFIN_NAND_PLAT_ALE 1
  335. static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
  336. {
  337. struct nand_chip *this = mtd->priv;
  338. if (cmd == NAND_CMD_NONE)
  339. return;
  340. if (ctrl & NAND_CLE)
  341. writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
  342. else
  343. writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
  344. }
  345. #define BFIN_NAND_PLAT_READY GPIO_PF3
  346. static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
  347. {
  348. return gpio_get_value(BFIN_NAND_PLAT_READY);
  349. }
  350. static struct platform_nand_data bfin_plat_nand_data = {
  351. .chip = {
  352. .chip_delay = 30,
  353. #ifdef CONFIG_MTD_PARTITIONS
  354. .part_probe_types = part_probes,
  355. .partitions = bfin_plat_nand_partitions,
  356. .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
  357. #endif
  358. },
  359. .ctrl = {
  360. .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
  361. .dev_ready = bfin_plat_nand_dev_ready,
  362. },
  363. };
  364. #define MAX(x, y) (x > y ? x : y)
  365. static struct resource bfin_plat_nand_resources = {
  366. .start = 0x20212000,
  367. .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
  368. .flags = IORESOURCE_IO,
  369. };
  370. static struct platform_device bfin_async_nand_device = {
  371. .name = "gen_nand",
  372. .id = -1,
  373. .num_resources = 1,
  374. .resource = &bfin_plat_nand_resources,
  375. .dev = {
  376. .platform_data = &bfin_plat_nand_data,
  377. },
  378. };
  379. static void bfin_plat_nand_init(void)
  380. {
  381. gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
  382. }
  383. #else
  384. static void bfin_plat_nand_init(void) {}
  385. #endif
  386. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  387. static struct mtd_partition stamp_partitions[] = {
  388. {
  389. .name = "bootloader(nor)",
  390. .size = 0x40000,
  391. .offset = 0,
  392. }, {
  393. .name = "linux kernel(nor)",
  394. .size = 0xE0000,
  395. .offset = MTDPART_OFS_APPEND,
  396. }, {
  397. .name = "file system(nor)",
  398. .size = 0x400000 - 0x40000 - 0xE0000 - 0x10000,
  399. .offset = MTDPART_OFS_APPEND,
  400. }, {
  401. .name = "MAC Address(nor)",
  402. .size = MTDPART_SIZ_FULL,
  403. .offset = 0x3F0000,
  404. .mask_flags = MTD_WRITEABLE,
  405. }
  406. };
  407. static struct physmap_flash_data stamp_flash_data = {
  408. .width = 2,
  409. .parts = stamp_partitions,
  410. .nr_parts = ARRAY_SIZE(stamp_partitions),
  411. };
  412. static struct resource stamp_flash_resource = {
  413. .start = 0x20000000,
  414. .end = 0x203fffff,
  415. .flags = IORESOURCE_MEM,
  416. };
  417. static struct platform_device stamp_flash_device = {
  418. .name = "physmap-flash",
  419. .id = 0,
  420. .dev = {
  421. .platform_data = &stamp_flash_data,
  422. },
  423. .num_resources = 1,
  424. .resource = &stamp_flash_resource,
  425. };
  426. #endif
  427. #if defined(CONFIG_MTD_M25P80) \
  428. || defined(CONFIG_MTD_M25P80_MODULE)
  429. static struct mtd_partition bfin_spi_flash_partitions[] = {
  430. {
  431. .name = "bootloader(spi)",
  432. .size = 0x00040000,
  433. .offset = 0,
  434. .mask_flags = MTD_CAP_ROM
  435. }, {
  436. .name = "linux kernel(spi)",
  437. .size = 0xe0000,
  438. .offset = MTDPART_OFS_APPEND,
  439. }, {
  440. .name = "file system(spi)",
  441. .size = MTDPART_SIZ_FULL,
  442. .offset = MTDPART_OFS_APPEND,
  443. }
  444. };
  445. static struct flash_platform_data bfin_spi_flash_data = {
  446. .name = "m25p80",
  447. .parts = bfin_spi_flash_partitions,
  448. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  449. /* .type = "m25p64", */
  450. };
  451. /* SPI flash chip (m25p64) */
  452. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  453. .enable_dma = 0, /* use dma transfer with this chip*/
  454. .bits_per_word = 8,
  455. };
  456. #endif
  457. #if defined(CONFIG_SPI_ADC_BF533) \
  458. || defined(CONFIG_SPI_ADC_BF533_MODULE)
  459. /* SPI ADC chip */
  460. static struct bfin5xx_spi_chip spi_adc_chip_info = {
  461. .enable_dma = 1, /* use dma transfer with this chip*/
  462. .bits_per_word = 16,
  463. };
  464. #endif
  465. #if defined(CONFIG_SND_BLACKFIN_AD1836) \
  466. || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
  467. static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
  468. .enable_dma = 0,
  469. .bits_per_word = 16,
  470. };
  471. #endif
  472. #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
  473. static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
  474. .enable_dma = 0,
  475. .bits_per_word = 16,
  476. };
  477. #endif
  478. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  479. #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
  480. static int bfin_mmc_spi_init(struct device *dev,
  481. irqreturn_t (*detect_int)(int, void *), void *data)
  482. {
  483. return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
  484. IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
  485. }
  486. static void bfin_mmc_spi_exit(struct device *dev, void *data)
  487. {
  488. free_irq(MMC_SPI_CARD_DETECT_INT, data);
  489. }
  490. static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
  491. .init = bfin_mmc_spi_init,
  492. .exit = bfin_mmc_spi_exit,
  493. .detect_delay = 100, /* msecs */
  494. };
  495. static struct bfin5xx_spi_chip mmc_spi_chip_info = {
  496. .enable_dma = 0,
  497. .bits_per_word = 8,
  498. };
  499. #endif
  500. #if defined(CONFIG_PBX)
  501. static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
  502. .ctl_reg = 0x4, /* send zero */
  503. .enable_dma = 0,
  504. .bits_per_word = 8,
  505. .cs_change_per_word = 1,
  506. };
  507. #endif
  508. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  509. #include <linux/spi/ad7877.h>
  510. static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
  511. .enable_dma = 0,
  512. .bits_per_word = 16,
  513. };
  514. static const struct ad7877_platform_data bfin_ad7877_ts_info = {
  515. .model = 7877,
  516. .vref_delay_usecs = 50, /* internal, no capacitor */
  517. .x_plate_ohms = 419,
  518. .y_plate_ohms = 486,
  519. .pressure_max = 1000,
  520. .pressure_min = 0,
  521. .stopacq_polarity = 1,
  522. .first_conversion_delay = 3,
  523. .acquisition_time = 1,
  524. .averaging = 1,
  525. .pen_down_acc_interval = 1,
  526. };
  527. #endif
  528. #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
  529. #include <linux/spi/ad7879.h>
  530. static const struct ad7879_platform_data bfin_ad7879_ts_info = {
  531. .model = 7879, /* Model = AD7879 */
  532. .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
  533. .pressure_max = 10000,
  534. .pressure_min = 0,
  535. .first_conversion_delay = 3, /* wait 512us before do a first conversion */
  536. .acquisition_time = 1, /* 4us acquisition time per sample */
  537. .median = 2, /* do 8 measurements */
  538. .averaging = 1, /* take the average of 4 middle samples */
  539. .pen_down_acc_interval = 255, /* 9.4 ms */
  540. .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */
  541. .gpio_default = 1, /* During initialization set GPIO = HIGH */
  542. };
  543. #endif
  544. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  545. static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
  546. .enable_dma = 0,
  547. .bits_per_word = 16,
  548. };
  549. #endif
  550. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  551. static struct bfin5xx_spi_chip spidev_chip_info = {
  552. .enable_dma = 0,
  553. .bits_per_word = 8,
  554. };
  555. #endif
  556. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  557. static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
  558. .enable_dma = 0,
  559. .bits_per_word = 8,
  560. };
  561. #endif
  562. #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
  563. static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
  564. .enable_dma = 1,
  565. .bits_per_word = 8,
  566. .cs_gpio = GPIO_PF10,
  567. };
  568. #endif
  569. #if defined(CONFIG_MTD_DATAFLASH) \
  570. || defined(CONFIG_MTD_DATAFLASH_MODULE)
  571. static struct mtd_partition bfin_spi_dataflash_partitions[] = {
  572. {
  573. .name = "bootloader(spi)",
  574. .size = 0x00040000,
  575. .offset = 0,
  576. .mask_flags = MTD_CAP_ROM
  577. }, {
  578. .name = "linux kernel(spi)",
  579. .size = 0xe0000,
  580. .offset = MTDPART_OFS_APPEND,
  581. }, {
  582. .name = "file system(spi)",
  583. .size = MTDPART_SIZ_FULL,
  584. .offset = MTDPART_OFS_APPEND,
  585. }
  586. };
  587. static struct flash_platform_data bfin_spi_dataflash_data = {
  588. .name = "SPI Dataflash",
  589. .parts = bfin_spi_dataflash_partitions,
  590. .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
  591. };
  592. /* DataFlash chip */
  593. static struct bfin5xx_spi_chip data_flash_chip_info = {
  594. .enable_dma = 0, /* use dma transfer with this chip*/
  595. .bits_per_word = 8,
  596. };
  597. #endif
  598. static struct spi_board_info bfin_spi_board_info[] __initdata = {
  599. #if defined(CONFIG_MTD_M25P80) \
  600. || defined(CONFIG_MTD_M25P80_MODULE)
  601. {
  602. /* the modalias must be the same as spi device driver name */
  603. .modalias = "m25p80", /* Name of spi_driver for this device */
  604. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  605. .bus_num = 0, /* Framework bus number */
  606. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  607. .platform_data = &bfin_spi_flash_data,
  608. .controller_data = &spi_flash_chip_info,
  609. .mode = SPI_MODE_3,
  610. },
  611. #endif
  612. #if defined(CONFIG_MTD_DATAFLASH) \
  613. || defined(CONFIG_MTD_DATAFLASH_MODULE)
  614. { /* DataFlash chip */
  615. .modalias = "mtd_dataflash",
  616. .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
  617. .bus_num = 0, /* Framework bus number */
  618. .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
  619. .platform_data = &bfin_spi_dataflash_data,
  620. .controller_data = &data_flash_chip_info,
  621. .mode = SPI_MODE_3,
  622. },
  623. #endif
  624. #if defined(CONFIG_SPI_ADC_BF533) \
  625. || defined(CONFIG_SPI_ADC_BF533_MODULE)
  626. {
  627. .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
  628. .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
  629. .bus_num = 0, /* Framework bus number */
  630. .chip_select = 1, /* Framework chip select. */
  631. .platform_data = NULL, /* No spi_driver specific config */
  632. .controller_data = &spi_adc_chip_info,
  633. },
  634. #endif
  635. #if defined(CONFIG_SND_BLACKFIN_AD1836) \
  636. || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
  637. {
  638. .modalias = "ad1836-spi",
  639. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  640. .bus_num = 0,
  641. .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
  642. .controller_data = &ad1836_spi_chip_info,
  643. },
  644. #endif
  645. #if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
  646. {
  647. .modalias = "ad9960-spi",
  648. .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
  649. .bus_num = 0,
  650. .chip_select = 1,
  651. .controller_data = &ad9960_spi_chip_info,
  652. },
  653. #endif
  654. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  655. {
  656. .modalias = "mmc_spi",
  657. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  658. .bus_num = 0,
  659. .chip_select = 4,
  660. .platform_data = &bfin_mmc_spi_pdata,
  661. .controller_data = &mmc_spi_chip_info,
  662. .mode = SPI_MODE_3,
  663. },
  664. #endif
  665. #if defined(CONFIG_PBX)
  666. {
  667. .modalias = "fxs-spi",
  668. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  669. .bus_num = 0,
  670. .chip_select = 8 - CONFIG_J11_JUMPER,
  671. .controller_data = &spi_si3xxx_chip_info,
  672. .mode = SPI_MODE_3,
  673. },
  674. {
  675. .modalias = "fxo-spi",
  676. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  677. .bus_num = 0,
  678. .chip_select = 8 - CONFIG_J19_JUMPER,
  679. .controller_data = &spi_si3xxx_chip_info,
  680. .mode = SPI_MODE_3,
  681. },
  682. #endif
  683. #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
  684. {
  685. .modalias = "ad7877",
  686. .platform_data = &bfin_ad7877_ts_info,
  687. .irq = IRQ_PF6,
  688. .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
  689. .bus_num = 0,
  690. .chip_select = 1,
  691. .controller_data = &spi_ad7877_chip_info,
  692. },
  693. #endif
  694. #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
  695. {
  696. .modalias = "ad7879",
  697. .platform_data = &bfin_ad7879_ts_info,
  698. .irq = IRQ_PF7,
  699. .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
  700. .bus_num = 0,
  701. .chip_select = 1,
  702. .controller_data = &spi_ad7879_chip_info,
  703. .mode = SPI_CPHA | SPI_CPOL,
  704. },
  705. #endif
  706. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  707. {
  708. .modalias = "spidev",
  709. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  710. .bus_num = 0,
  711. .chip_select = 1,
  712. .controller_data = &spidev_chip_info,
  713. },
  714. #endif
  715. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  716. {
  717. .modalias = "bfin-lq035q1-spi",
  718. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  719. .bus_num = 0,
  720. .chip_select = 2,
  721. .controller_data = &lq035q1_spi_chip_info,
  722. .mode = SPI_CPHA | SPI_CPOL,
  723. },
  724. #endif
  725. #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
  726. {
  727. .modalias = "enc28j60",
  728. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  729. .irq = IRQ_PF6,
  730. .bus_num = 0,
  731. .chip_select = 0, /* GPIO controlled SSEL */
  732. .controller_data = &enc28j60_spi_chip_info,
  733. .mode = SPI_MODE_0,
  734. },
  735. #endif
  736. };
  737. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  738. /* SPI controller data */
  739. static struct bfin5xx_spi_master bfin_spi0_info = {
  740. .num_chipselect = 8,
  741. .enable_dma = 1, /* master has the ability to do dma transfer */
  742. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  743. };
  744. /* SPI (0) */
  745. static struct resource bfin_spi0_resource[] = {
  746. [0] = {
  747. .start = SPI0_REGBASE,
  748. .end = SPI0_REGBASE + 0xFF,
  749. .flags = IORESOURCE_MEM,
  750. },
  751. [1] = {
  752. .start = CH_SPI,
  753. .end = CH_SPI,
  754. .flags = IORESOURCE_IRQ,
  755. },
  756. };
  757. static struct platform_device bfin_spi0_device = {
  758. .name = "bfin-spi",
  759. .id = 0, /* Bus number */
  760. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  761. .resource = bfin_spi0_resource,
  762. .dev = {
  763. .platform_data = &bfin_spi0_info, /* Passed to driver */
  764. },
  765. };
  766. #endif /* spi master and devices */
  767. #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
  768. static struct platform_device bfin_fb_device = {
  769. .name = "bf537-lq035",
  770. };
  771. #endif
  772. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  773. static struct platform_device bfin_fb_adv7393_device = {
  774. .name = "bfin-adv7393",
  775. };
  776. #endif
  777. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  778. #include <asm/bfin-lq035q1.h>
  779. static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
  780. .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
  781. .use_bl = 0, /* let something else control the LCD Blacklight */
  782. .gpio_bl = GPIO_PF7,
  783. };
  784. static struct resource bfin_lq035q1_resources[] = {
  785. {
  786. .start = IRQ_PPI_ERROR,
  787. .end = IRQ_PPI_ERROR,
  788. .flags = IORESOURCE_IRQ,
  789. },
  790. };
  791. static struct platform_device bfin_lq035q1_device = {
  792. .name = "bfin-lq035q1",
  793. .id = -1,
  794. .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
  795. .resource = bfin_lq035q1_resources,
  796. .dev = {
  797. .platform_data = &bfin_lq035q1_data,
  798. },
  799. };
  800. #endif
  801. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  802. static struct resource bfin_uart_resources[] = {
  803. #ifdef CONFIG_SERIAL_BFIN_UART0
  804. {
  805. .start = 0xFFC00400,
  806. .end = 0xFFC004FF,
  807. .flags = IORESOURCE_MEM,
  808. },
  809. #endif
  810. #ifdef CONFIG_SERIAL_BFIN_UART1
  811. {
  812. .start = 0xFFC02000,
  813. .end = 0xFFC020FF,
  814. .flags = IORESOURCE_MEM,
  815. },
  816. #endif
  817. };
  818. static struct platform_device bfin_uart_device = {
  819. .name = "bfin-uart",
  820. .id = 1,
  821. .num_resources = ARRAY_SIZE(bfin_uart_resources),
  822. .resource = bfin_uart_resources,
  823. };
  824. #endif
  825. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  826. static struct resource bfin_sir_resources[] = {
  827. #ifdef CONFIG_BFIN_SIR0
  828. {
  829. .start = 0xFFC00400,
  830. .end = 0xFFC004FF,
  831. .flags = IORESOURCE_MEM,
  832. },
  833. #endif
  834. #ifdef CONFIG_BFIN_SIR1
  835. {
  836. .start = 0xFFC02000,
  837. .end = 0xFFC020FF,
  838. .flags = IORESOURCE_MEM,
  839. },
  840. #endif
  841. };
  842. static struct platform_device bfin_sir_device = {
  843. .name = "bfin_sir",
  844. .id = 0,
  845. .num_resources = ARRAY_SIZE(bfin_sir_resources),
  846. .resource = bfin_sir_resources,
  847. };
  848. #endif
  849. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  850. static struct resource bfin_twi0_resource[] = {
  851. [0] = {
  852. .start = TWI0_REGBASE,
  853. .end = TWI0_REGBASE,
  854. .flags = IORESOURCE_MEM,
  855. },
  856. [1] = {
  857. .start = IRQ_TWI,
  858. .end = IRQ_TWI,
  859. .flags = IORESOURCE_IRQ,
  860. },
  861. };
  862. static struct platform_device i2c_bfin_twi_device = {
  863. .name = "i2c-bfin-twi",
  864. .id = 0,
  865. .num_resources = ARRAY_SIZE(bfin_twi0_resource),
  866. .resource = bfin_twi0_resource,
  867. };
  868. #endif
  869. #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
  870. #include <linux/input.h>
  871. #include <linux/i2c/adp5588_keys.h>
  872. static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
  873. [0] = KEY_GRAVE,
  874. [1] = KEY_1,
  875. [2] = KEY_2,
  876. [3] = KEY_3,
  877. [4] = KEY_4,
  878. [5] = KEY_5,
  879. [6] = KEY_6,
  880. [7] = KEY_7,
  881. [8] = KEY_8,
  882. [9] = KEY_9,
  883. [10] = KEY_0,
  884. [11] = KEY_MINUS,
  885. [12] = KEY_EQUAL,
  886. [13] = KEY_BACKSLASH,
  887. [15] = KEY_KP0,
  888. [16] = KEY_Q,
  889. [17] = KEY_W,
  890. [18] = KEY_E,
  891. [19] = KEY_R,
  892. [20] = KEY_T,
  893. [21] = KEY_Y,
  894. [22] = KEY_U,
  895. [23] = KEY_I,
  896. [24] = KEY_O,
  897. [25] = KEY_P,
  898. [26] = KEY_LEFTBRACE,
  899. [27] = KEY_RIGHTBRACE,
  900. [29] = KEY_KP1,
  901. [30] = KEY_KP2,
  902. [31] = KEY_KP3,
  903. [32] = KEY_A,
  904. [33] = KEY_S,
  905. [34] = KEY_D,
  906. [35] = KEY_F,
  907. [36] = KEY_G,
  908. [37] = KEY_H,
  909. [38] = KEY_J,
  910. [39] = KEY_K,
  911. [40] = KEY_L,
  912. [41] = KEY_SEMICOLON,
  913. [42] = KEY_APOSTROPHE,
  914. [43] = KEY_BACKSLASH,
  915. [45] = KEY_KP4,
  916. [46] = KEY_KP5,
  917. [47] = KEY_KP6,
  918. [48] = KEY_102ND,
  919. [49] = KEY_Z,
  920. [50] = KEY_X,
  921. [51] = KEY_C,
  922. [52] = KEY_V,
  923. [53] = KEY_B,
  924. [54] = KEY_N,
  925. [55] = KEY_M,
  926. [56] = KEY_COMMA,
  927. [57] = KEY_DOT,
  928. [58] = KEY_SLASH,
  929. [60] = KEY_KPDOT,
  930. [61] = KEY_KP7,
  931. [62] = KEY_KP8,
  932. [63] = KEY_KP9,
  933. [64] = KEY_SPACE,
  934. [65] = KEY_BACKSPACE,
  935. [66] = KEY_TAB,
  936. [67] = KEY_KPENTER,
  937. [68] = KEY_ENTER,
  938. [69] = KEY_ESC,
  939. [70] = KEY_DELETE,
  940. [74] = KEY_KPMINUS,
  941. [76] = KEY_UP,
  942. [77] = KEY_DOWN,
  943. [78] = KEY_RIGHT,
  944. [79] = KEY_LEFT,
  945. };
  946. static struct adp5588_kpad_platform_data adp5588_kpad_data = {
  947. .rows = 8,
  948. .cols = 10,
  949. .keymap = adp5588_keymap,
  950. .keymapsize = ARRAY_SIZE(adp5588_keymap),
  951. .repeat = 0,
  952. };
  953. #endif
  954. #ifdef CONFIG_I2C_BOARDINFO
  955. static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
  956. #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
  957. {
  958. I2C_BOARD_INFO("ad7142_joystick", 0x2C),
  959. .irq = IRQ_PF5,
  960. },
  961. #endif
  962. #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
  963. {
  964. I2C_BOARD_INFO("pcf8574_lcd", 0x22),
  965. },
  966. #endif
  967. #if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
  968. {
  969. I2C_BOARD_INFO("pcf8574_keypad", 0x27),
  970. .irq = IRQ_PG6,
  971. },
  972. #endif
  973. #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
  974. {
  975. I2C_BOARD_INFO("ad7879", 0x2F),
  976. .irq = IRQ_PG5,
  977. .platform_data = (void *)&bfin_ad7879_ts_info,
  978. },
  979. #endif
  980. #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
  981. {
  982. I2C_BOARD_INFO("adp5588-keys", 0x34),
  983. .irq = IRQ_PG0,
  984. .platform_data = (void *)&adp5588_kpad_data,
  985. },
  986. #endif
  987. };
  988. #endif
  989. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  990. static struct platform_device bfin_sport0_uart_device = {
  991. .name = "bfin-sport-uart",
  992. .id = 0,
  993. };
  994. static struct platform_device bfin_sport1_uart_device = {
  995. .name = "bfin-sport-uart",
  996. .id = 1,
  997. };
  998. #endif
  999. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  1000. #define PATA_INT IRQ_PF5
  1001. static struct pata_platform_info bfin_pata_platform_data = {
  1002. .ioport_shift = 1,
  1003. .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
  1004. };
  1005. static struct resource bfin_pata_resources[] = {
  1006. {
  1007. .start = 0x20314020,
  1008. .end = 0x2031403F,
  1009. .flags = IORESOURCE_MEM,
  1010. },
  1011. {
  1012. .start = 0x2031401C,
  1013. .end = 0x2031401F,
  1014. .flags = IORESOURCE_MEM,
  1015. },
  1016. {
  1017. .start = PATA_INT,
  1018. .end = PATA_INT,
  1019. .flags = IORESOURCE_IRQ,
  1020. },
  1021. };
  1022. static struct platform_device bfin_pata_device = {
  1023. .name = "pata_platform",
  1024. .id = -1,
  1025. .num_resources = ARRAY_SIZE(bfin_pata_resources),
  1026. .resource = bfin_pata_resources,
  1027. .dev = {
  1028. .platform_data = &bfin_pata_platform_data,
  1029. }
  1030. };
  1031. #endif
  1032. static const unsigned int cclk_vlev_datasheet[] =
  1033. {
  1034. VRPAIR(VLEV_085, 250000000),
  1035. VRPAIR(VLEV_090, 376000000),
  1036. VRPAIR(VLEV_095, 426000000),
  1037. VRPAIR(VLEV_100, 426000000),
  1038. VRPAIR(VLEV_105, 476000000),
  1039. VRPAIR(VLEV_110, 476000000),
  1040. VRPAIR(VLEV_115, 476000000),
  1041. VRPAIR(VLEV_120, 500000000),
  1042. VRPAIR(VLEV_125, 533000000),
  1043. VRPAIR(VLEV_130, 600000000),
  1044. };
  1045. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  1046. .tuple_tab = cclk_vlev_datasheet,
  1047. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  1048. .vr_settling_time = 25 /* us */,
  1049. };
  1050. static struct platform_device bfin_dpmc = {
  1051. .name = "bfin dpmc",
  1052. .dev = {
  1053. .platform_data = &bfin_dmpc_vreg_data,
  1054. },
  1055. };
  1056. static struct platform_device *stamp_devices[] __initdata = {
  1057. &bfin_dpmc,
  1058. #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
  1059. &bfin_pcmcia_cf_device,
  1060. #endif
  1061. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  1062. &rtc_device,
  1063. #endif
  1064. #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
  1065. &sl811_hcd_device,
  1066. #endif
  1067. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  1068. &isp1362_hcd_device,
  1069. #endif
  1070. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  1071. &bfin_isp1760_device,
  1072. #endif
  1073. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  1074. &smc91x_device,
  1075. #endif
  1076. #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
  1077. &dm9000_device,
  1078. #endif
  1079. #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
  1080. &ax88180_device,
  1081. #endif
  1082. #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
  1083. &bfin_mac_device,
  1084. #endif
  1085. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  1086. &net2272_bfin_device,
  1087. #endif
  1088. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  1089. &bfin_spi0_device,
  1090. #endif
  1091. #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
  1092. &bfin_fb_device,
  1093. #endif
  1094. #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
  1095. &bfin_lq035q1_device,
  1096. #endif
  1097. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  1098. &bfin_fb_adv7393_device,
  1099. #endif
  1100. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  1101. &bfin_uart_device,
  1102. #endif
  1103. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  1104. &bfin_sir_device,
  1105. #endif
  1106. #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
  1107. &i2c_bfin_twi_device,
  1108. #endif
  1109. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  1110. &bfin_sport0_uart_device,
  1111. &bfin_sport1_uart_device,
  1112. #endif
  1113. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  1114. &bfin_pata_device,
  1115. #endif
  1116. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  1117. &bfin_device_gpiokeys,
  1118. #endif
  1119. &bfin_gpios_device,
  1120. #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
  1121. &bfin_async_nand_device,
  1122. #endif
  1123. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  1124. &stamp_flash_device,
  1125. #endif
  1126. };
  1127. static int __init stamp_init(void)
  1128. {
  1129. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  1130. #ifdef CONFIG_I2C_BOARDINFO
  1131. i2c_register_board_info(0, bfin_i2c_board_info,
  1132. ARRAY_SIZE(bfin_i2c_board_info));
  1133. #endif
  1134. bfin_plat_nand_init();
  1135. platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
  1136. spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
  1137. #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
  1138. irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
  1139. #endif
  1140. return 0;
  1141. }
  1142. arch_initcall(stamp_init);
  1143. void native_machine_restart(char *cmd)
  1144. {
  1145. /* workaround reboot hang when booting from SPI */
  1146. if ((bfin_read_SYSCR() & 0x7) == 0x3)
  1147. bfin_gpio_reset_spi0_ssel1();
  1148. }
  1149. /*
  1150. * Currently the MAC address is saved in Flash by U-Boot
  1151. */
  1152. #define FLASH_MAC 0x203f0000
  1153. void bfin_get_ether_addr(char *addr)
  1154. {
  1155. *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
  1156. *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
  1157. }
  1158. EXPORT_SYMBOL(bfin_get_ether_addr);