Thread (6 messages) 6 messages, 3 authors, 2003-04-16

Re: [PATCH] imsttfb 2.5.x

From: Boris Bezlaj <hidden>
Date: 2003-04-15 22:43:34

On Tue, Apr 15, 2003 at 10:05:29PM +0200, Benjamin Herrenschmidt wrote:
quoted
Does readl handle byte swapping on the PPC. The registers expect the data 
feed to them to be little endian. Actually this driver will only work on 
the PPC and ix86 platform. Other big endian platforms are out of luck. 
It works on ix86? I thought there were problems with ramdac init..must
try that someday 8)
Yes, readl/writel will do the right thing. Use of in_le32 here is
probably for pre-historical reasons ;)

All PCI capabale big endian platforms shall have proper byteswapping
readl/writel.
quoted
P.S
   This whole issue really sucks. I really wish there was a clean standard 
api to this. 
There is one, and it's readl/writel ;)

The only real problem is that currently, we lack equivalent of the "s"
versions of in/out macros for mmio. This is a bit annoying for the few
rare case where they would be useful as those shouldn't byteswap, but
re-implementing with __raw_read/writel (which doesn't byteswap neither)
is nasty because it exposes the barrier problem to the driver.

It would be convenient to define {read,write}s{b,w,l} so the IO
accessors and MMIO accessors apre perfectly symetric, but that's an
old debate...
I can't really follow you here..not enough knowledge :( Anyway, here's
the mostly tested patch..works for me.

Or would it be better to scrap the read/write_reg_le32 alltogether?

P.S.
	Please check http://knjiznica-jesenice.org/~boris/boot/101_0145.JPG
What would i need to initialize in ramdac to get rid of "checkerboard" effect? Any ideas?


--- linux-2.5.50/drivers/video/ORIG_imsttfb.c   2003-04-15 23:06:29.000000000 +0200
+++ linux-2.5.50/drivers/video/imsttfb.c        2003-04-15 23:07:41.000000000 +0200
@@ -408,20 +408,12 @@
  */
 static inline u32 read_reg_le32(volatile u32 *base, int regindex)
 {
-#ifdef __powerpc__
-       return in_le32((volatile u32 *) (base + regindex));
-#else
        return readl(base + regindex);
-#endif
 }

 static inline void write_reg_le32(volatile u32 *base, int regindex, u32 val)
 {
-#ifdef __powerpc__
-       out_le32((volatile u32 *) (base + regindex), val);
-#else
        writel(val, base + regindex);
-#endif
 }

 static __u32
-- 

  Boris


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help