Skip to content

Commit

Permalink
sh: mach-snapgear: Rip out superfluous PIO routines.
Browse files Browse the repository at this point in the history
None of these PIO routines do anything other than basic error checking,
get rid of them and use the generic fallbacks.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Oct 29, 2010
1 parent 46bc858 commit 39c1198
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 170 deletions.
2 changes: 1 addition & 1 deletion arch/sh/boards/mach-snapgear/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Makefile for the SnapGear specific parts of the kernel
#

obj-y := setup.o io.o
obj-y := setup.o
121 changes: 0 additions & 121 deletions arch/sh/boards/mach-snapgear/io.c

This file was deleted.

36 changes: 10 additions & 26 deletions arch/sh/boards/mach-snapgear/setup.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* linux/arch/sh/boards/snapgear/setup.c
*
* Copyright (C) 2002 David McCullough <davidm@snapgear.com>
* Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
*
Expand All @@ -24,13 +22,14 @@
#include <asm/io.h>
#include <cpu/timer.h>

unsigned short secureedge5410_ioport;

/*
* EraseConfig handling functions
*/

static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)
{
(void)__raw_readb(0xb8000000); /* dummy read */
ctrl_delay(); /* dummy read */

printk("SnapGear: erase switch interrupt!\n");

Expand All @@ -39,21 +38,22 @@ static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id)

static int __init eraseconfig_init(void)
{
unsigned int irq = evt2irq(0x240);

printk("SnapGear: EraseConfig init\n");

/* Setup "EraseConfig" switch on external IRQ 0 */
if (request_irq(IRL0_IRQ, eraseconfig_interrupt, IRQF_DISABLED,
if (request_irq(irq, eraseconfig_interrupt, IRQF_DISABLED,
"Erase Config", NULL))
printk("SnapGear: failed to register IRQ%d for Reset witch\n",
IRL0_IRQ);
irq);
else
printk("SnapGear: registered EraseConfig switch on IRQ%d\n",
IRL0_IRQ);
return(0);
irq);
return 0;
}

module_init(eraseconfig_init);

/****************************************************************************/
/*
* Initialize IRQ setting
*
Expand All @@ -62,7 +62,6 @@ module_init(eraseconfig_init);
* IRL2 = eth1
* IRL3 = crypto
*/

static void __init init_snapgear_IRQ(void)
{
printk("Setup SnapGear IRQ/IPR ...\n");
Expand All @@ -76,20 +75,5 @@ static void __init init_snapgear_IRQ(void)
static struct sh_machine_vector mv_snapgear __initmv = {
.mv_name = "SnapGear SecureEdge5410",
.mv_nr_irqs = 72,

.mv_inb = snapgear_inb,
.mv_inw = snapgear_inw,
.mv_inl = snapgear_inl,
.mv_outb = snapgear_outb,
.mv_outw = snapgear_outw,
.mv_outl = snapgear_outl,

.mv_inb_p = snapgear_inb_p,
.mv_inw_p = snapgear_inw,
.mv_inl_p = snapgear_inl,
.mv_outb_p = snapgear_outb_p,
.mv_outw_p = snapgear_outw,
.mv_outl_p = snapgear_outl,

.mv_init_irq = init_snapgear_IRQ,
};
22 changes: 0 additions & 22 deletions arch/sh/include/mach-common/mach/snapgear.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,9 @@
#ifndef _ASM_SH_IO_SNAPGEAR_H
#define _ASM_SH_IO_SNAPGEAR_H

#if defined(CONFIG_CPU_SH4)
/*
* The external interrupt lines, these take up ints 0 - 15 inclusive
* depending on the priority for the interrupt. In fact the priority
* is the interrupt :-)
*/

#define IRL0_IRQ 2
#define IRL0_PRIORITY 13

#define IRL1_IRQ 5
#define IRL1_PRIORITY 10

#define IRL2_IRQ 8
#define IRL2_PRIORITY 7

#define IRL3_IRQ 11
#define IRL3_PRIORITY 4
#endif

#define __IO_PREFIX snapgear
#include <asm/io_generic.h>

#ifdef CONFIG_SH_SECUREEDGE5410
/*
* We need to remember what was written to the ioport as some bits
* are shared with other functions and you cannot read back what was
Expand Down Expand Up @@ -66,6 +45,5 @@ extern unsigned short secureedge5410_ioport;
((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
#define SECUREEDGE_READ_IOPORT() \
((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
#endif

#endif /* _ASM_SH_IO_SNAPGEAR_H */

0 comments on commit 39c1198

Please sign in to comment.