sh: Board updates for I/O routine rework.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 27 Sep 2006 06:41:24 +0000 (15:41 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 27 Sep 2006 06:41:24 +0000 (15:41 +0900)
This updates the various boards for some of the recent I/O routine
updates.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
43 files changed:
arch/sh/Makefile
arch/sh/boards/renesas/hs7751rvoip/io.c
arch/sh/boards/renesas/hs7751rvoip/setup.c
arch/sh/boards/renesas/systemh/io.c
arch/sh/boards/renesas/systemh/irq.c
arch/sh/boards/renesas/systemh/setup.c
arch/sh/boards/se/7300/io.c
arch/sh/boards/se/7300/irq.c
arch/sh/boards/se/7300/led.c
arch/sh/boards/se/7300/setup.c
arch/sh/boards/se/73180/setup.c
arch/sh/boards/se/770x/io.c
arch/sh/boards/se/770x/irq.c
arch/sh/boards/se/770x/led.c
arch/sh/boards/se/770x/mach.c
arch/sh/boards/se/770x/setup.c
arch/sh/boards/se/7751/io.c
arch/sh/boards/se/7751/irq.c
arch/sh/boards/se/7751/led.c
arch/sh/boards/se/7751/mach.c
arch/sh/boards/se/7751/setup.c
arch/sh/boards/sh03/setup.c
arch/sh/boards/snapgear/io.c
arch/sh/boards/snapgear/rtc.c
arch/sh/boards/snapgear/setup.c
arch/sh/boards/titan/io.c
arch/sh/cchips/Kconfig
arch/sh/kernel/cf-enabler.c
drivers/net/stnic.c
include/asm-sh/hs7751rvoip/hs7751rvoip.h
include/asm-sh/mc146818rtc.h
include/asm-sh/se.h [moved from include/asm-sh/se/se.h with 97% similarity]
include/asm-sh/se/io.h [deleted file]
include/asm-sh/se7300.h [moved from include/asm-sh/se7300/se7300.h with 97% similarity]
include/asm-sh/se7300/io.h [deleted file]
include/asm-sh/se73180.h [moved from include/asm-sh/se73180/se73180.h with 97% similarity]
include/asm-sh/se73180/io.h [deleted file]
include/asm-sh/se7751.h [moved from include/asm-sh/se7751/se7751.h with 97% similarity]
include/asm-sh/se7751/io.h [deleted file]
include/asm-sh/sh03/io.h
include/asm-sh/snapgear.h [moved from include/asm-sh/snapgear/io.h with 62% similarity]
include/asm-sh/systemh/io.h [deleted file]
include/asm-sh/systemh7751.h [moved from include/asm-sh/systemh/7751systemh.h with 97% similarity]

index 55dcba2c06fc125cf9a26fd053e4ceac3d787b45..65676c33822eab1df4beb6a8cfcc155547c650fa 100644 (file)
@@ -111,10 +111,7 @@ machdir-$(CONFIG_SH_UNKNOWN)                       := unknown
 
 incdir-y                       := $(notdir $(machdir-y))
 
-incdir-$(CONFIG_SH_SOLUTION_ENGINE)            := se
 incdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)       := se7751
-incdir-$(CONFIG_SH_7300_SOLUTION_ENGINE)        := se7300
-incdir-$(CONFIG_SH_73180_SOLUTION_ENGINE)      := se73180
 incdir-$(CONFIG_SH_HP6XX)                      := hp6xx
 
 ifneq ($(machdir-y),)
index edecf107fc132d62f64e916048d6c61ab6403d15..ecdce7ef6a3474194b670ebdcd1b6aed4fc8487f 100644 (file)
 #include <linux/pci.h>
 #include "../../../drivers/pci/pci-sh7751.h"
 
-extern void *area5_io8_base;   /* Area 5 8bit I/O Base address */
 extern void *area6_io8_base;   /* Area 6 8bit I/O Base address */
 extern void *area5_io16_base;  /* Area 5 16bit I/O Base address */
-extern void *area6_io16_base;  /* Area 6 16bit I/O Base address */
 
 /*
  * The 7751R HS7751RVoIP uses the built-in PCI controller (PCIC)
@@ -37,16 +35,10 @@ extern void *area6_io16_base;       /* Area 6 16bit I/O Base address */
 #define PCIMBR          (volatile long *)PCI_REG(SH7751_PCIMBR)
 #define PCI_IO_AREA    SH7751_PCI_IO_BASE
 #define PCI_MEM_AREA   SH7751_PCI_CONFIG_BASE
-
 #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
 
-#if defined(CONFIG_HS7751RVOIP_CODEC)
 #define CODEC_IO_BASE  0x1000
-#endif
-
-#define maybebadio(name,port) \
-  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
-        #name, (port), (__u32) __builtin_return_address(0))
+#define CODEC_IOMAP(a) ((unsigned long)area6_io8_base + ((a) - CODEC_IO_BASE))
 
 static inline void delay(void)
 {
@@ -61,7 +53,7 @@ static inline unsigned long port2adr(unsigned int port)
                else
                        return ((unsigned long)area5_io16_base + 0x800 + ((port-0x1f0) << 1));
        else
-               maybebadio(port2adr, (unsigned long)port);
+               maybebadio((unsigned long)port);
        return port;
 }
 
@@ -109,15 +101,15 @@ codec_port(unsigned long port)
 unsigned char hs7751rvoip_inb(unsigned long port)
 {
        if (PXSEG(port))
-               return *(volatile unsigned char *)port;
+               return ctrl_inb(port);
 #if defined(CONFIG_HS7751RVOIP_CODEC)
        else if (codec_port(port))
-               return *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE));
+               return ctrl_inb(CODEC_IOMAP(port));
 #endif
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-               return *(volatile unsigned char *)PCI_IOMAP(port);
+               return ctrl_inb(PCI_IOMAP(port));
        else
-               return (*(volatile unsigned short *)port2adr(port) & 0xff);
+               return ctrl_inw(port2adr(port)) & 0xff;
 }
 
 unsigned char hs7751rvoip_inb_p(unsigned long port)
@@ -125,15 +117,15 @@ unsigned char hs7751rvoip_inb_p(unsigned long port)
        unsigned char v;
 
         if (PXSEG(port))
-                v = *(volatile unsigned char *)port;
+               v = ctrl_inb(port);
 #if defined(CONFIG_HS7751RVOIP_CODEC)
        else if (codec_port(port))
-               v = *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE));
+               v = ctrl_inb(CODEC_IOMAP(port));
 #endif
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-                v = *(volatile unsigned char *)PCI_IOMAP(port);
+               v = ctrl_inb(PCI_IOMAP(port));
        else
-               v = (*(volatile unsigned short *)port2adr(port) & 0xff);
+               v = ctrl_inw(port2adr(port)) & 0xff;
        delay();
        return v;
 }
@@ -141,22 +133,22 @@ unsigned char hs7751rvoip_inb_p(unsigned long port)
 unsigned short hs7751rvoip_inw(unsigned long port)
 {
         if (PXSEG(port))
-                return *(volatile unsigned short *)port;
+               return ctrl_inw(port);
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-                return *(volatile unsigned short *)PCI_IOMAP(port);
+               return ctrl_inw(PCI_IOMAP(port));
        else
-               maybebadio(inw, port);
+               maybebadio(port);
        return 0;
 }
 
 unsigned int hs7751rvoip_inl(unsigned long port)
 {
         if (PXSEG(port))
-                return *(volatile unsigned long *)port;
+               return ctrl_inl(port);
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-                return *(volatile unsigned long *)PCI_IOMAP(port);
+               return ctrl_inl(PCI_IOMAP(port));
        else
-               maybebadio(inl, port);
+               maybebadio(port);
        return 0;
 }
 
