setup-shx3.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. /*
  2. * SH-X3 Prototype Setup
  3. *
  4. * Copyright (C) 2007 - 2010 Paul Mundt
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/platform_device.h>
  11. #include <linux/init.h>
  12. #include <linux/serial.h>
  13. #include <linux/serial_sci.h>
  14. #include <linux/io.h>
  15. #include <linux/gpio.h>
  16. #include <linux/sh_timer.h>
  17. #include <cpu/shx3.h>
  18. #include <asm/mmzone.h>
  19. /*
  20. * This intentionally only registers SCIF ports 0, 1, and 3. SCIF 2
  21. * INTEVT values overlap with the FPU EXPEVT ones, requiring special
  22. * demuxing in the exception dispatch path.
  23. *
  24. * As this overlap is something that never should have made it in to
  25. * silicon in the first place, we just refuse to deal with the port at
  26. * all rather than adding infrastructure to hack around it.
  27. */
  28. static struct plat_sci_port scif0_platform_data = {
  29. .mapbase = 0xffc30000,
  30. .flags = UPF_BOOT_AUTOCONF,
  31. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
  32. .scbrr_algo_id = SCBRR_ALGO_2,
  33. .type = PORT_SCIF,
  34. .irqs = { 40, 41, 43, 42 },
  35. };
  36. static struct platform_device scif0_device = {
  37. .name = "sh-sci",
  38. .id = 0,
  39. .dev = {
  40. .platform_data = &scif0_platform_data,
  41. },
  42. };
  43. static struct plat_sci_port scif1_platform_data = {
  44. .mapbase = 0xffc40000,
  45. .flags = UPF_BOOT_AUTOCONF,
  46. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
  47. .scbrr_algo_id = SCBRR_ALGO_2,
  48. .type = PORT_SCIF,
  49. .irqs = { 44, 45, 47, 46 },
  50. };
  51. static struct platform_device scif1_device = {
  52. .name = "sh-sci",
  53. .id = 1,
  54. .dev = {
  55. .platform_data = &scif1_platform_data,
  56. },
  57. };
  58. static struct plat_sci_port scif2_platform_data = {
  59. .mapbase = 0xffc60000,
  60. .flags = UPF_BOOT_AUTOCONF,
  61. .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
  62. .scbrr_algo_id = SCBRR_ALGO_2,
  63. .type = PORT_SCIF,
  64. .irqs = { 52, 53, 55, 54 },
  65. };
  66. static struct platform_device scif2_device = {
  67. .name = "sh-sci",
  68. .id = 2,
  69. .dev = {
  70. .platform_data = &scif2_platform_data,
  71. },
  72. };
  73. static struct sh_timer_config tmu0_platform_data = {
  74. .channel_offset = 0x04,
  75. .timer_bit = 0,
  76. .clockevent_rating = 200,
  77. };
  78. static struct resource tmu0_resources[] = {
  79. [0] = {
  80. .start = 0xffc10008,
  81. .end = 0xffc10013,
  82. .flags = IORESOURCE_MEM,
  83. },
  84. [1] = {
  85. .start = 16,
  86. .flags = IORESOURCE_IRQ,
  87. },
  88. };
  89. static struct platform_device tmu0_device = {
  90. .name = "sh_tmu",
  91. .id = 0,
  92. .dev = {
  93. .platform_data = &tmu0_platform_data,
  94. },
  95. .resource = tmu0_resources,
  96. .num_resources = ARRAY_SIZE(tmu0_resources),
  97. };
  98. static struct sh_timer_config tmu1_platform_data = {
  99. .channel_offset = 0x10,
  100. .timer_bit = 1,
  101. .clocksource_rating = 200,
  102. };
  103. static struct resource tmu1_resources[] = {
  104. [0] = {
  105. .start = 0xffc10014,
  106. .end = 0xffc1001f,
  107. .flags = IORESOURCE_MEM,
  108. },
  109. [1] = {
  110. .start = 17,
  111. .flags = IORESOURCE_IRQ,
  112. },
  113. };
  114. static struct platform_device tmu1_device = {
  115. .name = "sh_tmu",
  116. .id = 1,
  117. .dev = {
  118. .platform_data = &tmu1_platform_data,
  119. },
  120. .resource = tmu1_resources,
  121. .num_resources = ARRAY_SIZE(tmu1_resources),
  122. };
  123. static struct sh_timer_config tmu2_platform_data = {
  124. .channel_offset = 0x1c,
  125. .timer_bit = 2,
  126. };
  127. static struct resource tmu2_resources[] = {
  128. [0] = {
  129. .start = 0xffc10020,
  130. .end = 0xffc1002f,
  131. .flags = IORESOURCE_MEM,
  132. },
  133. [1] = {
  134. .start = 18,
  135. .flags = IORESOURCE_IRQ,
  136. },
  137. };
  138. static struct platform_device tmu2_device = {
  139. .name = "sh_tmu",
  140. .id = 2,
  141. .dev = {
  142. .platform_data = &tmu2_platform_data,
  143. },
  144. .resource = tmu2_resources,
  145. .num_resources = ARRAY_SIZE(tmu2_resources),
  146. };
  147. static struct sh_timer_config tmu3_platform_data = {
  148. .channel_offset = 0x04,
  149. .timer_bit = 0,
  150. };
  151. static struct resource tmu3_resources[] = {
  152. [0] = {
  153. .start = 0xffc20008,
  154. .end = 0xffc20013,
  155. .flags = IORESOURCE_MEM,
  156. },
  157. [1] = {
  158. .start = 19,
  159. .flags = IORESOURCE_IRQ,
  160. },
  161. };
  162. static struct platform_device tmu3_device = {
  163. .name = "sh_tmu",
  164. .id = 3,
  165. .dev = {
  166. .platform_data = &tmu3_platform_data,
  167. },
  168. .resource = tmu3_resources,
  169. .num_resources = ARRAY_SIZE(tmu3_resources),
  170. };
  171. static struct sh_timer_config tmu4_platform_data = {
  172. .channel_offset = 0x10,
  173. .timer_bit = 1,
  174. };
  175. static struct resource tmu4_resources[] = {
  176. [0] = {
  177. .start = 0xffc20014,
  178. .end = 0xffc2001f,
  179. .flags = IORESOURCE_MEM,
  180. },
  181. [1] = {
  182. .start = 20,
  183. .flags = IORESOURCE_IRQ,
  184. },
  185. };
  186. static struct platform_device tmu4_device = {
  187. .name = "sh_tmu",
  188. .id = 4,
  189. .dev = {
  190. .platform_data = &tmu4_platform_data,
  191. },
  192. .resource = tmu4_resources,
  193. .num_resources = ARRAY_SIZE(tmu4_resources),
  194. };
  195. static struct sh_timer_config tmu5_platform_data = {
  196. .channel_offset = 0x1c,
  197. .timer_bit = 2,
  198. };
  199. static struct resource tmu5_resources[] = {
  200. [0] = {
  201. .start = 0xffc20020,
  202. .end = 0xffc2002b,
  203. .flags = IORESOURCE_MEM,
  204. },
  205. [1] = {
  206. .start = 21,
  207. .flags = IORESOURCE_IRQ,
  208. },
  209. };
  210. static struct platform_device tmu5_device = {
  211. .name = "sh_tmu",
  212. .id = 5,
  213. .dev = {
  214. .platform_data = &tmu5_platform_data,
  215. },
  216. .resource = tmu5_resources,
  217. .num_resources = ARRAY_SIZE(tmu5_resources),
  218. };
  219. static struct platform_device *shx3_early_devices[] __initdata = {
  220. &scif0_device,
  221. &scif1_device,
  222. &scif2_device,
  223. &tmu0_device,
  224. &tmu1_device,
  225. &tmu2_device,
  226. &tmu3_device,
  227. &tmu4_device,
  228. &tmu5_device,
  229. };
  230. static int __init shx3_devices_setup(void)
  231. {
  232. return platform_add_devices(shx3_early_devices,
  233. ARRAY_SIZE(shx3_early_devices));
  234. }
  235. arch_initcall(shx3_devices_setup);
  236. void __init plat_early_device_setup(void)
  237. {
  238. early_platform_add_devices(shx3_early_devices,
  239. ARRAY_SIZE(shx3_early_devices));
  240. }
  241. enum {
  242. UNUSED = 0,
  243. /* interrupt sources */
  244. IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH,
  245. IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH,
  246. IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH,
  247. IRL_HHLL, IRL_HHLH, IRL_HHHL,
  248. IRQ0, IRQ1, IRQ2, IRQ3,
  249. HUDII,
  250. TMU0, TMU1, TMU2, TMU3, TMU4, TMU5,
  251. PCII0, PCII1, PCII2, PCII3, PCII4,
  252. PCII5, PCII6, PCII7, PCII8, PCII9,
  253. SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI,
  254. SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI,
  255. SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI,
  256. SCIF3_ERI, SCIF3_RXI, SCIF3_BRI, SCIF3_TXI,
  257. DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, DMAC0_DMINT3,
  258. DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE,
  259. DU,
  260. DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, DMAC1_DMINT9,
  261. DMAC1_DMINT10, DMAC1_DMINT11, DMAC1_DMAE,
  262. IIC, VIN0, VIN1, VCORE0, ATAPI,
  263. DTU0, DTU1, DTU2, DTU3,
  264. FE0, FE1,
  265. GPIO0, GPIO1, GPIO2, GPIO3,
  266. PAM, IRM,
  267. INTICI0, INTICI1, INTICI2, INTICI3,
  268. INTICI4, INTICI5, INTICI6, INTICI7,
  269. /* interrupt groups */
  270. IRL, PCII56789, SCIF0, SCIF1, SCIF2, SCIF3,
  271. DMAC0, DMAC1,
  272. };
  273. static struct intc_vect vectors[] __initdata = {
  274. INTC_VECT(HUDII, 0x3e0),
  275. INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
  276. INTC_VECT(TMU2, 0x440), INTC_VECT(TMU3, 0x460),
  277. INTC_VECT(TMU4, 0x480), INTC_VECT(TMU5, 0x4a0),
  278. INTC_VECT(PCII0, 0x500), INTC_VECT(PCII1, 0x520),
  279. INTC_VECT(PCII2, 0x540), INTC_VECT(PCII3, 0x560),
  280. INTC_VECT(PCII4, 0x580), INTC_VECT(PCII5, 0x5a0),
  281. INTC_VECT(PCII6, 0x5c0), INTC_VECT(PCII7, 0x5e0),
  282. INTC_VECT(PCII8, 0x600), INTC_VECT(PCII9, 0x620),
  283. INTC_VECT(SCIF0_ERI, 0x700), INTC_VECT(SCIF0_RXI, 0x720),
  284. INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760),
  285. INTC_VECT(SCIF1_ERI, 0x780), INTC_VECT(SCIF1_RXI, 0x7a0),
  286. INTC_VECT(SCIF1_BRI, 0x7c0), INTC_VECT(SCIF1_TXI, 0x7e0),
  287. INTC_VECT(SCIF3_ERI, 0x880), INTC_VECT(SCIF3_RXI, 0x8a0),
  288. INTC_VECT(SCIF3_BRI, 0x8c0), INTC_VECT(SCIF3_TXI, 0x8e0),
  289. INTC_VECT(DMAC0_DMINT0, 0x900), INTC_VECT(DMAC0_DMINT1, 0x920),
  290. INTC_VECT(DMAC0_DMINT2, 0x940), INTC_VECT(DMAC0_DMINT3, 0x960),
  291. INTC_VECT(DMAC0_DMINT4, 0x980), INTC_VECT(DMAC0_DMINT5, 0x9a0),
  292. INTC_VECT(DMAC0_DMAE, 0x9c0),
  293. INTC_VECT(DU, 0x9e0),
  294. INTC_VECT(DMAC1_DMINT6, 0xa00), INTC_VECT(DMAC1_DMINT7, 0xa20),
  295. INTC_VECT(DMAC1_DMINT8, 0xa40), INTC_VECT(DMAC1_DMINT9, 0xa60),
  296. INTC_VECT(DMAC1_DMINT10, 0xa80), INTC_VECT(DMAC1_DMINT11, 0xaa0),
  297. INTC_VECT(DMAC1_DMAE, 0xac0),
  298. INTC_VECT(IIC, 0xae0),
  299. INTC_VECT(VIN0, 0xb00), INTC_VECT(VIN1, 0xb20),
  300. INTC_VECT(VCORE0, 0xb00), INTC_VECT(ATAPI, 0xb60),
  301. INTC_VECT(DTU0, 0xc00), INTC_VECT(DTU0, 0xc20),
  302. INTC_VECT(DTU0, 0xc40),
  303. INTC_VECT(DTU1, 0xc60), INTC_VECT(DTU1, 0xc80),
  304. INTC_VECT(DTU1, 0xca0),
  305. INTC_VECT(DTU2, 0xcc0), INTC_VECT(DTU2, 0xce0),
  306. INTC_VECT(DTU2, 0xd00),
  307. INTC_VECT(DTU3, 0xd20), INTC_VECT(DTU3, 0xd40),
  308. INTC_VECT(DTU3, 0xd60),
  309. INTC_VECT(FE0, 0xe00), INTC_VECT(FE1, 0xe20),
  310. INTC_VECT(GPIO0, 0xe40), INTC_VECT(GPIO1, 0xe60),
  311. INTC_VECT(GPIO2, 0xe80), INTC_VECT(GPIO3, 0xea0),
  312. INTC_VECT(PAM, 0xec0), INTC_VECT(IRM, 0xee0),
  313. INTC_VECT(INTICI0, 0xf00), INTC_VECT(INTICI1, 0xf20),
  314. INTC_VECT(INTICI2, 0xf40), INTC_VECT(INTICI3, 0xf60),
  315. INTC_VECT(INTICI4, 0xf80), INTC_VECT(INTICI5, 0xfa0),
  316. INTC_VECT(INTICI6, 0xfc0), INTC_VECT(INTICI7, 0xfe0),
  317. };
  318. static struct intc_group groups[] __initdata = {
  319. INTC_GROUP(IRL, IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH,
  320. IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH,
  321. IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH,
  322. IRL_HHLL, IRL_HHLH, IRL_HHHL),
  323. INTC_GROUP(PCII56789, PCII5, PCII6, PCII7, PCII8, PCII9),
  324. INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
  325. INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
  326. INTC_GROUP(SCIF3, SCIF3_ERI, SCIF3_RXI, SCIF3_BRI, SCIF3_TXI),
  327. INTC_GROUP(DMAC0, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2,
  328. DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE),
  329. INTC_GROUP(DMAC1, DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8,
  330. DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11),
  331. };
  332. #define INT2DISTCR0 0xfe4108a0
  333. #define INT2DISTCR1 0xfe4108a4
  334. #define INT2DISTCR2 0xfe4108a8
  335. static struct intc_mask_reg mask_registers[] __initdata = {
  336. { 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */
  337. { IRQ0, IRQ1, IRQ2, IRQ3 } },
  338. { 0xfe410040, 0xfe410060, 32, /* CnINTMSK1 / CnINTMSKCLR1 */
  339. { IRL } },
  340. { 0xfe410820, 0xfe410850, 32, /* CnINT2MSK0 / CnINT2MSKCLR0 */
  341. { FE1, FE0, 0, ATAPI, VCORE0, VIN1, VIN0, IIC,
  342. DU, GPIO3, GPIO2, GPIO1, GPIO0, PAM, 0, 0,
  343. 0, 0, 0, 0, 0, 0, 0, 0, /* HUDI bits ignored */
  344. 0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, },
  345. INTC_SMP_BALANCING(INT2DISTCR0) },
  346. { 0xfe410830, 0xfe410860, 32, /* CnINT2MSK1 / CnINT2MSKCLR1 */
  347. { 0, 0, 0, 0, DTU3, DTU2, DTU1, DTU0, /* IRM bits ignored */
  348. PCII9, PCII8, PCII7, PCII6, PCII5, PCII4, PCII3, PCII2,
  349. PCII1, PCII0, DMAC1_DMAE, DMAC1_DMINT11,
  350. DMAC1_DMINT10, DMAC1_DMINT9, DMAC1_DMINT8, DMAC1_DMINT7,
  351. DMAC1_DMINT6, DMAC0_DMAE, DMAC0_DMINT5, DMAC0_DMINT4,
  352. DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 },
  353. INTC_SMP_BALANCING(INT2DISTCR1) },
  354. { 0xfe410840, 0xfe410870, 32, /* CnINT2MSK2 / CnINT2MSKCLR2 */
  355. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  356. SCIF3_TXI, SCIF3_BRI, SCIF3_RXI, SCIF3_ERI,
  357. SCIF2_TXI, SCIF2_BRI, SCIF2_RXI, SCIF2_ERI,
  358. SCIF1_TXI, SCIF1_BRI, SCIF1_RXI, SCIF1_ERI,
  359. SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI },
  360. INTC_SMP_BALANCING(INT2DISTCR2) },
  361. };
  362. static struct intc_prio_reg prio_registers[] __initdata = {
  363. { 0xfe410010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
  364. { 0xfe410800, 0, 32, 4, /* INT2PRI0 */ { 0, HUDII, TMU5, TMU4,
  365. TMU3, TMU2, TMU1, TMU0 } },
  366. { 0xfe410804, 0, 32, 4, /* INT2PRI1 */ { DTU3, DTU2, DTU1, DTU0,
  367. SCIF3, SCIF2,
  368. SCIF1, SCIF0 } },
  369. { 0xfe410808, 0, 32, 4, /* INT2PRI2 */ { DMAC1, DMAC0,
  370. PCII56789, PCII4,
  371. PCII3, PCII2,
  372. PCII1, PCII0 } },
  373. { 0xfe41080c, 0, 32, 4, /* INT2PRI3 */ { FE1, FE0, ATAPI, VCORE0,
  374. VIN1, VIN0, IIC, DU} },
  375. { 0xfe410810, 0, 32, 4, /* INT2PRI4 */ { 0, 0, PAM, GPIO3,
  376. GPIO2, GPIO1, GPIO0, IRM } },
  377. { 0xfe410090, 0xfe4100a0, 32, 4, /* CnICIPRI / CnICIPRICLR */
  378. { INTICI7, INTICI6, INTICI5, INTICI4,
  379. INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 4) },
  380. };
  381. static DECLARE_INTC_DESC(intc_desc, "shx3", vectors, groups,
  382. mask_registers, prio_registers, NULL);
  383. /* Support for external interrupt pins in IRQ mode */
  384. static struct intc_vect vectors_irq[] __initdata = {
  385. INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
  386. INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),
  387. };
  388. static struct intc_sense_reg sense_registers[] __initdata = {
  389. { 0xfe41001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
  390. };
  391. static DECLARE_INTC_DESC(intc_desc_irq, "shx3-irq", vectors_irq, groups,
  392. mask_registers, prio_registers, sense_registers);
  393. /* External interrupt pins in IRL mode */
  394. static struct intc_vect vectors_irl[] __initdata = {
  395. INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220),
  396. INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260),
  397. INTC_VECT(IRL_LHLL, 0x280), INTC_VECT(IRL_LHLH, 0x2a0),
  398. INTC_VECT(IRL_LHHL, 0x2c0), INTC_VECT(IRL_LHHH, 0x2e0),
  399. INTC_VECT(IRL_HLLL, 0x300), INTC_VECT(IRL_HLLH, 0x320),
  400. INTC_VECT(IRL_HLHL, 0x340), INTC_VECT(IRL_HLHH, 0x360),
  401. INTC_VECT(IRL_HHLL, 0x380), INTC_VECT(IRL_HHLH, 0x3a0),
  402. INTC_VECT(IRL_HHHL, 0x3c0),
  403. };
  404. static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups,
  405. mask_registers, prio_registers, NULL);
  406. void __init plat_irq_setup_pins(int mode)
  407. {
  408. int ret = 0;
  409. switch (mode) {
  410. case IRQ_MODE_IRQ:
  411. ret |= gpio_request(GPIO_FN_IRQ3, intc_desc_irq.name);
  412. ret |= gpio_request(GPIO_FN_IRQ2, intc_desc_irq.name);
  413. ret |= gpio_request(GPIO_FN_IRQ1, intc_desc_irq.name);
  414. ret |= gpio_request(GPIO_FN_IRQ0, intc_desc_irq.name);
  415. if (unlikely(ret)) {
  416. pr_err("Failed to set IRQ mode\n");
  417. return;
  418. }
  419. register_intc_controller(&intc_desc_irq);
  420. break;
  421. case IRQ_MODE_IRL3210:
  422. ret |= gpio_request(GPIO_FN_IRL3, intc_desc_irl.name);
  423. ret |= gpio_request(GPIO_FN_IRL2, intc_desc_irl.name);
  424. ret |= gpio_request(GPIO_FN_IRL1, intc_desc_irl.name);
  425. ret |= gpio_request(GPIO_FN_IRL0, intc_desc_irl.name);
  426. if (unlikely(ret)) {
  427. pr_err("Failed to set IRL mode\n");
  428. return;
  429. }
  430. register_intc_controller(&intc_desc_irl);
  431. break;
  432. default:
  433. BUG();
  434. }
  435. }
  436. void __init plat_irq_setup(void)
  437. {
  438. reserve_intc_vectors(vectors_irq, ARRAY_SIZE(vectors_irq));
  439. reserve_intc_vectors(vectors_irl, ARRAY_SIZE(vectors_irl));
  440. register_intc_controller(&intc_desc);
  441. }
  442. void __init plat_mem_setup(void)
  443. {
  444. unsigned int nid = 1;
  445. /* Register CPU#0 URAM space as Node 1 */
  446. setup_bootmem_node(nid++, 0x145f0000, 0x14610000); /* CPU0 */
  447. #if 0
  448. /* XXX: Not yet.. */
  449. setup_bootmem_node(nid++, 0x14df0000, 0x14e10000); /* CPU1 */
  450. setup_bootmem_node(nid++, 0x155f0000, 0x15610000); /* CPU2 */
  451. setup_bootmem_node(nid++, 0x15df0000, 0x15e10000); /* CPU3 */
  452. #endif
  453. setup_bootmem_node(nid++, 0x16000000, 0x16020000); /* CSM */
  454. }