stamp.c 29 KB

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