@@ -164,137 +156,168 @@ void hs7751rvoip_outb(unsigned char value, unsigned long port)
 {
 
         if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
+               ctrl_outb(value, port);
 #if defined(CONFIG_HS7751RVOIP_CODEC)
        else if (codec_port(port))
-               *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value;
+               ctrl_outb(value, CODEC_IOMAP(port));
 #endif
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-               *(unsigned char *)PCI_IOMAP(port) = value;
+               ctrl_outb(value, PCI_IOMAP(port));
        else
-               *(volatile unsigned short *)port2adr(port) = value;
+               ctrl_outb(value, port2adr(port));
 }
 
 void hs7751rvoip_outb_p(unsigned char value, unsigned long port)
 {
         if (PXSEG(port))
-                *(volatile unsigned char *)port = value;
+               ctrl_outb(value, port);
 #if defined(CONFIG_HS7751RVOIP_CODEC)
        else if (codec_port(port))
-               *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = value;
+               ctrl_outb(value, CODEC_IOMAP(port));
 #endif
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-               *(unsigned char *)PCI_IOMAP(port) = value;
+               ctrl_outb(value, PCI_IOMAP(port));
        else
-               *(volatile unsigned short *)port2adr(port) = value;
+               ctrl_outw(value, port2adr(port));
+
        delay();
 }
 
 void hs7751rvoip_outw(unsigned short value, unsigned long port)
 {
         if (PXSEG(port))
-                *(volatile unsigned short *)port = value;
+               ctrl_outw(value, port);
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-               *(unsigned short *)PCI_IOMAP(port) = value;
+               ctrl_outw(value, PCI_IOMAP(port));
        else
-               maybebadio(outw, port);
+               maybebadio(port);
 }
 
 void hs7751rvoip_outl(unsigned int value, unsigned long port)
 {
         if (PXSEG(port))
-                *(volatile unsigned long *)port = value;
+               ctrl_outl(value, port);
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-               *((unsigned long *)PCI_IOMAP(port)) = value;
+               ctrl_outl(value, PCI_IOMAP(port));
        else
-               maybebadio(outl, port);
+               maybebadio(port);
 }
 
 void hs7751rvoip_insb(unsigned long port, void *addr, unsigned long count)
 {
+       u8 *buf = addr;
+
        if (PXSEG(port))
-               while (count--) *((unsigned char *) addr)++ = *(volatile unsigned char *)port;
+               while (count--)
+                       *buf++ = ctrl_inb(port);
 #if defined(CONFIG_HS7751RVOIP_CODEC)
        else if (codec_port(port))
-               while (count--) *((unsigned char *) addr)++ = *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE));
+               while (count--)
+                       *buf++ = ctrl_inb(CODEC_IOMAP(port));
 #endif
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
-               volatile __u8 *bp = (__u8 *)PCI_IOMAP(port);
+               volatile u8 *bp = (volatile u8 *)PCI_IOMAP(port);
 
-               while (count--) *((volatile unsigned char *) addr)++ = *bp;
+               while (count--)
+                       *buf++ = *bp;
        } else {
-               volatile __u16 *p = (volatile unsigned short *)port2adr(port);
+               volatile u16 *p = (volatile u16 *)port2adr(port);
 
-               while (count--) *((unsigned char *) addr)++ = *p & 0xff;
+               while (count--)
+                       *buf++ = *p & 0xff;
        }
 }
 
 void hs7751rvoip_insw(unsigned long port, void *addr, unsigned long count)
 {
-       volatile __u16 *p;
+       volatile u16 *p;
+       u16 *buf = addr;
 
        if (PXSEG(port))
-               p = (volatile unsigned short *)port;
+               p = (volatile u16 *)port;
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-               p = (volatile unsigned short *)PCI_IOMAP(port);
+               p = (volatile u16 *)PCI_IOMAP(port);
        else
-               p = (volatile unsigned short *)port2adr(port);
-       while (count--) *((__u16 *) addr)++ = *p;
+               p = (volatile u16 *)port2adr(port);
+       while (count--)
+               *buf++ = *p;
 }
 
 void hs7751rvoip_insl(unsigned long port, void *addr, unsigned long count)
 {
+
        if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
-               volatile __u32 *p = (__u32 *)PCI_IOMAP(port);
+               volatile u32 *p = (volatile u32 *)PCI_IOMAP(port);
+               u32 *buf = addr;
 
-               while (count--) *((__u32 *) addr)++ = *p;
+               while (count--)
+                       *buf++ = *p;
        } else
-               maybebadio(insl, port);
+               maybebadio(port);
 }
 
 void hs7751rvoip_outsb(unsigned long port, const void *addr, unsigned long count)
 {
+       const u8 *buf = addr;
+
        if (PXSEG(port))
-               while (count--) *(volatile unsigned char *)port = *((unsigned char *) addr)++;
+               while (count--)
+                       ctrl_outb(*buf++, port);
 #if defined(CONFIG_HS7751RVOIP_CODEC)
        else if (codec_port(port))
-               while (count--) *(volatile unsigned char *)((unsigned long)area6_io8_base+(port-CODEC_IO_BASE)) = *((unsigned char *) addr)++;
+               while (count--)
+                       ctrl_outb(*buf++, CODEC_IOMAP(port));
 #endif
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
-               volatile __u8 *bp = (__u8 *)PCI_IOMAP(port);
+               volatile u8 *bp = (volatile u8 *)PCI_IOMAP(port);
 
-               while (count--) *bp = *((volatile unsigned char *) addr)++;
+               while (count--)
+                       *bp = *buf++;
        } else {
-               volatile __u16 *p = (volatile unsigned short *)port2adr(port);
+               volatile u16 *p = (volatile u16 *)port2adr(port);
 
-               while (count--) *p = *((unsigned char *) addr)++;
+               while (count--)
+                       *p = *buf++;
        }
 }
 
 void hs7751rvoip_outsw(unsigned long port, const void *addr, unsigned long count)
 {
-       volatile __u16 *p;
+       volatile u16 *p;
+       const u16 *buf = addr;
 
        if (PXSEG(port))
-               p = (volatile unsigned short *)port;
+               p = (volatile u16 *)port;
        else if (CHECK_SH7751_PCIIO(port) || shifted_port(port))
-               p = (volatile unsigned short *)PCI_IOMAP(port);
+               p = (volatile u16 *)PCI_IOMAP(port);
        else
-               p = (volatile unsigned short *)port2adr(port);
-       while (count--) *p = *((__u16 *) addr)++;
+               p = (volatile u16 *)port2adr(port);
+
+       while (count--)
+               *p = *buf++;
 }
 
 void hs7751rvoip_outsl(unsigned long port, const void *addr, unsigned long count)
 {
+       const u32 *buf = addr;
+
        if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) {
-               volatile __u32 *p = (__u32 *)PCI_IOMAP(port);
+               volatile u32 *p = (volatile u32 *)PCI_IOMAP(port);
 
-               while (count--) *p = *((__u32 *) addr)++;
+               while (count--)
+                       *p = *buf++;
        } else
-               maybebadio(outsl, port);
+               maybebadio(port);
 }
 
-unsigned long hs7751rvoip_isa_port2addr(unsigned long offset)
+void __iomem *hs7751rvoip_ioport_map(unsigned long port, unsigned int size)
 {
-       return port2adr(offset);
+        if (PXSEG(port))
+                return (void __iomem *)port;
+       else if (unlikely(codec_port(port) && (size == 1)))
+               return (void __iomem *)CODEC_IOMAP(port);
+        else if (CHECK_SH7751_PCIIO(port))
+                return (void __iomem *)PCI_IOMAP(port);
+
+        return (void __iomem *)port2adr(port);
 }
index aa51bda931f65dac6edde1176f0517824ae745a2..a2cbcc5d530f99567615c382c40c3313f108d736 100644 (file)
@@ -17,9 +17,8 @@
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <linux/pm.h>
-#include <asm/hs7751rvoip/hs7751rvoip.h>
-#include <asm/hs7751rvoip/io.h>
 #include <asm/io.h>
+#include <asm/hs7751rvoip/hs7751rvoip.h>
 #include <asm/machvec.h>
 #include <asm/rtc.h>
 #include <asm/irq.h>
