Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36307
b: refs/heads/master
c: 8599cf0
h: refs/heads/master
i:
  36305: 6923eee
  36303: 477f105
v: v3
  • Loading branch information
Paul Mundt committed Sep 27, 2006
1 parent b7b045d commit cf6c40d
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 157 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: ba463937ef75bceaf3943edf01f849257c68623a
refs/heads/master: 8599cf059209de22dd3be16816b90f1aad10c74a
47 changes: 17 additions & 30 deletions trunk/arch/sh/boards/bigsur/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* IRQ functions for a Hitachi Big Sur Evaluation Board.
*
*/
#undef DEBUG

#include <linux/sched.h>
#include <linux/module.h>
Expand All @@ -41,10 +42,8 @@
#undef BIGSUR_DEBUG

#ifdef BIGSUR_DEBUG
#define DPRINTK(args...) printk(args)
#define DIPRINTK(n, args...) if (BIGSUR_DEBUG>(n)) printk(args)
#else
#define DPRINTK(args...)
#define DIPRINTK(n, args...)
#endif /* BIGSUR_DEBUG */

Expand All @@ -60,45 +59,39 @@ extern int hd64465_irq_demux(int irq);
/* Level 1 IRQ routines */
static void disable_bigsur_l1irq(unsigned int irq)
{
unsigned long flags;
unsigned char mask;
unsigned int mask_port = ((irq - BIGSUR_IRQ_LOW)/8) ? BIGSUR_IRLMR1 : BIGSUR_IRLMR0;
unsigned char bit = (1 << ((irq - MGATE_IRQ_LOW)%8) );

if(irq >= BIGSUR_IRQ_LOW && irq < BIGSUR_IRQ_HIGH) {
DPRINTK("Disable L1 IRQ %d\n", irq);
pr_debug("Disable L1 IRQ %d\n", irq);
DIPRINTK(2,"disable_bigsur_l1irq: IMR=0x%08x mask=0x%x\n",
mask_port, bit);
local_irq_save(flags);

/* Disable IRQ - set mask bit */
mask = inb(mask_port) | bit;
outb(mask, mask_port);
local_irq_restore(flags);
return;
}
DPRINTK("disable_bigsur_l1irq: Invalid IRQ %d\n", irq);
pr_debug("disable_bigsur_l1irq: Invalid IRQ %d\n", irq);
}

static void enable_bigsur_l1irq(unsigned int irq)
{
unsigned long flags;
unsigned char mask;
unsigned int mask_port = ((irq - BIGSUR_IRQ_LOW)/8) ? BIGSUR_IRLMR1 : BIGSUR_IRLMR0;
unsigned char bit = (1 << ((irq - MGATE_IRQ_LOW)%8) );

if(irq >= BIGSUR_IRQ_LOW && irq < BIGSUR_IRQ_HIGH) {
DPRINTK("Enable L1 IRQ %d\n", irq);
pr_debug("Enable L1 IRQ %d\n", irq);
DIPRINTK(2,"enable_bigsur_l1irq: IMR=0x%08x mask=0x%x\n",
mask_port, bit);
local_irq_save(flags);
/* Enable L1 IRQ - clear mask bit */
mask = inb(mask_port) & ~bit;
outb(mask, mask_port);
local_irq_restore(flags);
return;
}
DPRINTK("enable_bigsur_l1irq: Invalid IRQ %d\n", irq);
pr_debug("enable_bigsur_l1irq: Invalid IRQ %d\n", irq);
}


