* [PATCH] sh: Provide in/out{b,w,l}
@ 2011-02-02 7:05 Nobuhiro Iwamatsu
2011-02-02 23:42 ` Paul Mundt
2011-02-09 4:05 ` Nobuhiro Iwamatsu
0 siblings, 2 replies; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2011-02-02 7:05 UTC (permalink / raw)
To: linux-sh
By commit 37b7a97884ba64bf7d403351ac2a9476ab4f1bba,
delete machvec IO routines.
Because the definition of in/out_{b,w,l} was deleted,
driver needing these cannot build.
This defines it again.
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
arch/sh/include/asm/io.h | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 28c5aa5..408d3ed 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -69,6 +69,43 @@
#define writesw(p,d,l) __raw_writesw(p,d,l)
#define writesl(p,d,l) __raw_writesl(p,d,l)
+static inline u8 inb(unsigned long addr)
+{
+ return __raw_readb(addr);
+}
+
+static inline u16 inw(unsigned long addr)
+{
+ return __raw_readw(addr);
+}
+
+static inline u32 inl(unsigned long addr)
+{
+ return __raw_readl(addr);
+}
+
+static inline void outb(u8 b, unsigned long addr)
+{
+ __raw_writeb(b, addr);
+}
+
+static inline void outw(u16 b, unsigned long addr)
+{
+ __raw_writew(b, addr);
+}
+
+static inline void outl(u32 b, unsigned long addr)
+{
+ __raw_writel(b, addr);
+}
+
+#define inb_p(addr) readb_relaxed(addr)
+#define inw_p(addr) readw_relaxed(addr)
+#define inl_p(addr) readl_relaxed(addr)
+#define outb_p(x, addr) writeb_relaxed((x), (addr))
+#define outw_p(x, addr) writew_relaxed((x), (addr))
+#define outl_p(x, addr) writel_relaxed((x), (addr))
+
#define __BUILD_UNCACHED_IO(bwlq, type) \
static inline type read##bwlq##_uncached(unsigned long addr) \
{ \
--
1.7.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sh: Provide in/out{b,w,l}
2011-02-02 7:05 [PATCH] sh: Provide in/out{b,w,l} Nobuhiro Iwamatsu
@ 2011-02-02 23:42 ` Paul Mundt
2011-02-09 4:05 ` Nobuhiro Iwamatsu
1 sibling, 0 replies; 3+ messages in thread
From: Paul Mundt @ 2011-02-02 23:42 UTC (permalink / raw)
To: linux-sh
On Wed, Feb 02, 2011 at 04:05:15PM +0900, Nobuhiro Iwamatsu wrote:
> By commit 37b7a97884ba64bf7d403351ac2a9476ab4f1bba,
> delete machvec IO routines.
> Because the definition of in/out_{b,w,l} was deleted,
> driver needing these cannot build.
> This defines it again.
>
Wrong. Please actually study the change and try to figure out what it is
doing before re-introducing stuff it intentionally removed.
The only time we have PIO is when PCI is available, anything else is just
broken wrapping in to MMIO due to drivers using legacy PIO accessors.
These are now few enough that it's trivial to simply fix up the drivers
accordingly.
If IOPORT support is enabled (by way of CONFIG_PCI) then all of the PIO
routines likewise become available -- these are constructed by the
BUILDIO_IOPORT macro. The PIO offsets in question are then relative to
the PCI channel's I/O base.
It took us years to get rid of all of the crap SuperIO fake PIO nonsense,
any attempt to re-add bogus PIO routines in an IOMEM only configuration
are fundamentally broken.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sh: Provide in/out{b,w,l}
2011-02-02 7:05 [PATCH] sh: Provide in/out{b,w,l} Nobuhiro Iwamatsu
2011-02-02 23:42 ` Paul Mundt
@ 2011-02-09 4:05 ` Nobuhiro Iwamatsu
1 sibling, 0 replies; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2011-02-09 4:05 UTC (permalink / raw)
To: linux-sh
Hi, Paul.
2011/2/3 Paul Mundt <lethal@linux-sh.org>:
> On Wed, Feb 02, 2011 at 04:05:15PM +0900, Nobuhiro Iwamatsu wrote:
>> By commit 37b7a97884ba64bf7d403351ac2a9476ab4f1bba,
>> delete machvec IO routines.
>> Because the definition of in/out_{b,w,l} was deleted,
>> driver needing these cannot build.
>> This defines it again.
>>
> Wrong. Please actually study the change and try to figure out what it is
> doing before re-introducing stuff it intentionally removed.
>
> The only time we have PIO is when PCI is available, anything else is just
> broken wrapping in to MMIO due to drivers using legacy PIO accessors.
> These are now few enough that it's trivial to simply fix up the drivers
> accordingly.
>
> If IOPORT support is enabled (by way of CONFIG_PCI) then all of the PIO
> routines likewise become available -- these are constructed by the
> BUILDIO_IOPORT macro. The PIO offsets in question are then relative to
> the PCI channel's I/O base.
>
> It took us years to get rid of all of the crap SuperIO fake PIO nonsense,
> any attempt to re-add bogus PIO routines in an IOMEM only configuration
> are fundamentally broken.
I read asm/io.h again and understood your indication.
Sorry, and thanks!
Nobuhiro
--
Nobuhiro Iwamatsu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-09 4:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-02 7:05 [PATCH] sh: Provide in/out{b,w,l} Nobuhiro Iwamatsu
2011-02-02 23:42 ` Paul Mundt
2011-02-09 4:05 ` Nobuhiro Iwamatsu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.