@@ -60,8 +59,8 @@ struct sh_machine_vector mv_hs7751rvoip __initmv = {
        .mv_outsw               = hs7751rvoip_outsw,
        .mv_outsl               = hs7751rvoip_outsl,
 
-       .mv_isa_port2addr       = hs7751rvoip_isa_port2addr,
        .mv_init_irq            = hs7751rvoip_init_irq,
+       .mv_ioport_map          = hs7751rvoip_ioport_map,
 };
 ALIAS_MV(hs7751rvoip)
 
index 85511576d414c3baf909323439aa1797a111b2ef..0befd4f9894c0e55f52b23126230bc421191a121 100644 (file)
 
 #include <linux/kernel.h>
 #include <linux/types.h>
-#include <asm/systemh/7751systemh.h>
+#include <linux/pci.h>
+#include <asm/systemh7751.h>
 #include <asm/addrspace.h>
 #include <asm/io.h>
-
-#include <linux/pci.h>
 #include "../../../drivers/pci/pci-sh7751.h"
 
 /*
 #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
 #define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area
                                                 of smc lan chip*/
-
-#define maybebadio(name,port) \
-  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
-        #name, (port), (__u32) __builtin_return_address(0))
-
 static inline void delay(void)
 {
        ctrl_inw(0xa0000000);
@@ -46,11 +40,7 @@ port2adr(unsigned int port)
 {
        if (port >= 0x2000)
                return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-#if 0
-       else
-               return (volatile __u16 *) (PA_SUPERIO + (port << 1));
-#endif
-       maybebadio(name,(unsigned long)port);
+       maybebadio((unsigned long)port);
        return (volatile __u16*)port;
 }
 
@@ -111,7 +101,7 @@ unsigned short sh7751systemh_inw(unsigned long port)
        else if (port <= 0x3F1)
                return *(volatile unsigned int *)ETHER_IOMAP(port);
        else
-               maybebadio(inw, port);
+               maybebadio(port);
        return 0;
 }
 
@@ -126,7 +116,7 @@ unsigned int sh7751systemh_inl(unsigned long port)
        else if (port <= 0x3F1)
                return *(volatile unsigned int *)ETHER_IOMAP(port);
        else
-               maybebadio(inl, port);
+               maybebadio(port);
        return 0;
 }
 
@@ -167,7 +157,7 @@ void sh7751systemh_outw(unsigned short value, unsigned long port)
        else if (port <= 0x3F1)
                *(volatile unsigned short *)ETHER_IOMAP(port) = value;
        else
-               maybebadio(outw, port);
+               maybebadio(port);
 }
 
 void sh7751systemh_outl(unsigned int value, unsigned long port)
@@ -177,7 +167,7 @@ void sh7751systemh_outl(unsigned int value, unsigned long port)
        else if (CHECK_SH7751_PCIIO(port))
                *((unsigned long*)PCI_IOMAP(port)) = value;
        else
-               maybebadio(outl, port);
+               maybebadio(port);
 }
 
 void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count)
@@ -194,7 +184,7 @@ void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count)
 
 void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count)
 {
-       maybebadio(insl, port);
+       maybebadio(port);
 }
 
 void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count)
@@ -211,73 +201,5 @@ void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long cou
 
 void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count)
 {
-       maybebadio(outsw, port);
-}
-
-/* For read/write calls, just copy generic (pass-thru); PCIMBR is  */
-/* already set up.  For a larger memory space, these would need to */
-/* reset PCIMBR as needed on a per-call basis...                   */
-
-unsigned char sh7751systemh_readb(unsigned long addr)
-{
-       return *(volatile unsigned char*)addr;
-}
-
-unsigned short sh7751systemh_readw(unsigned long addr)
-{
-       return *(volatile unsigned short*)addr;
-}
-
-unsigned int sh7751systemh_readl(unsigned long addr)
-{
-       return *(volatile unsigned long*)addr;
-}
-
-void sh7751systemh_writeb(unsigned char b, unsigned long addr)
-{
-       *(volatile unsigned char*)addr = b;
-}
-
-void sh7751systemh_writew(unsigned short b, unsigned long addr)
-{
-       *(volatile unsigned short*)addr = b;
-}
-
-void sh7751systemh_writel(unsigned int b, unsigned long addr)
-{
-        *(volatile unsigned long*)addr = b;
-}
-
-\f
-
-/* Map ISA bus address to the real address. Only for PCMCIA.  */
-
-/* ISA page descriptor.  */
-static __u32 sh_isa_memmap[256];
-
-#if 0
-static int
-sh_isa_mmap(__u32 start, __u32 length, __u32 offset)
-{
-       int idx;
-
-       if (start >= 0x100000 || (start & 0xfff) || (length != 0x1000))
-               return -1;
-
-       idx = start >> 12;
-       sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff);
-       printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n",
-              start, length, offset, idx, sh_isa_memmap[idx]);
-       return 0;
-}
-#endif
-
-unsigned long
-sh7751systemh_isa_port2addr(unsigned long offset)
-{
-       int idx;
-
-       idx = (offset >> 12) & 0xff;
-       offset &= 0xfff;
-       return sh_isa_memmap[idx] + offset;
+       maybebadio(port);
 }
index 8372d967f60120f249e71c0135578ca36459da04..53731a0abb8f2fd79f5c91d9ba71147abdfc3f6d 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <asm/io.h>
-#include <asm/mach/7751systemh.h>
+#include <asm/systemh7751.h>
 #include <asm/smc37c93x.h>
 
 /* address of external interrupt mask register
index 826fa3d7669c7952fee3655d8b7c126077a297b6..433c7c3f35e24decd836c8c9481bd4aaa998f90a 100644 (file)
@@ -15,9 +15,8 @@
  * for more details.
  */
 #include <linux/init.h>
-#include <asm/mach/7751systemh.h>
-#include <asm/mach/io.h>
 #include <asm/machvec.h>
+#include <asm/systemh7751.h>
 
 extern void make_systemh_irq(unsigned int irq);
 
@@ -31,8 +30,6 @@ const char *get_system_type(void)
  */
 void __init init_7751systemh_IRQ(void)
 {
-/*     make_ipr_irq(10, BCR_ILCRD, 1, 0x0f-10); LAN */
-/*     make_ipr_irq(14, BCR_ILCRA, 2, 0x0f-4); */
        make_systemh_irq(0xb);  /* Ethernet interrupt */
 }
 
@@ -60,15 +57,6 @@ struct sh_machine_vector mv_7751systemh __initmv = {
        .mv_outsw               = sh7751systemh_outsw,
        .mv_outsl               = sh7751systemh_outsl,
 
-       .mv_readb               = sh7751systemh_readb,
-       .mv_readw               = sh7751systemh_readw,
-       .mv_readl               = sh7751systemh_readl,
-       .mv_writeb              = sh7751systemh_writeb,
-       .mv_writew              = sh7751systemh_writew,
-       .mv_writel              = sh7751systemh_writel,
-
-       .mv_isa_port2addr       = sh7751systemh_isa_port2addr,
-
        .mv_init_irq            = init_7751systemh_IRQ,
 };
 ALIAS_MV(7751systemh)
index f449a94ddffde4822cc037ba5677c78627b106d0..8a03d7a52a7ca441ecf24bcc2d6f57e15bcd0be1 100644 (file)
@@ -9,8 +9,8 @@
  */
 
 #include <linux/kernel.h>
-#include <asm/mach/se7300.h>
 #include <asm/io.h>
+#include <asm/se7300.h>
 
 #define badio(fn, a) panic("bad i/o operation %s for %08lx.", #fn, a)
 
@@ -99,6 +99,7 @@ bad_outb(struct iop *p, unsigned char value, unsigned long port)
        badio(inw, port);
 }
 
