From: Kristoffer E. <kri...@gm...> - 2007-07-24 11:24:09
|
Oki, this is where im at now. diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7709.c b/arch/sh/kernel/cpu/sh3/setup-sh7709.c index 086f8e2..e652f89 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7709.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7709.c @@ -80,66 +80,91 @@ static int __init sh7709_devices_setup(void) } __initcall(sh7709_devices_setup); -static struct ipr_data ipr_irq_table[] = { - { 16, 0, 12, 2 }, /* TMU TUNI0 */ - { 17, 0, 8, 4 }, /* TMU TUNI1 */ - { 18, 0, 4, 1 }, /* TMU TUNI1 */ - { 19, 0, 4, 1 }, /* TMU TUNI1 */ - { 20, 0, 0, 2 }, /* RTC CUI */ - { 21, 0, 0, 2 }, /* RTC CUI */ - { 22, 0, 0, 2 }, /* RTC CUI */ - - { 23, 1, 4, 3 }, /* SCI */ - { 24, 1, 4, 3 }, /* SCI */ - { 25, 1, 4, 3 }, /* SCI */ - { 26, 1, 4, 3 }, /* SCI */ - { 27, 1, 12, 3 }, /* WDT ITI */ - - { 32, 2, 0, 1 }, /* IRQ 0 */ - { 33, 2, 4, 1 }, /* IRQ 1 */ - { 34, 2, 8, 1 }, /* IRQ 2 APM */ - { 35, 2, 12, 1 }, /* IRQ 3 TOUCHSCREEN */ - - { 36, 3, 0, 1 }, /* IRQ 4 */ - { 37, 3, 4, 1 }, /* IRQ 5 */ - - { 48, 4, 12, 7 }, /* DMA */ - { 49, 4, 12, 7 }, /* DMA */ - { 50, 4, 12, 7 }, /* DMA */ - { 51, 4, 12, 7 }, /* DMA */ - - { 52, 4, 8, 3 }, /* IRDA */ - { 53, 4, 8, 3 }, /* IRDA */ - { 54, 4, 8, 3 }, /* IRDA */ - { 55, 4, 8, 3 }, /* IRDA */ - - { 56, 4, 4, 3 }, /* SCIF */ - { 57, 4, 4, 3 }, /* SCIF */ - { 58, 4, 4, 3 }, /* SCIF */ - { 59, 4, 4, 3 }, /* SCIF */ +enum { + UNUSED = 0; + + /* Interrupt Sources */ + IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, + PINT0, PINT8, + DMAC0, DMAC1, DMAC2, DMAC3, + IRDA_ERI, IRDA_RXI, IRDA_BRI, IRDA_TXI, + SCIF_ERI, SCIF_RXI, SCIF_BRI, SCIF_TXI, + ADC, + TMU0, TMU1, TMU2, TICPI2, + RTC_ATI, RTC_PRI, RTC_CUI, + SCI_ERI, SCI_RXI, SCI_TXI, SCI_TEI, + WDT_ITI, + BSC_RCMI, BSC_ROVI, + + /* Interrupt Groups */ + RTC, DMAC0123, }; -static unsigned long ipr_offsets[] = { - 0xfffffee2, /* 0: IPRA */ - 0xfffffee4, /* 1: IPRB */ - 0xa4000016, /* 2: IPRC */ - 0xa4000018, /* 3: IPRD */ - 0xa400001a, /* 4: IPRE */ +static struct intc_vect vectors[] = { + /* IRQ */ + INTC_VECT(IRQ0, 0x600), INTC_VECT(IRQ1, 0x620), + INTC_VECT(IRQ2, 0x640), INTC_VECT(IRQ3, 0x660), + INTC_VECT(IRQ4, 0x680), INTC_VECT(IRQ5, 0x6a0), + + /* PINT */ + INTC_VECT(PINT0, 0x700), INTC_VECT(PINT8, 0x720), + + /* DMAC */ + INTC_VECT(DMAC0, 0x800), INTC_VECT(DMAC1, 0x820), + INTC_VECT(DMAC2, 0x840), INTC_VECT(DMAC3, 0x860), + + /* IRDA / SCI1 */ + INTC_VECT(IRDA_ERI, 0x880), INTC_VECT(IRDA_RXI, 0x8a0), + INTC_VECT(IRDA_BRI, 0x8c0), INTC_VECT(IRDA_TXI, 0x8e0), + + /* SCIF / SCI2 */ + INTC_VECT(SCIF_ERI, 0x900), INTC_VECT(SCIF_RXI, 0x920), + INTC_VECT(SCIF_BRI, 0x940), INTC_VECT(SCIF_TXI, 0x960), + + /* ADC */ + INTC_VECT(ADC, 0x980), + + /* TMU */ + INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), + INTC_VECT(TMU2, 0x440), INTC_VECT(TICPI2, 0x460), + + /* RTC */ + INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), + INTC_VECT(RTC_CUI, 0x4c0), + + /* SCI */ + INTC_VECT(SCI_ERI, 0x4e0), INTC_VECT(SCI_RXI, 0x500), + INTC_VECT(SCI_TXI, 0x520), INTC_VECT(SCI_TEI, 0x540), + + /* WDT */ + INTC_VECT(WDT_ITI, 0x560), + + /* BSC - REF */ + INTC_VECT(BSC_RCMI, 0x580), INTC_VECT(BSC_ROVI, 0x5a0), }; -static struct ipr_desc ipr_irq_desc = { - .ipr_offsets = ipr_offsets, - .nr_offsets = ARRAY_SIZE(ipr_offsets), - - .ipr_data = ipr_irq_table, - .nr_irqs = ARRAY_SIZE(ipr_irq_table), +static struct intc_groups groups[] = { + INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI), + INTC_GROUP(DMAC0123, DMAC0, DMAC1, DMAC2, DMAC3), +}; - .chip = { - .name = "IPR-sh7709", - }, +static struct intc_prio_reg prio_registers[] = { + { 0xfffffee2, 16, 4,/* IPRA */ { RTC_ATI, RTC_PRI, RTC_CUI, + TMU0, TMU1, TMU2, TICPI2 }}, + { 0xfffffee4, 16, 4,/* IPRB */ { SCI_ERI, SCI_RXI, SCI_TXI, SCI_TEI, + WDT_ITI, BSC_RCMI, BSC_ROVI }}, + { 0xa4000016, 16, 4,/* IPRC */ { IRQ0, IRQ1, IRQ2, IRQ3 }}, + { 0xa4000018, 16, 4,/* IPRD */ { IRQ4, IRQ5, PINT0, PINT8 }}, + { 0xa400001a, 16, 4,/* IPRE */ { DMAC0, DMAC1, DMAC2, DMAC3, + IRDA_ERI, IRDA_RXI, IRDA_BRI, + IRDA_TXI, SCIF_ERI, SCIF_RXI, + IRDA_BRI, IRDA_TXI, }}, }; +static DECLARE_INTC_DESC(intc_desc, "sh7709", vectors, groups, priorities, + mask_registers, prio_registers, sense_registers); + void __init plat_irq_setup(void) { - register_ipr_controller(&ipr_irq_desc); + register_intc_controller(&intc_desc); } On Mon, 23 Jul 2007 15:00:54 +0900 "Magnus Damm" <mag...@gm...> wrote: > On 7/22/07, Paul Mundt <le...@li...> wrote: > > On Sat, Jul 21, 2007 at 11:08:27PM -0700, Kristoffer Ericson wrote: > > > Since fallout of make_ipr_irq Im not quite sure how to repair this for > > > pint irq's. Ive looked at the dma-sh solution but not sure if thats the > > > proper way to go. > > > > > At a quick glance, PINT seems to use a couple of IPR IRQs for cascade, > > with the bulk of the logic in the demux. In this case, you're going to > > want to make sure that your CPU includes those PINT vectors in its IPR > > map, and then set up chained handlers for both where the PINT demux kicks > > in as normal. > > > > None of that should be terribly difficult, though you are going to want > > to convert your CPU subtype to the new INTC that Magnus wrote, he might > > be able to give you some more input if you run in to some barriers doing > > the conversion. > > I'd be happy to convert the 7709 setup code to work with the new intc > handler. And after that I can build pint support on top of intc as > well. This needs to be tested though and I don't have any 7709 > hardware around. So if anyone could help out testing things that would > be great. That would at least solve the issue of converting the 7709 > setup code to intc. > > But maybe hp6xx hardware isn't enough to test pint. I wonder if it is > using the pint interrupts at all. Hacking up pint support for a board > that doesn't use it seems the wrong way to go... > > The only board-specific irq constants that i can find being used on > hp6xx seem to be located in hp6xx.h except for the IRQ number for > hd644661 which is located in the config file as CONFIG_HD64461_IRQ=36. > These values all seem to map to IRQ pins. The irq number 93 otoh, it > is associated with the pata_platform setup data in > arch/sh/boards/hp6xx/setup.c and that is pretty close to PINT_IRQ_BASE > which seems to be set to 86. So maybe we have a pint interrupt there > after all... > > Kristoffer, do you have hp6xx hardware and some time for testing? > > Thanks! > > / magnus -- Kristoffer Ericson <Kri...@Gm...> |