stamp.c 43 KB

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