+#ifdef CONFIG_SMC91X
 /* MSTLANEX01 LAN at 0xb400:0000 */
 static struct iop laniop = {
        .start = 0x300,
@@ -110,6 +111,7 @@ static struct iop laniop = {
        .outb = simple_outb,
        .outw = simple_outw,
 };
+#endif
 
 /* NE2000 pc card NIC */
 static struct iop neiop = {
@@ -123,6 +125,7 @@ static struct iop neiop = {
        .outw = simple_outw,
 };
 
+#ifdef CONFIG_IDE
 /* CF in CF slot */
 static struct iop cfiop = {
        .base = 0xb0600000,
@@ -132,12 +135,13 @@ static struct iop cfiop = {
        .outb = pcc_outb,
        .outw = simple_outw,
 };
+#endif
 
 static __inline__ struct iop *
 port2iop(unsigned long port)
 {
        if (0) ;
-#if defined(CONFIG_SMC91111)
+#if defined(CONFIG_SMC91X)
        else if (laniop.check(&laniop, port))
                return &laniop;
 #endif
index 216a78d1a108c26c3ff4ab1cc0b74e7cfd958a00..ad1034f98a293ba4dfeb0259369538458e299f83 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/irq.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/mach/se7300.h>
+#include <asm/se7300.h>
 
 /*
  * Initialize IRQ setting
index ad51f0a9c1e31999041ac59b5e408679bee4dcba..4d03bb7774be781dcf5c3a599a603b3134389970 100644 (file)
  */
 
 #include <linux/sched.h>
-#include <asm/mach/se7300.h>
-
-static void
-mach_led(int position, int value)
-{
-       volatile unsigned short *p = (volatile unsigned short *) PA_LED;
-
-       if (value) {
-               *p |= (1 << 8);
-       } else {
-               *p &= ~(1 << 8);
-       }
-}
-
+#include <asm/se7300.h>
 
 /* Cycle the LED's in the clasic Knightrider/Sun pattern */
-void
-heartbeat_7300se(void)
+void heartbeat_7300se(void)
 {
        static unsigned int cnt = 0, period = 0;
        volatile unsigned short *p = (volatile unsigned short *) PA_LED;
index ebcd98d4c0818601535bfb52e051004d7579a9e7..bb7e1a189be8160b4125f86b701a872bb33dc39d 100644 (file)
@@ -9,8 +9,7 @@
 
 #include <linux/init.h>
 #include <asm/machvec.h>
-#include <asm/machvec_init.h>
-#include <asm/mach/io.h>
+#include <asm/se7300.h>
 
 void heartbeat_7300se(void);
 void init_7300se_IRQ(void);
index cdb7b5f8d942f7cf1520aa16c7661d95b6a4b142..cddc7a2b858fa425ecef3f83d3d1d902573c7a8f 100644 (file)
@@ -11,8 +11,7 @@
 
 #include <linux/init.h>
 #include <asm/machvec.h>
-#include <asm/machvec_init.h>
-#include <asm/mach/io.h>
+#include <asm/se73180.h>
 
 void heartbeat_73180se(void);
 void init_73180se_IRQ(void);
index 9a39ee963143fa4169bae4e9bb46abaabcf27a68..5102201c97ab6783a70a4c899f257d07a509fdfc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $
+/* $Id: io.c,v 1.6 2006/01/04 17:53:54 lethal Exp $
  *
  * linux/arch/sh/kernel/io_se.c
  *
@@ -11,7 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <asm/io.h>
-#include <asm/se/se.h>
+#include <asm/se.h>
 
 /* SH pcmcia io window base, start and end.  */
 int sh_pcic_io_wbase = 0xb8400000;
@@ -52,10 +52,6 @@ shifted_port(unsigned long port)
                return 1;
 }
 
-#define maybebadio(name,port) \
-  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
-        #name, (port), (__u32) __builtin_return_address(0))
-
 unsigned char se_inb(unsigned long port)
 {
        if (sh_pcic_io_start <= port && port <= sh_pcic_io_stop)
@@ -86,13 +82,13 @@ unsigned short se_inw(unsigned long port)
            (sh_pcic_io_start <= port && port <= sh_pcic_io_stop))
                return *port2adr(port);
        else
-               maybebadio(inw, port);
+               maybebadio(port);
        return 0;
 }
 
 unsigned int se_inl(unsigned long port)
 {
-       maybebadio(inl, port);
+       maybebadio(port);
        return 0;
 }
 
@@ -123,12 +119,12 @@ void se_outw(unsigned short value, unsigned long port)
            (sh_pcic_io_start <= port && port <= sh_pcic_io_stop))
                *port2adr(port) = value;
        else
-               maybebadio(outw, port);
+               maybebadio(port);
 }
 
 void se_outl(unsigned int value, unsigned long port)
 {
-       maybebadio(outl, port);
+       maybebadio(port);
 }
 
 void se_insb(unsigned long port, void *addr, unsigned long count)
@@ -159,7 +155,7 @@ void se_insw(unsigned long port, void *addr, unsigned long count)
 
 void se_insl(unsigned long port, void *addr, unsigned long count)
 {
-       maybebadio(insl, port);
+       maybebadio(port);
 }
 
 void se_outsb(unsigned long port, const void *addr, unsigned long count)
@@ -190,37 +186,5 @@ void se_outsw(unsigned long port, const void *addr, unsigned long count)
 
 void se_outsl(unsigned long port, const void *addr, unsigned long count)
 {
-       maybebadio(outsw, port);
-}
-
-/* Map ISA bus address to the real address. Only for PCMCIA.  */
-
-/* ISA page descriptor.  */
-static __u32 sh_isa_memmap[256];
-
-static int
-sh_isa_mmap(__u32 start, __u32 length, __u32 offset)
-{
-       int idx;
-
-       if (start >= 0x100000 || (start & 0xfff) || (length != 0x1000))
-               return -1;
-
-       idx = start >> 12;
-       sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff);
-#if 0
-       printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n",
-              start, length, offset, idx, sh_isa_memmap[idx]);
-#endif
-       return 0;
-}
-
-unsigned long
-se_isa_port2addr(unsigned long offset)
-{
-       int idx;
-
-       idx = (offset >> 12) & 0xff;
-       offset &= 0xfff;
-       return sh_isa_memmap[idx] + offset;
+       maybebadio(port);
 }
index 3e558716ce100fac939c084ecb8285cf382094a4..cff6700bbafd4f98878e462c9121a3057bd87acf 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/irq.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/se/se.h>
+#include <asm/se.h>
 
 /*
  * Initialize IRQ setting
index 73e9848387ea35ee84058ccb5516d238f3b31f5e..daf7b1ee786a3f7f1d833cc4a1712cbf5d6ae6e1 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include <linux/sched.h>
-#include <asm/se/se.h>
+#include <asm/se.h>
 
 /* Cycle the LED's in the clasic Knightrider/Sun pattern */
 void heartbeat_se(void)
index 6ec07bd3dcf1f436a7808e59d776345f2f6c5aa4..e8968b71c353154277bb95e41ad4f582805f1a53 100644 (file)
 
 #include <asm/machvec.h>
 #include <asm/rtc.h>
-#include <asm/machvec_init.h>
-
-#include <asm/se/io.h>
+#include <asm/se.h>
 
 void heartbeat_se(void);
