X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-sh%2Fio.h;h=a0e55b09e4fd773b30d9acf30e2e89ed60f72340;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=b0b2937b6f8349f94244bb4204e45263378e7529;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h index b0b2937b6..a0e55b09e 100644 --- a/include/asm-sh/io.h +++ b/include/asm-sh/io.h @@ -23,7 +23,6 @@ * inb by default expands to _inb, but the machine specific code may * define it to __inb if it chooses. */ -#include #include #include #include @@ -108,6 +107,9 @@ #define __raw_writew(v, a) __writew(v, (void __iomem *)(a)) #define __raw_writel(v, a) __writel(v, (void __iomem *)(a)) +void __raw_writesl(unsigned long addr, const void *data, int longlen); +void __raw_readsl(unsigned long addr, void *data, int longlen); + /* * The platform header files may define some of these macros to use * the inlined versions where appropriate. These macros may also be @@ -133,6 +135,9 @@ # define writel(v,a) ({ __raw_writel((v),(a)); mb(); }) #endif +#define writesl __raw_writesl +#define readsl __raw_readsl + #define readb_relaxed(a) readb(a) #define readw_relaxed(a) readw(a) #define readl_relaxed(a) readl(a) @@ -174,20 +179,6 @@ static inline void __set_io_port_base(unsigned long pbase) generic_io_base = pbase; } -#define isa_readb(a) readb(ioport_map(a, 1)) -#define isa_readw(a) readw(ioport_map(a, 2)) -#define isa_readl(a) readl(ioport_map(a, 4)) -#define isa_writeb(b,a) writeb(b,ioport_map(a, 1)) -#define isa_writew(w,a) writew(w,ioport_map(a, 2)) -#define isa_writel(l,a) writel(l,ioport_map(a, 4)) - -#define isa_memset_io(a,b,c) \ - memset((void *)(ioport_map((unsigned long)(a), 1)),(b),(c)) -#define isa_memcpy_fromio(a,b,c) \ - memcpy((a),(void *)(ioport_map((unsigned long)(b), 1)),(c)) -#define isa_memcpy_toio(a,b,c) \ - memcpy((void *)(ioport_map((unsigned long)(a), 1)),(b),(c)) - /* We really want to try and get these to memcpy etc */ extern void memcpy_fromio(void *, volatile void __iomem *, unsigned long); extern void memcpy_toio(volatile void __iomem *, const void *, unsigned long); @@ -224,8 +215,14 @@ static inline void ctrl_outl(unsigned int b, unsigned long addr) *(volatile unsigned long*)addr = b; } +static inline void ctrl_delay(void) +{ + ctrl_inw(P2SEG); +} + #define IO_SPACE_LIMIT 0xffffffff +#ifdef CONFIG_MMU /* * Change virtual addresses to physical addresses and vv. * These are trivial on the 1:1 Linux/SuperH mapping @@ -239,6 +236,10 @@ static inline void *phys_to_virt(unsigned long address) { return (void *)P1SEGADDR(address); } +#else +#define phys_to_virt(address) ((void *)(address)) +#define virt_to_phys(address) ((unsigned long)(address)) +#endif #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt @@ -303,22 +304,6 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) #define iounmap(addr) \ __iounmap((addr)) -static inline int check_signature(char __iomem *io_addr, - const unsigned char *signature, int length) -{ - int retval = 0; - do { - if (readb(io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - } while (length); - retval = 1; -out: - return retval; -} - /* * The caches on some architectures aren't dma-coherent and have need to * handle this in software. There are three types of operations that