All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Bezlaj <boris@gajba.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: James Simmons <jsimmons@infradead.org>,
	Linux Fbdev development list
	<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: [PATCH] imsttfb 2.5.x
Date: Wed, 16 Apr 2003 00:43:13 +0200	[thread overview]
Message-ID: <20030415224313.GA358@gajba.net> (raw)
In-Reply-To: <1050437129.2266.6.camel@zion.wanadoo.fr>

On Tue, Apr 15, 2003 at 10:05:29PM +0200, Benjamin Herrenschmidt wrote:
> 
> > 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.
> 
> > 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

  reply	other threads:[~2003-04-15 22:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-12 11:19 [PATCH] imsttfb 2.5.x Boris Bezlaj
2003-04-15  7:05 ` Benjamin Herrenschmidt
2003-04-15 19:33   ` James Simmons
2003-04-15 20:05     ` Benjamin Herrenschmidt
2003-04-15 22:43       ` Boris Bezlaj [this message]
2003-04-16  8:26         ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030415224313.GA358@gajba.net \
    --to=boris@gajba.net \
    --cc=benh@kernel.crashing.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.