Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181169
b: refs/heads/master
c: c7a9672
h: refs/heads/master
i:
  181167: 9bee39c
v: v3
  • Loading branch information
Paul Mundt committed Feb 2, 2010
1 parent a3f4d72 commit 87a5a50
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9867c569970d8afb4b882bafbbe81426bd46333
refs/heads/master: c7a967273a539a9a38413753c58125e777e2d30d
2 changes: 1 addition & 1 deletion trunk/arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ config GUSA_RB
config SPARSE_IRQ
def_bool y
depends on SUPERH32 && !SH_DREAMCAST && !SH_HIGHLANDER && \
!SH_RTS7751R2D && !HD64461 && !SH_7724_SOLUTION_ENGINE
!SH_RTS7751R2D && !HD64461
help
This enables support for sparse irqs. This is useful in general
as most CPUs have a fairly sparse array of IRQ vectors, which
Expand Down
38 changes: 27 additions & 11 deletions trunk/arch/sh/boards/mach-se/7724/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,15 @@ static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
{
struct fpga_irq set = get_fpga_irq(irq);
unsigned short intv = __raw_readw(set.sraddr);
struct irq_desc *ext_desc;
unsigned int ext_irq = set.base;

intv &= set.mask;

while (intv) {
if (intv & 0x0001) {
ext_desc = irq_desc + ext_irq;
handle_level_irq(ext_irq, ext_desc);
}
intv >>= 1;
ext_irq++;
for (; intv; intv >>= 1, ext_irq++) {
if (!(intv & 1))
continue;

generic_handle_irq(ext_irq);
}
}

Expand All @@ -113,7 +110,7 @@ static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
*/
void __init init_se7724_IRQ(void)
{
int i;
int i, nid = cpu_to_node(boot_cpu_data);

__raw_writew(0xffff, IRQ0_MR); /* mask all */
__raw_writew(0xffff, IRQ1_MR); /* mask all */
Expand All @@ -123,10 +120,29 @@ void __init init_se7724_IRQ(void)
__raw_writew(0x0000, IRQ2_SR); /* clear irq */
__raw_writew(0x002a, IRQ_MODE); /* set irq type */

for (i = 0; i < SE7724_FPGA_IRQ_NR; i++)
set_irq_chip_and_handler_name(SE7724_FPGA_IRQ_BASE + i,
for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) {
int irq, wanted;

wanted = SE7724_FPGA_IRQ_BASE + i;

irq = create_irq_nr(wanted, nid);
if (unlikely(irq == 0)) {
pr_err("%s: failed hooking irq %d for FPGA\n",
__func__, wanted);
return;
}

if (unlikely(irq != wanted)) {
pr_err("%s: got irq %d but wanted %d, bailing.\n",
__func__, irq, wanted);
destroy_irq(irq);
return;
}

set_irq_chip_and_handler_name(irq,
&se7724_irq_chip,
handle_level_irq, "level");
}

set_irq_chained_handler(IRQ0_IRQ, se7724_irq_demux);
set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
Expand Down

0 comments on commit 87a5a50

Please sign in to comment.