forked from jonsmirl/mpc5200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: sh: SH-4A UBC support sh: interrupt exception handling rework sh: Default enable R7780RP IRQs. sh: Zero-out coherent buffer in consistent_alloc(). sh: Convert IPR-IRQ to IRQ chip. sh: Convert INTC2 IRQ handler to irq_chip. sh: Fix pr_debug statements for sh4 sh: Convert r7780rp IRQ handler to IRQ chip. sh: Updates for IRQ handler changes. sh: Kill off timer_ops get_frequency(). sh: First step at generic timeofday support.
- Loading branch information
Showing
32 changed files
with
249 additions
and
1,100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,54 @@ | ||
/* | ||
* linux/arch/sh/boards/renesas/r7780rp/irq.c | ||
* | ||
* Copyright (C) 2000 Kazumoto Kojima | ||
* | ||
* Renesas Solutions Highlander R7780RP-1 Support. | ||
* | ||
* Modified for R7780RP-1 by | ||
* Atom Create Engineering Co., Ltd. 2002. | ||
* Copyright (C) 2002 Atom Create Engineering Co., Ltd. | ||
* Copyright (C) 2006 Paul Mundt | ||
* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
*/ | ||
#include <linux/init.h> | ||
#include <linux/irq.h> | ||
#include <asm/io.h> | ||
#include <asm/irq.h> | ||
#include <asm/r7780rp/r7780rp.h> | ||
|
||
#ifdef CONFIG_SH_R7780MP | ||
static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0}; | ||
#else | ||
static int mask_pos[] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 5, 6, 4, 0, 1, 2, 0}; | ||
#endif | ||
|
||
static void enable_r7780rp_irq(unsigned int irq); | ||
static void disable_r7780rp_irq(unsigned int irq); | ||
|
||
/* shutdown is same as "disable" */ | ||
#define shutdown_r7780rp_irq disable_r7780rp_irq | ||
|
||
static void ack_r7780rp_irq(unsigned int irq); | ||
static void end_r7780rp_irq(unsigned int irq); | ||
|
||
static unsigned int startup_r7780rp_irq(unsigned int irq) | ||
{ | ||
enable_r7780rp_irq(irq); | ||
return 0; /* never anything pending */ | ||
} | ||
|
||
static void disable_r7780rp_irq(unsigned int irq) | ||
{ | ||
unsigned short val; | ||
unsigned short mask = 0xffff ^ (0x0001 << mask_pos[irq]); | ||
|
||
/* Set the priority in IPR to 0 */ | ||
val = ctrl_inw(IRLCNTR1); | ||
val &= mask; | ||
ctrl_outw(val, IRLCNTR1); | ||
} | ||
|
||
static void enable_r7780rp_irq(unsigned int irq) | ||
{ | ||
unsigned short val; | ||
unsigned short value = (0x0001 << mask_pos[irq]); | ||
|
||
/* Set priority in IPR back to original value */ | ||
val = ctrl_inw(IRLCNTR1); | ||
val |= value; | ||
ctrl_outw(val, IRLCNTR1); | ||
} | ||
|
||
static void ack_r7780rp_irq(unsigned int irq) | ||
{ | ||
disable_r7780rp_irq(irq); | ||
ctrl_outw(ctrl_inw(IRLCNTR1) | (1 << mask_pos[irq]), IRLCNTR1); | ||
} | ||
|
||
static void end_r7780rp_irq(unsigned int irq) | ||
static void disable_r7780rp_irq(unsigned int irq) | ||
{ | ||
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))) | ||
enable_r7780rp_irq(irq); | ||
/* Set the priority in IPR to 0 */ | ||
ctrl_outw(ctrl_inw(IRLCNTR1) & (0xffff ^ (1 << mask_pos[irq])), | ||
IRLCNTR1); | ||
} | ||
|
||
static struct hw_interrupt_type r7780rp_irq_type = { | ||
.typename = "R7780RP-IRQ", | ||
.startup = startup_r7780rp_irq, | ||
.shutdown = shutdown_r7780rp_irq, | ||
.enable = enable_r7780rp_irq, | ||
.disable = disable_r7780rp_irq, | ||
.ack = ack_r7780rp_irq, | ||
.end = end_r7780rp_irq, | ||
static struct irq_chip r7780rp_irq_chip __read_mostly = { | ||
.name = "r7780rp", | ||
.mask = disable_r7780rp_irq, | ||
.unmask = enable_r7780rp_irq, | ||
.mask_ack = disable_r7780rp_irq, | ||
}; | ||
|
||
static void make_r7780rp_irq(unsigned int irq) | ||
{ | ||
disable_irq_nosync(irq); | ||
irq_desc[irq].chip = &r7780rp_irq_type; | ||
disable_r7780rp_irq(irq); | ||
} | ||
|
||
/* | ||
* Initialize IRQ setting | ||
*/ | ||
void __init init_r7780rp_IRQ(void) | ||
{ | ||
int i; | ||
|
||
/* IRL0=PCI Slot #A | ||
* IRL1=PCI Slot #B | ||
* IRL2=PCI Slot #C | ||
* IRL3=PCI Slot #D | ||
* IRL4=CF Card | ||
* IRL5=CF Card Insert | ||
* IRL6=M66596 | ||
* IRL7=SD Card | ||
* IRL8=Touch Panel | ||
* IRL9=SCI | ||
* IRL10=Serial | ||
* IRL11=Extention #A | ||
* IRL11=Extention #B | ||
* IRL12=Debug LAN | ||
* IRL13=Push Switch | ||
* IRL14=ZiggBee IO | ||
*/ | ||
|
||
for (i=0; i<15; i++) | ||
make_r7780rp_irq(i); | ||
for (i = 0; i < 15; i++) { | ||
disable_irq_nosync(i); | ||
set_irq_chip_and_handler(i, &r7780rp_irq_chip, | ||
handle_level_irq); | ||
enable_r7780rp_irq(i); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.