gic.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * linux/arch/arm/common/gic.c
  3. *
  4. * Copyright (C) 2002 ARM Limited, All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Interrupt architecture for the GIC:
  11. *
  12. * o There is one Interrupt Distributor, which receives interrupts
  13. * from system devices and sends them to the Interrupt Controllers.
  14. *
  15. * o There is one CPU Interface per CPU, which sends interrupts sent
  16. * by the Distributor, and interrupts generated locally, to the
  17. * associated CPU. The base address of the CPU interface is usually
  18. * aliased so that the same address points to different chips depending
  19. * on the CPU it is accessed from.
  20. *
  21. * Note that IRQs 0-31 are special - they are local to each CPU.
  22. * As such, the enable set/clear, pending set/clear and active bit
  23. * registers are banked per-cpu for these sources.
  24. */
  25. #include <linux/init.h>
  26. #include <linux/kernel.h>
  27. #include <linux/list.h>
  28. #include <linux/smp.h>
  29. #include <linux/cpu_pm.h>
  30. #include <linux/cpumask.h>
  31. #include <linux/io.h>
  32. #include <linux/interrupt.h>
  33. #include <linux/percpu.h>
  34. #include <linux/slab.h>
  35. #include <asm/irq.h>
  36. #include <asm/mach/irq.h>
  37. #include <asm/hardware/gic.h>
  38. static DEFINE_SPINLOCK(irq_controller_lock);
  39. /* Address of GIC 0 CPU interface */
  40. void __iomem *gic_cpu_base_addr __read_mostly;
  41. /*
  42. * Supported arch specific GIC irq extension.
  43. * Default make them NULL.
  44. */
  45. struct irq_chip gic_arch_extn = {
  46. .irq_eoi = NULL,
  47. .irq_mask = NULL,
  48. .irq_unmask = NULL,
  49. .irq_retrigger = NULL,
  50. .irq_set_type = NULL,
  51. .irq_set_wake = NULL,
  52. };
  53. #ifndef MAX_GIC_NR
  54. #define MAX_GIC_NR 1
  55. #endif
  56. static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly;
  57. static inline void __iomem *gic_dist_base(struct irq_data *d)
  58. {
  59. struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
  60. return gic_data->dist_base;
  61. }
  62. static inline void __iomem *gic_cpu_base(struct irq_data *d)
  63. {
  64. struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
  65. return gic_data->cpu_base;
  66. }
  67. static inline unsigned int gic_irq(struct irq_data *d)
  68. {
  69. struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
  70. return d->irq - gic_data->irq_offset;
  71. }
  72. /*
  73. * Routines to acknowledge, disable and enable interrupts
  74. */
  75. static void gic_mask_irq(struct irq_data *d)
  76. {
  77. u32 mask = 1 << (d->irq % 32);
  78. spin_lock(&irq_controller_lock);
  79. writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
  80. if (gic_arch_extn.irq_mask)
  81. gic_arch_extn.irq_mask(d);
  82. spin_unlock(&irq_controller_lock);
  83. }
  84. static void gic_unmask_irq(struct irq_data *d)
  85. {
  86. u32 mask = 1 << (d->irq % 32);
  87. spin_lock(&irq_controller_lock);
  88. if (gic_arch_extn.irq_unmask)
  89. gic_arch_extn.irq_unmask(d);
  90. writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
  91. spin_unlock(&irq_controller_lock);
  92. }
  93. static void gic_eoi_irq(struct irq_data *d)
  94. {
  95. if (gic_arch_extn.irq_eoi) {
  96. spin_lock(&irq_controller_lock);
  97. gic_arch_extn.irq_eoi(d);
  98. spin_unlock(&irq_controller_lock);
  99. }
  100. writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
  101. }
  102. static int gic_set_type(struct irq_data *d, unsigned int type)
  103. {
  104. void __iomem *base = gic_dist_base(d);
  105. unsigned int gicirq = gic_irq(d);
  106. u32 enablemask = 1 << (gicirq % 32);
  107. u32 enableoff = (gicirq / 32) * 4;
  108. u32 confmask = 0x2 << ((gicirq % 16) * 2);
  109. u32 confoff = (gicirq / 16) * 4;
  110. bool enabled = false;
  111. u32 val;
  112. /* Interrupt configuration for SGIs can't be changed */
  113. if (gicirq < 16)
  114. return -EINVAL;
  115. if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
  116. return -EINVAL;
  117. spin_lock(&irq_controller_lock);
  118. if (gic_arch_extn.irq_set_type)
  119. gic_arch_extn.irq_set_type(d, type);
  120. val = readl_relaxed(base + GIC_DIST_CONFIG + confoff);
  121. if (type == IRQ_TYPE_LEVEL_HIGH)
  122. val &= ~confmask;
  123. else if (type == IRQ_TYPE_EDGE_RISING)
  124. val |= confmask;
  125. /*
  126. * As recommended by the spec, disable the interrupt before changing
  127. * the configuration
  128. */
  129. if (readl_relaxed(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) {
  130. writel_relaxed(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff);
  131. enabled = true;
  132. }
  133. writel_relaxed(val, base + GIC_DIST_CONFIG + confoff);
  134. if (enabled)
  135. writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
  136. spin_unlock(&irq_controller_lock);
  137. return 0;
  138. }
  139. static int gic_retrigger(struct irq_data *d)
  140. {
  141. if (gic_arch_extn.irq_retrigger)
  142. return gic_arch_extn.irq_retrigger(d);
  143. return -ENXIO;
  144. }
  145. #ifdef CONFIG_SMP
  146. static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
  147. bool force)
  148. {
  149. void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
  150. unsigned int shift = (d->irq % 4) * 8;
  151. unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
  152. u32 val, mask, bit;
  153. if (cpu >= 8 || cpu >= nr_cpu_ids)
  154. return -EINVAL;
  155. mask = 0xff << shift;
  156. bit = 1 << (cpu_logical_map(cpu) + shift);
  157. spin_lock(&irq_controller_lock);
  158. val = readl_relaxed(reg) & ~mask;
  159. writel_relaxed(val | bit, reg);
  160. spin_unlock(&irq_controller_lock);
  161. return IRQ_SET_MASK_OK;
  162. }
  163. #endif
  164. #ifdef CONFIG_PM
  165. static int gic_set_wake(struct irq_data *d, unsigned int on)
  166. {
  167. int ret = -ENXIO;
  168. if (gic_arch_extn.irq_set_wake)
  169. ret = gic_arch_extn.irq_set_wake(d, on);
  170. return ret;
  171. }
  172. #else
  173. #define gic_set_wake NULL
  174. #endif
  175. static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
  176. {
  177. struct gic_chip_data *chip_data = irq_get_handler_data(irq);
  178. struct irq_chip *chip = irq_get_chip(irq);
  179. unsigned int cascade_irq, gic_irq;
  180. unsigned long status;
  181. chained_irq_enter(chip, desc);
  182. spin_lock(&irq_controller_lock);
  183. status = readl_relaxed(chip_data->cpu_base + GIC_CPU_INTACK);
  184. spin_unlock(&irq_controller_lock);
  185. gic_irq = (status & 0x3ff);
  186. if (gic_irq == 1023)
  187. goto out;
  188. cascade_irq = gic_irq + chip_data->irq_offset;
  189. if (unlikely(gic_irq < 32 || gic_irq > 1020 || cascade_irq >= NR_IRQS))
  190. do_bad_IRQ(cascade_irq, desc);
  191. else
  192. generic_handle_irq(cascade_irq);
  193. out:
  194. chained_irq_exit(chip, desc);
  195. }
  196. static struct irq_chip gic_chip = {
  197. .name = "GIC",
  198. .irq_mask = gic_mask_irq,
  199. .irq_unmask = gic_unmask_irq,
  200. .irq_eoi = gic_eoi_irq,
  201. .irq_set_type = gic_set_type,
  202. .irq_retrigger = gic_retrigger,
  203. #ifdef CONFIG_SMP
  204. .irq_set_affinity = gic_set_affinity,
  205. #endif
  206. .irq_set_wake = gic_set_wake,
  207. };
  208. void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
  209. {
  210. if (gic_nr >= MAX_GIC_NR)
  211. BUG();
  212. if (irq_set_handler_data(irq, &gic_data[gic_nr]) != 0)
  213. BUG();
  214. irq_set_chained_handler(irq, gic_handle_cascade_irq);
  215. }
  216. static void __init gic_dist_init(struct gic_chip_data *gic,
  217. unsigned int irq_start)
  218. {
  219. unsigned int gic_irqs, irq_limit, i;
  220. u32 cpumask;
  221. void __iomem *base = gic->dist_base;
  222. u32 cpu = 0;
  223. u32 nrppis = 0, ppi_base = 0;
  224. #ifdef CONFIG_SMP
  225. cpu = cpu_logical_map(smp_processor_id());
  226. #endif
  227. cpumask = 1 << cpu;
  228. cpumask |= cpumask << 8;
  229. cpumask |= cpumask << 16;
  230. writel_relaxed(0, base + GIC_DIST_CTRL);
  231. /*
  232. * Find out how many interrupts are supported.
  233. * The GIC only supports up to 1020 interrupt sources.
  234. */
  235. gic_irqs = readl_relaxed(base + GIC_DIST_CTR) & 0x1f;
  236. gic_irqs = (gic_irqs + 1) * 32;
  237. if (gic_irqs > 1020)
  238. gic_irqs = 1020;
  239. gic->gic_irqs = gic_irqs;
  240. /*
  241. * Nobody would be insane enough to use PPIs on a secondary
  242. * GIC, right?
  243. */
  244. if (gic == &gic_data[0]) {
  245. nrppis = (32 - irq_start) & 31;
  246. /* The GIC only supports up to 16 PPIs. */
  247. if (nrppis > 16)
  248. BUG();
  249. ppi_base = gic->irq_offset + 32 - nrppis;
  250. }
  251. pr_info("Configuring GIC with %d sources (%d PPIs)\n",
  252. gic_irqs, (gic == &gic_data[0]) ? nrppis : 0);
  253. /*
  254. * Set all global interrupts to be level triggered, active low.
  255. */
  256. for (i = 32; i < gic_irqs; i += 16)
  257. writel_relaxed(0, base + GIC_DIST_CONFIG + i * 4 / 16);
  258. /*
  259. * Set all global interrupts to this CPU only.
  260. */
  261. for (i = 32; i < gic_irqs; i += 4)
  262. writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
  263. /*
  264. * Set priority on all global interrupts.
  265. */
  266. for (i = 32; i < gic_irqs; i += 4)
  267. writel_relaxed(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
  268. /*
  269. * Disable all interrupts. Leave the PPI and SGIs alone
  270. * as these enables are banked registers.
  271. */
  272. for (i = 32; i < gic_irqs; i += 32)
  273. writel_relaxed(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
  274. /*
  275. * Limit number of interrupts registered to the platform maximum
  276. */
  277. irq_limit = gic->irq_offset + gic_irqs;
  278. if (WARN_ON(irq_limit > NR_IRQS))
  279. irq_limit = NR_IRQS;
  280. /*
  281. * Setup the Linux IRQ subsystem.
  282. */
  283. for (i = 0; i < nrppis; i++) {
  284. int ppi = i + ppi_base;
  285. irq_set_percpu_devid(ppi);
  286. irq_set_chip_and_handler(ppi, &gic_chip,
  287. handle_percpu_devid_irq);
  288. irq_set_chip_data(ppi, gic);
  289. set_irq_flags(ppi, IRQF_VALID | IRQF_NOAUTOEN);
  290. }
  291. for (i = irq_start + nrppis; i < irq_limit; i++) {
  292. irq_set_chip_and_handler(i, &gic_chip, handle_fasteoi_irq);
  293. irq_set_chip_data(i, gic);
  294. set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
  295. }
  296. writel_relaxed(1, base + GIC_DIST_CTRL);
  297. }
  298. static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
  299. {
  300. void __iomem *dist_base = gic->dist_base;
  301. void __iomem *base = gic->cpu_base;
  302. int i;
  303. /*
  304. * Deal with the banked PPI and SGI interrupts - disable all
  305. * PPI interrupts, ensure all SGI interrupts are enabled.
  306. */
  307. writel_relaxed(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);
  308. writel_relaxed(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);
  309. /*
  310. * Set priority on PPI and SGI interrupts
  311. */
  312. for (i = 0; i < 32; i += 4)
  313. writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);
  314. writel_relaxed(0xf0, base + GIC_CPU_PRIMASK);
  315. writel_relaxed(1, base + GIC_CPU_CTRL);
  316. }
  317. #ifdef CONFIG_CPU_PM
  318. /*
  319. * Saves the GIC distributor registers during suspend or idle. Must be called
  320. * with interrupts disabled but before powering down the GIC. After calling
  321. * this function, no interrupts will be delivered by the GIC, and another
  322. * platform-specific wakeup source must be enabled.
  323. */
  324. static void gic_dist_save(unsigned int gic_nr)
  325. {
  326. unsigned int gic_irqs;
  327. void __iomem *dist_base;
  328. int i;
  329. if (gic_nr >= MAX_GIC_NR)
  330. BUG();
  331. gic_irqs = gic_data[gic_nr].gic_irqs;
  332. dist_base = gic_data[gic_nr].dist_base;
  333. if (!dist_base)
  334. return;
  335. for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
  336. gic_data[gic_nr].saved_spi_conf[i] =
  337. readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
  338. for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
  339. gic_data[gic_nr].saved_spi_target[i] =
  340. readl_relaxed(dist_base + GIC_DIST_TARGET + i * 4);
  341. for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
  342. gic_data[gic_nr].saved_spi_enable[i] =
  343. readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
  344. }
  345. /*
  346. * Restores the GIC distributor registers during resume or when coming out of
  347. * idle. Must be called before enabling interrupts. If a level interrupt
  348. * that occured while the GIC was suspended is still present, it will be
  349. * handled normally, but any edge interrupts that occured will not be seen by
  350. * the GIC and need to be handled by the platform-specific wakeup source.
  351. */
  352. static void gic_dist_restore(unsigned int gic_nr)
  353. {
  354. unsigned int gic_irqs;
  355. unsigned int i;
  356. void __iomem *dist_base;
  357. if (gic_nr >= MAX_GIC_NR)
  358. BUG();
  359. gic_irqs = gic_data[gic_nr].gic_irqs;
  360. dist_base = gic_data[gic_nr].dist_base;
  361. if (!dist_base)
  362. return;
  363. writel_relaxed(0, dist_base + GIC_DIST_CTRL);
  364. for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
  365. writel_relaxed(gic_data[gic_nr].saved_spi_conf[i],
  366. dist_base + GIC_DIST_CONFIG + i * 4);
  367. for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
  368. writel_relaxed(0xa0a0a0a0,
  369. dist_base + GIC_DIST_PRI + i * 4);
  370. for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
  371. writel_relaxed(gic_data[gic_nr].saved_spi_target[i],
  372. dist_base + GIC_DIST_TARGET + i * 4);
  373. for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
  374. writel_relaxed(gic_data[gic_nr].saved_spi_enable[i],
  375. dist_base + GIC_DIST_ENABLE_SET + i * 4);
  376. writel_relaxed(1, dist_base + GIC_DIST_CTRL);
  377. }
  378. static void gic_cpu_save(unsigned int gic_nr)
  379. {
  380. int i;
  381. u32 *ptr;
  382. void __iomem *dist_base;
  383. void __iomem *cpu_base;
  384. if (gic_nr >= MAX_GIC_NR)
  385. BUG();
  386. dist_base = gic_data[gic_nr].dist_base;
  387. cpu_base = gic_data[gic_nr].cpu_base;
  388. if (!dist_base || !cpu_base)
  389. return;
  390. ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
  391. for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
  392. ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
  393. ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
  394. for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
  395. ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
  396. }
  397. static void gic_cpu_restore(unsigned int gic_nr)
  398. {
  399. int i;
  400. u32 *ptr;
  401. void __iomem *dist_base;
  402. void __iomem *cpu_base;
  403. if (gic_nr >= MAX_GIC_NR)
  404. BUG();
  405. dist_base = gic_data[gic_nr].dist_base;
  406. cpu_base = gic_data[gic_nr].cpu_base;
  407. if (!dist_base || !cpu_base)
  408. return;
  409. ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
  410. for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
  411. writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);
  412. ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
  413. for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
  414. writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);
  415. for (i = 0; i < DIV_ROUND_UP(32, 4); i++)
  416. writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4);
  417. writel_relaxed(0xf0, cpu_base + GIC_CPU_PRIMASK);
  418. writel_relaxed(1, cpu_base + GIC_CPU_CTRL);
  419. }
  420. static int gic_notifier(struct notifier_block *self, unsigned long cmd, void *v)
  421. {
  422. int i;
  423. for (i = 0; i < MAX_GIC_NR; i++) {
  424. switch (cmd) {
  425. case CPU_PM_ENTER:
  426. gic_cpu_save(i);
  427. break;
  428. case CPU_PM_ENTER_FAILED:
  429. case CPU_PM_EXIT:
  430. gic_cpu_restore(i);
  431. break;
  432. case CPU_CLUSTER_PM_ENTER:
  433. gic_dist_save(i);
  434. break;
  435. case CPU_CLUSTER_PM_ENTER_FAILED:
  436. case CPU_CLUSTER_PM_EXIT:
  437. gic_dist_restore(i);
  438. break;
  439. }
  440. }
  441. return NOTIFY_OK;
  442. }
  443. static struct notifier_block gic_notifier_block = {
  444. .notifier_call = gic_notifier,
  445. };
  446. static void __init gic_pm_init(struct gic_chip_data *gic)
  447. {
  448. gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4,
  449. sizeof(u32));
  450. BUG_ON(!gic->saved_ppi_enable);
  451. gic->saved_ppi_conf = __alloc_percpu(DIV_ROUND_UP(32, 16) * 4,
  452. sizeof(u32));
  453. BUG_ON(!gic->saved_ppi_conf);
  454. cpu_pm_register_notifier(&gic_notifier_block);
  455. }
  456. #else
  457. static void __init gic_pm_init(struct gic_chip_data *gic)
  458. {
  459. }
  460. #endif
  461. void __init gic_init(unsigned int gic_nr, unsigned int irq_start,
  462. void __iomem *dist_base, void __iomem *cpu_base)
  463. {
  464. struct gic_chip_data *gic;
  465. BUG_ON(gic_nr >= MAX_GIC_NR);
  466. gic = &gic_data[gic_nr];
  467. gic->dist_base = dist_base;
  468. gic->cpu_base = cpu_base;
  469. gic->irq_offset = (irq_start - 1) & ~31;
  470. if (gic_nr == 0)
  471. gic_cpu_base_addr = cpu_base;
  472. gic_chip.flags |= gic_arch_extn.flags;
  473. gic_dist_init(gic, irq_start);
  474. gic_cpu_init(gic);
  475. gic_pm_init(gic);
  476. }
  477. void __cpuinit gic_secondary_init(unsigned int gic_nr)
  478. {
  479. BUG_ON(gic_nr >= MAX_GIC_NR);
  480. gic_cpu_init(&gic_data[gic_nr]);
  481. }
  482. #ifdef CONFIG_SMP
  483. void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
  484. {
  485. int cpu;
  486. unsigned long map = 0;
  487. /* Convert our logical CPU mask into a physical one. */
  488. for_each_cpu(cpu, mask)
  489. map |= 1 << cpu_logical_map(cpu);
  490. /*
  491. * Ensure that stores to Normal memory are visible to the
  492. * other CPUs before issuing the IPI.
  493. */
  494. dsb();
  495. /* this always happens on GIC0 */
  496. writel_relaxed(map << 16 | irq, gic_data[0].dist_base + GIC_DIST_SOFTINT);
  497. }
  498. #endif