octeon-irq.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2004-2008 Cavium Networks
  7. */
  8. #include <linux/irq.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/smp.h>
  11. #include <asm/octeon/octeon.h>
  12. #include <asm/octeon/cvmx-pexp-defs.h>
  13. #include <asm/octeon/cvmx-npi-defs.h>
  14. DEFINE_RWLOCK(octeon_irq_ciu0_rwlock);
  15. DEFINE_RWLOCK(octeon_irq_ciu1_rwlock);
  16. DEFINE_SPINLOCK(octeon_irq_msi_lock);
  17. static void octeon_irq_core_ack(unsigned int irq)
  18. {
  19. unsigned int bit = irq - OCTEON_IRQ_SW0;
  20. /*
  21. * We don't need to disable IRQs to make these atomic since
  22. * they are already disabled earlier in the low level
  23. * interrupt code.
  24. */
  25. clear_c0_status(0x100 << bit);
  26. /* The two user interrupts must be cleared manually. */
  27. if (bit < 2)
  28. clear_c0_cause(0x100 << bit);
  29. }
  30. static void octeon_irq_core_eoi(unsigned int irq)
  31. {
  32. struct irq_desc *desc = irq_desc + irq;
  33. unsigned int bit = irq - OCTEON_IRQ_SW0;
  34. /*
  35. * If an IRQ is being processed while we are disabling it the
  36. * handler will attempt to unmask the interrupt after it has
  37. * been disabled.
  38. */
  39. if (desc->status & IRQ_DISABLED)
  40. return;
  41. /* There is a race here. We should fix it. */
  42. /*
  43. * We don't need to disable IRQs to make these atomic since
  44. * they are already disabled earlier in the low level
  45. * interrupt code.
  46. */
  47. set_c0_status(0x100 << bit);
  48. }
  49. static void octeon_irq_core_enable(unsigned int irq)
  50. {
  51. unsigned long flags;
  52. unsigned int bit = irq - OCTEON_IRQ_SW0;
  53. /*
  54. * We need to disable interrupts to make sure our updates are
  55. * atomic.
  56. */
  57. local_irq_save(flags);
  58. set_c0_status(0x100 << bit);
  59. local_irq_restore(flags);
  60. }
  61. static void octeon_irq_core_disable_local(unsigned int irq)
  62. {
  63. unsigned long flags;
  64. unsigned int bit = irq - OCTEON_IRQ_SW0;
  65. /*
  66. * We need to disable interrupts to make sure our updates are
  67. * atomic.
  68. */
  69. local_irq_save(flags);
  70. clear_c0_status(0x100 << bit);
  71. local_irq_restore(flags);
  72. }
  73. static void octeon_irq_core_disable(unsigned int irq)
  74. {
  75. #ifdef CONFIG_SMP
  76. on_each_cpu((void (*)(void *)) octeon_irq_core_disable_local,
  77. (void *) (long) irq, 1);
  78. #else
  79. octeon_irq_core_disable_local(irq);
  80. #endif
  81. }
  82. static struct irq_chip octeon_irq_chip_core = {
  83. .name = "Core",
  84. .enable = octeon_irq_core_enable,
  85. .disable = octeon_irq_core_disable,
  86. .ack = octeon_irq_core_ack,
  87. .eoi = octeon_irq_core_eoi,
  88. };
  89. static void octeon_irq_ciu0_ack(unsigned int irq)
  90. {
  91. /*
  92. * In order to avoid any locking accessing the CIU, we
  93. * acknowledge CIU interrupts by disabling all of them. This
  94. * way we can use a per core register and avoid any out of
  95. * core locking requirements. This has the side affect that
  96. * CIU interrupts can't be processed recursively.
  97. *
  98. * We don't need to disable IRQs to make these atomic since
  99. * they are already disabled earlier in the low level
  100. * interrupt code.
  101. */
  102. clear_c0_status(0x100 << 2);
  103. }
  104. static void octeon_irq_ciu0_eoi(unsigned int irq)
  105. {
  106. /*
  107. * Enable all CIU interrupts again. We don't need to disable
  108. * IRQs to make these atomic since they are already disabled
  109. * earlier in the low level interrupt code.
  110. */
  111. set_c0_status(0x100 << 2);
  112. }
  113. static void octeon_irq_ciu0_enable(unsigned int irq)
  114. {
  115. int coreid = cvmx_get_core_num();
  116. unsigned long flags;
  117. uint64_t en0;
  118. int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
  119. /*
  120. * A read lock is used here to make sure only one core is ever
  121. * updating the CIU enable bits at a time. During an enable
  122. * the cores don't interfere with each other. During a disable
  123. * the write lock stops any enables that might cause a
  124. * problem.
  125. */
  126. read_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
  127. en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  128. en0 |= 1ull << bit;
  129. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  130. cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  131. read_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
  132. }
  133. static void octeon_irq_ciu0_disable(unsigned int irq)
  134. {
  135. int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
  136. unsigned long flags;
  137. uint64_t en0;
  138. #ifdef CONFIG_SMP
  139. int cpu;
  140. write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
  141. for_each_online_cpu(cpu) {
  142. int coreid = cpu_logical_map(cpu);
  143. en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  144. en0 &= ~(1ull << bit);
  145. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  146. }
  147. /*
  148. * We need to do a read after the last update to make sure all
  149. * of them are done.
  150. */
  151. cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
  152. write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
  153. #else
  154. int coreid = cvmx_get_core_num();
  155. local_irq_save(flags);
  156. en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  157. en0 &= ~(1ull << bit);
  158. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  159. cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  160. local_irq_restore(flags);
  161. #endif
  162. }
  163. #ifdef CONFIG_SMP
  164. static int octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *dest)
  165. {
  166. int cpu;
  167. unsigned long flags;
  168. int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
  169. write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
  170. for_each_online_cpu(cpu) {
  171. int coreid = cpu_logical_map(cpu);
  172. uint64_t en0 =
  173. cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
  174. if (cpumask_test_cpu(cpu, dest))
  175. en0 |= 1ull << bit;
  176. else
  177. en0 &= ~(1ull << bit);
  178. cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
  179. }
  180. /*
  181. * We need to do a read after the last update to make sure all
  182. * of them are done.
  183. */
  184. cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
  185. write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
  186. return 0;
  187. }
  188. #endif
  189. static struct irq_chip octeon_irq_chip_ciu0 = {
  190. .name = "CIU0",
  191. .enable = octeon_irq_ciu0_enable,
  192. .disable = octeon_irq_ciu0_disable,
  193. .ack = octeon_irq_ciu0_ack,
  194. .eoi = octeon_irq_ciu0_eoi,
  195. #ifdef CONFIG_SMP
  196. .set_affinity = octeon_irq_ciu0_set_affinity,
  197. #endif
  198. };
  199. static void octeon_irq_ciu1_ack(unsigned int irq)
  200. {
  201. /*
  202. * In order to avoid any locking accessing the CIU, we
  203. * acknowledge CIU interrupts by disabling all of them. This
  204. * way we can use a per core register and avoid any out of
  205. * core locking requirements. This has the side affect that
  206. * CIU interrupts can't be processed recursively. We don't
  207. * need to disable IRQs to make these atomic since they are
  208. * already disabled earlier in the low level interrupt code.
  209. */
  210. clear_c0_status(0x100 << 3);
  211. }
  212. static void octeon_irq_ciu1_eoi(unsigned int irq)
  213. {
  214. /*
  215. * Enable all CIU interrupts again. We don't need to disable
  216. * IRQs to make these atomic since they are already disabled
  217. * earlier in the low level interrupt code.
  218. */
  219. set_c0_status(0x100 << 3);
  220. }
  221. static void octeon_irq_ciu1_enable(unsigned int irq)
  222. {
  223. int coreid = cvmx_get_core_num();
  224. unsigned long flags;
  225. uint64_t en1;
  226. int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
  227. /*
  228. * A read lock is used here to make sure only one core is ever
  229. * updating the CIU enable bits at a time. During an enable
  230. * the cores don't interfere with each other. During a disable
  231. * the write lock stops any enables that might cause a
  232. * problem.
  233. */
  234. read_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
  235. en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  236. en1 |= 1ull << bit;
  237. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  238. cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  239. read_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
  240. }
  241. static void octeon_irq_ciu1_disable(unsigned int irq)
  242. {
  243. int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
  244. unsigned long flags;
  245. uint64_t en1;
  246. #ifdef CONFIG_SMP
  247. int cpu;
  248. write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
  249. for_each_online_cpu(cpu) {
  250. int coreid = cpu_logical_map(cpu);
  251. en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  252. en1 &= ~(1ull << bit);
  253. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  254. }
  255. /*
  256. * We need to do a read after the last update to make sure all
  257. * of them are done.
  258. */
  259. cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
  260. write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
  261. #else
  262. int coreid = cvmx_get_core_num();
  263. local_irq_save(flags);
  264. en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  265. en1 &= ~(1ull << bit);
  266. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  267. cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
  268. local_irq_restore(flags);
  269. #endif
  270. }
  271. #ifdef CONFIG_SMP
  272. static int octeon_irq_ciu1_set_affinity(unsigned int irq, const struct cpumask *dest)
  273. {
  274. int cpu;
  275. unsigned long flags;
  276. int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
  277. write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
  278. for_each_online_cpu(cpu) {
  279. int coreid = cpu_logical_map(cpu);
  280. uint64_t en1 =
  281. cvmx_read_csr(CVMX_CIU_INTX_EN1
  282. (coreid * 2 + 1));
  283. if (cpumask_test_cpu(cpu, dest))
  284. en1 |= 1ull << bit;
  285. else
  286. en1 &= ~(1ull << bit);
  287. cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
  288. }
  289. /*
  290. * We need to do a read after the last update to make sure all
  291. * of them are done.
  292. */
  293. cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
  294. write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
  295. return 0;
  296. }
  297. #endif
  298. static struct irq_chip octeon_irq_chip_ciu1 = {
  299. .name = "CIU1",
  300. .enable = octeon_irq_ciu1_enable,
  301. .disable = octeon_irq_ciu1_disable,
  302. .ack = octeon_irq_ciu1_ack,
  303. .eoi = octeon_irq_ciu1_eoi,
  304. #ifdef CONFIG_SMP
  305. .set_affinity = octeon_irq_ciu1_set_affinity,
  306. #endif
  307. };
  308. #ifdef CONFIG_PCI_MSI
  309. static void octeon_irq_msi_ack(unsigned int irq)
  310. {
  311. if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
  312. /* These chips have PCI */
  313. cvmx_write_csr(CVMX_NPI_NPI_MSI_RCV,
  314. 1ull << (irq - OCTEON_IRQ_MSI_BIT0));
  315. } else {
  316. /*
  317. * These chips have PCIe. Thankfully the ACK doesn't
  318. * need any locking.
  319. */
  320. cvmx_write_csr(CVMX_PEXP_NPEI_MSI_RCV0,
  321. 1ull << (irq - OCTEON_IRQ_MSI_BIT0));
  322. }
  323. }
  324. static void octeon_irq_msi_eoi(unsigned int irq)
  325. {
  326. /* Nothing needed */
  327. }
  328. static void octeon_irq_msi_enable(unsigned int irq)
  329. {
  330. if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
  331. /*
  332. * Octeon PCI doesn't have the ability to mask/unmask
  333. * MSI interrupts individually. Instead of
  334. * masking/unmasking them in groups of 16, we simple
  335. * assume MSI devices are well behaved. MSI
  336. * interrupts are always enable and the ACK is assumed
  337. * to be enough.
  338. */
  339. } else {
  340. /* These chips have PCIe. Note that we only support
  341. * the first 64 MSI interrupts. Unfortunately all the
  342. * MSI enables are in the same register. We use
  343. * MSI0's lock to control access to them all.
  344. */
  345. uint64_t en;
  346. unsigned long flags;
  347. spin_lock_irqsave(&octeon_irq_msi_lock, flags);
  348. en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  349. en |= 1ull << (irq - OCTEON_IRQ_MSI_BIT0);
  350. cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
  351. cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  352. spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
  353. }
  354. }
  355. static void octeon_irq_msi_disable(unsigned int irq)
  356. {
  357. if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
  358. /* See comment in enable */
  359. } else {
  360. /*
  361. * These chips have PCIe. Note that we only support
  362. * the first 64 MSI interrupts. Unfortunately all the
  363. * MSI enables are in the same register. We use
  364. * MSI0's lock to control access to them all.
  365. */
  366. uint64_t en;
  367. unsigned long flags;
  368. spin_lock_irqsave(&octeon_irq_msi_lock, flags);
  369. en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  370. en &= ~(1ull << (irq - OCTEON_IRQ_MSI_BIT0));
  371. cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
  372. cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
  373. spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
  374. }
  375. }
  376. static struct irq_chip octeon_irq_chip_msi = {
  377. .name = "MSI",
  378. .enable = octeon_irq_msi_enable,
  379. .disable = octeon_irq_msi_disable,
  380. .ack = octeon_irq_msi_ack,
  381. .eoi = octeon_irq_msi_eoi,
  382. };
  383. #endif
  384. void __init arch_init_irq(void)
  385. {
  386. int irq;
  387. #ifdef CONFIG_SMP
  388. /* Set the default affinity to the boot cpu. */
  389. cpumask_clear(irq_default_affinity);
  390. cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
  391. #endif
  392. if (NR_IRQS < OCTEON_IRQ_LAST)
  393. pr_err("octeon_irq_init: NR_IRQS is set too low\n");
  394. /* 0 - 15 reserved for i8259 master and slave controller. */
  395. /* 17 - 23 Mips internal */
  396. for (irq = OCTEON_IRQ_SW0; irq <= OCTEON_IRQ_TIMER; irq++) {
  397. set_irq_chip_and_handler(irq, &octeon_irq_chip_core,
  398. handle_percpu_irq);
  399. }
  400. /* 24 - 87 CIU_INT_SUM0 */
  401. for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) {
  402. set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu0,
  403. handle_percpu_irq);
  404. }
  405. /* 88 - 151 CIU_INT_SUM1 */
  406. for (irq = OCTEON_IRQ_WDOG0; irq <= OCTEON_IRQ_RESERVED151; irq++) {
  407. set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu1,
  408. handle_percpu_irq);
  409. }
  410. #ifdef CONFIG_PCI_MSI
  411. /* 152 - 215 PCI/PCIe MSI interrupts */
  412. for (irq = OCTEON_IRQ_MSI_BIT0; irq <= OCTEON_IRQ_MSI_BIT63; irq++) {
  413. set_irq_chip_and_handler(irq, &octeon_irq_chip_msi,
  414. handle_percpu_irq);
  415. }
  416. #endif
  417. set_c0_status(0x300 << 2);
  418. }
  419. asmlinkage void plat_irq_dispatch(void)
  420. {
  421. const unsigned long core_id = cvmx_get_core_num();
  422. const uint64_t ciu_sum0_address = CVMX_CIU_INTX_SUM0(core_id * 2);
  423. const uint64_t ciu_en0_address = CVMX_CIU_INTX_EN0(core_id * 2);
  424. const uint64_t ciu_sum1_address = CVMX_CIU_INT_SUM1;
  425. const uint64_t ciu_en1_address = CVMX_CIU_INTX_EN1(core_id * 2 + 1);
  426. unsigned long cop0_cause;
  427. unsigned long cop0_status;
  428. uint64_t ciu_en;
  429. uint64_t ciu_sum;
  430. while (1) {
  431. cop0_cause = read_c0_cause();
  432. cop0_status = read_c0_status();
  433. cop0_cause &= cop0_status;
  434. cop0_cause &= ST0_IM;
  435. if (unlikely(cop0_cause & STATUSF_IP2)) {
  436. ciu_sum = cvmx_read_csr(ciu_sum0_address);
  437. ciu_en = cvmx_read_csr(ciu_en0_address);
  438. ciu_sum &= ciu_en;
  439. if (likely(ciu_sum))
  440. do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WORKQ0 - 1);
  441. else
  442. spurious_interrupt();
  443. } else if (unlikely(cop0_cause & STATUSF_IP3)) {
  444. ciu_sum = cvmx_read_csr(ciu_sum1_address);
  445. ciu_en = cvmx_read_csr(ciu_en1_address);
  446. ciu_sum &= ciu_en;
  447. if (likely(ciu_sum))
  448. do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WDOG0 - 1);
  449. else
  450. spurious_interrupt();
  451. } else if (likely(cop0_cause)) {
  452. do_IRQ(fls(cop0_cause) - 9 + MIPS_CPU_IRQ_BASE);
  453. } else {
  454. break;
  455. }
  456. }
  457. }
  458. #ifdef CONFIG_HOTPLUG_CPU
  459. static int is_irq_enabled_on_cpu(unsigned int irq, unsigned int cpu)
  460. {
  461. unsigned int isset;
  462. #ifdef CONFIG_SMP
  463. int coreid = cpu_logical_map(cpu);
  464. #else
  465. int coreid = cvmx_get_core_num();
  466. #endif
  467. int bit = (irq < OCTEON_IRQ_WDOG0) ?
  468. irq - OCTEON_IRQ_WORKQ0 : irq - OCTEON_IRQ_WDOG0;
  469. if (irq < 64) {
  470. isset = (cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)) &
  471. (1ull << bit)) >> bit;
  472. } else {
  473. isset = (cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)) &
  474. (1ull << bit)) >> bit;
  475. }
  476. return isset;
  477. }
  478. void fixup_irqs(void)
  479. {
  480. int irq;
  481. for (irq = OCTEON_IRQ_SW0; irq <= OCTEON_IRQ_TIMER; irq++)
  482. octeon_irq_core_disable_local(irq);
  483. for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_GPIO15; irq++) {
  484. if (is_irq_enabled_on_cpu(irq, smp_processor_id())) {
  485. /* ciu irq migrates to next cpu */
  486. octeon_irq_chip_ciu0.disable(irq);
  487. octeon_irq_ciu0_set_affinity(irq, &cpu_online_map);
  488. }
  489. }
  490. #if 0
  491. for (irq = OCTEON_IRQ_MBOX0; irq <= OCTEON_IRQ_MBOX1; irq++)
  492. octeon_irq_mailbox_mask(irq);
  493. #endif
  494. for (irq = OCTEON_IRQ_UART0; irq <= OCTEON_IRQ_BOOTDMA; irq++) {
  495. if (is_irq_enabled_on_cpu(irq, smp_processor_id())) {
  496. /* ciu irq migrates to next cpu */
  497. octeon_irq_chip_ciu0.disable(irq);
  498. octeon_irq_ciu0_set_affinity(irq, &cpu_online_map);
  499. }
  500. }
  501. for (irq = OCTEON_IRQ_UART2; irq <= OCTEON_IRQ_RESERVED135; irq++) {
  502. if (is_irq_enabled_on_cpu(irq, smp_processor_id())) {
  503. /* ciu irq migrates to next cpu */
  504. octeon_irq_chip_ciu1.disable(irq);
  505. octeon_irq_ciu1_set_affinity(irq, &cpu_online_map);
  506. }
  507. }
  508. }
  509. #endif /* CONFIG_HOTPLUG_CPU */