setup-sh7372.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. /*
  2. * sh7372 processor support
  3. *
  4. * Copyright (C) 2010 Magnus Damm
  5. * Copyright (C) 2008 Yoshihiro Shimoda
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/irq.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/delay.h>
  26. #include <linux/input.h>
  27. #include <linux/io.h>
  28. #include <linux/serial_sci.h>
  29. #include <linux/sh_dma.h>
  30. #include <linux/sh_intc.h>
  31. #include <linux/sh_timer.h>
  32. #include <mach/hardware.h>
  33. #include <mach/sh7372.h>
  34. #include <asm/mach-types.h>
  35. #include <asm/mach/arch.h>
  36. /* SCIFA0 */
  37. static struct plat_sci_port scif0_platform_data = {
  38. .mapbase = 0xe6c40000,
  39. .flags = UPF_BOOT_AUTOCONF,
  40. .scscr = SCSCR_RE | SCSCR_TE,
  41. .scbrr_algo_id = SCBRR_ALGO_4,
  42. .type = PORT_SCIFA,
  43. .irqs = { evt2irq(0x0c00), evt2irq(0x0c00),
  44. evt2irq(0x0c00), evt2irq(0x0c00) },
  45. };
  46. static struct platform_device scif0_device = {
  47. .name = "sh-sci",
  48. .id = 0,
  49. .dev = {
  50. .platform_data = &scif0_platform_data,
  51. },
  52. };
  53. /* SCIFA1 */
  54. static struct plat_sci_port scif1_platform_data = {
  55. .mapbase = 0xe6c50000,
  56. .flags = UPF_BOOT_AUTOCONF,
  57. .scscr = SCSCR_RE | SCSCR_TE,
  58. .scbrr_algo_id = SCBRR_ALGO_4,
  59. .type = PORT_SCIFA,
  60. .irqs = { evt2irq(0x0c20), evt2irq(0x0c20),
  61. evt2irq(0x0c20), evt2irq(0x0c20) },
  62. };
  63. static struct platform_device scif1_device = {
  64. .name = "sh-sci",
  65. .id = 1,
  66. .dev = {
  67. .platform_data = &scif1_platform_data,
  68. },
  69. };
  70. /* SCIFA2 */
  71. static struct plat_sci_port scif2_platform_data = {
  72. .mapbase = 0xe6c60000,
  73. .flags = UPF_BOOT_AUTOCONF,
  74. .scscr = SCSCR_RE | SCSCR_TE,
  75. .scbrr_algo_id = SCBRR_ALGO_4,
  76. .type = PORT_SCIFA,
  77. .irqs = { evt2irq(0x0c40), evt2irq(0x0c40),
  78. evt2irq(0x0c40), evt2irq(0x0c40) },
  79. };
  80. static struct platform_device scif2_device = {
  81. .name = "sh-sci",
  82. .id = 2,
  83. .dev = {
  84. .platform_data = &scif2_platform_data,
  85. },
  86. };
  87. /* SCIFA3 */
  88. static struct plat_sci_port scif3_platform_data = {
  89. .mapbase = 0xe6c70000,
  90. .flags = UPF_BOOT_AUTOCONF,
  91. .scscr = SCSCR_RE | SCSCR_TE,
  92. .scbrr_algo_id = SCBRR_ALGO_4,
  93. .type = PORT_SCIFA,
  94. .irqs = { evt2irq(0x0c60), evt2irq(0x0c60),
  95. evt2irq(0x0c60), evt2irq(0x0c60) },
  96. };
  97. static struct platform_device scif3_device = {
  98. .name = "sh-sci",
  99. .id = 3,
  100. .dev = {
  101. .platform_data = &scif3_platform_data,
  102. },
  103. };
  104. /* SCIFA4 */
  105. static struct plat_sci_port scif4_platform_data = {
  106. .mapbase = 0xe6c80000,
  107. .flags = UPF_BOOT_AUTOCONF,
  108. .scscr = SCSCR_RE | SCSCR_TE,
  109. .scbrr_algo_id = SCBRR_ALGO_4,
  110. .type = PORT_SCIFA,
  111. .irqs = { evt2irq(0x0d20), evt2irq(0x0d20),
  112. evt2irq(0x0d20), evt2irq(0x0d20) },
  113. };
  114. static struct platform_device scif4_device = {
  115. .name = "sh-sci",
  116. .id = 4,
  117. .dev = {
  118. .platform_data = &scif4_platform_data,
  119. },
  120. };
  121. /* SCIFA5 */
  122. static struct plat_sci_port scif5_platform_data = {
  123. .mapbase = 0xe6cb0000,
  124. .flags = UPF_BOOT_AUTOCONF,
  125. .scscr = SCSCR_RE | SCSCR_TE,
  126. .scbrr_algo_id = SCBRR_ALGO_4,
  127. .type = PORT_SCIFA,
  128. .irqs = { evt2irq(0x0d40), evt2irq(0x0d40),
  129. evt2irq(0x0d40), evt2irq(0x0d40) },
  130. };
  131. static struct platform_device scif5_device = {
  132. .name = "sh-sci",
  133. .id = 5,
  134. .dev = {
  135. .platform_data = &scif5_platform_data,
  136. },
  137. };
  138. /* SCIFB */
  139. static struct plat_sci_port scif6_platform_data = {
  140. .mapbase = 0xe6c30000,
  141. .flags = UPF_BOOT_AUTOCONF,
  142. .scscr = SCSCR_RE | SCSCR_TE,
  143. .scbrr_algo_id = SCBRR_ALGO_4,
  144. .type = PORT_SCIFB,
  145. .irqs = { evt2irq(0x0d60), evt2irq(0x0d60),
  146. evt2irq(0x0d60), evt2irq(0x0d60) },
  147. };
  148. static struct platform_device scif6_device = {
  149. .name = "sh-sci",
  150. .id = 6,
  151. .dev = {
  152. .platform_data = &scif6_platform_data,
  153. },
  154. };
  155. /* CMT */
  156. static struct sh_timer_config cmt10_platform_data = {
  157. .name = "CMT10",
  158. .channel_offset = 0x10,
  159. .timer_bit = 0,
  160. .clockevent_rating = 125,
  161. .clocksource_rating = 125,
  162. };
  163. static struct resource cmt10_resources[] = {
  164. [0] = {
  165. .name = "CMT10",
  166. .start = 0xe6138010,
  167. .end = 0xe613801b,
  168. .flags = IORESOURCE_MEM,
  169. },
  170. [1] = {
  171. .start = evt2irq(0x0b00), /* CMT1_CMT10 */
  172. .flags = IORESOURCE_IRQ,
  173. },
  174. };
  175. static struct platform_device cmt10_device = {
  176. .name = "sh_cmt",
  177. .id = 10,
  178. .dev = {
  179. .platform_data = &cmt10_platform_data,
  180. },
  181. .resource = cmt10_resources,
  182. .num_resources = ARRAY_SIZE(cmt10_resources),
  183. };
  184. /* TMU */
  185. static struct sh_timer_config tmu00_platform_data = {
  186. .name = "TMU00",
  187. .channel_offset = 0x4,
  188. .timer_bit = 0,
  189. .clockevent_rating = 200,
  190. };
  191. static struct resource tmu00_resources[] = {
  192. [0] = {
  193. .name = "TMU00",
  194. .start = 0xfff60008,
  195. .end = 0xfff60013,
  196. .flags = IORESOURCE_MEM,
  197. },
  198. [1] = {
  199. .start = intcs_evt2irq(0xe80), /* TMU_TUNI0 */
  200. .flags = IORESOURCE_IRQ,
  201. },
  202. };
  203. static struct platform_device tmu00_device = {
  204. .name = "sh_tmu",
  205. .id = 0,
  206. .dev = {
  207. .platform_data = &tmu00_platform_data,
  208. },
  209. .resource = tmu00_resources,
  210. .num_resources = ARRAY_SIZE(tmu00_resources),
  211. };
  212. static struct sh_timer_config tmu01_platform_data = {
  213. .name = "TMU01",
  214. .channel_offset = 0x10,
  215. .timer_bit = 1,
  216. .clocksource_rating = 200,
  217. };
  218. static struct resource tmu01_resources[] = {
  219. [0] = {
  220. .name = "TMU01",
  221. .start = 0xfff60014,
  222. .end = 0xfff6001f,
  223. .flags = IORESOURCE_MEM,
  224. },
  225. [1] = {
  226. .start = intcs_evt2irq(0xea0), /* TMU_TUNI1 */
  227. .flags = IORESOURCE_IRQ,
  228. },
  229. };
  230. static struct platform_device tmu01_device = {
  231. .name = "sh_tmu",
  232. .id = 1,
  233. .dev = {
  234. .platform_data = &tmu01_platform_data,
  235. },
  236. .resource = tmu01_resources,
  237. .num_resources = ARRAY_SIZE(tmu01_resources),
  238. };
  239. /* I2C */
  240. static struct resource iic0_resources[] = {
  241. [0] = {
  242. .name = "IIC0",
  243. .start = 0xFFF20000,
  244. .end = 0xFFF20425 - 1,
  245. .flags = IORESOURCE_MEM,
  246. },
  247. [1] = {
  248. .start = intcs_evt2irq(0xe00), /* IIC0_ALI0 */
  249. .end = intcs_evt2irq(0xe60), /* IIC0_DTEI0 */
  250. .flags = IORESOURCE_IRQ,
  251. },
  252. };
  253. static struct platform_device iic0_device = {
  254. .name = "i2c-sh_mobile",
  255. .id = 0, /* "i2c0" clock */
  256. .num_resources = ARRAY_SIZE(iic0_resources),
  257. .resource = iic0_resources,
  258. };
  259. static struct resource iic1_resources[] = {
  260. [0] = {
  261. .name = "IIC1",
  262. .start = 0xE6C20000,
  263. .end = 0xE6C20425 - 1,
  264. .flags = IORESOURCE_MEM,
  265. },
  266. [1] = {
  267. .start = evt2irq(0x780), /* IIC1_ALI1 */
  268. .end = evt2irq(0x7e0), /* IIC1_DTEI1 */
  269. .flags = IORESOURCE_IRQ,
  270. },
  271. };
  272. static struct platform_device iic1_device = {
  273. .name = "i2c-sh_mobile",
  274. .id = 1, /* "i2c1" clock */
  275. .num_resources = ARRAY_SIZE(iic1_resources),
  276. .resource = iic1_resources,
  277. };
  278. /* DMA */
  279. /* Transmit sizes and respective CHCR register values */
  280. enum {
  281. XMIT_SZ_8BIT = 0,
  282. XMIT_SZ_16BIT = 1,
  283. XMIT_SZ_32BIT = 2,
  284. XMIT_SZ_64BIT = 7,
  285. XMIT_SZ_128BIT = 3,
  286. XMIT_SZ_256BIT = 4,
  287. XMIT_SZ_512BIT = 5,
  288. };
  289. /* log2(size / 8) - used to calculate number of transfers */
  290. #define TS_SHIFT { \
  291. [XMIT_SZ_8BIT] = 0, \
  292. [XMIT_SZ_16BIT] = 1, \
  293. [XMIT_SZ_32BIT] = 2, \
  294. [XMIT_SZ_64BIT] = 3, \
  295. [XMIT_SZ_128BIT] = 4, \
  296. [XMIT_SZ_256BIT] = 5, \
  297. [XMIT_SZ_512BIT] = 6, \
  298. }
  299. #define TS_INDEX2VAL(i) ((((i) & 3) << 3) | \
  300. (((i) & 0xc) << (20 - 2)))
  301. static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = {
  302. {
  303. .slave_id = SHDMA_SLAVE_SCIF0_TX,
  304. .addr = 0xe6c40020,
  305. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  306. .mid_rid = 0x21,
  307. }, {
  308. .slave_id = SHDMA_SLAVE_SCIF0_RX,
  309. .addr = 0xe6c40024,
  310. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  311. .mid_rid = 0x22,
  312. }, {
  313. .slave_id = SHDMA_SLAVE_SCIF1_TX,
  314. .addr = 0xe6c50020,
  315. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  316. .mid_rid = 0x25,
  317. }, {
  318. .slave_id = SHDMA_SLAVE_SCIF1_RX,
  319. .addr = 0xe6c50024,
  320. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  321. .mid_rid = 0x26,
  322. }, {
  323. .slave_id = SHDMA_SLAVE_SCIF2_TX,
  324. .addr = 0xe6c60020,
  325. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  326. .mid_rid = 0x29,
  327. }, {
  328. .slave_id = SHDMA_SLAVE_SCIF2_RX,
  329. .addr = 0xe6c60024,
  330. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  331. .mid_rid = 0x2a,
  332. }, {
  333. .slave_id = SHDMA_SLAVE_SCIF3_TX,
  334. .addr = 0xe6c70020,
  335. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  336. .mid_rid = 0x2d,
  337. }, {
  338. .slave_id = SHDMA_SLAVE_SCIF3_RX,
  339. .addr = 0xe6c70024,
  340. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  341. .mid_rid = 0x2e,
  342. }, {
  343. .slave_id = SHDMA_SLAVE_SCIF4_TX,
  344. .addr = 0xe6c80020,
  345. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  346. .mid_rid = 0x39,
  347. }, {
  348. .slave_id = SHDMA_SLAVE_SCIF4_RX,
  349. .addr = 0xe6c80024,
  350. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  351. .mid_rid = 0x3a,
  352. }, {
  353. .slave_id = SHDMA_SLAVE_SCIF5_TX,
  354. .addr = 0xe6cb0020,
  355. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  356. .mid_rid = 0x35,
  357. }, {
  358. .slave_id = SHDMA_SLAVE_SCIF5_RX,
  359. .addr = 0xe6cb0024,
  360. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  361. .mid_rid = 0x36,
  362. }, {
  363. .slave_id = SHDMA_SLAVE_SCIF6_TX,
  364. .addr = 0xe6c30040,
  365. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  366. .mid_rid = 0x3d,
  367. }, {
  368. .slave_id = SHDMA_SLAVE_SCIF6_RX,
  369. .addr = 0xe6c30060,
  370. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
  371. .mid_rid = 0x3e,
  372. }, {
  373. .slave_id = SHDMA_SLAVE_SDHI0_TX,
  374. .addr = 0xe6850030,
  375. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
  376. .mid_rid = 0xc1,
  377. }, {
  378. .slave_id = SHDMA_SLAVE_SDHI0_RX,
  379. .addr = 0xe6850030,
  380. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
  381. .mid_rid = 0xc2,
  382. }, {
  383. .slave_id = SHDMA_SLAVE_SDHI1_TX,
  384. .addr = 0xe6860030,
  385. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
  386. .mid_rid = 0xc9,
  387. }, {
  388. .slave_id = SHDMA_SLAVE_SDHI1_RX,
  389. .addr = 0xe6860030,
  390. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
  391. .mid_rid = 0xca,
  392. }, {
  393. .slave_id = SHDMA_SLAVE_SDHI2_TX,
  394. .addr = 0xe6870030,
  395. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
  396. .mid_rid = 0xcd,
  397. }, {
  398. .slave_id = SHDMA_SLAVE_SDHI2_RX,
  399. .addr = 0xe6870030,
  400. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
  401. .mid_rid = 0xce,
  402. }, {
  403. .slave_id = SHDMA_SLAVE_MMCIF_TX,
  404. .addr = 0xe6bd0034,
  405. .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
  406. .mid_rid = 0xd1,
  407. }, {
  408. .slave_id = SHDMA_SLAVE_MMCIF_RX,
  409. .addr = 0xe6bd0034,
  410. .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
  411. .mid_rid = 0xd2,
  412. },
  413. };
  414. static const struct sh_dmae_channel sh7372_dmae_channels[] = {
  415. {
  416. .offset = 0,
  417. .dmars = 0,
  418. .dmars_bit = 0,
  419. }, {
  420. .offset = 0x10,
  421. .dmars = 0,
  422. .dmars_bit = 8,
  423. }, {
  424. .offset = 0x20,
  425. .dmars = 4,
  426. .dmars_bit = 0,
  427. }, {
  428. .offset = 0x30,
  429. .dmars = 4,
  430. .dmars_bit = 8,
  431. }, {
  432. .offset = 0x50,
  433. .dmars = 8,
  434. .dmars_bit = 0,
  435. }, {
  436. .offset = 0x60,
  437. .dmars = 8,
  438. .dmars_bit = 8,
  439. }
  440. };
  441. static const unsigned int ts_shift[] = TS_SHIFT;
  442. static struct sh_dmae_pdata dma_platform_data = {
  443. .slave = sh7372_dmae_slaves,
  444. .slave_num = ARRAY_SIZE(sh7372_dmae_slaves),
  445. .channel = sh7372_dmae_channels,
  446. .channel_num = ARRAY_SIZE(sh7372_dmae_channels),
  447. .ts_low_shift = 3,
  448. .ts_low_mask = 0x18,
  449. .ts_high_shift = (20 - 2), /* 2 bits for shifted low TS */
  450. .ts_high_mask = 0x00300000,
  451. .ts_shift = ts_shift,
  452. .ts_shift_num = ARRAY_SIZE(ts_shift),
  453. .dmaor_init = DMAOR_DME,
  454. };
  455. /* Resource order important! */
  456. static struct resource sh7372_dmae0_resources[] = {
  457. {
  458. /* Channel registers and DMAOR */
  459. .start = 0xfe008020,
  460. .end = 0xfe00808f,
  461. .flags = IORESOURCE_MEM,
  462. },
  463. {
  464. /* DMARSx */
  465. .start = 0xfe009000,
  466. .end = 0xfe00900b,
  467. .flags = IORESOURCE_MEM,
  468. },
  469. {
  470. /* DMA error IRQ */
  471. .start = evt2irq(0x20c0),
  472. .end = evt2irq(0x20c0),
  473. .flags = IORESOURCE_IRQ,
  474. },
  475. {
  476. /* IRQ for channels 0-5 */
  477. .start = evt2irq(0x2000),
  478. .end = evt2irq(0x20a0),
  479. .flags = IORESOURCE_IRQ,
  480. },
  481. };
  482. /* Resource order important! */
  483. static struct resource sh7372_dmae1_resources[] = {
  484. {
  485. /* Channel registers and DMAOR */
  486. .start = 0xfe018020,
  487. .end = 0xfe01808f,
  488. .flags = IORESOURCE_MEM,
  489. },
  490. {
  491. /* DMARSx */
  492. .start = 0xfe019000,
  493. .end = 0xfe01900b,
  494. .flags = IORESOURCE_MEM,
  495. },
  496. {
  497. /* DMA error IRQ */
  498. .start = evt2irq(0x21c0),
  499. .end = evt2irq(0x21c0),
  500. .flags = IORESOURCE_IRQ,
  501. },
  502. {
  503. /* IRQ for channels 0-5 */
  504. .start = evt2irq(0x2100),
  505. .end = evt2irq(0x21a0),
  506. .flags = IORESOURCE_IRQ,
  507. },
  508. };
  509. /* Resource order important! */
  510. static struct resource sh7372_dmae2_resources[] = {
  511. {
  512. /* Channel registers and DMAOR */
  513. .start = 0xfe028020,
  514. .end = 0xfe02808f,
  515. .flags = IORESOURCE_MEM,
  516. },
  517. {
  518. /* DMARSx */
  519. .start = 0xfe029000,
  520. .end = 0xfe02900b,
  521. .flags = IORESOURCE_MEM,
  522. },
  523. {
  524. /* DMA error IRQ */
  525. .start = evt2irq(0x22c0),
  526. .end = evt2irq(0x22c0),
  527. .flags = IORESOURCE_IRQ,
  528. },
  529. {
  530. /* IRQ for channels 0-5 */
  531. .start = evt2irq(0x2200),
  532. .end = evt2irq(0x22a0),
  533. .flags = IORESOURCE_IRQ,
  534. },
  535. };
  536. static struct platform_device dma0_device = {
  537. .name = "sh-dma-engine",
  538. .id = 0,
  539. .resource = sh7372_dmae0_resources,
  540. .num_resources = ARRAY_SIZE(sh7372_dmae0_resources),
  541. .dev = {
  542. .platform_data = &dma_platform_data,
  543. },
  544. };
  545. static struct platform_device dma1_device = {
  546. .name = "sh-dma-engine",
  547. .id = 1,
  548. .resource = sh7372_dmae1_resources,
  549. .num_resources = ARRAY_SIZE(sh7372_dmae1_resources),
  550. .dev = {
  551. .platform_data = &dma_platform_data,
  552. },
  553. };
  554. static struct platform_device dma2_device = {
  555. .name = "sh-dma-engine",
  556. .id = 2,
  557. .resource = sh7372_dmae2_resources,
  558. .num_resources = ARRAY_SIZE(sh7372_dmae2_resources),
  559. .dev = {
  560. .platform_data = &dma_platform_data,
  561. },
  562. };
  563. static struct platform_device *sh7372_early_devices[] __initdata = {
  564. &scif0_device,
  565. &scif1_device,
  566. &scif2_device,
  567. &scif3_device,
  568. &scif4_device,
  569. &scif5_device,
  570. &scif6_device,
  571. &cmt10_device,
  572. &tmu00_device,
  573. &tmu01_device,
  574. };
  575. static struct platform_device *sh7372_late_devices[] __initdata = {
  576. &iic0_device,
  577. &iic1_device,
  578. &dma0_device,
  579. &dma1_device,
  580. &dma2_device,
  581. };
  582. void __init sh7372_add_standard_devices(void)
  583. {
  584. platform_add_devices(sh7372_early_devices,
  585. ARRAY_SIZE(sh7372_early_devices));
  586. platform_add_devices(sh7372_late_devices,
  587. ARRAY_SIZE(sh7372_late_devices));
  588. }
  589. void __init sh7372_add_early_devices(void)
  590. {
  591. early_platform_add_devices(sh7372_early_devices,
  592. ARRAY_SIZE(sh7372_early_devices));
  593. }