Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85558
b: refs/heads/master
c: f99cb7a
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Feb 14, 2008
1 parent 4cade09 commit 873a22a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 47 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: db02612b4eb6136f06a924e6aa28752a841ad1bc
refs/heads/master: f99cb7a43c5cca1813a97312487acf7a0f88ee2a
47 changes: 14 additions & 33 deletions trunk/arch/sh/cchips/hd6446x/hd64465/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,62 +17,54 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/irq.h>

#include <asm/io.h>
#include <asm/irq.h>

#include <asm/hd64465/hd64465.h>

static void disable_hd64465_irq(unsigned int irq)
{
unsigned short nimr;
unsigned short mask = 1 << (irq - HD64465_IRQ_BASE);

pr_debug("disable_hd64465_irq(%d): mask=%x\n", irq, mask);
pr_debug("disable_hd64465_irq(%d): mask=%x\n", irq, mask);
nimr = inw(HD64465_REG_NIMR);
nimr |= mask;
outw(nimr, HD64465_REG_NIMR);
}


static void enable_hd64465_irq(unsigned int irq)
{
unsigned short nimr;
unsigned short mask = 1 << (irq - HD64465_IRQ_BASE);

pr_debug("enable_hd64465_irq(%d): mask=%x\n", irq, mask);
pr_debug("enable_hd64465_irq(%d): mask=%x\n", irq, mask);
nimr = inw(HD64465_REG_NIMR);
nimr &= ~mask;
outw(nimr, HD64465_REG_NIMR);
}


static void mask_and_ack_hd64465(unsigned int irq)
{
disable_hd64465_irq(irq);
}


static void end_hd64465_irq(unsigned int irq)
{
if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
enable_hd64465_irq(irq);
}