-void setup_se(void);
 void init_se_IRQ(void);
 
 /*
@@ -57,8 +54,6 @@ struct sh_machine_vector mv_se __initmv = {
        .mv_outsw               = se_outsw,
        .mv_outsl               = se_outsl,
 
-       .mv_isa_port2addr       = se_isa_port2addr,
-
        .mv_init_irq            = init_se_IRQ,
 #ifdef CONFIG_HEARTBEAT
        .mv_heartbeat           = heartbeat_se,
index b6730ea575029417a099b7c744fe9855f69fc877..c9f75272e751479435181d4082eb49745645a877 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <asm/io.h>
-#include <asm/se/se.h>
+#include <asm/se.h>
 #include <asm/smc37c93x.h>
 
 /*
index 99041b26926121f33be525e3432daaa656a11f7f..0e8a3ba4831671978de0b48adfe1637307d3f950 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * linux/arch/sh/kernel/io_7751se.c
  *
  * Copyright (C) 2001  Ian da Silva, Jeremy Siegel
@@ -14,7 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <asm/io.h>
-#include <asm/se7751/se7751.h>
+#include <asm/se7751.h>
 #include <asm/addrspace.h>
 
 #include <linux/pci.h>
@@ -52,10 +52,6 @@ int sh_pcic_io_dummy;
 
 #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
 
-#define maybebadio(name,port) \
-  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
-        #name, (port), (__u32) __builtin_return_address(0))
-
 static inline void delay(void)
 {
        ctrl_inw(0xa0000000);
@@ -66,11 +62,7 @@ port2adr(unsigned int port)
 {
        if (port >= 0x2000)
                return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-#if 0
-       else
-               return (volatile __u16 *) (PA_SUPERIO + (port << 1));
-#endif
-       maybebadio(name,(unsigned long)port);
+       maybebadio((unsigned long)port);
        return (volatile __u16*)port;
 }
 
@@ -140,7 +132,7 @@ unsigned short sh7751se_inw(unsigned long port)
        else if (port >= 0x2000)
                return *port2adr(port);
        else
-               maybebadio(inw, port);
+               maybebadio(port);
        return 0;
 }
 
@@ -153,7 +145,7 @@ unsigned int sh7751se_inl(unsigned long port)
        else if (port >= 0x2000)
                return *port2adr(port);
        else
-               maybebadio(inl, port);
+               maybebadio(port);
        return 0;
 }
 
@@ -188,7 +180,7 @@ void sh7751se_outw(unsigned short value, unsigned long port)
        else if (port >= 0x2000)
                *port2adr(port) = value;
        else
-               maybebadio(outw, port);
+               maybebadio(port);
 }
 
 void sh7751se_outl(unsigned int value, unsigned long port)
@@ -198,17 +190,17 @@ void sh7751se_outl(unsigned int value, unsigned long port)
        else if (CHECK_SH7751_PCIIO(port))
                *((unsigned long*)PCI_IOMAP(port)) = value;
        else
-               maybebadio(outl, port);
+               maybebadio(port);
 }
 
 void sh7751se_insl(unsigned long port, void *addr, unsigned long count)
 {
-       maybebadio(insl, port);
+       maybebadio(port);
 }
 
 void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count)
 {
-       maybebadio(outsw, port);
+       maybebadio(port);
 }
 
 /* Map ISA bus address to the real address. Only for PCMCIA.  */
index bf6c023615df87306125654263eca40d0421ff7e..c607b0a48479d87b14ebff2d81263f8ae650cca1 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/irq.h>
-#include <asm/se7751/se7751.h>
+#include <asm/se7751.h>
 
 /*
  * Initialize IRQ setting
index 4405e26cf866c001b2d917470d6152875a7e62d0..ff0355dea81b37ba235c0c53953917a44cb1a786 100644 (file)
@@ -8,9 +8,8 @@
  *
  * This file contains Solution Engine specific LED code.
  */
-
-#include <asm/se7751/se7751.h>
 #include <linux/sched.h>
+#include <asm/se7751.h>
 
 /* Cycle the LED's in the clasic Knightrider/Sun pattern */
 void heartbeat_7751se(void)
index 62d8d3e62590567b527fe9f0110123fc95b86b37..1bb9047d863b5940c3f5233af0d850c610165b94 100644 (file)
  */
 
 #include <linux/init.h>
-
 #include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/machvec_init.h>
-
-#include <asm/se7751/io.h>
+#include <asm/se7751.h>
 
 void heartbeat_7751se(void);
 void init_7751se_IRQ(void);
@@ -44,8 +40,6 @@ struct sh_machine_vector mv_7751se __initmv = {
        .mv_insl                = sh7751se_insl,
        .mv_outsl               = sh7751se_outsl,
 
-       .mv_isa_port2addr       = sh7751se_isa_port2addr,
-
        .mv_init_irq            = init_7751se_IRQ,
 #ifdef CONFIG_HEARTBEAT
        .mv_heartbeat           = heartbeat_7751se,
index 48dc5aee67d4d6c6cd4edc3225cd3749cfe29af3..8b693105893c036726e6617ef9f535653296715e 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * linux/arch/sh/kernel/setup_7751se.c
  *
  * Copyright (C) 2000  Kazumoto Kojima
 
 #include <linux/init.h>
 #include <linux/irq.h>
-
-#include <linux/hdreg.h>
 #include <linux/ide.h>
 #include <asm/io.h>
-#include <asm/se7751/se7751.h>
+#include <asm/se7751.h>
 
 #ifdef CONFIG_SH_KGDB
 #include <asm/kgdb.h>
index 60290f8f289c49fda70b3f6ee6912b6f6b63ea8a..dab742a00c6f34a738eda09a76f216a122338c25 100644 (file)
@@ -7,22 +7,19 @@
 
 #include <linux/init.h>
 #include <linux/irq.h>
-#include <linux/hdreg.h>
-#include <linux/ide.h>
 #include <asm/io.h>
+#include <asm/rtc.h>
 #include <asm/sh03/io.h>
 #include <asm/sh03/sh03.h>
 #include <asm/addrspace.h>
 #include "../../drivers/pci/pci-sh7751.h"
 
-extern void (*board_time_init)(void);
-
 const char *get_system_type(void)
 {
        return "Interface CTP/PCI-SH03)";
 }
 
-void init_sh03_IRQ(void)
+static void init_sh03_IRQ(void)
 {
        ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR);
 
@@ -34,24 +31,20 @@ void init_sh03_IRQ(void)
 
 extern void *cf_io_base;
 
-unsigned long sh03_isa_port2addr(unsigned long port)
+static void __iomem *sh03_ioport_map(unsigned long port, unsigned int size)
 {
        if (PXSEG(port))
-               return port;
+               return (void __iomem *)port;
        /* CompactFlash (IDE) */
-       if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6)) {
-               return (unsigned long)cf_io_base + port;
-       }
-        return port + SH7751_PCI_IO_BASE;
-}
+       if (((port >= 0x1f0) && (port <= 0x1f7)) || (port == 0x3f6))
+               return (void __iomem *)((unsigned long)cf_io_base + port);
 
-/*
- * The Machine Vector
- */
+        return (void __iomem *)(port + SH7751_PCI_IO_BASE);
+}
 
 struct sh_machine_vector mv_sh03 __initmv = {
        .mv_nr_irqs             = 48,
-       .mv_isa_port2addr       = sh03_isa_port2addr,
+       .mv_ioport_map          = sh03_ioport_map,
        .mv_init_irq            = init_sh03_IRQ,
 
 #ifdef CONFIG_HEARTBEAT
index e2eb78fc381d6573b072cadcbc6e5fbdb7bacd7c..9f700b8392bb4d3cad12a96c73cb05a599b2fd51 100644 (file)
@@ -28,39 +28,26 @@ unsigned short secureedge5410_ioport;
 /*
  * The SnapGear uses the built-in PCI controller (PCIC)
  * of the 7751 processor
- */ 
+ */
 
 #define PCIIOBR                (volatile long *)PCI_REG(SH7751_PCIIOBR)
 #define PCIMBR          (volatile long *)PCI_REG(SH7751_PCIMBR)
 #define PCI_IO_AREA    SH7751_PCI_IO_BASE
 #define PCI_MEM_AREA   SH7751_PCI_CONFIG_BASE
 
-
 #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK))
 
-
-#define maybebadio(name,port) \
-  printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
-        #name, (port), (__u32) __builtin_return_address(0))
-
-
 static inline void delay(void)
 {
        ctrl_inw(0xa0000000);
 }
 
-
 static inline volatile __u16 *port2adr(unsigned int port)
 {
-#if 0
-       if (port >= 0x2000)
-               return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000));
-#endif
-       maybebadio(name,(unsigned long)port);
+       maybebadio((unsigned long)port);
        return (volatile __u16*)port;
 }
 
-
 /* In case someone configures the kernel w/o PCI support: in that */
 /* scenario, don't ever bother to check for PCI-window addresses */
 
@@ -115,7 +102,7 @@ unsigned short snapgear_inw(unsigned long port)
        else if (port >= 0x2000)
                return *port2adr(port);
        else
-               maybebadio(inw, port);
+               maybebadio(port);
        return 0;
 }
 
