board-dm365-evm.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. /*
  2. * TI DaVinci DM365 EVM board support
  3. *
  4. * Copyright (C) 2009 Texas Instruments Incorporated
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation version 2.
  9. *
  10. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/init.h>
  17. #include <linux/err.h>
  18. #include <linux/i2c.h>
  19. #include <linux/io.h>
  20. #include <linux/clk.h>
  21. #include <linux/i2c/at24.h>
  22. #include <linux/leds.h>
  23. #include <linux/mtd/mtd.h>
  24. #include <linux/mtd/partitions.h>
  25. #include <linux/slab.h>
  26. #include <linux/mtd/nand.h>
  27. #include <linux/input.h>
  28. #include <linux/spi/spi.h>
  29. #include <linux/spi/eeprom.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/mach/arch.h>
  32. #include <mach/mux.h>
  33. #include <mach/dm365.h>
  34. #include <mach/common.h>
  35. #include <mach/i2c.h>
  36. #include <mach/serial.h>
  37. #include <mach/mmc.h>
  38. #include <mach/nand.h>
  39. #include <mach/keyscan.h>
  40. #include <media/tvp514x.h>
  41. static inline int have_imager(void)
  42. {
  43. /* REVISIT when it's supported, trigger via Kconfig */
  44. return 0;
  45. }
  46. static inline int have_tvp7002(void)
  47. {
  48. /* REVISIT when it's supported, trigger via Kconfig */
  49. return 0;
  50. }
  51. #define DM365_EVM_PHY_MASK (0x2)
  52. #define DM365_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
  53. /*
  54. * A MAX-II CPLD is used for various board control functions.
  55. */
  56. #define CPLD_OFFSET(a13a8,a2a1) (((a13a8) << 10) + ((a2a1) << 3))
  57. #define CPLD_VERSION CPLD_OFFSET(0,0) /* r/o */
  58. #define CPLD_TEST CPLD_OFFSET(0,1)
  59. #define CPLD_LEDS CPLD_OFFSET(0,2)
  60. #define CPLD_MUX CPLD_OFFSET(0,3)
  61. #define CPLD_SWITCH CPLD_OFFSET(1,0) /* r/o */
  62. #define CPLD_POWER CPLD_OFFSET(1,1)
  63. #define CPLD_VIDEO CPLD_OFFSET(1,2)
  64. #define CPLD_CARDSTAT CPLD_OFFSET(1,3) /* r/o */
  65. #define CPLD_DILC_OUT CPLD_OFFSET(2,0)
  66. #define CPLD_DILC_IN CPLD_OFFSET(2,1) /* r/o */
  67. #define CPLD_IMG_DIR0 CPLD_OFFSET(2,2)
  68. #define CPLD_IMG_MUX0 CPLD_OFFSET(2,3)
  69. #define CPLD_IMG_MUX1 CPLD_OFFSET(3,0)
  70. #define CPLD_IMG_DIR1 CPLD_OFFSET(3,1)
  71. #define CPLD_IMG_MUX2 CPLD_OFFSET(3,2)
  72. #define CPLD_IMG_MUX3 CPLD_OFFSET(3,3)
  73. #define CPLD_IMG_DIR2 CPLD_OFFSET(4,0)
  74. #define CPLD_IMG_MUX4 CPLD_OFFSET(4,1)
  75. #define CPLD_IMG_MUX5 CPLD_OFFSET(4,2)
  76. #define CPLD_RESETS CPLD_OFFSET(4,3)
  77. #define CPLD_CCD_DIR1 CPLD_OFFSET(0x3e,0)
  78. #define CPLD_CCD_IO1 CPLD_OFFSET(0x3e,1)
  79. #define CPLD_CCD_DIR2 CPLD_OFFSET(0x3e,2)
  80. #define CPLD_CCD_IO2 CPLD_OFFSET(0x3e,3)
  81. #define CPLD_CCD_DIR3 CPLD_OFFSET(0x3f,0)
  82. #define CPLD_CCD_IO3 CPLD_OFFSET(0x3f,1)
  83. static void __iomem *cpld;
  84. /* NOTE: this is geared for the standard config, with a socketed
  85. * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
  86. * swap chips with a different block size, partitioning will
  87. * need to be changed. This NAND chip MT29F16G08FAA is the default
  88. * NAND shipped with the Spectrum Digital DM365 EVM
  89. */
  90. #define NAND_BLOCK_SIZE SZ_128K
  91. static struct mtd_partition davinci_nand_partitions[] = {
  92. {
  93. /* UBL (a few copies) plus U-Boot */
  94. .name = "bootloader",
  95. .offset = 0,
  96. .size = 28 * NAND_BLOCK_SIZE,
  97. .mask_flags = MTD_WRITEABLE, /* force read-only */
  98. }, {
  99. /* U-Boot environment */
  100. .name = "params",
  101. .offset = MTDPART_OFS_APPEND,
  102. .size = 2 * NAND_BLOCK_SIZE,
  103. .mask_flags = 0,
  104. }, {
  105. .name = "kernel",
  106. .offset = MTDPART_OFS_APPEND,
  107. .size = SZ_4M,
  108. .mask_flags = 0,
  109. }, {
  110. .name = "filesystem1",
  111. .offset = MTDPART_OFS_APPEND,
  112. .size = SZ_512M,
  113. .mask_flags = 0,
  114. }, {
  115. .name = "filesystem2",
  116. .offset = MTDPART_OFS_APPEND,
  117. .size = MTDPART_SIZ_FULL,
  118. .mask_flags = 0,
  119. }
  120. /* two blocks with bad block table (and mirror) at the end */
  121. };
  122. static struct davinci_nand_pdata davinci_nand_data = {
  123. .mask_chipsel = BIT(14),
  124. .parts = davinci_nand_partitions,
  125. .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
  126. .ecc_mode = NAND_ECC_HW,
  127. .options = NAND_USE_FLASH_BBT,
  128. .ecc_bits = 4,
  129. };
  130. static struct resource davinci_nand_resources[] = {
  131. {
  132. .start = DM365_ASYNC_EMIF_DATA_CE0_BASE,
  133. .end = DM365_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1,
  134. .flags = IORESOURCE_MEM,
  135. }, {
  136. .start = DM365_ASYNC_EMIF_CONTROL_BASE,
  137. .end = DM365_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
  138. .flags = IORESOURCE_MEM,
  139. },
  140. };
  141. static struct platform_device davinci_nand_device = {
  142. .name = "davinci_nand",
  143. .id = 0,
  144. .num_resources = ARRAY_SIZE(davinci_nand_resources),
  145. .resource = davinci_nand_resources,
  146. .dev = {
  147. .platform_data = &davinci_nand_data,
  148. },
  149. };
  150. static struct at24_platform_data eeprom_info = {
  151. .byte_len = (256*1024) / 8,
  152. .page_size = 64,
  153. .flags = AT24_FLAG_ADDR16,
  154. .setup = davinci_get_mac_addr,
  155. .context = (void *)0x7f00,
  156. };
  157. static struct snd_platform_data dm365_evm_snd_data;
  158. static struct i2c_board_info i2c_info[] = {
  159. {
  160. I2C_BOARD_INFO("24c256", 0x50),
  161. .platform_data = &eeprom_info,
  162. },
  163. {
  164. I2C_BOARD_INFO("tlv320aic3x", 0x18),
  165. },
  166. };
  167. static struct davinci_i2c_platform_data i2c_pdata = {
  168. .bus_freq = 400 /* kHz */,
  169. .bus_delay = 0 /* usec */,
  170. };
  171. static int dm365evm_keyscan_enable(struct device *dev)
  172. {
  173. return davinci_cfg_reg(DM365_KEYSCAN);
  174. }
  175. static unsigned short dm365evm_keymap[] = {
  176. KEY_KP2,
  177. KEY_LEFT,
  178. KEY_EXIT,
  179. KEY_DOWN,
  180. KEY_ENTER,
  181. KEY_UP,
  182. KEY_KP1,
  183. KEY_RIGHT,
  184. KEY_MENU,
  185. KEY_RECORD,
  186. KEY_REWIND,
  187. KEY_KPMINUS,
  188. KEY_STOP,
  189. KEY_FASTFORWARD,
  190. KEY_KPPLUS,
  191. KEY_PLAYPAUSE,
  192. 0
  193. };
  194. static struct davinci_ks_platform_data dm365evm_ks_data = {
  195. .device_enable = dm365evm_keyscan_enable,
  196. .keymap = dm365evm_keymap,
  197. .keymapsize = ARRAY_SIZE(dm365evm_keymap),
  198. .rep = 1,
  199. /* Scan period = strobe + interval */
  200. .strobe = 0x5,
  201. .interval = 0x2,
  202. .matrix_type = DAVINCI_KEYSCAN_MATRIX_4X4,
  203. };
  204. static int cpld_mmc_get_cd(int module)
  205. {
  206. if (!cpld)
  207. return -ENXIO;
  208. /* low == card present */
  209. return !(__raw_readb(cpld + CPLD_CARDSTAT) & BIT(module ? 4 : 0));
  210. }
  211. static int cpld_mmc_get_ro(int module)
  212. {
  213. if (!cpld)
  214. return -ENXIO;
  215. /* high == card's write protect switch active */
  216. return !!(__raw_readb(cpld + CPLD_CARDSTAT) & BIT(module ? 5 : 1));
  217. }
  218. static struct davinci_mmc_config dm365evm_mmc_config = {
  219. .get_cd = cpld_mmc_get_cd,
  220. .get_ro = cpld_mmc_get_ro,
  221. .wires = 4,
  222. .max_freq = 50000000,
  223. .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
  224. .version = MMC_CTLR_VERSION_2,
  225. };
  226. static void dm365evm_emac_configure(void)
  227. {
  228. /*
  229. * EMAC pins are multiplexed with GPIO and UART
  230. * Further details are available at the DM365 ARM
  231. * Subsystem Users Guide(sprufg5.pdf) pages 125 - 127
  232. */
  233. davinci_cfg_reg(DM365_EMAC_TX_EN);
  234. davinci_cfg_reg(DM365_EMAC_TX_CLK);
  235. davinci_cfg_reg(DM365_EMAC_COL);
  236. davinci_cfg_reg(DM365_EMAC_TXD3);
  237. davinci_cfg_reg(DM365_EMAC_TXD2);
  238. davinci_cfg_reg(DM365_EMAC_TXD1);
  239. davinci_cfg_reg(DM365_EMAC_TXD0);
  240. davinci_cfg_reg(DM365_EMAC_RXD3);
  241. davinci_cfg_reg(DM365_EMAC_RXD2);
  242. davinci_cfg_reg(DM365_EMAC_RXD1);
  243. davinci_cfg_reg(DM365_EMAC_RXD0);
  244. davinci_cfg_reg(DM365_EMAC_RX_CLK);
  245. davinci_cfg_reg(DM365_EMAC_RX_DV);
  246. davinci_cfg_reg(DM365_EMAC_RX_ER);
  247. davinci_cfg_reg(DM365_EMAC_CRS);
  248. davinci_cfg_reg(DM365_EMAC_MDIO);
  249. davinci_cfg_reg(DM365_EMAC_MDCLK);
  250. /*
  251. * EMAC interrupts are multiplexed with GPIO interrupts
  252. * Details are available at the DM365 ARM
  253. * Subsystem Users Guide(sprufg5.pdf) pages 133 - 134
  254. */
  255. davinci_cfg_reg(DM365_INT_EMAC_RXTHRESH);
  256. davinci_cfg_reg(DM365_INT_EMAC_RXPULSE);
  257. davinci_cfg_reg(DM365_INT_EMAC_TXPULSE);
  258. davinci_cfg_reg(DM365_INT_EMAC_MISCPULSE);
  259. }
  260. static void dm365evm_mmc_configure(void)
  261. {
  262. /*
  263. * MMC/SD pins are multiplexed with GPIO and EMIF
  264. * Further details are available at the DM365 ARM
  265. * Subsystem Users Guide(sprufg5.pdf) pages 118, 128 - 131
  266. */
  267. davinci_cfg_reg(DM365_SD1_CLK);
  268. davinci_cfg_reg(DM365_SD1_CMD);
  269. davinci_cfg_reg(DM365_SD1_DATA3);
  270. davinci_cfg_reg(DM365_SD1_DATA2);
  271. davinci_cfg_reg(DM365_SD1_DATA1);
  272. davinci_cfg_reg(DM365_SD1_DATA0);
  273. }
  274. static struct tvp514x_platform_data tvp5146_pdata = {
  275. .clk_polarity = 0,
  276. .hs_polarity = 1,
  277. .vs_polarity = 1
  278. };
  279. #define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
  280. /* Inputs available at the TVP5146 */
  281. static struct v4l2_input tvp5146_inputs[] = {
  282. {
  283. .index = 0,
  284. .name = "Composite",
  285. .type = V4L2_INPUT_TYPE_CAMERA,
  286. .std = TVP514X_STD_ALL,
  287. },
  288. {
  289. .index = 1,
  290. .name = "S-Video",
  291. .type = V4L2_INPUT_TYPE_CAMERA,
  292. .std = TVP514X_STD_ALL,
  293. },
  294. };
  295. /*
  296. * this is the route info for connecting each input to decoder
  297. * ouput that goes to vpfe. There is a one to one correspondence
  298. * with tvp5146_inputs
  299. */
  300. static struct vpfe_route tvp5146_routes[] = {
  301. {
  302. .input = INPUT_CVBS_VI2B,
  303. .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
  304. },
  305. {
  306. .input = INPUT_SVIDEO_VI2C_VI1C,
  307. .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
  308. },
  309. };
  310. static struct vpfe_subdev_info vpfe_sub_devs[] = {
  311. {
  312. .name = "tvp5146",
  313. .grp_id = 0,
  314. .num_inputs = ARRAY_SIZE(tvp5146_inputs),
  315. .inputs = tvp5146_inputs,
  316. .routes = tvp5146_routes,
  317. .can_route = 1,
  318. .ccdc_if_params = {
  319. .if_type = VPFE_BT656,
  320. .hdpol = VPFE_PINPOL_POSITIVE,
  321. .vdpol = VPFE_PINPOL_POSITIVE,
  322. },
  323. .board_info = {
  324. I2C_BOARD_INFO("tvp5146", 0x5d),
  325. .platform_data = &tvp5146_pdata,
  326. },
  327. },
  328. };
  329. static struct vpfe_config vpfe_cfg = {
  330. .num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
  331. .sub_devs = vpfe_sub_devs,
  332. .i2c_adapter_id = 1,
  333. .card_name = "DM365 EVM",
  334. .ccdc = "ISIF",
  335. };
  336. static void __init evm_init_i2c(void)
  337. {
  338. davinci_init_i2c(&i2c_pdata);
  339. i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
  340. }
  341. static struct platform_device *dm365_evm_nand_devices[] __initdata = {
  342. &davinci_nand_device,
  343. };
  344. static inline int have_leds(void)
  345. {
  346. #ifdef CONFIG_LEDS_CLASS
  347. return 1;
  348. #else
  349. return 0;
  350. #endif
  351. }
  352. struct cpld_led {
  353. struct led_classdev cdev;
  354. u8 mask;
  355. };
  356. static const struct {
  357. const char *name;
  358. const char *trigger;
  359. } cpld_leds[] = {
  360. { "dm365evm::ds2", },
  361. { "dm365evm::ds3", },
  362. { "dm365evm::ds4", },
  363. { "dm365evm::ds5", },
  364. { "dm365evm::ds6", "nand-disk", },
  365. { "dm365evm::ds7", "mmc1", },
  366. { "dm365evm::ds8", "mmc0", },
  367. { "dm365evm::ds9", "heartbeat", },
  368. };
  369. static void cpld_led_set(struct led_classdev *cdev, enum led_brightness b)
  370. {
  371. struct cpld_led *led = container_of(cdev, struct cpld_led, cdev);
  372. u8 reg = __raw_readb(cpld + CPLD_LEDS);
  373. if (b != LED_OFF)
  374. reg &= ~led->mask;
  375. else
  376. reg |= led->mask;
  377. __raw_writeb(reg, cpld + CPLD_LEDS);
  378. }
  379. static enum led_brightness cpld_led_get(struct led_classdev *cdev)
  380. {
  381. struct cpld_led *led = container_of(cdev, struct cpld_led, cdev);
  382. u8 reg = __raw_readb(cpld + CPLD_LEDS);
  383. return (reg & led->mask) ? LED_OFF : LED_FULL;
  384. }
  385. static int __init cpld_leds_init(void)
  386. {
  387. int i;
  388. if (!have_leds() || !cpld)
  389. return 0;
  390. /* setup LEDs */
  391. __raw_writeb(0xff, cpld + CPLD_LEDS);
  392. for (i = 0; i < ARRAY_SIZE(cpld_leds); i++) {
  393. struct cpld_led *led;
  394. led = kzalloc(sizeof(*led), GFP_KERNEL);
  395. if (!led)
  396. break;
  397. led->cdev.name = cpld_leds[i].name;
  398. led->cdev.brightness_set = cpld_led_set;
  399. led->cdev.brightness_get = cpld_led_get;
  400. led->cdev.default_trigger = cpld_leds[i].trigger;
  401. led->mask = BIT(i);
  402. if (led_classdev_register(NULL, &led->cdev) < 0) {
  403. kfree(led);
  404. break;
  405. }
  406. }
  407. return 0;
  408. }
  409. /* run after subsys_initcall() for LEDs */
  410. fs_initcall(cpld_leds_init);
  411. static void __init evm_init_cpld(void)
  412. {
  413. u8 mux, resets;
  414. const char *label;
  415. struct clk *aemif_clk;
  416. /* Make sure we can configure the CPLD through CS1. Then
  417. * leave it on for later access to MMC and LED registers.
  418. */
  419. aemif_clk = clk_get(NULL, "aemif");
  420. if (IS_ERR(aemif_clk))
  421. return;
  422. clk_enable(aemif_clk);
  423. if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE,
  424. "cpld") == NULL)
  425. goto fail;
  426. cpld = ioremap(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE);
  427. if (!cpld) {
  428. release_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE,
  429. SECTION_SIZE);
  430. fail:
  431. pr_err("ERROR: can't map CPLD\n");
  432. clk_disable(aemif_clk);
  433. return;
  434. }
  435. /* External muxing for some signals */
  436. mux = 0;
  437. /* Read SW5 to set up NAND + keypad _or_ OneNAND (sync read).
  438. * NOTE: SW4 bus width setting must match!
  439. */
  440. if ((__raw_readb(cpld + CPLD_SWITCH) & BIT(5)) == 0) {
  441. /* external keypad mux */
  442. mux |= BIT(7);
  443. platform_add_devices(dm365_evm_nand_devices,
  444. ARRAY_SIZE(dm365_evm_nand_devices));
  445. } else {
  446. /* no OneNAND support yet */
  447. }
  448. /* Leave external chips in reset when unused. */
  449. resets = BIT(3) | BIT(2) | BIT(1) | BIT(0);
  450. /* Static video input config with SN74CBT16214 1-of-3 mux:
  451. * - port b1 == tvp7002 (mux lowbits == 1 or 6)
  452. * - port b2 == imager (mux lowbits == 2 or 7)
  453. * - port b3 == tvp5146 (mux lowbits == 5)
  454. *
  455. * Runtime switching could work too, with limitations.
  456. */
  457. if (have_imager()) {
  458. label = "HD imager";
  459. mux |= 1;
  460. /* externally mux MMC1/ENET/AIC33 to imager */
  461. mux |= BIT(6) | BIT(5) | BIT(3);
  462. } else {
  463. struct davinci_soc_info *soc_info = &davinci_soc_info;
  464. /* we can use MMC1 ... */
  465. dm365evm_mmc_configure();
  466. davinci_setup_mmc(1, &dm365evm_mmc_config);
  467. /* ... and ENET ... */
  468. dm365evm_emac_configure();
  469. soc_info->emac_pdata->phy_mask = DM365_EVM_PHY_MASK;
  470. soc_info->emac_pdata->mdio_max_freq = DM365_EVM_MDIO_FREQUENCY;
  471. resets &= ~BIT(3);
  472. /* ... and AIC33 */
  473. resets &= ~BIT(1);
  474. if (have_tvp7002()) {
  475. mux |= 2;
  476. resets &= ~BIT(2);
  477. label = "tvp7002 HD";
  478. } else {
  479. /* default to tvp5146 */
  480. mux |= 5;
  481. resets &= ~BIT(0);
  482. label = "tvp5146 SD";
  483. }
  484. }
  485. __raw_writeb(mux, cpld + CPLD_MUX);
  486. __raw_writeb(resets, cpld + CPLD_RESETS);
  487. pr_info("EVM: %s video input\n", label);
  488. /* REVISIT export switches: NTSC/PAL (SW5.6), EXTRA1 (SW5.2), etc */
  489. }
  490. static struct davinci_uart_config uart_config __initdata = {
  491. .enabled_uarts = (1 << 0),
  492. };
  493. static void __init dm365_evm_map_io(void)
  494. {
  495. /* setup input configuration for VPFE input devices */
  496. dm365_set_vpfe_config(&vpfe_cfg);
  497. dm365_init();
  498. }
  499. static struct spi_eeprom at25640 = {
  500. .byte_len = SZ_64K / 8,
  501. .name = "at25640",
  502. .page_size = 32,
  503. .flags = EE_ADDR2,
  504. };
  505. static struct spi_board_info dm365_evm_spi_info[] __initconst = {
  506. {
  507. .modalias = "at25",
  508. .platform_data = &at25640,
  509. .max_speed_hz = 10 * 1000 * 1000,
  510. .bus_num = 0,
  511. .chip_select = 0,
  512. .mode = SPI_MODE_0,
  513. },
  514. };
  515. static __init void dm365_evm_init(void)
  516. {
  517. evm_init_i2c();
  518. davinci_serial_init(&uart_config);
  519. dm365evm_emac_configure();
  520. dm365evm_mmc_configure();
  521. davinci_setup_mmc(0, &dm365evm_mmc_config);
  522. /* maybe setup mmc1/etc ... _after_ mmc0 */
  523. evm_init_cpld();
  524. #ifdef CONFIG_SND_DM365_AIC3X_CODEC
  525. dm365_init_asp(&dm365_evm_snd_data);
  526. #elif defined(CONFIG_SND_DM365_VOICE_CODEC)
  527. dm365_init_vc(&dm365_evm_snd_data);
  528. #endif
  529. dm365_init_rtc();
  530. dm365_init_ks(&dm365evm_ks_data);
  531. dm365_init_spi0(BIT(0), dm365_evm_spi_info,
  532. ARRAY_SIZE(dm365_evm_spi_info));
  533. }
  534. MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
  535. .phys_io = IO_PHYS,
  536. .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
  537. .boot_params = (0x80000100),
  538. .map_io = dm365_evm_map_io,
  539. .init_irq = davinci_irq_init,
  540. .timer = &davinci_timer,
  541. .init_machine = dm365_evm_init,
  542. MACHINE_END