static unsigned int startup_hd64465_irq(unsigned int irq)
{
{
enable_hd64465_irq(irq);
return 0;
}


static void shutdown_hd64465_irq(unsigned int irq)
{
disable_hd64465_irq(irq);
}


static struct hw_interrupt_type hd64465_irq_type = {
.typename = "HD64465-IRQ",
.startup = startup_hd64465_irq,
Expand All @@ -83,7 +75,6 @@ static struct hw_interrupt_type hd64465_irq_type = {
.end = end_hd64465_irq,
};


static irqreturn_t hd64465_interrupt(int irq, void *dev_id)
{
printk(KERN_INFO
Expand All @@ -93,55 +84,49 @@ static irqreturn_t hd64465_interrupt(int irq, void *dev_id)
return IRQ_NONE;
}


/*====================================================*/

/*
* Support for a secondary IRQ demux step. This is necessary
* because the HD64465 presents a very thin interface to the
* PCMCIA bus; a lot of features (such as remapping interrupts)
* normally done in hardware by other PCMCIA host bridges is
* instead done in software.
*/
static struct
{
static struct {
int (*func)(int, void *);
void *dev;
} hd64465_demux[HD64465_IRQ_NUM];

void hd64465_register_irq_demux(int irq,
int (*demux)(int irq, void *dev), void *dev)
{
hd64465_demux[irq - HD64465_IRQ_BASE].func = demux;
hd64465_demux[irq - HD64465_IRQ_BASE].dev = dev;
hd64465_demux[irq - HD64465_IRQ_BASE].func = demux;
hd64465_demux[irq - HD64465_IRQ_BASE].dev = dev;
}
EXPORT_SYMBOL(hd64465_register_irq_demux);

void hd64465_unregister_irq_demux(int irq)
{
hd64465_demux[irq - HD64465_IRQ_BASE].func = 0;
hd64465_demux[irq - HD64465_IRQ_BASE].func = 0;
}
EXPORT_SYMBOL(hd64465_unregister_irq_demux);



int hd64465_irq_demux(int irq)
{
if (irq == CONFIG_HD64465_IRQ) {
unsigned short i, bit;
unsigned short nirr = inw(HD64465_REG_NIRR);
unsigned short nimr = inw(HD64465_REG_NIMR);

pr_debug("hd64465_irq_demux, nirr=%04x, nimr=%04x\n", nirr, nimr);
pr_debug("hd64465_irq_demux, nirr=%04x, nimr=%04x\n", nirr, nimr);
nirr &= ~nimr;
for (bit = 1, i = 0 ; i < HD64465_IRQ_NUM ; bit <<= 1, i++)
if (nirr & bit)
break;
break;

if (i < HD64465_IRQ_NUM) {
if (i < HD64465_IRQ_NUM) {
irq = HD64465_IRQ_BASE + i;
if (hd64465_demux[i].func != 0)
irq = hd64465_demux[i].func(irq, hd64465_demux[i].dev);
if (hd64465_demux[i].func != 0)
irq = hd64465_demux[i].func(irq, hd64465_demux[i].dev);
}
}
return irq;
Expand All @@ -154,7 +139,6 @@ static struct irqaction irq0 = {
.name = "HD64465",
};


static int __init setup_hd64465(void)
{
int i;
Expand All @@ -176,25 +160,22 @@ static int __init setup_hd64465(void)

rev = inw(HD64465_REG_SRR);
printk(KERN_INFO "HD64465 hardware revision %d.%d\n", (rev >> 8) & 0xff, rev & 0xff);
outw(0xffff, HD64465_REG_NIMR); /* mask all interrupts */

outw(0xffff, HD64465_REG_NIMR); /* mask all interrupts */

for (i = 0; i < HD64465_IRQ_NUM ; i++) {
irq_desc[HD64465_IRQ_BASE + i].chip = &hd64465_irq_type;
}

setup_irq(CONFIG_HD64465_IRQ, &irq0);

#ifdef CONFIG_SERIAL
/* wake up the UART from STANDBY at this point */
smscr = inw(HD64465_REG_SMSCR);
outw(smscr & (~HD64465_SMSCR_UARTST), HD64465_REG_SMSCR);

/* remap IO ports for first ISA serial port to HD64465 UART */
hd64465_port_map(0x3f8, 8, CONFIG_HD64465_IOBASE + 0x8000, 1);
#endif

return 0;
}

module_init(setup_hd64465);
1 change: 0 additions & 1 deletion trunk/arch/sh/configs/se7705_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ CONFIG_CPU_LITTLE_ENDIAN=y
# CONFIG_SH_DSP is not set
# CONFIG_SH_ADC is not set
CONFIG_CPU_HAS_INTEVT=y
CONFIG_CPU_HAS_PINT_IRQ=y
CONFIG_CPU_HAS_IPR_IRQ=y
CONFIG_CPU_HAS_SR_RB=y

Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/sh/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ asmlinkage void do_softirq(void)

void __init init_IRQ(void)
{
#ifdef CONFIG_CPU_HAS_PINT_IRQ
init_IRQ_pint();
#endif
plat_irq_setup();

/* Perform the machine specific initialisation */
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sh/kernel/traps_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static int misaligned_fpu_load(struct pt_regs *regs,
current->thread.fpu.hard.fp_regs[destreg] = buflo;
current->thread.fpu.hard.fp_regs[destreg+1] = bufhi;
} else {
#if defined(CONFIG_LITTLE_ENDIAN)
#if defined(CONFIG_CPU_LITTLE_ENDIAN)
current->thread.fpu.hard.fp_regs[destreg] = bufhi;
current->thread.fpu.hard.fp_regs[destreg+1] = buflo;
#else
Expand Down Expand Up @@ -700,7 +700,7 @@ static int misaligned_fpu_store(struct pt_regs *regs,
buflo = current->thread.fpu.hard.fp_regs[srcreg];
bufhi = current->thread.fpu.hard.fp_regs[srcreg+1];
} else {
#if defined(CONFIG_LITTLE_ENDIAN)
#if defined(CONFIG_CPU_LITTLE_ENDIAN)
bufhi = current->thread.fpu.hard.fp_regs[srcreg];
buflo = current->thread.fpu.hard.fp_regs[srcreg+1];
#else
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/kernel/vmlinux_64.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SECTIONS
KPROBES_TEXT
*(.fixup)
*(.gnu.warning)
#ifdef CONFIG_LITTLE_ENDIAN
#ifdef CONFIG_CPU_LITTLE_ENDIAN
} = 0x6ff0fff0
#else
} = 0xf0fff06f
Expand Down
6 changes: 0 additions & 6 deletions trunk/include/asm-sh/cpu-sh5/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
/* This has to be a common function because the next location to fill
* information is shared. */
extern void __do_tlb_refill(unsigned long address, unsigned long long is_text_not_data, pte_t *pte);

/* Profiling counter. */
#ifdef CONFIG_SH64_PROC_TLB
extern unsigned long long calls_to_do_fast_page_fault;
#endif

#endif /* __ASSEMBLY__ */

#endif /* __ASM_SH_CPU_SH5_MMU_CONTEXT_H */

0 comments on commit 873a22a

Please sign in to comment.