@@ -129,7 +116,7 @@ unsigned int snapgear_inl(unsigned long port)
        else if (port >= 0x2000)
                return *port2adr(port);
        else
-               maybebadio(inl, port);
+               maybebadio(port);
        return 0;
 }
 
@@ -167,7 +154,7 @@ void snapgear_outw(unsigned short value, unsigned long port)
        else if (port >= 0x2000)
                *port2adr(port) = value;
        else
-               maybebadio(outw, port);
+               maybebadio(port);
 }
 
 
@@ -178,49 +165,15 @@ void snapgear_outl(unsigned int value, unsigned long port)
        else if (CHECK_SH7751_PCIIO(port))
                *((unsigned long*)PCI_IOMAP(port)) = value;
        else
-               maybebadio(outl, port);
+               maybebadio(port);
 }
 
 void snapgear_insl(unsigned long port, void *addr, unsigned long count)
 {
-       maybebadio(insl, port);
+       maybebadio(port);
 }
 
 void snapgear_outsl(unsigned long port, const void *addr, unsigned long count)
 {
-       maybebadio(outsw, port);
-}
-
-/* Map ISA bus address to the real address. Only for PCMCIA.  */
-
-
-/* ISA page descriptor.  */
-static __u32 sh_isa_memmap[256];
-
-
-#if 0
-static int sh_isa_mmap(__u32 start, __u32 length, __u32 offset)
-{
-       int idx;
-
-       if (start >= 0x100000 || (start & 0xfff) || (length != 0x1000))
-               return -1;
-
-       idx = start >> 12;
-       sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff);
-#if 0
-       printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n",
-              start, length, offset, idx, sh_isa_memmap[idx]);
-#endif
-       return 0;
-}
-#endif
-
-unsigned long snapgear_isa_port2addr(unsigned long offset)
-{
-       int idx;
-
-       idx = (offset >> 12) & 0xff;
-       offset &= 0xfff;
-       return sh_isa_memmap[idx] + offset;
+       maybebadio(port);
 }
index b71e009da35cb265dfbcb208527451bff2dbc69f..287bc4ed3ac7c57bbf409c1f88397851c297caa2 100644 (file)
 #include <linux/time.h>
 #include <linux/rtc.h>
 #include <linux/mc146818rtc.h>
-
 #include <asm/io.h>
-#include <asm/rtc.h>
-#include <asm/mc146818rtc.h>
 
 /****************************************************************************/
 
index f1f7c70c9402d61384776b0c3ba7927729771d45..66ce32f8b13c87484fa8695628180c4a8510a4bf 100644 (file)
@@ -1,5 +1,4 @@
-/****************************************************************************/
-/* 
+/*
  * linux/arch/sh/boards/snapgear/setup.c
  *
  * Copyright (C) 2002  David McCullough <davidm@snapgear.com>
@@ -12,8 +11,6 @@
  *           Modified for 7751 Solution Engine by
  *           Ian da Silva and Jeremy Siegel, 2001.
  */
-/****************************************************************************/
-
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/sched.h>
-
 #include <asm/machvec.h>
-#include <asm/mach/io.h>
+#include <asm/snapgear.h>
 #include <asm/irq.h>
 #include <asm/io.h>
+#include <asm/rtc.h>
 #include <asm/cpu/timer.h>
 
-extern void (*board_time_init)(void);
 extern void secureedge5410_rtc_init(void);
 extern void pcibios_init(void);
 
@@ -85,91 +81,6 @@ static void __init init_snapgear_IRQ(void)
        make_ipr_irq(IRL3_IRQ, IRL3_IPR_ADDR, IRL3_IPR_POS, IRL3_PRIORITY);
 }
 
-/****************************************************************************/
-/*
- *     Fast poll interrupt simulator.
- */
-
-/*
- * Leave all of the fast timer/fast poll stuff commented out for now, since
- * it's not clear whether it actually works or not. Since it wasn't being used
- * at all in 2.4, we'll assume it's not sane for 2.6 either.. -- PFM
- */
-#if 0
-#define FAST_POLL      1000
-//#define FAST_POLL_INTR
-
-#define FASTTIMER_IRQ   17
-#define FASTTIMER_IPR_ADDR  INTC_IPRA
-#define FASTTIMER_IPR_POS    2
-#define FASTTIMER_PRIORITY   3
-
-#ifdef FAST_POLL_INTR
-#define TMU1_TCR_INIT  0x0020
-#else
-#define TMU1_TCR_INIT  0
-#endif
-#define TMU_TSTR_INIT  1
-#define TMU1_TCR_CALIB 0x0000
-
-
-#ifdef FAST_POLL_INTR
-static void fast_timer_irq(int irq, void *dev_instance, struct pt_regs *regs)
-{
-       unsigned long timer_status;
-    timer_status = ctrl_inw(TMU1_TCR);
-       timer_status &= ~0x100;
-       ctrl_outw(timer_status, TMU1_TCR);
-}
-#endif
-
-/*
- * return the current ticks on the fast timer
- */
-
-unsigned long fast_timer_count(void)
-{
-       return(ctrl_inl(TMU1_TCNT));
-}
-
-/*
- * setup a fast timer for profiling etc etc
- */
-
-static void setup_fast_timer()
-{
-       unsigned long interval;
-
-#ifdef FAST_POLL_INTR
-       interval = (current_cpu_data.module_clock/4 + FAST_POLL/2) / FAST_POLL;
-
-       make_ipr_irq(FASTTIMER_IRQ, FASTTIMER_IPR_ADDR, FASTTIMER_IPR_POS,
-                       FASTTIMER_PRIORITY);
-
-       printk("SnapGear: %dHz fast timer on IRQ %d\n",FAST_POLL,FASTTIMER_IRQ);
-
-       if (request_irq(FASTTIMER_IRQ, fast_timer_irq, 0, "SnapGear fast timer",
-                       NULL) != 0)
-               printk("%s(%d): request_irq() failed?\n", __FILE__, __LINE__);
-#else
-       printk("SnapGear: fast timer running\n",FAST_POLL,FASTTIMER_IRQ);
-       interval = 0xffffffff;
-#endif
-
-       ctrl_outb(ctrl_inb(TMU_TSTR) & ~0x2, TMU_TSTR); /* disable timer 1 */
-       ctrl_outw(TMU1_TCR_INIT, TMU1_TCR);
-       ctrl_outl(interval, TMU1_TCOR);
-       ctrl_outl(interval, TMU1_TCNT);
-       ctrl_outb(ctrl_inb(TMU_TSTR) | 0x2, TMU_TSTR); /* enable timer 1 */
-
-       printk("Timer count 1 = 0x%x\n", fast_timer_count());
-       udelay(1000);
-       printk("Timer count 2 = 0x%x\n", fast_timer_count());
-}
-#endif
-
-/****************************************************************************/
-
 const char *get_system_type(void)
 {
        return "SnapGear SecureEdge5410";
@@ -196,8 +107,6 @@ struct sh_machine_vector mv_snapgear __initmv = {
        .mv_outw_p              = snapgear_outw,
        .mv_outl_p              = snapgear_outl,
 
-       .mv_isa_port2addr       = snapgear_isa_port2addr,
-
        .mv_init_irq            = init_snapgear_IRQ,
 };
 ALIAS_MV(snapgear)
index b886fd233a66cf24e77d13e901f60f3d89a9231d..48f3494f55b15310ca8d3dcfd1f19951ea0e5c29 100644 (file)
@@ -30,10 +30,10 @@ static inline void delay(void)
         ctrl_inw(0xa0000000);
 }
 
-static inline volatile u16 *port2adr(unsigned int port)
+static inline unsigned int port2adr(unsigned int port)
 {
         maybebadio((unsigned long)port);
-        return (volatile u16*)port;
+        return port;
 }
 
 u8 titan_inb(unsigned long port)
index 155d139884c34f8b440a7cc8a1f2d33567964c06..0582ca8346b697e99a21f24208e2c3c22231fe86 100644 (file)
@@ -65,6 +65,11 @@ config HD64461_IRQ
 
          Do not change this unless you know what you are doing.
 
