ezkit.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. /*
  2. * Copyright 2004-2009 Analog Devices Inc.
  3. * 2005 National ICT Australia (NICTA)
  4. * Aidan Williams <aidan@nicta.com.au>
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #include <linux/device.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/mtd/mtd.h>
  11. #include <linux/mtd/partitions.h>
  12. #include <linux/mtd/physmap.h>
  13. #include <linux/spi/spi.h>
  14. #include <linux/irq.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/delay.h>
  17. #include <asm/dma.h>
  18. #include <asm/bfin5xx_spi.h>
  19. #include <asm/portmux.h>
  20. #include <asm/dpmc.h>
  21. /*
  22. * Name the Board for the /proc/cpuinfo
  23. */
  24. const char bfin_board_name[] = "ADI BF561-EZKIT";
  25. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  26. #include <linux/usb/isp1760.h>
  27. static struct resource bfin_isp1760_resources[] = {
  28. [0] = {
  29. .start = 0x2C0F0000,
  30. .end = 0x203C0000 + 0xfffff,
  31. .flags = IORESOURCE_MEM,
  32. },
  33. [1] = {
  34. .start = IRQ_PF10,
  35. .end = IRQ_PF10,
  36. .flags = IORESOURCE_IRQ,
  37. },
  38. };
  39. static struct isp1760_platform_data isp1760_priv = {
  40. .is_isp1761 = 0,
  41. .bus_width_16 = 1,
  42. .port1_otg = 0,
  43. .analog_oc = 0,
  44. .dack_polarity_high = 0,
  45. .dreq_polarity_high = 0,
  46. };
  47. static struct platform_device bfin_isp1760_device = {
  48. .name = "isp1760",
  49. .id = 0,
  50. .dev = {
  51. .platform_data = &isp1760_priv,
  52. },
  53. .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
  54. .resource = bfin_isp1760_resources,
  55. };
  56. #endif
  57. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  58. #include <linux/usb/isp1362.h>
  59. static struct resource isp1362_hcd_resources[] = {
  60. {
  61. .start = 0x2c060000,
  62. .end = 0x2c060000,
  63. .flags = IORESOURCE_MEM,
  64. }, {
  65. .start = 0x2c060004,
  66. .end = 0x2c060004,
  67. .flags = IORESOURCE_MEM,
  68. }, {
  69. .start = IRQ_PF8,
  70. .end = IRQ_PF8,
  71. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
  72. },
  73. };
  74. static struct isp1362_platform_data isp1362_priv = {
  75. .sel15Kres = 1,
  76. .clknotstop = 0,
  77. .oc_enable = 0,
  78. .int_act_high = 0,
  79. .int_edge_triggered = 0,
  80. .remote_wakeup_connected = 0,
  81. .no_power_switching = 1,
  82. .power_switching_mode = 0,
  83. };
  84. static struct platform_device isp1362_hcd_device = {
  85. .name = "isp1362-hcd",
  86. .id = 0,
  87. .dev = {
  88. .platform_data = &isp1362_priv,
  89. },
  90. .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
  91. .resource = isp1362_hcd_resources,
  92. };
  93. #endif
  94. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  95. static struct resource net2272_bfin_resources[] = {
  96. {
  97. .start = 0x2C000000,
  98. .end = 0x2C000000 + 0x7F,
  99. .flags = IORESOURCE_MEM,
  100. }, {
  101. .start = 1,
  102. .flags = IORESOURCE_BUS,
  103. }, {
  104. .start = IRQ_PF10,
  105. .end = IRQ_PF10,
  106. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
  107. },
  108. };
  109. static struct platform_device net2272_bfin_device = {
  110. .name = "net2272",
  111. .id = -1,
  112. .num_resources = ARRAY_SIZE(net2272_bfin_resources),
  113. .resource = net2272_bfin_resources,
  114. };
  115. #endif
  116. /*
  117. * USB-LAN EzExtender board
  118. * Driver needs to know address, irq and flag pin.
  119. */
  120. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  121. #include <linux/smc91x.h>
  122. static struct smc91x_platdata smc91x_info = {
  123. .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
  124. .leda = RPC_LED_100_10,
  125. .ledb = RPC_LED_TX_RX,
  126. };
  127. static struct resource smc91x_resources[] = {
  128. {
  129. .name = "smc91x-regs",
  130. .start = 0x2C010300,
  131. .end = 0x2C010300 + 16,
  132. .flags = IORESOURCE_MEM,
  133. }, {
  134. .start = IRQ_PF9,
  135. .end = IRQ_PF9,
  136. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  137. },
  138. };
  139. static struct platform_device smc91x_device = {
  140. .name = "smc91x",
  141. .id = 0,
  142. .num_resources = ARRAY_SIZE(smc91x_resources),
  143. .resource = smc91x_resources,
  144. .dev = {
  145. .platform_data = &smc91x_info,
  146. },
  147. };
  148. #endif
  149. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  150. #ifdef CONFIG_SERIAL_BFIN_UART0
  151. static struct resource bfin_uart0_resources[] = {
  152. {
  153. .start = BFIN_UART_THR,
  154. .end = BFIN_UART_GCTL+2,
  155. .flags = IORESOURCE_MEM,
  156. },
  157. {
  158. .start = IRQ_UART_TX,
  159. .end = IRQ_UART_TX,
  160. .flags = IORESOURCE_IRQ,
  161. },
  162. {
  163. .start = IRQ_UART_RX,
  164. .end = IRQ_UART_RX,
  165. .flags = IORESOURCE_IRQ,
  166. },
  167. {
  168. .start = IRQ_UART_ERROR,
  169. .end = IRQ_UART_ERROR,
  170. .flags = IORESOURCE_IRQ,
  171. },
  172. {
  173. .start = CH_UART_TX,
  174. .end = CH_UART_TX,
  175. .flags = IORESOURCE_DMA,
  176. },
  177. {
  178. .start = CH_UART_RX,
  179. .end = CH_UART_RX,
  180. .flags = IORESOURCE_DMA,
  181. },
  182. };
  183. static unsigned short bfin_uart0_peripherals[] = {
  184. P_UART0_TX, P_UART0_RX, 0
  185. };
  186. static struct platform_device bfin_uart0_device = {
  187. .name = "bfin-uart",
  188. .id = 0,
  189. .num_resources = ARRAY_SIZE(bfin_uart0_resources),
  190. .resource = bfin_uart0_resources,
  191. .dev = {
  192. .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
  193. },
  194. };
  195. #endif
  196. #endif
  197. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  198. #ifdef CONFIG_BFIN_SIR0
  199. static struct resource bfin_sir0_resources[] = {
  200. {
  201. .start = 0xFFC00400,
  202. .end = 0xFFC004FF,
  203. .flags = IORESOURCE_MEM,
  204. },
  205. {
  206. .start = IRQ_UART0_RX,
  207. .end = IRQ_UART0_RX+1,
  208. .flags = IORESOURCE_IRQ,
  209. },
  210. {
  211. .start = CH_UART0_RX,
  212. .end = CH_UART0_RX+1,
  213. .flags = IORESOURCE_DMA,
  214. },
  215. };
  216. static struct platform_device bfin_sir0_device = {
  217. .name = "bfin_sir",
  218. .id = 0,
  219. .num_resources = ARRAY_SIZE(bfin_sir0_resources),
  220. .resource = bfin_sir0_resources,
  221. };
  222. #endif
  223. #endif
  224. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  225. static struct mtd_partition ezkit_partitions[] = {
  226. {
  227. .name = "bootloader(nor)",
  228. .size = 0x40000,
  229. .offset = 0,
  230. }, {
  231. .name = "linux kernel(nor)",
  232. .size = 0x1C0000,
  233. .offset = MTDPART_OFS_APPEND,
  234. }, {
  235. .name = "file system(nor)",
  236. .size = 0x800000 - 0x40000 - 0x1C0000 - 0x2000 * 8,
  237. .offset = MTDPART_OFS_APPEND,
  238. }, {
  239. .name = "config(nor)",
  240. .size = 0x2000 * 7,
  241. .offset = MTDPART_OFS_APPEND,
  242. }, {
  243. .name = "u-boot env(nor)",
  244. .size = 0x2000,
  245. .offset = MTDPART_OFS_APPEND,
  246. }
  247. };
  248. static struct physmap_flash_data ezkit_flash_data = {
  249. .width = 2,
  250. .parts = ezkit_partitions,
  251. .nr_parts = ARRAY_SIZE(ezkit_partitions),
  252. };
  253. static struct resource ezkit_flash_resource = {
  254. .start = 0x20000000,
  255. .end = 0x207fffff,
  256. .flags = IORESOURCE_MEM,
  257. };
  258. static struct platform_device ezkit_flash_device = {
  259. .name = "physmap-flash",
  260. .id = 0,
  261. .dev = {
  262. .platform_data = &ezkit_flash_data,
  263. },
  264. .num_resources = 1,
  265. .resource = &ezkit_flash_resource,
  266. };
  267. #endif
  268. #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
  269. /* SPI (0) */
  270. static struct resource bfin_spi0_resource[] = {
  271. [0] = {
  272. .start = SPI0_REGBASE,
  273. .end = SPI0_REGBASE + 0xFF,
  274. .flags = IORESOURCE_MEM,
  275. },
  276. [1] = {
  277. .start = CH_SPI,
  278. .end = CH_SPI,
  279. .flags = IORESOURCE_DMA,
  280. },
  281. [2] = {
  282. .start = IRQ_SPI,
  283. .end = IRQ_SPI,
  284. .flags = IORESOURCE_IRQ,
  285. }
  286. };
  287. /* SPI controller data */
  288. static struct bfin5xx_spi_master bfin_spi0_info = {
  289. .num_chipselect = 8,
  290. .enable_dma = 1, /* master has the ability to do dma transfer */
  291. .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
  292. };
  293. static struct platform_device bfin_spi0_device = {
  294. .name = "bfin-spi",
  295. .id = 0, /* Bus number */
  296. .num_resources = ARRAY_SIZE(bfin_spi0_resource),
  297. .resource = bfin_spi0_resource,
  298. .dev = {
  299. .platform_data = &bfin_spi0_info, /* Passed to driver */
  300. },
  301. };
  302. #endif
  303. static struct spi_board_info bfin_spi_board_info[] __initdata = {
  304. #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
  305. || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
  306. {
  307. .modalias = "ad183x",
  308. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  309. .bus_num = 0,
  310. .chip_select = 4,
  311. .platform_data = "ad1836", /* only includes chip name for the moment */
  312. .mode = SPI_MODE_3,
  313. },
  314. #endif
  315. #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
  316. {
  317. .modalias = "spidev",
  318. .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
  319. .bus_num = 0,
  320. .chip_select = 1,
  321. },
  322. #endif
  323. };
  324. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  325. #include <linux/input.h>
  326. #include <linux/gpio_keys.h>
  327. static struct gpio_keys_button bfin_gpio_keys_table[] = {
  328. {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"},
  329. {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"},
  330. {BTN_2, GPIO_PF7, 1, "gpio-keys: BTN2"},
  331. {BTN_3, GPIO_PF8, 1, "gpio-keys: BTN3"},
  332. };
  333. static struct gpio_keys_platform_data bfin_gpio_keys_data = {
  334. .buttons = bfin_gpio_keys_table,
  335. .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
  336. };
  337. static struct platform_device bfin_device_gpiokeys = {
  338. .name = "gpio-keys",
  339. .dev = {
  340. .platform_data = &bfin_gpio_keys_data,
  341. },
  342. };
  343. #endif
  344. #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
  345. #include <linux/i2c-gpio.h>
  346. static struct i2c_gpio_platform_data i2c_gpio_data = {
  347. .sda_pin = GPIO_PF1,
  348. .scl_pin = GPIO_PF0,
  349. .sda_is_open_drain = 0,
  350. .scl_is_open_drain = 0,
  351. .udelay = 10,
  352. };
  353. static struct platform_device i2c_gpio_device = {
  354. .name = "i2c-gpio",
  355. .id = 0,
  356. .dev = {
  357. .platform_data = &i2c_gpio_data,
  358. },
  359. };
  360. #endif
  361. static const unsigned int cclk_vlev_datasheet[] =
  362. {
  363. VRPAIR(VLEV_085, 250000000),
  364. VRPAIR(VLEV_090, 300000000),
  365. VRPAIR(VLEV_095, 313000000),
  366. VRPAIR(VLEV_100, 350000000),
  367. VRPAIR(VLEV_105, 400000000),
  368. VRPAIR(VLEV_110, 444000000),
  369. VRPAIR(VLEV_115, 450000000),
  370. VRPAIR(VLEV_120, 475000000),
  371. VRPAIR(VLEV_125, 500000000),
  372. VRPAIR(VLEV_130, 600000000),
  373. };
  374. static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
  375. .tuple_tab = cclk_vlev_datasheet,
  376. .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
  377. .vr_settling_time = 25 /* us */,
  378. };
  379. static struct platform_device bfin_dpmc = {
  380. .name = "bfin dpmc",
  381. .dev = {
  382. .platform_data = &bfin_dmpc_vreg_data,
  383. },
  384. };
  385. #if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \
  386. || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
  387. #include <linux/videodev2.h>
  388. #include <media/blackfin/bfin_capture.h>
  389. #include <media/blackfin/ppi.h>
  390. static const unsigned short ppi_req[] = {
  391. P_PPI0_D0, P_PPI0_D1, P_PPI0_D2, P_PPI0_D3,
  392. P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7,
  393. P_PPI0_CLK, P_PPI0_FS1, P_PPI0_FS2,
  394. 0,
  395. };
  396. static const struct ppi_info ppi_info = {
  397. .type = PPI_TYPE_PPI,
  398. .dma_ch = CH_PPI0,
  399. .irq_err = IRQ_PPI1_ERROR,
  400. .base = (void __iomem *)PPI0_CONTROL,
  401. .pin_req = ppi_req,
  402. };
  403. #if defined(CONFIG_VIDEO_ADV7183) \
  404. || defined(CONFIG_VIDEO_ADV7183_MODULE)
  405. #include <media/adv7183.h>
  406. static struct v4l2_input adv7183_inputs[] = {
  407. {
  408. .index = 0,
  409. .name = "Composite",
  410. .type = V4L2_INPUT_TYPE_CAMERA,
  411. .std = V4L2_STD_ALL,
  412. },
  413. {
  414. .index = 1,
  415. .name = "S-Video",
  416. .type = V4L2_INPUT_TYPE_CAMERA,
  417. .std = V4L2_STD_ALL,
  418. },
  419. {
  420. .index = 2,
  421. .name = "Component",
  422. .type = V4L2_INPUT_TYPE_CAMERA,
  423. .std = V4L2_STD_ALL,
  424. },
  425. };
  426. static struct bcap_route adv7183_routes[] = {
  427. {
  428. .input = ADV7183_COMPOSITE4,
  429. .output = ADV7183_8BIT_OUT,
  430. },
  431. {
  432. .input = ADV7183_SVIDEO0,
  433. .output = ADV7183_8BIT_OUT,
  434. },
  435. {
  436. .input = ADV7183_COMPONENT0,
  437. .output = ADV7183_8BIT_OUT,
  438. },
  439. };
  440. static const unsigned adv7183_gpio[] = {
  441. GPIO_PF13, /* reset pin */
  442. GPIO_PF2, /* output enable pin */
  443. };
  444. static struct bfin_capture_config bfin_capture_data = {
  445. .card_name = "BF561",
  446. .inputs = adv7183_inputs,
  447. .num_inputs = ARRAY_SIZE(adv7183_inputs),
  448. .routes = adv7183_routes,
  449. .i2c_adapter_id = 0,
  450. .board_info = {
  451. .type = "adv7183",
  452. .addr = 0x20,
  453. .platform_data = (void *)adv7183_gpio,
  454. },
  455. .ppi_info = &ppi_info,
  456. .ppi_control = (PACK_EN | DLEN_8 | DMA32 | FLD_SEL),
  457. };
  458. #endif
  459. static struct platform_device bfin_capture_device = {
  460. .name = "bfin_capture",
  461. .dev = {
  462. .platform_data = &bfin_capture_data,
  463. },
  464. };
  465. #endif
  466. #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
  467. static struct platform_device bfin_i2s = {
  468. .name = "bfin-i2s",
  469. .id = CONFIG_SND_BF5XX_SPORT_NUM,
  470. /* TODO: add platform data here */
  471. };
  472. #endif
  473. #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
  474. static struct platform_device bfin_tdm = {
  475. .name = "bfin-tdm",
  476. .id = CONFIG_SND_BF5XX_SPORT_NUM,
  477. /* TODO: add platform data here */
  478. };
  479. #endif
  480. #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
  481. static struct platform_device bfin_ac97 = {
  482. .name = "bfin-ac97",
  483. .id = CONFIG_SND_BF5XX_SPORT_NUM,
  484. /* TODO: add platform data here */
  485. };
  486. #endif
  487. static struct platform_device *ezkit_devices[] __initdata = {
  488. &bfin_dpmc,
  489. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  490. &smc91x_device,
  491. #endif
  492. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  493. &net2272_bfin_device,
  494. #endif
  495. #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
  496. &bfin_isp1760_device,
  497. #endif
  498. #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
  499. &bfin_spi0_device,
  500. #endif
  501. #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
  502. #ifdef CONFIG_SERIAL_BFIN_UART0
  503. &bfin_uart0_device,
  504. #endif
  505. #endif
  506. #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
  507. #ifdef CONFIG_BFIN_SIR0
  508. &bfin_sir0_device,
  509. #endif
  510. #endif
  511. #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
  512. &bfin_device_gpiokeys,
  513. #endif
  514. #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
  515. &i2c_gpio_device,
  516. #endif
  517. #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
  518. &isp1362_hcd_device,
  519. #endif
  520. #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
  521. &ezkit_flash_device,
  522. #endif
  523. #if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \
  524. || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
  525. &bfin_capture_device,
  526. #endif
  527. #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
  528. &bfin_i2s,
  529. #endif
  530. #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
  531. &bfin_tdm,
  532. #endif
  533. #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
  534. &bfin_ac97,
  535. #endif
  536. };
  537. static int __init net2272_init(void)
  538. {
  539. #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
  540. int ret;
  541. ret = gpio_request(GPIO_PF11, "net2272");
  542. if (ret)
  543. return ret;
  544. /* Reset the USB chip */
  545. gpio_direction_output(GPIO_PF11, 0);
  546. mdelay(2);
  547. gpio_set_value(GPIO_PF11, 1);
  548. #endif
  549. return 0;
  550. }
  551. static int __init ezkit_init(void)
  552. {
  553. int ret;
  554. printk(KERN_INFO "%s(): registering device resources\n", __func__);
  555. ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
  556. if (ret < 0)
  557. return ret;
  558. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  559. bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
  560. SSYNC();
  561. #endif
  562. #if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
  563. bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 15));
  564. bfin_write_FIO0_FLAG_S(1 << 15);
  565. SSYNC();
  566. /*
  567. * This initialization lasts for approximately 4500 MCLKs.
  568. * MCLK = 12.288MHz
  569. */
  570. udelay(400);
  571. #endif
  572. if (net2272_init())
  573. pr_warning("unable to configure net2272; it probably won't work\n");
  574. spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
  575. return 0;
  576. }
  577. arch_initcall(ezkit_init);
  578. static struct platform_device *ezkit_early_devices[] __initdata = {
  579. #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
  580. #ifdef CONFIG_SERIAL_BFIN_UART0
  581. &bfin_uart0_device,
  582. #endif
  583. #endif
  584. };
  585. void __init native_machine_early_platform_add_devices(void)
  586. {
  587. printk(KERN_INFO "register early platform devices\n");
  588. early_platform_add_devices(ezkit_early_devices,
  589. ARRAY_SIZE(ezkit_early_devices));
  590. }