WIP FPC-III support
[linux/fpc-iii.git] / arch / powerpc / platforms / ps3 / interrupt.c
blob78f2339ed5cb18296b1d1d5586a9396df02e7005
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * PS3 interrupt routines.
5 * Copyright (C) 2006 Sony Computer Entertainment Inc.
6 * Copyright 2006 Sony Corp.
7 */
9 #include <linux/kernel.h>
10 #include <linux/export.h>
11 #include <linux/irq.h>
13 #include <asm/machdep.h>
14 #include <asm/udbg.h>
15 #include <asm/lv1call.h>
16 #include <asm/smp.h>
18 #include "platform.h"
20 #if defined(DEBUG)
21 #define DBG udbg_printf
22 #define FAIL udbg_printf
23 #else
24 #define DBG pr_devel
25 #define FAIL pr_debug
26 #endif
28 /**
29 * struct ps3_bmp - a per cpu irq status and mask bitmap structure
30 * @status: 256 bit status bitmap indexed by plug
31 * @unused_1: Alignment
32 * @mask: 256 bit mask bitmap indexed by plug
33 * @unused_2: Alignment
35 * The HV maintains per SMT thread mappings of HV outlet to HV plug on
36 * behalf of the guest. These mappings are implemented as 256 bit guest
37 * supplied bitmaps indexed by plug number. The addresses of the bitmaps
38 * are registered with the HV through lv1_configure_irq_state_bitmap().
39 * The HV requires that the 512 bits of status + mask not cross a page
40 * boundary. PS3_BMP_MINALIGN is used to define this minimal 64 byte
41 * alignment.
43 * The HV supports 256 plugs per thread, assigned as {0..255}, for a total
44 * of 512 plugs supported on a processor. To simplify the logic this
45 * implementation equates HV plug value to Linux virq value, constrains each
46 * interrupt to have a system wide unique plug number, and limits the range
47 * of the plug values to map into the first dword of the bitmaps. This
48 * gives a usable range of plug values of {NUM_ISA_INTERRUPTS..63}. Note
49 * that there is no constraint on how many in this set an individual thread
50 * can acquire.
52 * The mask is declared as unsigned long so we can use set/clear_bit on it.
55 #define PS3_BMP_MINALIGN 64
57 struct ps3_bmp {
58 struct {
59 u64 status;
60 u64 unused_1[3];
61 unsigned long mask;
62 u64 unused_2[3];
66 /**
67 * struct ps3_private - a per cpu data structure
68 * @bmp: ps3_bmp structure
69 * @bmp_lock: Synchronize access to bmp.
70 * @ipi_debug_brk_mask: Mask for debug break IPIs
71 * @ppe_id: HV logical_ppe_id
72 * @thread_id: HV thread_id
73 * @ipi_mask: Mask of IPI virqs
76 struct ps3_private {
77 struct ps3_bmp bmp __attribute__ ((aligned (PS3_BMP_MINALIGN)));
78 spinlock_t bmp_lock;
79 u64 ppe_id;
80 u64 thread_id;
81 unsigned long ipi_debug_brk_mask;
82 unsigned long ipi_mask;
85 static DEFINE_PER_CPU(struct ps3_private, ps3_private);
87 /**
88 * ps3_chip_mask - Set an interrupt mask bit in ps3_bmp.
89 * @virq: The assigned Linux virq.
91 * Sets ps3_bmp.mask and calls lv1_did_update_interrupt_mask().
94 static void ps3_chip_mask(struct irq_data *d)
96 struct ps3_private *pd = irq_data_get_irq_chip_data(d);
97 unsigned long flags;
99 DBG("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
100 pd->thread_id, d->irq);
102 local_irq_save(flags);
103 clear_bit(63 - d->irq, &pd->bmp.mask);
104 lv1_did_update_interrupt_mask(pd->ppe_id, pd->thread_id);
105 local_irq_restore(flags);
109 * ps3_chip_unmask - Clear an interrupt mask bit in ps3_bmp.
110 * @virq: The assigned Linux virq.
112 * Clears ps3_bmp.mask and calls lv1_did_update_interrupt_mask().
115 static void ps3_chip_unmask(struct irq_data *d)
117 struct ps3_private *pd = irq_data_get_irq_chip_data(d);
118 unsigned long flags;
120 DBG("%s:%d: thread_id %llu, virq %d\n", __func__, __LINE__,
121 pd->thread_id, d->irq);
123 local_irq_save(flags);
124 set_bit(63 - d->irq, &pd->bmp.mask);
125 lv1_did_update_interrupt_mask(pd->ppe_id, pd->thread_id);
126 local_irq_restore(flags);
130 * ps3_chip_eoi - HV end-of-interrupt.
131 * @virq: The assigned Linux virq.
133 * Calls lv1_end_of_interrupt_ext().
136 static void ps3_chip_eoi(struct irq_data *d)
138 const struct ps3_private *pd = irq_data_get_irq_chip_data(d);
140 /* non-IPIs are EOIed here. */
142 if (!test_bit(63 - d->irq, &pd->ipi_mask))
143 lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, d->irq);
147 * ps3_irq_chip - Represents the ps3_bmp as a Linux struct irq_chip.
150 static struct irq_chip ps3_irq_chip = {
151 .name = "ps3",
152 .irq_mask = ps3_chip_mask,
153 .irq_unmask = ps3_chip_unmask,
154 .irq_eoi = ps3_chip_eoi,
158 * ps3_virq_setup - virq related setup.
159 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
160 * serviced on.
161 * @outlet: The HV outlet from the various create outlet routines.
162 * @virq: The assigned Linux virq.
164 * Calls irq_create_mapping() to get a virq and sets the chip data to
165 * ps3_private data.
168 static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
169 unsigned int *virq)
171 int result;
172 struct ps3_private *pd;
174 /* This defines the default interrupt distribution policy. */
176 if (cpu == PS3_BINDING_CPU_ANY)
177 cpu = 0;
179 pd = &per_cpu(ps3_private, cpu);
181 *virq = irq_create_mapping(NULL, outlet);
183 if (!*virq) {
184 FAIL("%s:%d: irq_create_mapping failed: outlet %lu\n",
185 __func__, __LINE__, outlet);
186 result = -ENOMEM;
187 goto fail_create;
190 DBG("%s:%d: outlet %lu => cpu %u, virq %u\n", __func__, __LINE__,
191 outlet, cpu, *virq);
193 result = irq_set_chip_data(*virq, pd);
195 if (result) {
196 FAIL("%s:%d: irq_set_chip_data failed\n",
197 __func__, __LINE__);
198 goto fail_set;
201 ps3_chip_mask(irq_get_irq_data(*virq));
203 return result;
205 fail_set:
206 irq_dispose_mapping(*virq);
207 fail_create:
208 return result;
212 * ps3_virq_destroy - virq related teardown.
213 * @virq: The assigned Linux virq.
215 * Clears chip data and calls irq_dispose_mapping() for the virq.
218 static int ps3_virq_destroy(unsigned int virq)
220 const struct ps3_private *pd = irq_get_chip_data(virq);
222 DBG("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
223 __LINE__, pd->ppe_id, pd->thread_id, virq);
225 irq_set_chip_data(virq, NULL);
226 irq_dispose_mapping(virq);
228 DBG("%s:%d <-\n", __func__, __LINE__);
229 return 0;
233 * ps3_irq_plug_setup - Generic outlet and virq related setup.
234 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
235 * serviced on.
236 * @outlet: The HV outlet from the various create outlet routines.
237 * @virq: The assigned Linux virq.
239 * Sets up virq and connects the irq plug.
242 int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
243 unsigned int *virq)
245 int result;
246 struct ps3_private *pd;
248 result = ps3_virq_setup(cpu, outlet, virq);
250 if (result) {
251 FAIL("%s:%d: ps3_virq_setup failed\n", __func__, __LINE__);
252 goto fail_setup;
255 pd = irq_get_chip_data(*virq);
257 /* Binds outlet to cpu + virq. */
259 result = lv1_connect_irq_plug_ext(pd->ppe_id, pd->thread_id, *virq,
260 outlet, 0);
262 if (result) {
263 FAIL("%s:%d: lv1_connect_irq_plug_ext failed: %s\n",
264 __func__, __LINE__, ps3_result(result));
265 result = -EPERM;
266 goto fail_connect;
269 return result;
271 fail_connect:
272 ps3_virq_destroy(*virq);
273 fail_setup:
274 return result;
276 EXPORT_SYMBOL_GPL(ps3_irq_plug_setup);
279 * ps3_irq_plug_destroy - Generic outlet and virq related teardown.
280 * @virq: The assigned Linux virq.
282 * Disconnects the irq plug and tears down virq.
283 * Do not call for system bus event interrupts setup with
284 * ps3_sb_event_receive_port_setup().
287 int ps3_irq_plug_destroy(unsigned int virq)
289 int result;
290 const struct ps3_private *pd = irq_get_chip_data(virq);
292 DBG("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__,
293 __LINE__, pd->ppe_id, pd->thread_id, virq);
295 ps3_chip_mask(irq_get_irq_data(virq));
297 result = lv1_disconnect_irq_plug_ext(pd->ppe_id, pd->thread_id, virq);
299 if (result)
300 FAIL("%s:%d: lv1_disconnect_irq_plug_ext failed: %s\n",
301 __func__, __LINE__, ps3_result(result));
303 ps3_virq_destroy(virq);
305 return result;
307 EXPORT_SYMBOL_GPL(ps3_irq_plug_destroy);
310 * ps3_event_receive_port_setup - Setup an event receive port.
311 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
312 * serviced on.
313 * @virq: The assigned Linux virq.
315 * The virq can be used with lv1_connect_interrupt_event_receive_port() to
316 * arrange to receive interrupts from system-bus devices, or with
317 * ps3_send_event_locally() to signal events.
320 int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
322 int result;
323 u64 outlet;
325 result = lv1_construct_event_receive_port(&outlet);
327 if (result) {
328 FAIL("%s:%d: lv1_construct_event_receive_port failed: %s\n",
329 __func__, __LINE__, ps3_result(result));
330 *virq = 0;
331 return result;
334 result = ps3_irq_plug_setup(cpu, outlet, virq);
335 BUG_ON(result);
337 return result;
339 EXPORT_SYMBOL_GPL(ps3_event_receive_port_setup);
342 * ps3_event_receive_port_destroy - Destroy an event receive port.
343 * @virq: The assigned Linux virq.
345 * Since ps3_event_receive_port_destroy destroys the receive port outlet,
346 * SB devices need to call disconnect_interrupt_event_receive_port() before
347 * this.
350 int ps3_event_receive_port_destroy(unsigned int virq)
352 int result;
354 DBG(" -> %s:%d virq %u\n", __func__, __LINE__, virq);
356 ps3_chip_mask(irq_get_irq_data(virq));
358 result = lv1_destruct_event_receive_port(virq_to_hw(virq));
360 if (result)
361 FAIL("%s:%d: lv1_destruct_event_receive_port failed: %s\n",
362 __func__, __LINE__, ps3_result(result));
365 * Don't call ps3_virq_destroy() here since ps3_smp_cleanup_cpu()
366 * calls from interrupt context (smp_call_function) when kexecing.
369 DBG(" <- %s:%d\n", __func__, __LINE__);
370 return result;
373 int ps3_send_event_locally(unsigned int virq)
375 return lv1_send_event_locally(virq_to_hw(virq));
379 * ps3_sb_event_receive_port_setup - Setup a system bus event receive port.
380 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
381 * serviced on.
382 * @dev: The system bus device instance.
383 * @virq: The assigned Linux virq.
385 * An event irq represents a virtual device interrupt. The interrupt_id
386 * coresponds to the software interrupt number.
389 int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev,
390 enum ps3_cpu_binding cpu, unsigned int *virq)
392 /* this should go in system-bus.c */
394 int result;
396 result = ps3_event_receive_port_setup(cpu, virq);
398 if (result)
399 return result;
401 result = lv1_connect_interrupt_event_receive_port(dev->bus_id,
402 dev->dev_id, virq_to_hw(*virq), dev->interrupt_id);
404 if (result) {
405 FAIL("%s:%d: lv1_connect_interrupt_event_receive_port"
406 " failed: %s\n", __func__, __LINE__,
407 ps3_result(result));
408 ps3_event_receive_port_destroy(*virq);
409 *virq = 0;
410 return result;
413 DBG("%s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__,
414 dev->interrupt_id, *virq);
416 return 0;
418 EXPORT_SYMBOL(ps3_sb_event_receive_port_setup);
420 int ps3_sb_event_receive_port_destroy(struct ps3_system_bus_device *dev,
421 unsigned int virq)
423 /* this should go in system-bus.c */
425 int result;
427 DBG(" -> %s:%d: interrupt_id %u, virq %u\n", __func__, __LINE__,
428 dev->interrupt_id, virq);
430 result = lv1_disconnect_interrupt_event_receive_port(dev->bus_id,
431 dev->dev_id, virq_to_hw(virq), dev->interrupt_id);
433 if (result)
434 FAIL("%s:%d: lv1_disconnect_interrupt_event_receive_port"
435 " failed: %s\n", __func__, __LINE__,
436 ps3_result(result));
438 result = ps3_event_receive_port_destroy(virq);
439 BUG_ON(result);
442 * ps3_event_receive_port_destroy() destroys the IRQ plug,
443 * so don't call ps3_irq_plug_destroy() here.
446 result = ps3_virq_destroy(virq);
447 BUG_ON(result);
449 DBG(" <- %s:%d\n", __func__, __LINE__);
450 return result;
452 EXPORT_SYMBOL(ps3_sb_event_receive_port_destroy);
455 * ps3_io_irq_setup - Setup a system bus io irq.
456 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
457 * serviced on.
458 * @interrupt_id: The device interrupt id read from the system repository.
459 * @virq: The assigned Linux virq.
461 * An io irq represents a non-virtualized device interrupt. interrupt_id
462 * coresponds to the interrupt number of the interrupt controller.
465 int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
466 unsigned int *virq)
468 int result;
469 u64 outlet;
471 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
473 if (result) {
474 FAIL("%s:%d: lv1_construct_io_irq_outlet failed: %s\n",
475 __func__, __LINE__, ps3_result(result));
476 return result;
479 result = ps3_irq_plug_setup(cpu, outlet, virq);
480 BUG_ON(result);
482 return result;
484 EXPORT_SYMBOL_GPL(ps3_io_irq_setup);
486 int ps3_io_irq_destroy(unsigned int virq)
488 int result;
489 unsigned long outlet = virq_to_hw(virq);
491 ps3_chip_mask(irq_get_irq_data(virq));
494 * lv1_destruct_io_irq_outlet() will destroy the IRQ plug,
495 * so call ps3_irq_plug_destroy() first.
498 result = ps3_irq_plug_destroy(virq);
499 BUG_ON(result);
501 result = lv1_destruct_io_irq_outlet(outlet);
503 if (result)
504 FAIL("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n",
505 __func__, __LINE__, ps3_result(result));
507 return result;
509 EXPORT_SYMBOL_GPL(ps3_io_irq_destroy);
512 * ps3_vuart_irq_setup - Setup the system virtual uart virq.
513 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
514 * serviced on.
515 * @virt_addr_bmp: The caller supplied virtual uart interrupt bitmap.
516 * @virq: The assigned Linux virq.
518 * The system supports only a single virtual uart, so multiple calls without
519 * freeing the interrupt will return a wrong state error.
522 int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
523 unsigned int *virq)
525 int result;
526 u64 outlet;
527 u64 lpar_addr;
529 BUG_ON(!is_kernel_addr((u64)virt_addr_bmp));
531 lpar_addr = ps3_mm_phys_to_lpar(__pa(virt_addr_bmp));
533 result = lv1_configure_virtual_uart_irq(lpar_addr, &outlet);
535 if (result) {
536 FAIL("%s:%d: lv1_configure_virtual_uart_irq failed: %s\n",
537 __func__, __LINE__, ps3_result(result));
538 return result;
541 result = ps3_irq_plug_setup(cpu, outlet, virq);
542 BUG_ON(result);
544 return result;
546 EXPORT_SYMBOL_GPL(ps3_vuart_irq_setup);
548 int ps3_vuart_irq_destroy(unsigned int virq)
550 int result;
552 ps3_chip_mask(irq_get_irq_data(virq));
553 result = lv1_deconfigure_virtual_uart_irq();
555 if (result) {
556 FAIL("%s:%d: lv1_configure_virtual_uart_irq failed: %s\n",
557 __func__, __LINE__, ps3_result(result));
558 return result;
561 result = ps3_irq_plug_destroy(virq);
562 BUG_ON(result);
564 return result;
566 EXPORT_SYMBOL_GPL(ps3_vuart_irq_destroy);
569 * ps3_spe_irq_setup - Setup an spe virq.
570 * @cpu: enum ps3_cpu_binding indicating the cpu the interrupt should be
571 * serviced on.
572 * @spe_id: The spe_id returned from lv1_construct_logical_spe().
573 * @class: The spe interrupt class {0,1,2}.
574 * @virq: The assigned Linux virq.
578 int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
579 unsigned int class, unsigned int *virq)
581 int result;
582 u64 outlet;
584 BUG_ON(class > 2);
586 result = lv1_get_spe_irq_outlet(spe_id, class, &outlet);
588 if (result) {
589 FAIL("%s:%d: lv1_get_spe_irq_outlet failed: %s\n",
590 __func__, __LINE__, ps3_result(result));
591 return result;
594 result = ps3_irq_plug_setup(cpu, outlet, virq);
595 BUG_ON(result);
597 return result;
600 int ps3_spe_irq_destroy(unsigned int virq)
602 int result;
604 ps3_chip_mask(irq_get_irq_data(virq));
606 result = ps3_irq_plug_destroy(virq);
607 BUG_ON(result);
609 return result;
613 #define PS3_INVALID_OUTLET ((irq_hw_number_t)-1)
614 #define PS3_PLUG_MAX 63
616 #if defined(DEBUG)
617 static void _dump_64_bmp(const char *header, const u64 *p, unsigned cpu,
618 const char* func, int line)
620 pr_debug("%s:%d: %s %u {%04llx_%04llx_%04llx_%04llx}\n",
621 func, line, header, cpu,
622 *p >> 48, (*p >> 32) & 0xffff, (*p >> 16) & 0xffff,
623 *p & 0xffff);
626 static void __maybe_unused _dump_256_bmp(const char *header,
627 const u64 *p, unsigned cpu, const char* func, int line)
629 pr_debug("%s:%d: %s %u {%016llx:%016llx:%016llx:%016llx}\n",
630 func, line, header, cpu, p[0], p[1], p[2], p[3]);
633 #define dump_bmp(_x) _dump_bmp(_x, __func__, __LINE__)
634 static void _dump_bmp(struct ps3_private* pd, const char* func, int line)
636 unsigned long flags;
638 spin_lock_irqsave(&pd->bmp_lock, flags);
639 _dump_64_bmp("stat", &pd->bmp.status, pd->thread_id, func, line);
640 _dump_64_bmp("mask", (u64*)&pd->bmp.mask, pd->thread_id, func, line);
641 spin_unlock_irqrestore(&pd->bmp_lock, flags);
644 #define dump_mask(_x) _dump_mask(_x, __func__, __LINE__)
645 static void __maybe_unused _dump_mask(struct ps3_private *pd,
646 const char* func, int line)
648 unsigned long flags;
650 spin_lock_irqsave(&pd->bmp_lock, flags);
651 _dump_64_bmp("mask", (u64*)&pd->bmp.mask, pd->thread_id, func, line);
652 spin_unlock_irqrestore(&pd->bmp_lock, flags);
654 #else
655 static void dump_bmp(struct ps3_private* pd) {};
656 #endif /* defined(DEBUG) */
658 static int ps3_host_map(struct irq_domain *h, unsigned int virq,
659 irq_hw_number_t hwirq)
661 DBG("%s:%d: hwirq %lu, virq %u\n", __func__, __LINE__, hwirq,
662 virq);
664 irq_set_chip_and_handler(virq, &ps3_irq_chip, handle_fasteoi_irq);
666 return 0;
669 static int ps3_host_match(struct irq_domain *h, struct device_node *np,
670 enum irq_domain_bus_token bus_token)
672 /* Match all */
673 return 1;
676 static const struct irq_domain_ops ps3_host_ops = {
677 .map = ps3_host_map,
678 .match = ps3_host_match,
681 void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
683 struct ps3_private *pd = &per_cpu(ps3_private, cpu);
685 set_bit(63 - virq, &pd->ipi_debug_brk_mask);
687 DBG("%s:%d: cpu %u, virq %u, mask %lxh\n", __func__, __LINE__,
688 cpu, virq, pd->ipi_debug_brk_mask);
691 void __init ps3_register_ipi_irq(unsigned int cpu, unsigned int virq)
693 struct ps3_private *pd = &per_cpu(ps3_private, cpu);
695 set_bit(63 - virq, &pd->ipi_mask);
697 DBG("%s:%d: cpu %u, virq %u, ipi_mask %lxh\n", __func__, __LINE__,
698 cpu, virq, pd->ipi_mask);
701 static unsigned int ps3_get_irq(void)
703 struct ps3_private *pd = this_cpu_ptr(&ps3_private);
704 u64 x = (pd->bmp.status & pd->bmp.mask);
705 unsigned int plug;
707 /* check for ipi break first to stop this cpu ASAP */
709 if (x & pd->ipi_debug_brk_mask)
710 x &= pd->ipi_debug_brk_mask;
712 asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x));
713 plug &= 0x3f;
715 if (unlikely(!plug)) {
716 DBG("%s:%d: no plug found: thread_id %llu\n", __func__,
717 __LINE__, pd->thread_id);
718 dump_bmp(&per_cpu(ps3_private, 0));
719 dump_bmp(&per_cpu(ps3_private, 1));
720 return 0;
723 #if defined(DEBUG)
724 if (unlikely(plug < NUM_ISA_INTERRUPTS || plug > PS3_PLUG_MAX)) {
725 dump_bmp(&per_cpu(ps3_private, 0));
726 dump_bmp(&per_cpu(ps3_private, 1));
727 BUG();
729 #endif
731 /* IPIs are EOIed here. */
733 if (test_bit(63 - plug, &pd->ipi_mask))
734 lv1_end_of_interrupt_ext(pd->ppe_id, pd->thread_id, plug);
736 return plug;
739 void __init ps3_init_IRQ(void)
741 int result;
742 unsigned cpu;
743 struct irq_domain *host;
745 host = irq_domain_add_nomap(NULL, PS3_PLUG_MAX + 1, &ps3_host_ops, NULL);
746 irq_set_default_host(host);
748 for_each_possible_cpu(cpu) {
749 struct ps3_private *pd = &per_cpu(ps3_private, cpu);
751 lv1_get_logical_ppe_id(&pd->ppe_id);
752 pd->thread_id = get_hard_smp_processor_id(cpu);
753 spin_lock_init(&pd->bmp_lock);
755 DBG("%s:%d: ppe_id %llu, thread_id %llu, bmp %lxh\n",
756 __func__, __LINE__, pd->ppe_id, pd->thread_id,
757 ps3_mm_phys_to_lpar(__pa(&pd->bmp)));
759 result = lv1_configure_irq_state_bitmap(pd->ppe_id,
760 pd->thread_id, ps3_mm_phys_to_lpar(__pa(&pd->bmp)));
762 if (result)
763 FAIL("%s:%d: lv1_configure_irq_state_bitmap failed:"
764 " %s\n", __func__, __LINE__,
765 ps3_result(result));
768 ppc_md.get_irq = ps3_get_irq;
771 void ps3_shutdown_IRQ(int cpu)
773 int result;
774 u64 ppe_id;
775 u64 thread_id = get_hard_smp_processor_id(cpu);
777 lv1_get_logical_ppe_id(&ppe_id);
778 result = lv1_configure_irq_state_bitmap(ppe_id, thread_id, 0);
780 DBG("%s:%d: lv1_configure_irq_state_bitmap (%llu:%llu/%d) %s\n", __func__,
781 __LINE__, ppe_id, thread_id, cpu, ps3_result(result));