From b66c1a3919abb40f9bd8fb92a0d9fd77eb899c54 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Mon, 16 Jan 2006 22:14:15 -0800 Subject: [PATCH] sh: I/O routine cleanups and ioremap() overhaul This introduces a few changes in the way that the I/O routines are defined on SH, specifically so that things like the iomap API properly wrap through the machvec for board-specific quirks. In addition to this, the old p3_ioremap() work is converted to a more generic __ioremap() that will map through the PMB if it's available, or fall back on page tables for everything else. An alpha-like IO_CONCAT is also added so we can start to clean up the board-specific io.h mess, which will be handled in board update patches.. Signed-off-by: Paul Mundt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-sh/machvec.h | 66 +++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 35 deletions(-) (limited to 'include/asm-sh/machvec.h') diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h index 3f18aa18051..550c50a7359 100644 --- a/include/asm-sh/machvec.h +++ b/include/asm-sh/machvec.h @@ -18,44 +18,37 @@ #include struct device; -struct timeval; -struct sh_machine_vector -{ +struct sh_machine_vector { int mv_nr_irqs; - unsigned char (*mv_inb)(unsigned long); - unsigned short (*mv_inw)(unsigned long); - unsigned int (*mv_inl)(unsigned long); - void (*mv_outb)(unsigned char, unsigned long); - void (*mv_outw)(unsigned short, unsigned long); - void (*mv_outl)(unsigned int, unsigned long); - - unsigned char (*mv_inb_p)(unsigned long); - unsigned short (*mv_inw_p)(unsigned long); - unsigned int (*mv_inl_p)(unsigned long); - void (*mv_outb_p)(unsigned char, unsigned long); - void (*mv_outw_p)(unsigned short, unsigned long); - void (*mv_outl_p)(unsigned int, unsigned long); - - void (*mv_insb)(unsigned long port, void *addr, unsigned long count); - void (*mv_insw)(unsigned long port, void *addr, unsigned long count); - void (*mv_insl)(unsigned long port, void *addr, unsigned long count); - void (*mv_outsb)(unsigned long port, const void *addr, unsigned long count); - void (*mv_outsw)(unsigned long port, const void *addr, unsigned long count); - void (*mv_outsl)(unsigned long port, const void *addr, unsigned long count); - - unsigned char (*mv_readb)(unsigned long); - unsigned short (*mv_readw)(unsigned long); - unsigned int (*mv_readl)(unsigned long); - void (*mv_writeb)(unsigned char, unsigned long); - void (*mv_writew)(unsigned short, unsigned long); - void (*mv_writel)(unsigned int, unsigned long); - - void* (*mv_ioremap)(unsigned long offset, unsigned long size); - void (*mv_iounmap)(void *addr); - - unsigned long (*mv_isa_port2addr)(unsigned long offset); + u8 (*mv_inb)(unsigned long); + u16 (*mv_inw)(unsigned long); + u32 (*mv_inl)(unsigned long); + void (*mv_outb)(u8, unsigned long); + void (*mv_outw)(u16, unsigned long); + void (*mv_outl)(u32, unsigned long); + + u8 (*mv_inb_p)(unsigned long); + u16 (*mv_inw_p)(unsigned long); + u32 (*mv_inl_p)(unsigned long); + void (*mv_outb_p)(u8, unsigned long); + void (*mv_outw_p)(u16, unsigned long); + void (*mv_outl_p)(u32, unsigned long); + + void (*mv_insb)(unsigned long, void *dst, unsigned long count); + void (*mv_insw)(unsigned long, void *dst, unsigned long count); + void (*mv_insl)(unsigned long, void *dst, unsigned long count); + void (*mv_outsb)(unsigned long, const void *src, unsigned long count); + void (*mv_outsw)(unsigned long, const void *src, unsigned long count); + void (*mv_outsl)(unsigned long, const void *src, unsigned long count); + + u8 (*mv_readb)(void __iomem *); + u16 (*mv_readw)(void __iomem *); + u32 (*mv_readl)(void __iomem *); + void (*mv_writeb)(u8, void __iomem *); + void (*mv_writew)(u16, void __iomem *); + void (*mv_writel)(u32, void __iomem *); int (*mv_irq_demux)(int irq); @@ -66,6 +59,9 @@ struct sh_machine_vector void *(*mv_consistent_alloc)(struct device *, size_t, dma_addr_t *, gfp_t); int (*mv_consistent_free)(struct device *, size_t, void *, dma_addr_t); + + void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size); + void (*mv_ioport_unmap)(void __iomem *); }; extern struct sh_machine_vector sh_mv; -- cgit v1.2.3