summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/fsl_msi.h
diff options
context:
space:
mode:
authorTudor Laurentiu <b10716@freescale.com>2014-08-21 12:33:53 +0300
committerScott Wood <scottwood@freescale.com>2014-09-04 18:51:45 -0500
commitc822e73731fce3b49a4887140878d084d8a44c08 (patch)
tree5ad4eccb8fb9e033eb3b379d7060bb6f6e86b2ba /arch/powerpc/sysdev/fsl_msi.h
parentde99f53d3af0e1bb9bc6c9e3107d72f3af6e05e9 (diff)
downloadlinux-stable-c822e73731fce3b49a4887140878d084d8a44c08.tar.gz
linux-stable-c822e73731fce3b49a4887140878d084d8a44c08.tar.bz2
linux-stable-c822e73731fce3b49a4887140878d084d8a44c08.zip
powerpc/fsl_msi: spread msi ints across different MSIRs
Allocate msis such that each time a new interrupt is requested, the SRS (MSIR register select) to be used is allocated in a round-robin fashion. The end result is that the msi interrupts will be spread across distinct MSIRs with the main benefit that now users can set affinity to each msi int through the mpic irq backing up the MSIR register. This is achieved with the help of a newly introduced msi bitmap api that allows specifying the starting point when searching for a free msi interrupt. Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com> Cc: Scott Wood <scottwood@freescale.com> Cc: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/sysdev/fsl_msi.h')
-rw-r--r--arch/powerpc/sysdev/fsl_msi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h
index 420cfcbdac01..50ec4b04c732 100644
--- a/arch/powerpc/sysdev/fsl_msi.h
+++ b/arch/powerpc/sysdev/fsl_msi.h
@@ -15,6 +15,7 @@
#include <linux/of.h>
#include <asm/msi_bitmap.h>
+#include <asm/atomic.h>
#define NR_MSI_REG_MSIIR 8 /* MSIIR can index 8 MSI registers */
#define NR_MSI_REG_MSIIR1 16 /* MSIIR1 can index 16 MSI registers */
@@ -27,6 +28,8 @@
#define FSL_PIC_IP_IPIC 0x00000002
#define FSL_PIC_IP_VMPIC 0x00000003
+#define FSL_PIC_FTR_MPIC_4_3 0x00000010
+
struct fsl_msi_cascade_data;
struct fsl_msi {
@@ -37,6 +40,8 @@ struct fsl_msi {
u32 msiir_offset; /* Offset of MSIIR, relative to start of CCSR */
u32 ibs_shift; /* Shift of interrupt bit select */
u32 srs_shift; /* Shift of the shared interrupt register select */
+ u32 msir_num; /* Number of available MSIR regs */
+ atomic_t msi_alloc_cnt; /* Counter for MSI hwirq allocations */
void __iomem *msi_regs;
u32 feature;
struct fsl_msi_cascade_data *cascade_array[NR_MSI_REG_MAX];