+config HD64461_IOBASE
+       hex "HD64461 start address"
+       depends on HD64461
+       default "0xb0000000"
+
 config HD64461_ENABLER
        bool "HD64461 PCMCIA enabler"
        depends on HD64461
@@ -73,7 +78,6 @@ config HD64461_ENABLER
          via the HD64461 companion chip.
          Otherwise, say N.
 
-
 config HD64465_IOBASE
        hex "HD64465 start address"
        depends on HD64465
index c9b823d1d073eac175172fea84386e6c5416d867..3e5fa1e24df097b450c5a33dd035d94cd04f2d09 100644 (file)
@@ -10,7 +10,8 @@
  */
 
 #include <linux/init.h>
-
+#include <linux/mm.h>
+#include <linux/vmalloc.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 
@@ -32,8 +33,6 @@
 /* SH4 can't access PCMCIA interface through P2 area.
  * we must remap it with appropreate attribute bit of the page set.
  * this part is based on Greg Banks' hd64465_ss.c implementation - Masahiro Abe */
-#include <linux/mm.h>
-#include <linux/vmalloc.h>
 
 #if defined(CONFIG_CF_AREA6)
 #define slot_no 0
@@ -84,7 +83,7 @@ static int __init cf_init_default(void)
 }
 
 #if defined(CONFIG_SH_SOLUTION_ENGINE)
-#include <asm/se/se.h>
+#include <asm/se.h>
 
 /*
  * SolutionEngine
index 3fd7a4fee6658e3504fe4da58a8fa167f19c2672..e6f90427160cf162d82682a409af375eb6e4903b 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/se/se.h>
+#include <asm/se.h>
 #include <asm/machvec.h>
 #ifdef CONFIG_SH_STANDARD_BIOS
 #include <asm/sh_bios.h>
index 857cc2ebbc69250cbc0df25501c8e95840c03750..69faf0171473b2ca8c54abe19182504ce253c261 100644 (file)
@@ -44,6 +44,9 @@
 #define        IRQ_RINGING     4               /* Ringing IRQ */
 #define        IRQ_CODEC       5               /* CODEC IRQ */
 
+#define __IO_PREFIX    hs7751rvoip
+#include <asm/io_generic.h>
+
 /* arch/sh/boards/renesas/hs7751rvoip/irq.c */
 void init_hs7751rvoip_IRQ(void);
 
index 1707cfb2915d04fcccf357035689881ef71d2133..adc6e67c6b754d9980e80bcbabf02d02356ec7fb 100644 (file)
@@ -24,7 +24,7 @@
 #define CMOS_WRITE(val,addr)   __CMOS_WRITE(val,addr,b)
 
 #elif defined(CONFIG_SH_SECUREEDGE5410)
-#include <asm/snapgear/io.h>
+#include <asm/snapgear.h>
 
 #define RTC_PORT(n)             SECUREEDGE_IOPORT_ADDR
 #define CMOS_READ(addr)         secureedge5410_cmos_read(addr)
similarity index 97%
rename from include/asm-sh/se/se.h
rename to include/asm-sh/se.h
index 791c5da0388a129526e10192b6087f8e8b2cfb27..a1832154a3aacf40400c2982e997bd2cc9e35f61 100644 (file)
@@ -74,4 +74,7 @@
 #define IRQ_STNIC      10
 #endif
 
+#define __IO_PREFIX    se
+#include <asm/io_generic.h>
+
 #endif  /* __ASM_SH_HITACHI_SE_H */
diff --git a/include/asm-sh/se/io.h b/include/asm-sh/se/io.h
deleted file mode 100644 (file)
index 9eeb86c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * include/asm-sh/io_se.h
- *
- * Copyright 2000 Stuart Menefy (stuart.menefy@st.com)
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an Hitachi SolutionEngine
- */
-
-#ifndef _ASM_SH_IO_SE_H
-#define _ASM_SH_IO_SE_H
-
-extern unsigned char se_inb(unsigned long port);
-extern unsigned short se_inw(unsigned long port);
-extern unsigned int se_inl(unsigned long port);
-
-extern void se_outb(unsigned char value, unsigned long port);
-extern void se_outw(unsigned short value, unsigned long port);
-extern void se_outl(unsigned int value, unsigned long port);
-
-extern unsigned char se_inb_p(unsigned long port);
-extern void se_outb_p(unsigned char value, unsigned long port);
-
-extern void se_insb(unsigned long port, void *addr, unsigned long count);
-extern void se_insw(unsigned long port, void *addr, unsigned long count);
-extern void se_insl(unsigned long port, void *addr, unsigned long count);
-extern void se_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void se_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void se_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned long se_isa_port2addr(unsigned long offset);
-
-#endif /* _ASM_SH_IO_SE_H */
similarity index 97%
rename from include/asm-sh/se7300/se7300.h
rename to include/asm-sh/se7300.h
index 3ec1ded86c97477e25399910e573aeddae002635..4e24edccb30d0d964dfc675b57433860620dd766 100644 (file)
@@ -58,4 +58,7 @@
 #define PA_LCD1                0xb8000000
 #define PA_LCD2                0xb8800000
 
+#define __IO_PREFIX    sh7300se
+#include <asm/io_generic.h>
+
 #endif  /* __ASM_SH_HITACHI_SE7300_H */
diff --git a/include/asm-sh/se7300/io.h b/include/asm-sh/se7300/io.h
deleted file mode 100644 (file)
index c6af855..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * include/asm-sh/se7300/io.h
- *
- * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
- * IO functions for SH-Mobile(SH7300) SolutionEngine
- */
-
-#ifndef _ASM_SH_IO_7300SE_H
-#define _ASM_SH_IO_7300SE_H
-
-extern unsigned char sh7300se_inb(unsigned long port);
-extern unsigned short sh7300se_inw(unsigned long port);
-extern unsigned int sh7300se_inl(unsigned long port);
-
-extern void sh7300se_outb(unsigned char value, unsigned long port);
-extern void sh7300se_outw(unsigned short value, unsigned long port);
-extern void sh7300se_outl(unsigned int value, unsigned long port);
-
-extern unsigned char sh7300se_inb_p(unsigned long port);
-extern void sh7300se_outb_p(unsigned char value, unsigned long port);
-
-extern void sh7300se_insb(unsigned long port, void *addr, unsigned long count);
-extern void sh7300se_insw(unsigned long port, void *addr, unsigned long count);
-extern void sh7300se_insl(unsigned long port, void *addr, unsigned long count);
-extern void sh7300se_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void sh7300se_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void sh7300se_outsl(unsigned long port, const void *addr, unsigned long count);
-
-#endif /* _ASM_SH_IO_7300SE_H */
similarity index 97%
rename from include/asm-sh/se73180/se73180.h
rename to include/asm-sh/se73180.h
index f5b93e39e768dddca9c8a02ab9aee783a30f13ca..3a4acb3e38a15239f695d0f95313977f5cb2f2bc 100644 (file)
@@ -59,4 +59,7 @@
 #define PA_LCD1                0xb8000000
 #define PA_LCD2                0xb8800000
 
+#define __IO_PREFIX    sh73180se
+#include <asm/io_generic.h>
+
 #endif  /* __ASM_SH_HITACHI_SE73180_H */
