setup-sh7786.c 26 KB

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