Expand Down Expand Up @@ -126,51 +119,45 @@ static const u32 imr_offset = BIGSUR_IMR0 - BIGSUR_IMR1;
/* Level 2 IRQ routines */
static void disable_bigsur_l2irq(unsigned int irq)
{
unsigned long flags;
unsigned char mask;
unsigned char bit = 1 << ((irq-BIGSUR_2NDLVL_IRQ_LOW)%8);
unsigned int mask_port = imr_base - REG_NUM(irq)*imr_offset;

if(irq >= BIGSUR_2NDLVL_IRQ_LOW && irq < BIGSUR_2NDLVL_IRQ_HIGH) {
DPRINTK("Disable L2 IRQ %d\n", irq);
if(irq >= BIGSUR_2NDLVL_IRQ_LOW && irq < BIGSUR_2NDLVL_IRQ_HIGH) {
pr_debug("Disable L2 IRQ %d\n", irq);
DIPRINTK(2,"disable_bigsur_l2irq: IMR=0x%08x mask=0x%x\n",
mask_port, bit);
local_irq_save(flags);

/* Disable L2 IRQ - set mask bit */
mask = inb(mask_port) | bit;
outb(mask, mask_port);
local_irq_restore(flags);
return;
}
DPRINTK("disable_bigsur_l2irq: Invalid IRQ %d\n", irq);
pr_debug("disable_bigsur_l2irq: Invalid IRQ %d\n", irq);
}

static void enable_bigsur_l2irq(unsigned int irq)
{
unsigned long flags;
unsigned char mask;
unsigned char bit = 1 << ((irq-BIGSUR_2NDLVL_IRQ_LOW)%8);
unsigned int mask_port = imr_base - REG_NUM(irq)*imr_offset;

if(irq >= BIGSUR_2NDLVL_IRQ_LOW && irq < BIGSUR_2NDLVL_IRQ_HIGH) {
DPRINTK("Enable L2 IRQ %d\n", irq);
if(irq >= BIGSUR_2NDLVL_IRQ_LOW && irq < BIGSUR_2NDLVL_IRQ_HIGH) {
pr_debug("Enable L2 IRQ %d\n", irq);
DIPRINTK(2,"enable_bigsur_l2irq: IMR=0x%08x mask=0x%x\n",
mask_port, bit);
local_irq_save(flags);

/* Enable L2 IRQ - clear mask bit */
mask = inb(mask_port) & ~bit;
outb(mask, mask_port);
local_irq_restore(flags);
return;
}
DPRINTK("enable_bigsur_l2irq: Invalid IRQ %d\n", irq);
pr_debug("enable_bigsur_l2irq: Invalid IRQ %d\n", irq);
}

static void mask_and_ack_bigsur(unsigned int irq)
{
DPRINTK("mask_and_ack_bigsur IRQ %d\n", irq);
pr_debug("mask_and_ack_bigsur IRQ %d\n", irq);
if(irq >= BIGSUR_IRQ_LOW && irq < BIGSUR_IRQ_HIGH)
disable_bigsur_l1irq(irq);
else
Expand All @@ -179,7 +166,7 @@ static void mask_and_ack_bigsur(unsigned int irq)

static void end_bigsur_irq(unsigned int irq)
{
DPRINTK("end_bigsur_irq IRQ %d\n", irq);
pr_debug("end_bigsur_irq IRQ %d\n", irq);
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
if(irq >= BIGSUR_IRQ_LOW && irq < BIGSUR_IRQ_HIGH)
enable_bigsur_l1irq(irq);
Expand All @@ -193,7 +180,7 @@ static unsigned int startup_bigsur_irq(unsigned int irq)
u8 mask;
u32 reg;

DPRINTK("startup_bigsur_irq IRQ %d\n", irq);
pr_debug("startup_bigsur_irq IRQ %d\n", irq);

if(irq >= BIGSUR_IRQ_LOW && irq < BIGSUR_IRQ_HIGH) {
/* Enable the L1 IRQ */
Expand All @@ -218,7 +205,7 @@ static unsigned int startup_bigsur_irq(unsigned int irq)

static void shutdown_bigsur_irq(unsigned int irq)
{
DPRINTK("shutdown_bigsur_irq IRQ %d\n", irq);
pr_debug("shutdown_bigsur_irq IRQ %d\n", irq);
if(irq >= BIGSUR_IRQ_LOW && irq < BIGSUR_IRQ_HIGH)
disable_bigsur_l1irq(irq);
else
Expand Down Expand Up @@ -260,7 +247,7 @@ static void make_bigsur_l1isr(unsigned int irq) {
disable_bigsur_l1irq(irq);
return;
}
DPRINTK("make_bigsur_l1isr: bad irq, %d\n", irq);
pr_debug("make_bigsur_l1isr: bad irq, %d\n", irq);
return;
}

Expand All @@ -277,7 +264,7 @@ static void make_bigsur_l2isr(unsigned int irq) {
disable_bigsur_l2irq(irq);
return;
}
DPRINTK("make_bigsur_l2isr: bad irq, %d\n", irq);
pr_debug("make_bigsur_l2isr: bad irq, %d\n", irq);
return;
}

Expand Down
7 changes: 0 additions & 7 deletions trunk/arch/sh/boards/dreamcast/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/

#include <linux/irq.h>

#include <asm/io.h>
#include <asm/irq.h>
#include <asm/dreamcast/sysasic.h>
Expand Down Expand Up @@ -57,29 +56,23 @@
/* Disable the hardware event by masking its bit in its EMR */
static inline void disable_systemasic_irq(unsigned int irq)
{
unsigned long flags;
__u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
__u32 mask;

local_irq_save(flags);
mask = inl(emr);
mask &= ~(1 << EVENT_BIT(irq));
outl(mask, emr);
local_irq_restore(flags);
}

/* Enable the hardware event by setting its bit in its EMR */
static inline void enable_systemasic_irq(unsigned int irq)
{
unsigned long flags;
__u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2);
__u32 mask;

local_irq_save(flags);
mask = inl(emr);
mask |= (1 << EVENT_BIT(irq));
outl(mask, emr);
local_irq_restore(flags);
}

/* Acknowledge a hardware event by writing its bit back to its ESR */
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/sh/boards/landisk/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,24 @@ static unsigned int startup_landisk_irq(unsigned int irq)

static void disable_landisk_irq(unsigned int irq)
{
unsigned long flags;
unsigned char val;
unsigned char mask = 0xff ^ (0x01 << (irq - 5));

/* Set the priority in IPR to 0 */
local_irq_save(flags);
val = ctrl_inb(PA_IMASK);
val &= mask;
ctrl_outb(val, PA_IMASK);
local_irq_restore(flags);
}

static void enable_landisk_irq(unsigned int irq)
{
unsigned long flags;
unsigned char val;
unsigned char value = (0x01 << (irq - 5));

/* Set priority in IPR back to original value */
local_irq_save(flags);
val = ctrl_inb(PA_IMASK);
val |= value;
ctrl_outb(val, PA_IMASK);
local_irq_restore(flags);
}

static void ack_landisk_irq(unsigned int irq)
Expand Down
14 changes: 0 additions & 14 deletions trunk/arch/sh/boards/mpc1211/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,34 +80,25 @@ volatile unsigned long irq_err_count;

static void disable_mpc1211_irq(unsigned int irq)
{
unsigned long flags;

save_and_cli(flags);
if( irq < 8) {
m_irq_mask |= (1 << irq);
outb(m_irq_mask,I8259_M_MR);
} else {
s_irq_mask |= (1 << (irq - 8));
outb(s_irq_mask,I8259_S_MR);
}
restore_flags(flags);

}

static void enable_mpc1211_irq(unsigned int irq)
{
unsigned long flags;

save_and_cli(flags);

if( irq < 8) {
m_irq_mask &= ~(1 << irq);
outb(m_irq_mask,I8259_M_MR);
} else {
s_irq_mask &= ~(1 << (irq - 8));
outb(s_irq_mask,I8259_S_MR);
}
restore_flags(flags);
}

static inline int mpc1211_irq_real(unsigned int irq)
Expand All @@ -131,10 +122,6 @@ static inline int mpc1211_irq_real(unsigned int irq)

static void mask_and_ack_mpc1211(unsigned int irq)
{
unsigned long flags;

save_and_cli(flags);

if(irq < 8) {
if(m_irq_mask & (1<<irq)){
if(!mpc1211_irq_real(irq)){
Expand Down Expand Up @@ -162,7 +149,6 @@ static void mask_and_ack_mpc1211(unsigned int irq)
outb(0x60+(irq-8),I8259_S_CR); /* EOI */
outb(0x60+2,I8259_M_CR);
}
restore_flags(flags);
}

static void end_mpc1211_irq(unsigned int irq)
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/sh/boards/renesas/hs7751rvoip/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,24 @@ static unsigned int startup_hs7751rvoip_irq(unsigned int irq)

static void disable_hs7751rvoip_irq(unsigned int irq)
{
unsigned long flags;
unsigned short val;
unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]);

/* Set the priority in IPR to 0 */
local_irq_save(flags);
val = ctrl_inw(IRLCNTR3);
val &= mask;
ctrl_outw(val, IRLCNTR3);
local_irq_restore(flags);
}

static void enable_hs7751rvoip_irq(unsigned int irq)
{
unsigned long flags;
unsigned short val;
unsigned short value = (0x0001 << mask_pos[irq]);

/* Set priority in IPR back to original value */
local_irq_save(flags);
val = ctrl_inw(IRLCNTR3);
val |= value;
ctrl_outw(val, IRLCNTR3);
local_irq_restore(flags);
}

static void ack_hs7751rvoip_irq(unsigned int irq)
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/sh/boards/renesas/r7780rp/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,24 @@ static unsigned int startup_r7780rp_irq(unsigned int irq)

static void disable_r7780rp_irq(unsigned int irq)
{
unsigned long flags;
unsigned short val;
unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]);

/* Set the priority in IPR to 0 */
local_irq_save(flags);
val = ctrl_inw(IRLCNTR1);
val &= mask;
ctrl_outw(val, IRLCNTR1);
local_irq_restore(flags);
}

static void enable_r7780rp_irq(unsigned int irq)
{
unsigned long flags;
unsigned short val;
unsigned short value = (0x0001 << mask_pos[irq]);

/* Set priority in IPR back to original value */
local_irq_save(flags);
val = ctrl_inw(IRLCNTR1);
val |= value;
ctrl_outw(val, IRLCNTR1);
local_irq_restore(flags);
}

static void ack_r7780rp_irq(unsigned int irq)
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/sh/boards/renesas/rts7751r2d/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,24 @@ static unsigned int startup_rts7751r2d_irq(unsigned int irq)

static void disable_rts7751r2d_irq(unsigned int irq)
{
unsigned long flags;
unsigned short val;
unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]);

/* Set the priority in IPR to 0 */
local_irq_save(flags);
val = ctrl_inw(IRLCNTR1);
val &= mask;
ctrl_outw(val, IRLCNTR1);
local_irq_restore(flags);
}

static void enable_rts7751r2d_irq(unsigned int irq)
{
unsigned long flags;
unsigned short val;
unsigned short value = (0x0001 << mask_pos[irq]);

/* Set priority in IPR back to original value */
local_irq_save(flags);
val = ctrl_inw(IRLCNTR1);
val |= value;
ctrl_outw(val, IRLCNTR1);
local_irq_restore(flags);
}

int rts7751r2d_irq_demux(int irq)
Expand Down
Loading

0 comments on commit cf6c40d

Please sign in to comment.