/* * linux/include/asm-m68k/io.h * * 4/1/00 RZ: - rewritten to avoid clashes between ISA/PCI and other * IO access * - added Q40 support * - added skeleton for GG-II and Amiga PCMCIA * 2/3/01 RZ: - moved a few more defs into raw_io.h * * inX/outX should not be used by any driver unless it does * ISA access. Other drivers should use function defined in raw_io.h * or define its own macros on top of these. * * inX(),outX() are for ISA I/O * isa_readX(),isa_writeX() are for ISA memory */ #ifndef _IO_H #define _IO_H #ifdef __KERNEL__ #include #include #include #include #ifdef CONFIG_ATARI #include #endif /* * IO/MEM definitions for various ISA bridges */ #ifdef CONFIG_Q40 #define q40_isa_io_base 0xff400000 #define q40_isa_mem_base 0xff800000 #define Q40_ISA_IO_B(ioaddr) (q40_isa_io_base+1+4*((unsigned long)(ioaddr))) #define Q40_ISA_IO_W(ioaddr) (q40_isa_io_base+ 4*((unsigned long)(ioaddr))) #define Q40_ISA_MEM_B(madr) (q40_isa_mem_base+1+4*((unsigned long)(madr))) #define Q40_ISA_MEM_W(madr) (q40_isa_mem_base+ 4*((unsigned long)(madr))) #define MULTI_ISA 0 #endif /* Q40 */ #ifdef CONFIG_AMIGA_PCMCIA #include #define AG_ISA_IO_B(ioaddr) ( GAYLE_IO+(ioaddr)+(((ioaddr)&1)*GAYLE_ODD) ) #define AG_ISA_IO_W(ioaddr) ( GAYLE_IO+(ioaddr) ) #ifndef MULTI_ISA #define MULTI_ISA 0 #else #undef MULTI_ISA #define MULTI_ISA 1 #endif #endif /* AMIGA_PCMCIA */ #if defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE) #define HAVE_ARCH_PIO_SIZE #define PIO_OFFSET 0 #define PIO_MASK 0xffff #define PIO_RESERVED 0x10000 u8 mcf_pci_inb(u32 addr); u16 mcf_pci_inw(u32 addr); u32 mcf_pci_inl(u32 addr); void mcf_pci_insb(u32 addr, u8 *buf, u32 len); void mcf_pci_insw(u32 addr, u16 *buf, u32 len); void mcf_pci_insl(u32 addr, u32 *buf, u32 len); void mcf_pci_outb(u8 v, u32 addr); void mcf_pci_outw(u16 v, u32 addr); void mcf_pci_outl(u32 v, u32 addr); void mcf_pci_outsb(u32 addr, const u8 *buf, u32 len); void mcf_pci_outsw(u32 addr, const u16 *buf, u32 len); void mcf_pci_outsl(u32 addr, const u32 *buf, u32 len); #define inb mcf_pci_inb #define inb_p mcf_pci_inb #define inw mcf_pci_inw #define inw_p mcf_pci_inw #define inl mcf_pci_inl #define inl_p mcf_pci_inl #define insb mcf_pci_insb #define insw mcf_pci_insw #define insl mcf_pci_insl #define outb mcf_pci_outb #define outb_p mcf_pci_outb #define outw mcf_pci_outw #define outw_p mcf_pci_outw #define outl mcf_pci_outl #define outl_p mcf_pci_outl #define outsb mcf_pci_outsb #define outsw mcf_pci_outsw #define outsl mcf_pci_outsl #define readb(addr) in_8(addr) #define writeb(v, addr) out_8((addr), (v)) #define readw(addr) in_le16(addr) #define writew(v, addr) out_le16((addr), (v)) #elif defined(CONFIG_ISA) #if MULTI_ISA == 0 #undef MULTI_ISA #endif #define ISA_TYPE_Q40 (1) #define ISA_TYPE_AG (2) #if defined(CONFIG_Q40) && !defined(MULTI_ISA) #define ISA_TYPE ISA_TYPE_Q40 #define ISA_SEX 0 #endif #if defined(CONFIG_AMIGA_PCMCIA) && !defined(MULTI_ISA) #define ISA_TYPE ISA_TYPE_AG #define ISA_SEX 1 #endif #ifdef MULTI_ISA extern int isa_type; extern int isa_sex; #define ISA_TYPE isa_type #define ISA_SEX isa_sex #endif /* * define inline addr translation functions. Normally only one variant will * be compiled in so the case statement will be optimised away */ static inline u8 __iomem *isa_itb(unsigned long addr) {