stamp.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /*
  2. * File: arch/blackfin/mach-bf533/stamp.c
  3. * Based on: arch/blackfin/mach-bf533/ezkit.c
  4. * Author: Aidan Williams <aidan@nicta.com.au>
  5. *
  6. * Created: 2005
  7. * Description: Board Info File for the BF533-STAMP
  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/platform_device.h>
  32. #include <linux/mtd/mtd.h>
  33. #include <linux/mtd/partitions.h>
  34. #include <linux/mtd/physmap.h>
  35. #include <linux/spi/spi.h>
  36. #include <linux/spi/flash.h>
  37. #include <linux/spi/mmc_spi.h>
  38. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  39. #include <linux/usb/isp1362.h>
  40. #endif
  41. #include <linux/irq.h>
  42. #include <linux/i2c.h>
  43. #include <asm/dma.h>
  44. #include <asm/bfin5xx_spi.h>
  45. #include <asm/reboot.h>
  46. #include <asm/portmux.h>
  47. #include <asm/dpmc.h>
  48. /*
  49. * Name the Board for the /proc/cpuinfo
  50. */
  51. const char bfin_board_name[] = "ADI BF533-STAMP";
  52. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  53. static struct platform_device rtc_device = {
  54. .name = "rtc-bfin",
  55. .id = -1,
  56. };
  57. #endif
  58. /*
  59. * Driver needs to know address, irq and flag pin.
  60. */
  61. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  62. #include <linux/smc91x.h>
  63. static struct smc91x_platdata smc91x_info = {
  64. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  65. .leda = RPC_LED_100_10,
  66. .ledb = RPC_LED_TX_RX,
  67. };
  68. static struct resource smc91x_resources[] = {
  69. {
  70. .name = "smc91x-regs",
  71. .start = 0x20300300,
  72. .end = 0x20300300 + 16,
  73. .flags = IORESOURCE_MEM,
  74. }, {
  75. .start = IRQ_PF7,
  76. .end = IRQ_PF7,
  77. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  78. },
  79. };
  80. static struct platform_device smc91x_device = {
  81. .name = "smc91x",
  82. .id = 0,
  83. .num_resources = ARRAY_SIZE(smc91x_resources),
  84. .resource = smc91x_resources,
  85. .dev = {
  86. .platform_data = &smc91x_info,
  87. },
  88. };
  89. #endif
  90. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  91. static struct platform_device bfin_fb_adv7393_device = {
  92. .name = "bfin-adv7393",
  93. };
  94. #endif
  95. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  96. static struct resource net2272_bfin_resources[] = {
  97. {
  98. .start = 0x20300000,
  99. .end = 0x20300000 + 0x100,
  100. .flags = IORESOURCE_MEM,
  101. }, {
  102. .start = IRQ_PF10,
  103. .end = IRQ_PF10,
  104. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  105. },
  106. };
  107. static struct platform_device net2272_bfin_device = {
  108. .name = "net2272",
  109. .id = -1,
  110. .num_resources = ARRAY_SIZE(net2272_bfin_resources),
  111. .resource = net2272_bfin_resources,
  112. };
  113. #endif
  114. #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
  115. static struct mtd_partition stamp_partitions[] = {
  116. {
  117. .name = "bootloader(nor)",
  118. .size = 0x40000,
  119. .offset = 0,
  120. }, {
  121. .name = "linux kernel(nor)",
  122. .size = 0x180000,
  123. .offset = MTDPART_OFS_APPEND,
  124. }, {
  125. .name = "file system(nor)",
  126. .size = MTDPART_SIZ_FULL,
  127. .offset = MTDPART_OFS_APPEND,
  128. }
  129. };
  130. static struct physmap_flash_data stamp_flash_data = {
  131. .width = 2,
  132. .parts = stamp_partitions,
  133. .nr_parts = ARRAY_SIZE(stamp_partitions),
  134. };
  135. static struct resource stamp_flash_resource[] = {
  136. {
  137. .name = "cfi_probe",
  138. .start = 0x20000000,
  139. .end = 0x203fffff,
  140. .flags = IORESOURCE_MEM,
  141. }, {
  142. .start = 0x7BB07BB0, /* AMBCTL0 setting when accessing flash */
  143. .end = 0x7BB07BB0, /* AMBCTL1 setting when accessing flash */
  144. .flags = IORESOURCE_MEM,
  145. }, {
  146. .start = GPIO_PF0,
  147. .flags = IORESOURCE_IRQ,
  148. }
  149. };
  150. static struct platform_device stamp_flash_device = {
  151. .name = "bfin-async-flash",
  152. .id = 0,
  153. .dev = {
  154. .platform_data = &stamp_flash_data,
  155. },
  156. .num_resources = ARRAY_SIZE(stamp_flash_resource),
  157. .resource = stamp_flash_resource,
  158. };
  159. #endif
  160. #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
  161. static struct mtd_partition bfin_spi_flash_partitions[] = {
  162. {
  163. .name = "bootloader(spi)",
  164. .size = 0x00040000,
  165. .offset = 0,
  166. .mask_flags = MTD_CAP_ROM
  167. }, {
  168. .name = "linux kernel(spi)",
  169. .size = 0x180000,
  170. .offset = MTDPART_OFS_APPEND,
  171. }, {
  172. .name = "file system(spi)",
  173. .size = MTDPART_SIZ_FULL,
  174. .offset = MTDPART_OFS_APPEND,
  175. }
  176. };
  177. static struct flash_platform_data bfin_spi_flash_data = {
  178. .name = "m25p80",
  179. .parts = bfin_spi_flash_partitions,
  180. .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
  181. .type = "m25p64",
  182. };
  183. /* SPI flash chip (m25p64) */
  184. static struct bfin5xx_spi_chip spi_flash_chip_info = {
  185. .enable_dma = 0, /* use dma transfer with this chip*/
  186. .bits_per_word = 8,
  187. };
  188. #endif
  189. #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  190. /* SPI ADC chip */
  191. static struct bfin5xx_spi_chip spi_adc_chip_info = {
  192. .enable_dma = 1, /* use dma transfer with this chip*/
  193. .bits_per_word = 16,
  194. };
  195. #endif
  196. #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
  197. static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
  198. .enable_dma = 0,
  199. .bits_per_word = 16,
  200. };
  201. #endif
  202. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  203. static struct bfin5xx_spi_chip spidev_chip_info = {
  204. .enable_dma = 0,
  205. .bits_per_word = 8,
  206. };
  207. #endif
  208. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  209. #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
  210. static int bfin_mmc_spi_init(struct device *dev,
  211. irqreturn_t (*detect_int)(int, void *), void *data)
  212. {
  213. return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
  214. IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
  215. "mmc-spi-detect", data);
  216. }
  217. static void bfin_mmc_spi_exit(struct device *dev, void *data)
  218. {
  219. free_irq(MMC_SPI_CARD_DETECT_INT, data);
  220. }
  221. static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
  222. .init = bfin_mmc_spi_init,
  223. .exit = bfin_mmc_spi_exit,
  224. .detect_delay = 100, /* msecs */
  225. };
  226. static struct bfin5xx_spi_chip mmc_spi_chip_info = {
  227. .enable_dma = 0,
  228. .bits_per_word = 8,
  229. .pio_interrupt = 0,
  230. };
  231. #endif
  232. static struct spi_board_info bfin_spi_board_info[] __initdata = {
  233. #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
  234. {
  235. /* the modalias must be the same as spi device driver name */
  236. .modalias = "m25p80", /* Name of spi_driver for this device */
  237. .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
  238. .bus_num = 0, /* Framework bus number */
  239. .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
  240. .platform_data = &bfin_spi_flash_data,
  241. .controller_data = &spi_flash_chip_info,
  242. .mode = SPI_MODE_3,
  243. },
  244. #endif
  245. #if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
  246. {
  247. .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
  248. .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
  249. .bus_num = 0, /* Framework bus number */
  250. .chip_select = 1, /* Framework chip select. */
  251. .platform_data = NULL, /* No spi_driver specific config */
  252. .controller_data = &spi_adc_chip_info,
  253. },
  254. #endif
  255. #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
  256. {
  257. .modalias = "ad1836",
  258. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  259. .bus_num = 0,
  260. .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
  261. .controller_data = &ad1836_spi_chip_info,
  262. },
  263. #endif
  264. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  265. {
  266. .modalias = "spidev",
  267. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  268. .bus_num = 0,
  269. .chip_select = 1,
  270. .controller_data = &spidev_chip_info,
  271. },
  272. #endif
  273. #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
  274. {
  275. .modalias = "mmc_spi",
  276. .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
  277. .bus_num = 0,
  278. .chip_select = 4,
  279. .platform_data = &bfin_mmc_spi_pdata,
  280. .controller_data = &mmc_spi_chip_info,
  281. .mode = SPI_MODE_3,
  282. },
  283. #endif
  284. };
  285. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  286. /* SPI (0) */
  287. static struct resource bfin_spi0_resource[] = {
  288. [0] = {
  289. .start = SPI0_REGBASE,
  290. .end = SPI0_REGBASE + 0xFF,
  291. .flags = IORESOURCE_MEM,
  292. },
  293. [1] = {
  294. .start = CH_SPI,
  295. .end = CH_SPI,
  296. .flags = IORESOURCE_DMA,
  297. },
  298. [2] = {
  299. .start = IRQ_SPI,
  300. .end = IRQ_SPI,
  301. .flags = IORESOURCE_IRQ,
  302. }
  303. };
  304. /* SPI controller data */
  305. static struct bfin5xx_spi_master bfin_spi0_info = {
  306. .num_chipselect = 8,
  307. .enable_dma = 1, /* master has the ability to do dma transfer */
  308. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  309. };
  310. static struct platform_device bfin_spi0_device = {
  311. .name = "bfin-spi",
  312. .id = 0, /* Bus number */
  313. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  314. .resource = bfin_spi0_resource,
  315. .dev = {
  316. .platform_data = &bfin_spi0_info, /* Passed to driver */
  317. },
  318. };
  319. #endif /* spi master and devices */
  320. #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
  321. static struct platform_device bfin_fb_device = {
  322. .name = "bf537-fb",
  323. };
  324. #endif
  325. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  326. static struct resource bfin_uart_resources[] = {
  327. {
  328. .start = 0xFFC00400,
  329. .end = 0xFFC004FF,
  330. .flags = IORESOURCE_MEM,
  331. },
  332. };
  333. static struct platform_device bfin_uart_device = {
  334. .name = "bfin-uart",
  335. .id = 1,
  336. .num_resources = ARRAY_SIZE(bfin_uart_resources),
  337. .resource = bfin_uart_resources,
  338. };
  339. #endif
  340. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  341. #ifdef CONFIG_BFIN_SIR0
  342. static struct resource bfin_sir0_resources[] = {
  343. {
  344. .start = 0xFFC00400,
  345. .end = 0xFFC004FF,
  346. .flags = IORESOURCE_MEM,
  347. },
  348. {
  349. .start = IRQ_UART0_RX,
  350. .end = IRQ_UART0_RX+1,
  351. .flags = IORESOURCE_IRQ,
  352. },
  353. {
  354. .start = CH_UART0_RX,
  355. .end = CH_UART0_RX+1,
  356. .flags = IORESOURCE_DMA,
  357. },
  358. };
  359. static struct platform_device bfin_sir0_device = {
  360. .name = "bfin_sir",
  361. .id = 0,
  362. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  363. .resource = bfin_sir0_resources,
  364. };
  365. #endif
  366. #endif
  367. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  368. static struct platform_device bfin_sport0_uart_device = {
  369. .name = "bfin-sport-uart",
  370. .id = 0,
  371. };
  372. static struct platform_device bfin_sport1_uart_device = {
  373. .name = "bfin-sport-uart",
  374. .id = 1,
  375. };
  376. #endif
  377. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  378. #include <linux/input.h>
  379. #include <linux/gpio_keys.h>
  380. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  381. {BTN_0, GPIO_PF5, 0, "gpio-keys: BTN0"},
  382. {BTN_1, GPIO_PF6, 0, "gpio-keys: BTN1"},
  383. {BTN_2, GPIO_PF8, 0, "gpio-keys: BTN2"},
  384. };
  385. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  386. .buttons = bfin_gpio_keys_table,
  387. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  388. };
  389. static struct platform_device bfin_device_gpiokeys = {
  390. .name = "gpio-keys",
  391. .dev = {
  392. .platform_data = &bfin_gpio_keys_data,
  393. },
  394. };
  395. #endif
  396. static struct resource bfin_gpios_resources = {
  397. .start = 0,
  398. .end = MAX_BLACKFIN_GPIOS - 1,
  399. .flags = IORESOURCE_IRQ,
  400. };
  401. static struct platform_device bfin_gpios_device = {
  402. .name = "simple-gpio",
  403. .id = -1,
  404. .num_resources = 1,
  405. .resource = &bfin_gpios_resources,
  406. };
  407. #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
  408. #include <linux/i2c-gpio.h>
  409. static struct i2c_gpio_platform_data i2c_gpio_data = {
  410. .sda_pin = 2,
  411. .scl_pin = 3,
  412. .sda_is_open_drain = 0,
  413. .scl_is_open_drain = 0,
  414. .udelay = 40,
  415. };
  416. static struct platform_device i2c_gpio_device = {
  417. .name = "i2c-gpio",
  418. .id = 0,
  419. .dev = {
  420. .platform_data = &i2c_gpio_data,
  421. },
  422. };
  423. #endif
  424. static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
  425. #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
  426. {
  427. I2C_BOARD_INFO("ad7142_joystick", 0x2C),
  428. .irq = 39,
  429. },
  430. #endif
  431. #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
  432. {
  433. I2C_BOARD_INFO("pcf8574_lcd", 0x22),
  434. },
  435. #endif
  436. #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
  437. {
  438. I2C_BOARD_INFO("pcf8574_keypad", 0x27),
  439. .irq = 39,
  440. },
  441. #endif
  442. };
  443. static const unsigned int cclk_vlev_datasheet[] =
  444. {
  445. VRPAIR(VLEV_085, 250000000),
  446. VRPAIR(VLEV_090, 376000000),
  447. VRPAIR(VLEV_095, 426000000),
  448. VRPAIR(VLEV_100, 426000000),
  449. VRPAIR(VLEV_105, 476000000),
  450. VRPAIR(VLEV_110, 476000000),
  451. VRPAIR(VLEV_115, 476000000),
  452. VRPAIR(VLEV_120, 600000000),
  453. VRPAIR(VLEV_125, 600000000),
  454. VRPAIR(VLEV_130, 600000000),
  455. };
  456. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  457. .tuple_tab = cclk_vlev_datasheet,
  458. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  459. .vr_settling_time = 25 /* us */,
  460. };
  461. static struct platform_device bfin_dpmc = {
  462. .name = "bfin dpmc",
  463. .dev = {
  464. .platform_data = &bfin_dmpc_vreg_data,
  465. },
  466. };
  467. static struct platform_device *stamp_devices[] __initdata = {
  468. &bfin_dpmc,
  469. #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
  470. &rtc_device,
  471. #endif
  472. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  473. &smc91x_device,
  474. #endif
  475. #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
  476. &bfin_fb_adv7393_device,
  477. #endif
  478. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  479. &net2272_bfin_device,
  480. #endif
  481. #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
  482. &bfin_spi0_device,
  483. #endif
  484. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  485. &bfin_uart_device,
  486. #endif
  487. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  488. #ifdef CONFIG_BFIN_SIR0
  489. &bfin_sir0_device,
  490. #endif
  491. #endif
  492. #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
  493. &bfin_sport0_uart_device,
  494. &bfin_sport1_uart_device,
  495. #endif
  496. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  497. &bfin_device_gpiokeys,
  498. #endif
  499. #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
  500. &i2c_gpio_device,
  501. #endif
  502. &bfin_gpios_device,
  503. #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
  504. &stamp_flash_device,
  505. #endif
  506. };
  507. static int __init stamp_init(void)
  508. {
  509. int ret;
  510. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  511. i2c_register_board_info(0, bfin_i2c_board_info,
  512. ARRAY_SIZE(bfin_i2c_board_info));
  513. ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
  514. if (ret < 0)
  515. return ret;
  516. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  517. /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
  518. bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF0);
  519. bfin_write_FIO_FLAG_S(PF0);
  520. SSYNC();
  521. #endif
  522. spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
  523. return 0;
  524. }
  525. arch_initcall(stamp_init);
  526. void native_machine_restart(char *cmd)
  527. {
  528. /* workaround pull up on cpld / flash pin not being strong enough */
  529. bfin_write_FIO_INEN(~PF0);
  530. bfin_write_FIO_DIR(PF0);
  531. bfin_write_FIO_FLAG_C(PF0);
  532. }