diff --git a/include/asm-sh/se73180/io.h b/include/asm-sh/se73180/io.h
deleted file mode 100644 (file)
index c9cb1b9..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * include/asm-sh/se73180/io.h
- *
- * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
- * Based on include/asm-sh/se7300/io.h
- *
- * IO functions for SH-Mobile3(SH73180) SolutionEngine
- *
- */
-
-#ifndef _ASM_SH_IO_73180SE_H
-#define _ASM_SH_IO_73180SE_H
-
-extern unsigned char sh73180se_inb(unsigned long port);
-extern unsigned short sh73180se_inw(unsigned long port);
-extern unsigned int sh73180se_inl(unsigned long port);
-
-extern void sh73180se_outb(unsigned char value, unsigned long port);
-extern void sh73180se_outw(unsigned short value, unsigned long port);
-extern void sh73180se_outl(unsigned int value, unsigned long port);
-
-extern unsigned char sh73180se_inb_p(unsigned long port);
-extern void sh73180se_outb_p(unsigned char value, unsigned long port);
-
-extern void sh73180se_insb(unsigned long port, void *addr, unsigned long count);
-extern void sh73180se_insw(unsigned long port, void *addr, unsigned long count);
-extern void sh73180se_insl(unsigned long port, void *addr, unsigned long count);
-extern void sh73180se_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void sh73180se_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void sh73180se_outsl(unsigned long port, const void *addr, unsigned long count);
-
-#endif /* _ASM_SH_IO_73180SE_H */
similarity index 97%
rename from include/asm-sh/se7751/se7751.h
rename to include/asm-sh/se7751.h
index 738e22bebdfbf13bf12da7e70143379c57526105..88cd379d9084013b48df01462c91ee6d706bd6b4 100644 (file)
@@ -65,4 +65,7 @@
 
 #define IRQ_79C973     13
 
+#define __IO_PREFIX    sh7751se
+#include <asm/io_generic.h>
+
 #endif  /* __ASM_SH_HITACHI_7751SE_H */
diff --git a/include/asm-sh/se7751/io.h b/include/asm-sh/se7751/io.h
deleted file mode 100644 (file)
index 78d8f57..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * include/asm-sh/io_7751se.h
- *
- * Modified version of io_se.h for the 7751se-specific functions.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- *
- * IO functions for an Hitachi SolutionEngine
- */
-
-#ifndef _ASM_SH_IO_7751SE_H
-#define _ASM_SH_IO_7751SE_H
-
-extern unsigned char sh7751se_inb(unsigned long port);
-extern unsigned short sh7751se_inw(unsigned long port);
-extern unsigned int sh7751se_inl(unsigned long port);
-
-extern void sh7751se_outb(unsigned char value, unsigned long port);
-extern void sh7751se_outw(unsigned short value, unsigned long port);
-extern void sh7751se_outl(unsigned int value, unsigned long port);
-
-extern unsigned char sh7751se_inb_p(unsigned long port);
-extern void sh7751se_outb_p(unsigned char value, unsigned long port);
-
-extern void sh7751se_insb(unsigned long port, void *addr, unsigned long count);
-extern void sh7751se_insw(unsigned long port, void *addr, unsigned long count);
-extern void sh7751se_insl(unsigned long port, void *addr, unsigned long count);
-extern void sh7751se_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void sh7751se_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void sh7751se_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char sh7751se_readb(unsigned long addr);
-extern unsigned short sh7751se_readw(unsigned long addr);
-extern unsigned int sh7751se_readl(unsigned long addr);
-extern void sh7751se_writeb(unsigned char b, unsigned long addr);
-extern void sh7751se_writew(unsigned short b, unsigned long addr);
-extern void sh7751se_writel(unsigned int b, unsigned long addr);
-
-extern unsigned long sh7751se_isa_port2addr(unsigned long offset);
-
-#endif /* _ASM_SH_IO_7751SE_H */
index 25792e9831ea4ab86e65b5cae37e5138e74b6b79..df3b187ef8836e7168264e5546ae0017b494964b 100644 (file)
 #define IRL3_IPR_POS   0
 #define IRL3_PRIORITY  4
 
-
-extern unsigned long sh03_isa_port2addr(unsigned long offset);
-
-extern void setup_sh03(void);
-extern void init_sh03_IRQ(void);
-extern void heartbeat_sh03(void);
-
-extern void sh03_rtc_gettimeofday(struct timeval *tv);
-extern int sh03_rtc_settimeofday(const struct timeval *tv);
+void heartbeat_sh03(void);
 
 #endif /* _ASM_SH_IO_SH03_H */
similarity index 62%
rename from include/asm-sh/snapgear/io.h
rename to include/asm-sh/snapgear.h
index bfa97ac0628019448c5c76cd0febe93f167c5cbf..6b5e4ddc073accbdb7133b7831b53303fdccc086 100644 (file)
 #define IRL3_PRIORITY  4
 #endif
 
-extern unsigned char snapgear_inb(unsigned long port);
-extern unsigned short snapgear_inw(unsigned long port);
-extern unsigned int snapgear_inl(unsigned long port);
-
-extern void snapgear_outb(unsigned char value, unsigned long port);
-extern void snapgear_outw(unsigned short value, unsigned long port);
-extern void snapgear_outl(unsigned int value, unsigned long port);
-
-extern unsigned char snapgear_inb_p(unsigned long port);
-extern void snapgear_outb_p(unsigned char value, unsigned long port);
-
-extern void snapgear_insl(unsigned long port, void *addr, unsigned long count);
-extern void snapgear_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned long snapgear_isa_port2addr(unsigned long offset);
+#define __IO_PREFIX    snapgear
+#include <asm/io_generic.h>
 
 #ifdef CONFIG_SH_SECUREEDGE5410
 /*
@@ -79,14 +66,14 @@ extern unsigned long snapgear_isa_port2addr(unsigned long offset);
  * D12        -                      RTS RESET
  */
 
- #define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
- extern unsigned short secureedge5410_ioport;
+#define SECUREEDGE_IOPORT_ADDR ((volatile short *) 0xb0000000)
+extern unsigned short secureedge5410_ioport;
 
- #define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
-                (secureedge5410_ioport = \
-                               ((secureedge5410_ioport & ~(mask)) | ((val) & (mask)))))
- #define SECUREEDGE_READ_IOPORT() \
-                ((*SECUREEDGE_IOPORT_ADDR&0x0817) | (secureedge5410_ioport&~0x0817))
+#define SECUREEDGE_WRITE_IOPORT(val, mask) (*SECUREEDGE_IOPORT_ADDR = \
+        (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 */
diff --git a/include/asm-sh/systemh/io.h b/include/asm-sh/systemh/io.h
deleted file mode 100644 (file)
index 327849b..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * include/asm-sh/systemh/io.h
- *
- * Stupid I/O definitions for SystemH, cloned from SE7751.
- *
- * Copyright (C) 2003  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.
- */
-#ifndef __ASM_SH_SYSTEMH_IO_H
-#define __ASM_SH_SYSTEMH_IO_H
-
-extern unsigned char sh7751systemh_inb(unsigned long port);
-extern unsigned short sh7751systemh_inw(unsigned long port);
-extern unsigned int sh7751systemh_inl(unsigned long port);
-
-extern void sh7751systemh_outb(unsigned char value, unsigned long port);
-extern void sh7751systemh_outw(unsigned short value, unsigned long port);
-extern void sh7751systemh_outl(unsigned int value, unsigned long port);
-
-extern unsigned char sh7751systemh_inb_p(unsigned long port);
-extern void sh7751systemh_outb_p(unsigned char value, unsigned long port);
-
-extern void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count);
-extern void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count);
-extern void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count);
-extern void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count);
-extern void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long count);
-extern void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count);
-
-extern unsigned char sh7751systemh_readb(unsigned long addr);
-extern unsigned short sh7751systemh_readw(unsigned long addr);
-extern unsigned int sh7751systemh_readl(unsigned long addr);
-extern void sh7751systemh_writeb(unsigned char b, unsigned long addr);
-extern void sh7751systemh_writew(unsigned short b, unsigned long addr);
-extern void sh7751systemh_writel(unsigned int b, unsigned long addr);
-
-extern unsigned long sh7751systemh_isa_port2addr(unsigned long offset);
-
-#endif /* __ASM_SH_SYSTEMH_IO_H */
-
similarity index 97%
rename from include/asm-sh/systemh/7751systemh.h
rename to include/asm-sh/systemh7751.h
index 4170531bdbd937206bf4ee4b84129cae2922d4f7..b143bb2a2ca757a8128f14185fc2b6eabf6f931d 100644 (file)
@@ -65,4 +65,7 @@
 
 #define IRQ_79C973     13
 
+#define __IO_PREFIX    sh7751systemh
+#include <asm/io_generic.h>
+
 #endif  /* __ASM_SH_SYSTEMH_7751SYSTEMH_H */