aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/xics/ics-rtas.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2011-04-14 18:31:59 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-20 03:01:20 -0400
commit5ca123760177ed16cbd9bab609bff69eb8fc45bd (patch)
tree45a054edd05fc06924e4a62e559ebee79f08efcd /arch/powerpc/sysdev/xics/ics-rtas.c
parentab814b938d1d372bd2ac6268c15d4e0e6a5245c4 (diff)
powerpc/xics: Move irq_host matching into the ics backend
An upcoming new ics backend will need to implement different matching semantics to the current ones, which are essentially the RTAS ics backends. So move the current match into the RTAS backend, and allow other ics backends to override. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/xics/ics-rtas.c')
-rw-r--r--arch/powerpc/sysdev/xics/ics-rtas.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/xics/ics-rtas.c b/arch/powerpc/sysdev/xics/ics-rtas.c
index 5b3ee387e89d..610c148fedcc 100644
--- a/arch/powerpc/sysdev/xics/ics-rtas.c
+++ b/arch/powerpc/sysdev/xics/ics-rtas.c
@@ -26,12 +26,14 @@ static int ibm_int_off;
26static int ics_rtas_map(struct ics *ics, unsigned int virq); 26static int ics_rtas_map(struct ics *ics, unsigned int virq);
27static void ics_rtas_mask_unknown(struct ics *ics, unsigned long vec); 27static void ics_rtas_mask_unknown(struct ics *ics, unsigned long vec);
28static long ics_rtas_get_server(struct ics *ics, unsigned long vec); 28static long ics_rtas_get_server(struct ics *ics, unsigned long vec);
29static int ics_rtas_host_match(struct ics *ics, struct device_node *node);
29 30
30/* Only one global & state struct ics */ 31/* Only one global & state struct ics */
31static struct ics ics_rtas = { 32static struct ics ics_rtas = {
32 .map = ics_rtas_map, 33 .map = ics_rtas_map,
33 .mask_unknown = ics_rtas_mask_unknown, 34 .mask_unknown = ics_rtas_mask_unknown,
34 .get_server = ics_rtas_get_server, 35 .get_server = ics_rtas_get_server,
36 .host_match = ics_rtas_host_match,
35}; 37};
36 38
37static void ics_rtas_unmask_irq(struct irq_data *d) 39static void ics_rtas_unmask_irq(struct irq_data *d)
@@ -202,6 +204,15 @@ static long ics_rtas_get_server(struct ics *ics, unsigned long vec)
202 return status[0]; 204 return status[0];
203} 205}
204 206
207static int ics_rtas_host_match(struct ics *ics, struct device_node *node)
208{
209 /* IBM machines have interrupt parents of various funky types for things
210 * like vdevices, events, etc... The trick we use here is to match
211 * everything here except the legacy 8259 which is compatible "chrp,iic"
212 */
213 return !of_device_is_compatible(node, "chrp,iic");
214}
215
205int ics_rtas_init(void) 216int ics_rtas_init(void)
206{ 217{
207 ibm_get_xive = rtas_token("ibm,get-xive"); 218 ibm_get_xive = rtas_token("ibm,get-xive");