setup-sh7786.c 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  1. /*
  2. * SH7786 Setup
  3. *
  4. * Copyright (C) 2009 - 2011 Renesas Solutions Corp.
  5. * Kuninori Morimoto <morimoto.kuninori@renesas.com>
  6. * Paul Mundt <paul.mundt@renesas.com>
  7. *
  8. * Based on SH7785 Setup
  9. *
  10. * Copyright (C) 2007 Paul Mundt
  11. *
  12. * This file is subject to the terms and conditions of the GNU General Public
  13. * License. See the file "COPYING" in the main directory of this archive
  14. * for more details.
  15. */
  16. #include <linux/platform_device.h>
  17. #include <linux/init.h>
  18. #include <linux/serial.h>
  19. #include <linux/serial_sci.h>
  20. #include <linux/io.h>
  21. #include <linux/mm.h>
  22. #include <linux/dma-mapping.h>
  23. #include <linux/sh_timer.h>
  24. #include <linux/sh_dma.h>
  25. #include <linux/sh_intc.h>
  26. #include <linux/usb/ohci_pdriver.h>
  27. #include <cpu/dma-register.h>
  28. #include <asm/mmzone.h>
  29. static struct plat_sci_port scif0_platform_data = {
  30. .mapbase = 0xffea0000,
  31. .flags = UPF_BOOT_AUTOCONF,
  32. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
  33. .scbrr_algo_id = SCBRR_ALGO_1,
  34. .type = PORT_SCIF,
  35. .irqs = { evt2irq(0x700),
  36. evt2irq(0x720),
  37. evt2irq(0x760),
  38. evt2irq(0x740) },
  39. .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
  40. };
  41. static struct platform_device scif0_device = {
  42. .name = "sh-sci",
  43. .id = 0,
  44. .dev = {
  45. .platform_data = &scif0_platform_data,
  46. },
  47. };
  48. /*
  49. * The rest of these all have multiplexed IRQs
  50. */
  51. static struct plat_sci_port scif1_platform_data = {
  52. .mapbase = 0xffeb0000,
  53. .flags = UPF_BOOT_AUTOCONF,
  54. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
  55. .scbrr_algo_id = SCBRR_ALGO_1,
  56. .type = PORT_SCIF,
  57. .irqs = SCIx_IRQ_MUXED(evt2irq(0x780)),
  58. .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
  59. };
  60. static struct platform_device scif1_device = {
  61. .name = "sh-sci",
  62. .id = 1,
  63. .dev = {
  64. .platform_data = &scif1_platform_data,
  65. },
  66. };
  67. static struct plat_sci_port scif2_platform_data = {
  68. .mapbase = 0xffec0000,
  69. .flags = UPF_BOOT_AUTOCONF,
  70. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
  71. .scbrr_algo_id = SCBRR_ALGO_1,
  72. .type = PORT_SCIF,
  73. .irqs = SCIx_IRQ_MUXED(evt2irq(0x840)),
  74. .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
  75. };
  76. static struct platform_device scif2_device = {
  77. .name = "sh-sci",
  78. .id = 2,
  79. .dev = {
  80. .platform_data = &scif2_platform_data,
  81. },
  82. };
  83. static struct plat_sci_port scif3_platform_data = {
  84. .mapbase = 0xffed0000,
  85. .flags = UPF_BOOT_AUTOCONF,
  86. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
  87. .scbrr_algo_id = SCBRR_ALGO_1,
  88. .type = PORT_SCIF,
  89. .irqs = SCIx_IRQ_MUXED(evt2irq(0x860)),
  90. .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
  91. };
  92. static struct platform_device scif3_device = {
  93. .name = "sh-sci",
  94. .id = 3,
  95. .dev = {
  96. .platform_data = &scif3_platform_data,
  97. },
  98. };
  99. static struct plat_sci_port scif4_platform_data = {
  100. .mapbase = 0xffee0000,
  101. .flags = UPF_BOOT_AUTOCONF,
  102. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
  103. .scbrr_algo_id = SCBRR_ALGO_1,
  104. .type = PORT_SCIF,
  105. .irqs = SCIx_IRQ_MUXED(evt2irq(0x880)),
  106. .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
  107. };
  108. static struct platform_device scif4_device = {
  109. .name = "sh-sci",
  110. .id = 4,
  111. .dev = {
  112. .platform_data = &scif4_platform_data,
  113. },
  114. };
  115. static struct plat_sci_port scif5_platform_data = {
  116. .mapbase = 0xffef0000,
  117. .flags = UPF_BOOT_AUTOCONF,
  118. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1,
  119. .scbrr_algo_id = SCBRR_ALGO_1,
  120. .type = PORT_SCIF,
  121. .irqs = SCIx_IRQ_MUXED(evt2irq(0x8a0)),
  122. .regtype = SCIx_SH4_SCIF_FIFODATA_REGTYPE,
  123. };
  124. static struct platform_device scif5_device = {
  125. .name = "sh-sci",
  126. .id = 5,
  127. .dev = {
  128. .platform_data = &scif5_platform_data,
  129. },
  130. };
  131. static struct sh_timer_config tmu0_platform_data = {
  132. .channel_offset = 0x04,
  133. .timer_bit = 0,
  134. .clockevent_rating = 200,
  135. };
  136. static struct resource tmu0_resources[] = {
  137. [0] = {
  138. .start = 0xffd80008,
  139. .end = 0xffd80013,
  140. .flags = IORESOURCE_MEM,
  141. },
  142. [1] = {
  143. .start = evt2irq(0x400),
  144. .flags = IORESOURCE_IRQ,
  145. },
  146. };
  147. static struct platform_device tmu0_device = {
  148. .name = "sh_tmu",
  149. .id = 0,
  150. .dev = {
  151. .platform_data = &tmu0_platform_data,
  152. },
  153. .resource = tmu0_resources,
  154. .num_resources = ARRAY_SIZE(tmu0_resources),
  155. };
  156. static struct sh_timer_config tmu1_platform_data = {
  157. .channel_offset = 0x10,
  158. .timer_bit = 1,
  159. .clocksource_rating = 200,
  160. };
  161. static struct resource tmu1_resources[] = {
  162. [0] = {
  163. .start = 0xffd80014,
  164. .end = 0xffd8001f,
  165. .flags = IORESOURCE_MEM,
  166. },
  167. [1] = {
  168. .start = evt2irq(0x420),
  169. .flags = IORESOURCE_IRQ,
  170. },
  171. };
  172. static struct platform_device tmu1_device = {
  173. .name = "sh_tmu",
  174. .id = 1,
  175. .dev = {
  176. .platform_data = &tmu1_platform_data,
  177. },
  178. .resource = tmu1_resources,
  179. .num_resources = ARRAY_SIZE(tmu1_resources),
  180. };
  181. static struct sh_timer_config tmu2_platform_data = {
  182. .channel_offset = 0x1c,
  183. .timer_bit = 2,
  184. };
  185. static struct resource tmu2_resources[] = {
  186. [0] = {
  187. .start = 0xffd80020,
  188. .end = 0xffd8002f,
  189. .flags = IORESOURCE_MEM,
  190. },
  191. [1] = {
  192. .start = evt2irq(0x440),
  193. .flags = IORESOURCE_IRQ,
  194. },
  195. };
  196. static struct platform_device tmu2_device = {
  197. .name = "sh_tmu",
  198. .id = 2,
  199. .dev = {
  200. .platform_data = &tmu2_platform_data,
  201. },
  202. .resource = tmu2_resources,
  203. .num_resources = ARRAY_SIZE(tmu2_resources),
  204. };
  205. static struct sh_timer_config tmu3_platform_data = {
  206. .channel_offset = 0x04,
  207. .timer_bit = 0,
  208. };
  209. static struct resource tmu3_resources[] = {
  210. [0] = {
  211. .start = 0xffda0008,
  212. .end = 0xffda0013,
  213. .flags = IORESOURCE_MEM,
  214. },
  215. [1] = {
  216. .start = evt2irq(0x480),
  217. .flags = IORESOURCE_IRQ,
  218. },
  219. };
  220. static struct platform_device tmu3_device = {
  221. .name = "sh_tmu",
  222. .id = 3,
  223. .dev = {
  224. .platform_data = &tmu3_platform_data,
  225. },
  226. .resource = tmu3_resources,
  227. .num_resources = ARRAY_SIZE(tmu3_resources),
  228. };
  229. static struct sh_timer_config tmu4_platform_data = {
  230. .channel_offset = 0x10,
  231. .timer_bit = 1,
  232. };
  233. static struct resource tmu4_resources[] = {
  234. [0] = {
  235. .start = 0xffda0014,
  236. .end = 0xffda001f,
  237. .flags = IORESOURCE_MEM,
  238. },
  239. [1] = {
  240. .start = evt2irq(0x4a0),
  241. .flags = IORESOURCE_IRQ,
  242. },
  243. };
  244. static struct platform_device tmu4_device = {
  245. .name = "sh_tmu",
  246. .id = 4,
  247. .dev = {
  248. .platform_data = &tmu4_platform_data,
  249. },
  250. .resource = tmu4_resources,
  251. .num_resources = ARRAY_SIZE(tmu4_resources),
  252. };
  253. static struct sh_timer_config tmu5_platform_data = {
  254. .channel_offset = 0x1c,
  255. .timer_bit = 2,
  256. };
  257. static struct resource tmu5_resources[] = {
  258. [0] = {
  259. .start = 0xffda0020,
  260. .end = 0xffda002b,
  261. .flags = IORESOURCE_MEM,
  262. },
  263. [1] = {
  264. .start = evt2irq(0x4c0),
  265. .flags = IORESOURCE_IRQ,
  266. },
  267. };
  268. static struct platform_device tmu5_device = {
  269. .name = "sh_tmu",
  270. .id = 5,
  271. .dev = {
  272. .platform_data = &tmu5_platform_data,
  273. },
  274. .resource = tmu5_resources,
  275. .num_resources = ARRAY_SIZE(tmu5_resources),
  276. };
  277. static struct sh_timer_config tmu6_platform_data = {
  278. .channel_offset = 0x04,
  279. .timer_bit = 0,
  280. };
  281. static struct resource tmu6_resources[] = {
  282. [0] = {
  283. .start = 0xffdc0008,
  284. .end = 0xffdc0013,
  285. .flags = IORESOURCE_MEM,
  286. },
  287. [1] = {
  288. .start = evt2irq(0x7a0),
  289. .flags = IORESOURCE_IRQ,
  290. },
  291. };
  292. static struct platform_device tmu6_device = {
  293. .name = "sh_tmu",
  294. .id = 6,
  295. .dev = {
  296. .platform_data = &tmu6_platform_data,
  297. },
  298. .resource = tmu6_resources,
  299. .num_resources = ARRAY_SIZE(tmu6_resources),
  300. };
  301. static struct sh_timer_config tmu7_platform_data = {
  302. .channel_offset = 0x10,
  303. .timer_bit = 1,
  304. };
  305. static struct resource tmu7_resources[] = {
  306. [0] = {
  307. .start = 0xffdc0014,
  308. .end = 0xffdc001f,
  309. .flags = IORESOURCE_MEM,
  310. },
  311. [1] = {
  312. .start = evt2irq(0x7a0),
  313. .flags = IORESOURCE_IRQ,
  314. },
  315. };
  316. static struct platform_device tmu7_device = {
  317. .name = "sh_tmu",
  318. .id = 7,
  319. .dev = {
  320. .platform_data = &tmu7_platform_data,
  321. },
  322. .resource = tmu7_resources,
  323. .num_resources = ARRAY_SIZE(tmu7_resources),
  324. };
  325. static struct sh_timer_config tmu8_platform_data = {
  326. .channel_offset = 0x1c,
  327. .timer_bit = 2,
  328. };
  329. static struct resource tmu8_resources[] = {
  330. [0] = {
  331. .start = 0xffdc0020,
  332. .end = 0xffdc002b,
  333. .flags = IORESOURCE_MEM,
  334. },
  335. [1] = {
  336. .start = evt2irq(0x7a0),
  337. .flags = IORESOURCE_IRQ,
  338. },
  339. };
  340. static struct platform_device tmu8_device = {
  341. .name = "sh_tmu",
  342. .id = 8,
  343. .dev = {
  344. .platform_data = &tmu8_platform_data,
  345. },
  346. .resource = tmu8_resources,
  347. .num_resources = ARRAY_SIZE(tmu8_resources),
  348. };
  349. static struct sh_timer_config tmu9_platform_data = {
  350. .channel_offset = 0x04,
  351. .timer_bit = 0,
  352. };
  353. static struct resource tmu9_resources[] = {
  354. [0] = {
  355. .start = 0xffde0008,
  356. .end = 0xffde0013,
  357. .flags = IORESOURCE_MEM,
  358. },
  359. [1] = {
  360. .start = evt2irq(0x7c0),
  361. .flags = IORESOURCE_IRQ,
  362. },
  363. };
  364. static struct platform_device tmu9_device = {
  365. .name = "sh_tmu",
  366. .id = 9,
  367. .dev = {
  368. .platform_data = &tmu9_platform_data,
  369. },
  370. .resource = tmu9_resources,
  371. .num_resources = ARRAY_SIZE(tmu9_resources),
  372. };
  373. static struct sh_timer_config tmu10_platform_data = {
  374. .channel_offset = 0x10,
  375. .timer_bit = 1,
  376. };
  377. static struct resource tmu10_resources[] = {
  378. [0] = {
  379. .start = 0xffde0014,
  380. .end = 0xffde001f,
  381. .flags = IORESOURCE_MEM,
  382. },
  383. [1] = {
  384. .start = evt2irq(0x7c0),
  385. .flags = IORESOURCE_IRQ,
  386. },
  387. };
  388. static struct platform_device tmu10_device = {
  389. .name = "sh_tmu",
  390. .id = 10,
  391. .dev = {
  392. .platform_data = &tmu10_platform_data,
  393. },
  394. .resource = tmu10_resources,
  395. .num_resources = ARRAY_SIZE(tmu10_resources),
  396. };
  397. static struct sh_timer_config tmu11_platform_data = {
  398. .channel_offset = 0x1c,
  399. .timer_bit = 2,
  400. };
  401. static struct resource tmu11_resources[] = {
  402. [0] = {
  403. .start = 0xffde0020,
  404. .end = 0xffde002b,
  405. .flags = IORESOURCE_MEM,
  406. },
  407. [1] = {
  408. .start = evt2irq(0x7c0),
  409. .flags = IORESOURCE_IRQ,
  410. },
  411. };
  412. static struct platform_device tmu11_device = {
  413. .name = "sh_tmu",
  414. .id = 11,
  415. .dev = {
  416. .platform_data = &tmu11_platform_data,
  417. },
  418. .resource = tmu11_resources,
  419. .num_resources = ARRAY_SIZE(tmu11_resources),
  420. };
  421. static const struct sh_dmae_channel dmac0_channels[] = {
  422. {
  423. .offset = 0,
  424. .dmars = 0,
  425. .dmars_bit = 0,
  426. }, {
  427. .offset = 0x10,
  428. .dmars = 0,
  429. .dmars_bit = 8,
  430. }, {
  431. .offset = 0x20,
  432. .dmars = 4,
  433. .dmars_bit = 0,
  434. }, {
  435. .offset = 0x30,
  436. .dmars = 4,
  437. .dmars_bit = 8,
  438. }, {
  439. .offset = 0x50,
  440. .dmars = 8,
  441. .dmars_bit = 0,
  442. }, {
  443. .offset = 0x60,
  444. .dmars = 8,
  445. .dmars_bit = 8,
  446. }
  447. };
  448. static const unsigned int ts_shift[] = TS_SHIFT;
  449. static struct sh_dmae_pdata dma0_platform_data = {
  450. .channel = dmac0_channels,
  451. .channel_num = ARRAY_SIZE(dmac0_channels),
  452. .ts_low_shift = CHCR_TS_LOW_SHIFT,
  453. .ts_low_mask = CHCR_TS_LOW_MASK,
  454. .ts_high_shift = CHCR_TS_HIGH_SHIFT,
  455. .ts_high_mask = CHCR_TS_HIGH_MASK,
  456. .ts_shift = ts_shift,
  457. .ts_shift_num = ARRAY_SIZE(ts_shift),
  458. .dmaor_init = DMAOR_INIT,
  459. };
  460. /* Resource order important! */
  461. static struct resource dmac0_resources[] = {
  462. {
  463. /* Channel registers and DMAOR */
  464. .start = 0xfe008020,
  465. .end = 0xfe00808f,
  466. .flags = IORESOURCE_MEM,
  467. }, {
  468. /* DMARSx */
  469. .start = 0xfe009000,
  470. .end = 0xfe00900b,
  471. .flags = IORESOURCE_MEM,
  472. }, {
  473. .name = "error_irq",
  474. .start = evt2irq(0x5c0),
  475. .end = evt2irq(0x5c0),
  476. .flags = IORESOURCE_IRQ,
  477. }, {
  478. /* IRQ for channels 0-5 */
  479. .start = evt2irq(0x500),
  480. .end = evt2irq(0x5a0),
  481. .flags = IORESOURCE_IRQ,
  482. },
  483. };
  484. static struct platform_device dma0_device = {
  485. .name = "sh-dma-engine",
  486. .id = 0,
  487. .resource = dmac0_resources,
  488. .num_resources = ARRAY_SIZE(dmac0_resources),
  489. .dev = {
  490. .platform_data = &dma0_platform_data,
  491. },
  492. };
  493. #define USB_EHCI_START 0xffe70000
  494. #define USB_OHCI_START 0xffe70400
  495. static struct resource usb_ehci_resources[] = {
  496. [0] = {
  497. .start = USB_EHCI_START,
  498. .end = USB_EHCI_START + 0x3ff,
  499. .flags = IORESOURCE_MEM,
  500. },
  501. [1] = {
  502. .start = evt2irq(0xba0),
  503. .end = evt2irq(0xba0),
  504. .flags = IORESOURCE_IRQ,
  505. },
  506. };
  507. static struct platform_device usb_ehci_device = {
  508. .name = "sh_ehci",
  509. .id = -1,
  510. .dev = {
  511. .dma_mask = &usb_ehci_device.dev.coherent_dma_mask,
  512. .coherent_dma_mask = DMA_BIT_MASK(32),
  513. },
  514. .num_resources = ARRAY_SIZE(usb_ehci_resources),
  515. .resource = usb_ehci_resources,
  516. };
  517. static struct resource usb_ohci_resources[] = {
  518. [0] = {
  519. .start = USB_OHCI_START,
  520. .end = USB_OHCI_START + 0x3ff,
  521. .flags = IORESOURCE_MEM,
  522. },
  523. [1] = {
  524. .start = evt2irq(0xba0),
  525. .end = evt2irq(0xba0),
  526. .flags = IORESOURCE_IRQ,
  527. },
  528. };
  529. static struct usb_ohci_pdata usb_ohci_pdata;
  530. static struct platform_device usb_ohci_device = {
  531. .name = "ohci-platform",
  532. .id = -1,
  533. .dev = {
  534. .dma_mask = &usb_ohci_device.dev.coherent_dma_mask,
  535. .coherent_dma_mask = DMA_BIT_MASK(32),
  536. .platform_data = &usb_ohci_pdata,
  537. },
  538. .num_resources = ARRAY_SIZE(usb_ohci_resources),
  539. .resource = usb_ohci_resources,
  540. };
  541. static struct platform_device *sh7786_early_devices[] __initdata = {
  542. &scif0_device,
  543. &scif1_device,
  544. &scif2_device,
  545. &scif3_device,
  546. &scif4_device,
  547. &scif5_device,
  548. &tmu0_device,
  549. &tmu1_device,
  550. &tmu2_device,
  551. &tmu3_device,
  552. &tmu4_device,
  553. &tmu5_device,
  554. &tmu6_device,
  555. &tmu7_device,
  556. &tmu8_device,
  557. &tmu9_device,
  558. &tmu10_device,
  559. &tmu11_device,
  560. };
  561. static struct platform_device *sh7786_devices[] __initdata = {
  562. &dma0_device,
  563. &usb_ehci_device,
  564. &usb_ohci_device,
  565. };
  566. /*
  567. * Please call this function if your platform board
  568. * use external clock for USB
  569. * */
  570. #define USBCTL0 0xffe70858
  571. #define CLOCK_MODE_MASK 0xffffff7f
  572. #define EXT_CLOCK_MODE 0x00000080
  573. void __init sh7786_usb_use_exclock(void)
  574. {
  575. u32 val = __raw_readl(USBCTL0) & CLOCK_MODE_MASK;
  576. __raw_writel(val | EXT_CLOCK_MODE, USBCTL0);
  577. }
  578. #define USBINITREG1 0xffe70094
  579. #define USBINITREG2 0xffe7009c
  580. #define USBINITVAL1 0x00ff0040
  581. #define USBINITVAL2 0x00000001
  582. #define USBPCTL1 0xffe70804
  583. #define USBST 0xffe70808
  584. #define PHY_ENB 0x00000001
  585. #define PLL_ENB 0x00000002
  586. #define PHY_RST 0x00000004
  587. #define ACT_PLL_STATUS 0xc0000000
  588. static void __init sh7786_usb_setup(void)
  589. {
  590. int i = 1000000;
  591. /*
  592. * USB initial settings
  593. *
  594. * The following settings are necessary
  595. * for using the USB modules.
  596. *
  597. * see "USB Initial Settings" for detail
  598. */
  599. __raw_writel(USBINITVAL1, USBINITREG1);
  600. __raw_writel(USBINITVAL2, USBINITREG2);
  601. /*
  602. * Set the PHY and PLL enable bit
  603. */
  604. __raw_writel(PHY_ENB | PLL_ENB, USBPCTL1);
  605. while (i--) {
  606. if (ACT_PLL_STATUS == (__raw_readl(USBST) & ACT_PLL_STATUS)) {
  607. /* Set the PHY RST bit */
  608. __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
  609. printk(KERN_INFO "sh7786 usb setup done\n");
  610. break;
  611. }
  612. cpu_relax();
  613. }
  614. }
  615. enum {
  616. UNUSED = 0,
  617. /* interrupt sources */
  618. IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
  619. IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
  620. IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
  621. IRL0_HHLL, IRL0_HHLH, IRL0_HHHL,
  622. IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,
  623. IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,
  624. IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,
  625. IRL4_HHLL, IRL4_HHLH, IRL4_HHHL,
  626. IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
  627. WDT,
  628. TMU0_0, TMU0_1, TMU0_2, TMU0_3,
  629. TMU1_0, TMU1_1, TMU1_2,
  630. DMAC0_0, DMAC0_1, DMAC0_2, DMAC0_3, DMAC0_4, DMAC0_5, DMAC0_6,
  631. HUDI1, HUDI0,
  632. DMAC1_0, DMAC1_1, DMAC1_2, DMAC1_3,
  633. HPB_0, HPB_1, HPB_2,
  634. SCIF0_0, SCIF0_1, SCIF0_2, SCIF0_3,
  635. SCIF1,
  636. TMU2, TMU3,
  637. SCIF2, SCIF3, SCIF4, SCIF5,
  638. Eth_0, Eth_1,
  639. PCIeC0_0, PCIeC0_1, PCIeC0_2,
  640. PCIeC1_0, PCIeC1_1, PCIeC1_2,
  641. USB,
  642. I2C0, I2C1,
  643. DU,
  644. SSI0, SSI1, SSI2, SSI3,
  645. PCIeC2_0, PCIeC2_1, PCIeC2_2,
  646. HAC0, HAC1,
  647. FLCTL,
  648. HSPI,
  649. GPIO0, GPIO1,
  650. Thermal,
  651. INTICI0, INTICI1, INTICI2, INTICI3,
  652. INTICI4, INTICI5, INTICI6, INTICI7,
  653. /* Muxed sub-events */
  654. TXI1, BRI1, RXI1, ERI1,
  655. };
  656. static struct intc_vect sh7786_vectors[] __initdata = {
  657. INTC_VECT(WDT, 0x3e0),
  658. INTC_VECT(TMU0_0, 0x400), INTC_VECT(TMU0_1, 0x420),
  659. INTC_VECT(TMU0_2, 0x440), INTC_VECT(TMU0_3, 0x460),
  660. INTC_VECT(TMU1_0, 0x480), INTC_VECT(TMU1_1, 0x4a0),
  661. INTC_VECT(TMU1_2, 0x4c0),
  662. INTC_VECT(DMAC0_0, 0x500), INTC_VECT(DMAC0_1, 0x520),
  663. INTC_VECT(DMAC0_2, 0x540), INTC_VECT(DMAC0_3, 0x560),
  664. INTC_VECT(DMAC0_4, 0x580), INTC_VECT(DMAC0_5, 0x5a0),
  665. INTC_VECT(DMAC0_6, 0x5c0),
  666. INTC_VECT(HUDI1, 0x5e0), INTC_VECT(HUDI0, 0x600),
  667. INTC_VECT(DMAC1_0, 0x620), INTC_VECT(DMAC1_1, 0x640),
  668. INTC_VECT(DMAC1_2, 0x660), INTC_VECT(DMAC1_3, 0x680),
  669. INTC_VECT(HPB_0, 0x6a0), INTC_VECT(HPB_1, 0x6c0),
  670. INTC_VECT(HPB_2, 0x6e0),
  671. INTC_VECT(SCIF0_0, 0x700), INTC_VECT(SCIF0_1, 0x720),
  672. INTC_VECT(SCIF0_2, 0x740), INTC_VECT(SCIF0_3, 0x760),
  673. INTC_VECT(SCIF1, 0x780),
  674. INTC_VECT(TMU2, 0x7a0), INTC_VECT(TMU3, 0x7c0),
  675. INTC_VECT(SCIF2, 0x840), INTC_VECT(SCIF3, 0x860),
  676. INTC_VECT(SCIF4, 0x880), INTC_VECT(SCIF5, 0x8a0),
  677. INTC_VECT(Eth_0, 0x8c0), INTC_VECT(Eth_1, 0x8e0),
  678. INTC_VECT(PCIeC0_0, 0xae0), INTC_VECT(PCIeC0_1, 0xb00),
  679. INTC_VECT(PCIeC0_2, 0xb20),
  680. INTC_VECT(PCIeC1_0, 0xb40), INTC_VECT(PCIeC1_1, 0xb60),
  681. INTC_VECT(PCIeC1_2, 0xb80),
  682. INTC_VECT(USB, 0xba0),
  683. INTC_VECT(I2C0, 0xcc0), INTC_VECT(I2C1, 0xce0),
  684. INTC_VECT(DU, 0xd00),
  685. INTC_VECT(SSI0, 0xd20), INTC_VECT(SSI1, 0xd40),
  686. INTC_VECT(SSI2, 0xd60), INTC_VECT(SSI3, 0xd80),
  687. INTC_VECT(PCIeC2_0, 0xda0), INTC_VECT(PCIeC2_1, 0xdc0),
  688. INTC_VECT(PCIeC2_2, 0xde0),
  689. INTC_VECT(HAC0, 0xe00), INTC_VECT(HAC1, 0xe20),
  690. INTC_VECT(FLCTL, 0xe40),
  691. INTC_VECT(HSPI, 0xe80),
  692. INTC_VECT(GPIO0, 0xea0), INTC_VECT(GPIO1, 0xec0),
  693. INTC_VECT(Thermal, 0xee0),
  694. INTC_VECT(INTICI0, 0xf00), INTC_VECT(INTICI1, 0xf20),
  695. INTC_VECT(INTICI2, 0xf40), INTC_VECT(INTICI3, 0xf60),
  696. INTC_VECT(INTICI4, 0xf80), INTC_VECT(INTICI5, 0xfa0),
  697. INTC_VECT(INTICI6, 0xfc0), INTC_VECT(INTICI7, 0xfe0),
  698. };
  699. #define CnINTMSK0 0xfe410030
  700. #define CnINTMSK1 0xfe410040
  701. #define CnINTMSKCLR0 0xfe410050
  702. #define CnINTMSKCLR1 0xfe410060
  703. #define CnINT2MSKR0 0xfe410a20
  704. #define CnINT2MSKR1 0xfe410a24
  705. #define CnINT2MSKR2 0xfe410a28
  706. #define CnINT2MSKR3 0xfe410a2c
  707. #define CnINT2MSKCR0 0xfe410a30
  708. #define CnINT2MSKCR1 0xfe410a34
  709. #define CnINT2MSKCR2 0xfe410a38
  710. #define CnINT2MSKCR3 0xfe410a3c
  711. #define INTMSK2 0xfe410068
  712. #define INTMSKCLR2 0xfe41006c
  713. #define INTDISTCR0 0xfe4100b0
  714. #define INTDISTCR1 0xfe4100b4
  715. #define INT2DISTCR0 0xfe410900
  716. #define INT2DISTCR1 0xfe410904
  717. #define INT2DISTCR2 0xfe410908
  718. #define INT2DISTCR3 0xfe41090c
  719. static struct intc_mask_reg sh7786_mask_registers[] __initdata = {
  720. { CnINTMSK0, CnINTMSKCLR0, 32,
  721. { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 },
  722. INTC_SMP_BALANCING(INTDISTCR0) },
  723. { INTMSK2, INTMSKCLR2, 32,
  724. { IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
  725. IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
  726. IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
  727. IRL0_HHLL, IRL0_HHLH, IRL0_HHHL, 0,
  728. IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,
  729. IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,
  730. IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,
  731. IRL4_HHLL, IRL4_HHLH, IRL4_HHHL, 0, } },
  732. { CnINT2MSKR0, CnINT2MSKCR0 , 32,
  733. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  734. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, WDT },
  735. INTC_SMP_BALANCING(INT2DISTCR0) },
  736. { CnINT2MSKR1, CnINT2MSKCR1, 32,
  737. { TMU0_0, TMU0_1, TMU0_2, TMU0_3, TMU1_0, TMU1_1, TMU1_2, 0,
  738. DMAC0_0, DMAC0_1, DMAC0_2, DMAC0_3, DMAC0_4, DMAC0_5, DMAC0_6,
  739. HUDI1, HUDI0,
  740. DMAC1_0, DMAC1_1, DMAC1_2, DMAC1_3,
  741. HPB_0, HPB_1, HPB_2,
  742. SCIF0_0, SCIF0_1, SCIF0_2, SCIF0_3,
  743. SCIF1,
  744. TMU2, TMU3, 0, }, INTC_SMP_BALANCING(INT2DISTCR1) },
  745. { CnINT2MSKR2, CnINT2MSKCR2, 32,
  746. { 0, 0, SCIF2, SCIF3, SCIF4, SCIF5,
  747. Eth_0, Eth_1,
  748. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  749. PCIeC0_0, PCIeC0_1, PCIeC0_2,
  750. PCIeC1_0, PCIeC1_1, PCIeC1_2,
  751. USB, 0, 0 }, INTC_SMP_BALANCING(INT2DISTCR2) },
  752. { CnINT2MSKR3, CnINT2MSKCR3, 32,
  753. { 0, 0, 0, 0, 0, 0,
  754. I2C0, I2C1,
  755. DU, SSI0, SSI1, SSI2, SSI3,
  756. PCIeC2_0, PCIeC2_1, PCIeC2_2,
  757. HAC0, HAC1,
  758. FLCTL, 0,
  759. HSPI, GPIO0, GPIO1, Thermal,
  760. 0, 0, 0, 0, 0, 0, 0, 0 }, INTC_SMP_BALANCING(INT2DISTCR3) },
  761. };
  762. static struct intc_prio_reg sh7786_prio_registers[] __initdata = {
  763. { 0xfe410010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3,
  764. IRQ4, IRQ5, IRQ6, IRQ7 } },
  765. { 0xfe410800, 0, 32, 8, /* INT2PRI0 */ { 0, 0, 0, WDT } },
  766. { 0xfe410804, 0, 32, 8, /* INT2PRI1 */ { TMU0_0, TMU0_1,
  767. TMU0_2, TMU0_3 } },
  768. { 0xfe410808, 0, 32, 8, /* INT2PRI2 */ { TMU1_0, TMU1_1,
  769. TMU1_2, 0 } },
  770. { 0xfe41080c, 0, 32, 8, /* INT2PRI3 */ { DMAC0_0, DMAC0_1,
  771. DMAC0_2, DMAC0_3 } },
  772. { 0xfe410810, 0, 32, 8, /* INT2PRI4 */ { DMAC0_4, DMAC0_5,
  773. DMAC0_6, HUDI1 } },
  774. { 0xfe410814, 0, 32, 8, /* INT2PRI5 */ { HUDI0, DMAC1_0,
  775. DMAC1_1, DMAC1_2 } },
  776. { 0xfe410818, 0, 32, 8, /* INT2PRI6 */ { DMAC1_3, HPB_0,
  777. HPB_1, HPB_2 } },
  778. { 0xfe41081c, 0, 32, 8, /* INT2PRI7 */ { SCIF0_0, SCIF0_1,
  779. SCIF0_2, SCIF0_3 } },
  780. { 0xfe410820, 0, 32, 8, /* INT2PRI8 */ { SCIF1, TMU2, TMU3, 0 } },
  781. { 0xfe410824, 0, 32, 8, /* INT2PRI9 */ { 0, 0, SCIF2, SCIF3 } },
  782. { 0xfe410828, 0, 32, 8, /* INT2PRI10 */ { SCIF4, SCIF5,
  783. Eth_0, Eth_1 } },
  784. { 0xfe41082c, 0, 32, 8, /* INT2PRI11 */ { 0, 0, 0, 0 } },
  785. { 0xfe410830, 0, 32, 8, /* INT2PRI12 */ { 0, 0, 0, 0 } },
  786. { 0xfe410834, 0, 32, 8, /* INT2PRI13 */ { 0, 0, 0, 0 } },
  787. { 0xfe410838, 0, 32, 8, /* INT2PRI14 */ { 0, 0, 0, PCIeC0_0 } },
  788. { 0xfe41083c, 0, 32, 8, /* INT2PRI15 */ { PCIeC0_1, PCIeC0_2,
  789. PCIeC1_0, PCIeC1_1 } },
  790. { 0xfe410840, 0, 32, 8, /* INT2PRI16 */ { PCIeC1_2, USB, 0, 0 } },
  791. { 0xfe410844, 0, 32, 8, /* INT2PRI17 */ { 0, 0, 0, 0 } },
  792. { 0xfe410848, 0, 32, 8, /* INT2PRI18 */ { 0, 0, I2C0, I2C1 } },
  793. { 0xfe41084c, 0, 32, 8, /* INT2PRI19 */ { DU, SSI0, SSI1, SSI2 } },
  794. { 0xfe410850, 0, 32, 8, /* INT2PRI20 */ { SSI3, PCIeC2_0,
  795. PCIeC2_1, PCIeC2_2 } },
  796. { 0xfe410854, 0, 32, 8, /* INT2PRI21 */ { HAC0, HAC1, FLCTL, 0 } },
  797. { 0xfe410858, 0, 32, 8, /* INT2PRI22 */ { HSPI, GPIO0,
  798. GPIO1, Thermal } },
  799. { 0xfe41085c, 0, 32, 8, /* INT2PRI23 */ { 0, 0, 0, 0 } },
  800. { 0xfe410860, 0, 32, 8, /* INT2PRI24 */ { 0, 0, 0, 0 } },
  801. { 0xfe410090, 0xfe4100a0, 32, 4, /* CnICIPRI / CnICIPRICLR */
  802. { INTICI7, INTICI6, INTICI5, INTICI4,
  803. INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 2) },
  804. };
  805. static struct intc_subgroup sh7786_subgroups[] __initdata = {
  806. { 0xfe410c20, 32, SCIF1,
  807. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  808. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TXI1, BRI1, RXI1, ERI1 } },
  809. };
  810. static struct intc_desc sh7786_intc_desc __initdata = {
  811. .name = "sh7786",
  812. .hw = {
  813. .vectors = sh7786_vectors,
  814. .nr_vectors = ARRAY_SIZE(sh7786_vectors),
  815. .mask_regs = sh7786_mask_registers,
  816. .nr_mask_regs = ARRAY_SIZE(sh7786_mask_registers),
  817. .subgroups = sh7786_subgroups,
  818. .nr_subgroups = ARRAY_SIZE(sh7786_subgroups),
  819. .prio_regs = sh7786_prio_registers,
  820. .nr_prio_regs = ARRAY_SIZE(sh7786_prio_registers),
  821. },
  822. };
  823. /* Support for external interrupt pins in IRQ mode */
  824. static struct intc_vect vectors_irq0123[] __initdata = {
  825. INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240),
  826. INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0),
  827. };
  828. static struct intc_vect vectors_irq4567[] __initdata = {
  829. INTC_VECT(IRQ4, 0x300), INTC_VECT(IRQ5, 0x340),
  830. INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0),
  831. };
  832. static struct intc_sense_reg sh7786_sense_registers[] __initdata = {
  833. { 0xfe41001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3,
  834. IRQ4, IRQ5, IRQ6, IRQ7 } },
  835. };
  836. static struct intc_mask_reg sh7786_ack_registers[] __initdata = {
  837. { 0xfe410024, 0, 32, /* INTREQ */
  838. { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
  839. };
  840. static DECLARE_INTC_DESC_ACK(intc_desc_irq0123, "sh7786-irq0123",
  841. vectors_irq0123, NULL, sh7786_mask_registers,
  842. sh7786_prio_registers, sh7786_sense_registers,
  843. sh7786_ack_registers);
  844. static DECLARE_INTC_DESC_ACK(intc_desc_irq4567, "sh7786-irq4567",
  845. vectors_irq4567, NULL, sh7786_mask_registers,
  846. sh7786_prio_registers, sh7786_sense_registers,
  847. sh7786_ack_registers);
  848. /* External interrupt pins in IRL mode */
  849. static struct intc_vect vectors_irl0123[] __initdata = {
  850. INTC_VECT(IRL0_LLLL, 0x200), INTC_VECT(IRL0_LLLH, 0x220),
  851. INTC_VECT(IRL0_LLHL, 0x240), INTC_VECT(IRL0_LLHH, 0x260),
  852. INTC_VECT(IRL0_LHLL, 0x280), INTC_VECT(IRL0_LHLH, 0x2a0),
  853. INTC_VECT(IRL0_LHHL, 0x2c0), INTC_VECT(IRL0_LHHH, 0x2e0),
  854. INTC_VECT(IRL0_HLLL, 0x300), INTC_VECT(IRL0_HLLH, 0x320),
  855. INTC_VECT(IRL0_HLHL, 0x340), INTC_VECT(IRL0_HLHH, 0x360),
  856. INTC_VECT(IRL0_HHLL, 0x380), INTC_VECT(IRL0_HHLH, 0x3a0),
  857. INTC_VECT(IRL0_HHHL, 0x3c0),
  858. };
  859. static struct intc_vect vectors_irl4567[] __initdata = {
  860. INTC_VECT(IRL4_LLLL, 0x900), INTC_VECT(IRL4_LLLH, 0x920),
  861. INTC_VECT(IRL4_LLHL, 0x940), INTC_VECT(IRL4_LLHH, 0x960),
  862. INTC_VECT(IRL4_LHLL, 0x980), INTC_VECT(IRL4_LHLH, 0x9a0),
  863. INTC_VECT(IRL4_LHHL, 0x9c0), INTC_VECT(IRL4_LHHH, 0x9e0),
  864. INTC_VECT(IRL4_HLLL, 0xa00), INTC_VECT(IRL4_HLLH, 0xa20),
  865. INTC_VECT(IRL4_HLHL, 0xa40), INTC_VECT(IRL4_HLHH, 0xa60),
  866. INTC_VECT(IRL4_HHLL, 0xa80), INTC_VECT(IRL4_HHLH, 0xaa0),
  867. INTC_VECT(IRL4_HHHL, 0xac0),
  868. };
  869. static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7786-irl0123", vectors_irl0123,
  870. NULL, sh7786_mask_registers, NULL, NULL);
  871. static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7786-irl4567", vectors_irl4567,
  872. NULL, sh7786_mask_registers, NULL, NULL);
  873. #define INTC_ICR0 0xfe410000
  874. #define INTC_INTMSK0 CnINTMSK0
  875. #define INTC_INTMSK1 CnINTMSK1
  876. #define INTC_INTMSK2 INTMSK2
  877. #define INTC_INTMSKCLR1 CnINTMSKCLR1
  878. #define INTC_INTMSKCLR2 INTMSKCLR2
  879. void __init plat_irq_setup(void)
  880. {
  881. /* disable IRQ3-0 + IRQ7-4 */
  882. __raw_writel(0xff000000, INTC_INTMSK0);
  883. /* disable IRL3-0 + IRL7-4 */
  884. __raw_writel(0xc0000000, INTC_INTMSK1);
  885. __raw_writel(0xfffefffe, INTC_INTMSK2);
  886. /* select IRL mode for IRL3-0 + IRL7-4 */
  887. __raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
  888. register_intc_controller(&sh7786_intc_desc);
  889. }
  890. void __init plat_irq_setup_pins(int mode)
  891. {
  892. switch (mode) {
  893. case IRQ_MODE_IRQ7654:
  894. /* select IRQ mode for IRL7-4 */
  895. __raw_writel(__raw_readl(INTC_ICR0) | 0x00400000, INTC_ICR0);
  896. register_intc_controller(&intc_desc_irq4567);
  897. break;
  898. case IRQ_MODE_IRQ3210:
  899. /* select IRQ mode for IRL3-0 */
  900. __raw_writel(__raw_readl(INTC_ICR0) | 0x00800000, INTC_ICR0);
  901. register_intc_controller(&intc_desc_irq0123);
  902. break;
  903. case IRQ_MODE_IRL7654:
  904. /* enable IRL7-4 but don't provide any masking */
  905. __raw_writel(0x40000000, INTC_INTMSKCLR1);
  906. __raw_writel(0x0000fffe, INTC_INTMSKCLR2);
  907. break;
  908. case IRQ_MODE_IRL3210:
  909. /* enable IRL0-3 but don't provide any masking */
  910. __raw_writel(0x80000000, INTC_INTMSKCLR1);
  911. __raw_writel(0xfffe0000, INTC_INTMSKCLR2);
  912. break;
  913. case IRQ_MODE_IRL7654_MASK:
  914. /* enable IRL7-4 and mask using cpu intc controller */
  915. __raw_writel(0x40000000, INTC_INTMSKCLR1);
  916. register_intc_controller(&intc_desc_irl4567);
  917. break;
  918. case IRQ_MODE_IRL3210_MASK:
  919. /* enable IRL0-3 and mask using cpu intc controller */
  920. __raw_writel(0x80000000, INTC_INTMSKCLR1);
  921. register_intc_controller(&intc_desc_irl0123);
  922. break;
  923. default:
  924. BUG();
  925. }
  926. }
  927. void __init plat_mem_setup(void)
  928. {
  929. }
  930. static int __init sh7786_devices_setup(void)
  931. {
  932. int ret, irq;
  933. sh7786_usb_setup();
  934. /*
  935. * De-mux SCIF1 IRQs if possible
  936. */
  937. irq = intc_irq_lookup(sh7786_intc_desc.name, TXI1);
  938. if (irq > 0) {
  939. scif1_platform_data.irqs[SCIx_TXI_IRQ] = irq;
  940. scif1_platform_data.irqs[SCIx_ERI_IRQ] =
  941. intc_irq_lookup(sh7786_intc_desc.name, ERI1);
  942. scif1_platform_data.irqs[SCIx_BRI_IRQ] =
  943. intc_irq_lookup(sh7786_intc_desc.name, BRI1);
  944. scif1_platform_data.irqs[SCIx_RXI_IRQ] =
  945. intc_irq_lookup(sh7786_intc_desc.name, RXI1);
  946. }
  947. ret = platform_add_devices(sh7786_early_devices,
  948. ARRAY_SIZE(sh7786_early_devices));
  949. if (unlikely(ret != 0))
  950. return ret;
  951. return platform_add_devices(sh7786_devices,
  952. ARRAY_SIZE(sh7786_devices));
  953. }
  954. arch_initcall(sh7786_devices_setup);
  955. void __init plat_early_device_setup(void)
  956. {
  957. early_platform_add_devices(sh7786_early_devices,
  958. ARRAY_SIZE(sh7786_early_devices));
  959. }