generic 2.6.24 support
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / patches-2.6.24 / 930-ppc_big_endian_io_memory_accessors.patch
1 From a.othieno@bluewin.ch Tue Oct 11 07:50:21 2005
2 From: Arthur Othieno <a.othieno@bluewin.ch>
3 Subject: Big-endian I/O memory accessors.
4 Date: Tue, 11 Oct 2005 07:50:21 +1000
5 X-Patchwork-ID: 2759
6
7 From: Arthur Othieno <a.othieno@bluewin.ch>
8
9 I/O memory accessors. Big endian version. For those busses/devices
10 that do export big-endian I/O memory.
11
12 Of notable relevance/reference:
13
14 http://lwn.net/Articles/132804/
15 http://ozlabs.org/pipermail/linuxppc-embedded/2005-August/019798.html
16 http://ozlabs.org/pipermail/linuxppc-embedded/2005-August/019752.html
17
18 Signed-off-by: Arthur Othieno <a.othieno@bluewin.ch>
19 ---
20
21 Paulus,
22
23 A similar patch for ppc64 made it upstream with your big ppc64 merge.
24 This one is still sitting in http://patchwork.ozlabs.org/linuxppc/
25 and didn't make it with the ppc32 equivalent. Thanks.
26
27
28 include/asm-ppc/io.h | 20 ++++++++++++++++++++
29 1 file changed, 20 insertions(+)
30
31
32 ---
33 diff -uprN a/include/asm-ppc/io.h b/include/asm-ppc/io.h
34 --- a/include/asm-ppc/io.h 2005-08-21 17:49:44.000000000 -0400
35 +++ b/include/asm-ppc/io.h 2005-08-21 20:29:55.000000000 -0400
36 @@ -487,11 +487,21 @@ static inline unsigned int ioread16(void
37 return readw(addr);
38 }
39
40 +static inline unsigned int ioread16be(void __iomem *addr)
41 +{
42 + return in_be16(addr);
43 +}
44 +
45 static inline unsigned int ioread32(void __iomem *addr)
46 {
47 return readl(addr);
48 }
49
50 +static inline unsigned int ioread32be(void __iomem *addr)
51 +{
52 + return in_be32(addr);
53 +}
54 +
55 static inline void iowrite8(u8 val, void __iomem *addr)
56 {
57 writeb(val, addr);
58 @@ -502,11 +512,21 @@ static inline void iowrite16(u16 val, vo
59 writew(val, addr);
60 }
61
62 +static inline void iowrite16be(u16 val, void __iomem *addr)
63 +{
64 + out_be16(addr, val);
65 +}
66 +
67 static inline void iowrite32(u32 val, void __iomem *addr)
68 {
69 writel(val, addr);
70 }
71
72 +static inline void iowrite32be(u32 val, void __iomem *addr)
73 +{
74 + out_be32(addr, val);
75 +}
76 +
77 static inline void ioread8_rep(void __iomem *addr, void *dst, unsigned long count)
78 {
79 _insb(addr, dst, count);
80