From: Mark A. Greer <hidden> Date: 2006-06-19 20:08:11
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
Signed-off-by: Mark A. Greer <redacted>
--
arch/powerpc/sysdev/mpic.c | 6 ++++++
include/asm-powerpc/mpic.h | 2 ++
2 files changed, 8 insertions(+)
--
@@ -629,6 +629,12 @@ #endif /* CONFIG_SMP */mb();}+/* For serial interrupts & set clock ratio */+if(flags&MPIC_SERIAL_MODE)+mpic_write(mpic->gregs,MPIC_GREG_GLOBAL_CONF_1,+mpic_read(mpic->gregs,MPIC_GREG_GLOBAL_CONF_1)+|(1<<27)|(0x7<<28));+/* Read feature register, calculate num CPUs and, for non-ISU*MPICs,numsourcesaswell.OnISUMPICs,sourcesarecounted*asISUsareadded
From: Olof Johansson <hidden> Date: 2006-06-19 20:11:21
Hi,
On Mon, Jun 19, 2006 at 01:08:11PM -0700, Mark A. Greer wrote:
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
[...]
+ /* For serial interrupts & set clock ratio */
+ if (flags & MPIC_SERIAL_MODE)
+ mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1,
+ mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1)
+ | (1<<27) | (0x7<<28));
Can you define some constants so others can see just what the bits mean
without digging up documentation, instead of just doing magic numbers?
MPIC_GREG_GLOBAL_CONF_0 already does so; you can copy the style from
there.
Thanks,
-Olof
From: Mark A. Greer <hidden> Date: 2006-06-19 22:03:48
[This patch completely replaces the previous patch.]
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
Signed-off-by: Mark A. Greer <redacted>
--
arch/powerpc/sysdev/mpic.c | 8 ++++++++
include/asm-powerpc/mpic.h | 5 +++++
2 files changed, 13 insertions(+)
--
@@ -629,6 +629,14 @@ #endif /* CONFIG_SMP */mb();}+/* For serial interrupts & set clock ratio */+if(flags&MPIC_SERIAL_MODE)+mpic_write(mpic->gregs,MPIC_GREG_GLOBAL_CONF_1,+(mpic_read(mpic->gregs,MPIC_GREG_GLOBAL_CONF_1)+&~MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK)+|MPIC_GREG_GLOBAL_CONF_1_SIE+|MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(7));+/* Read feature register, calculate num CPUs and, for non-ISU*MPICs,numsourcesaswell.OnISUMPICs,sourcesarecounted*asISUsareadded
Can you define some constants so others can see just what the bits
mean
without digging up documentation, instead of just doing magic numbers?
[my favourite argument :-) ]
You'll have to read the documentation to properly understand what
the bit patterns mean anyway. And if you use symbolic names, you
only add another step: hunting through header files.
MPIC_GREG_GLOBAL_CONF_0 already does so; you can copy the style from
there.
...but yeah, definitely, mixing styles is at least as bad.
Segher
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2006-06-20 04:01:26
On Mon, 2006-06-19 at 13:08 -0700, Mark A. Greer wrote:
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
You hard code the clock ratio... why not add a separate call to be
called after mpic_init,
something like mpic_set_serial_int(int mpic, int enable, int
clock_ratio) ?
Ben.
quoted hunk
Signed-off-by: Mark A. Greer <redacted>
--
arch/powerpc/sysdev/mpic.c | 6 ++++++
include/asm-powerpc/mpic.h | 2 ++
2 files changed, 8 insertions(+)
--
@@ -629,6 +629,12 @@ #endif /* CONFIG_SMP */mb();}+/* For serial interrupts & set clock ratio */+if(flags&MPIC_SERIAL_MODE)+mpic_write(mpic->gregs,MPIC_GREG_GLOBAL_CONF_1,+mpic_read(mpic->gregs,MPIC_GREG_GLOBAL_CONF_1)+|(1<<27)|(0x7<<28));+/* Read feature register, calculate num CPUs and, for non-ISU*MPICs,numsourcesaswell.OnISUMPICs,sourcesarecounted*asISUsareadded
From: Mark A. Greer <hidden> Date: 2006-06-20 16:37:24
On Tue, Jun 20, 2006 at 02:01:26PM +1000, Benjamin Herrenschmidt wrote:
On Mon, 2006-06-19 at 13:08 -0700, Mark A. Greer wrote:
quoted
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
You hard code the clock ratio...
Basically, I just brought what was already in ppc over to powerpc.
I didn't really think about it much.
why not add a separate call to be called after mpic_init,
something like mpic_set_serial_int(int mpic, int enable, int
clock_ratio) ?
Yeah, that's a better way to do it.
I'll make a new patch.
Mark
From: Mark A. Greer <hidden> Date: 2006-06-20 21:15:36
On Tue, Jun 20, 2006 at 02:01:26PM +1000, Benjamin Herrenschmidt wrote:
On Mon, 2006-06-19 at 13:08 -0700, Mark A. Greer wrote:
quoted
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
You hard code the clock ratio... why not add a separate call to be
called after mpic_init,
something like mpic_set_serial_int(int mpic, int enable, int
clock_ratio) ?
How's this?
--
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
Signed-off-by: Mark A. Greer <redacted>
--
arch/powerpc/sysdev/mpic.c | 20 ++++++++++++++++++++
include/asm-powerpc/mpic.h | 10 ++++++++++
2 files changed, 30 insertions(+)
--
@@ -284,6 +288,12 @@ extern int mpic_get_one_irq(struct mpic /* This one gets to the primary mpic */externintmpic_get_irq(structpt_regs*regs);+/* Set the EPIC clock ratio */+voidmpic_set_clk_ratio(structmpic*mpic,u32clock_ratio);++/* Enable/Disable EPIC serial interrupt mode */+voidmpic_set_serial_int(structmpic*mpic,intenable);+/* global mpic for pSeries */externstructmpic*pSeries_mpic;
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2006-06-20 22:04:20
On Tue, 2006-06-20 at 14:15 -0700, Mark A. Greer wrote:
On Tue, Jun 20, 2006 at 02:01:26PM +1000, Benjamin Herrenschmidt wrote:
quoted
On Mon, 2006-06-19 at 13:08 -0700, Mark A. Greer wrote:
quoted
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
You hard code the clock ratio... why not add a separate call to be
called after mpic_init,
something like mpic_set_serial_int(int mpic, int enable, int
clock_ratio) ?
How's this?
Looks good to me.
Ben.
quoted hunk
--
MPC10x-style interrupt controllers have a serial mode that allows
several interrupts to be clocked in through one INT signal.
This patch adds the software support for that mode.
Signed-off-by: Mark A. Greer <redacted>
--
arch/powerpc/sysdev/mpic.c | 20 ++++++++++++++++++++
include/asm-powerpc/mpic.h | 10 ++++++++++
2 files changed, 30 insertions(+)
--
@@ -284,6 +288,12 @@ extern int mpic_get_one_irq(struct mpic /* This one gets to the primary mpic */externintmpic_get_irq(structpt_regs*regs);+/* Set the EPIC clock ratio */+voidmpic_set_clk_ratio(structmpic*mpic,u32clock_ratio);++/* Enable/Disable EPIC serial interrupt mode */+voidmpic_set_serial_int(structmpic*mpic,intenable);+/* global mpic for pSeries */externstructmpic*pSeries_mpic;
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2006-06-21 01:12:36
On Tue, 2006-06-20 at 00:35 +0200, Segher Boessenkool wrote:
quoted
Can you define some constants so others can see just what the bits
mean
without digging up documentation, instead of just doing magic numbers?
[my favourite argument :-) ]
You'll have to read the documentation to properly understand what
the bit patterns mean anyway. And if you use symbolic names, you
only add another step: hunting through header files.
Sure, that's why we should remove every symbolic constant in every
driver anywhere in the kernel right ? Sure would help.
Ben.