Skip to content

Commit

Permalink
[PATCH] powerpc: Move xics.[ch] into platforms/pseries
Browse files Browse the repository at this point in the history
This patch moves the XICS interrupt controller code into the
platforms/pseries directory, since it only appears on pSeries
machines.  If it ever appears on some other machine we can move it to
sysdev, although xics.c itself will need a bunch of changes in that
case to remove pSeries specific assumptions.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
David Gibson authored and Paul Mackerras committed Oct 28, 2005
1 parent 22b2803 commit 007e8f5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/platforms/pseries/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \
setup.o iommu.o rtas-fw.o ras.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_IBMVIO) += vio.o
obj-$(CONFIG_XICS) += xics.o
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include <asm/time.h>
#include <asm/nvram.h>
#include <asm/plpar_wrappers.h>
#include <asm/xics.h>
#include "xics.h"
#include <asm/firmware.h>
#include <asm/pmc.h>
#include <asm/mpic.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <asm/paca.h>
#include <asm/time.h>
#include <asm/machdep.h>
#include <asm/xics.h>
#include "xics.h"
#include <asm/cputable.h>
#include <asm/firmware.h>
#include <asm/system.h>
Expand Down
25 changes: 13 additions & 12 deletions arch/ppc64/kernel/xics.c → arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* arch/ppc64/kernel/xics.c
/*
* arch/powerpc/platforms/pseries/xics.c
*
* Copyright 2000 IBM Corporation.
*
Expand All @@ -25,11 +25,12 @@
#include <asm/pgtable.h>
#include <asm/smp.h>
#include <asm/rtas.h>
#include <asm/xics.h>
#include <asm/hvcall.h>
#include <asm/machdep.h>
#include <asm/i8259.h>

#include "xics.h"

static unsigned int xics_startup(unsigned int irq);
static void xics_enable_irq(unsigned int irq);
static void xics_disable_irq(unsigned int irq);
Expand Down Expand Up @@ -61,7 +62,7 @@ static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC);
/* Want a priority other than 0. Various HW issues require this. */
#define DEFAULT_PRIORITY 5

/*
/*
* Mark IPIs as higher priority so we can take them inside interrupts that
* arent marked SA_INTERRUPT
*/
Expand Down Expand Up @@ -168,11 +169,11 @@ static inline long plpar_xirr(unsigned long *xirr_ret)
static int pSeriesLP_xirr_info_get(int n_cpu)
{
unsigned long lpar_rc;
unsigned long return_value;
unsigned long return_value;

lpar_rc = plpar_xirr(&return_value);
if (lpar_rc != H_Success)
panic(" bad return code xirr - rc = %lx \n", lpar_rc);
panic(" bad return code xirr - rc = %lx \n", lpar_rc);
return (int)return_value;
}

Expand All @@ -184,7 +185,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
lpar_rc = plpar_eoi(val64);
if (lpar_rc != H_Success)
panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
val64);
val64);
}

void pSeriesLP_cppr_info(int n_cpu, u8 value)
Expand All @@ -193,7 +194,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value)

lpar_rc = plpar_cppr(value);
if (lpar_rc != H_Success)
panic("bad return code cppr - rc = %lx\n", lpar_rc);
panic("bad return code cppr - rc = %lx\n", lpar_rc);
}

static void pSeriesLP_qirr_info(int n_cpu , u8 value)
Expand All @@ -202,7 +203,7 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value)

lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
if (lpar_rc != H_Success)
panic("bad return code qirr - rc = %lx\n", lpar_rc);
panic("bad return code qirr - rc = %lx\n", lpar_rc);
}

xics_ops pSeriesLP_ops = {
Expand Down Expand Up @@ -461,7 +462,7 @@ void xics_init_IRQ(void)
struct xics_interrupt_node {
unsigned long addr;
unsigned long size;
} intnodes[NR_CPUS];
} intnodes[NR_CPUS];

ppc64_boot_msg(0x20, "XICS Init");

Expand All @@ -486,7 +487,7 @@ void xics_init_IRQ(void)
ireg = (uint *)get_property(np, "reg", &ilen);
if (!ireg)
panic("xics_init_IRQ: can't find interrupt reg property");

while (ilen) {
intnodes[indx].addr = (unsigned long)*ireg++ << 32;
ilen -= sizeof(uint);
Expand Down Expand Up @@ -554,7 +555,7 @@ void xics_init_IRQ(void)
continue;

hard_id = get_hard_smp_processor_id(i);
xics_per_cpu[i] = ioremap(intnodes[hard_id].addr,
xics_per_cpu[i] = ioremap(intnodes[hard_id].addr,
intnodes[hard_id].size);
}
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* arch/ppc64/kernel/xics.h
/*
* arch/powerpc/platforms/pseries/xics.h
*
* Copyright 2000 IBM Corporation.
*
Expand All @@ -9,8 +9,8 @@
* 2 of the License, or (at your option) any later version.
*/

#ifndef _PPC64_KERNEL_XICS_H
#define _PPC64_KERNEL_XICS_H
#ifndef _POWERPC_KERNEL_XICS_H
#define _POWERPC_KERNEL_XICS_H

#include <linux/cache.h>

Expand All @@ -31,4 +31,4 @@ struct xics_ipi_struct {

extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;

#endif /* _PPC64_KERNEL_XICS_H */
#endif /* _POWERPC_KERNEL_XICS_H */
2 changes: 0 additions & 2 deletions arch/ppc64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ obj-$(CONFIG_BOOTX_TEXT) += btext.o
endif
obj-$(CONFIG_HVCS) += hvcserver.o

obj-$(CONFIG_XICS) += xics.o

obj-$(CONFIG_PPC_PMAC) += udbg_scc.o

obj-$(CONFIG_PPC_MAPLE) += maple_setup.o maple_pci.o maple_time.o \
Expand Down

0 comments on commit 007e8f5

Please sign in to comment.