* [PATCH] imsttfb 2.5.x
@ 2003-04-12 11:19 Boris Bezlaj
2003-04-15 7:05 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Boris Bezlaj @ 2003-04-12 11:19 UTC (permalink / raw)
To: linux-fbdev-devel
In 2.5.67 imsttfb locks the system when it's time to scrool the text.
Patch below fixes that. Otherwise everything seems to work as in 2.4
--- linux/drivers/video/ORIG_imsttfb.c 2003-04-09 15:11:46.000000000 +0200
+++ linux/drivers/video/imsttfb.c 2003-04-11 16:44:07.000000000 +0200
@@ -409,7 +409,7 @@
static inline u32 read_reg_le32(volatile u32 *base, int regindex)
{
#ifdef __powerpc__
- in_le32((volatile u32 *) (base + regindex));
+ return in_le32((volatile u32 *) (base + regindex));
#else
return readl(base + regindex);
#endif
--
Boris
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] imsttfb 2.5.x
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
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2003-04-15 7:05 UTC (permalink / raw)
To: Boris Bezlaj; +Cc: Linux Fbdev development list
On Sat, 2003-04-12 at 13:19, Boris Bezlaj wrote:
> In 2.5.67 imsttfb locks the system when it's time to scrool the text.
> Patch below fixes that. Otherwise everything seems to work as in 2.4
>
> --- linux/drivers/video/ORIG_imsttfb.c 2003-04-09 15:11:46.000000000 +0200
> +++ linux/drivers/video/imsttfb.c 2003-04-11 16:44:07.000000000 +0200
> @@ -409,7 +409,7 @@
> static inline u32 read_reg_le32(volatile u32 *base, int regindex)
> {
> #ifdef __powerpc__
> - in_le32((volatile u32 *) (base + regindex));
> + return in_le32((volatile u32 *) (base + regindex));
> #else
> return readl(base + regindex);
> #endif
There is actually no reason not to use readl() on ppc as well
Ben.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] imsttfb 2.5.x
2003-04-15 7:05 ` Benjamin Herrenschmidt
@ 2003-04-15 19:33 ` James Simmons
2003-04-15 20:05 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: James Simmons @ 2003-04-15 19:33 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Boris Bezlaj, Linux Fbdev development list
> On Sat, 2003-04-12 at 13:19, Boris Bezlaj wrote:
> > In 2.5.67 imsttfb locks the system when it's time to scrool the text.
> > Patch below fixes that. Otherwise everything seems to work as in 2.4
> >
> > --- linux/drivers/video/ORIG_imsttfb.c 2003-04-09 15:11:46.000000000 +0200
> > +++ linux/drivers/video/imsttfb.c 2003-04-11 16:44:07.000000000 +0200
> > @@ -409,7 +409,7 @@
> > static inline u32 read_reg_le32(volatile u32 *base, int regindex)
> > {
> > #ifdef __powerpc__
> > - in_le32((volatile u32 *) (base + regindex));
> > + return in_le32((volatile u32 *) (base + regindex));
> > #else
> > return readl(base + regindex);
> > #endif
>
> There is actually no reason not to use readl() on ppc as well
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.
P.S
This whole issue really sucks. I really wish there was a clean standard
api to this.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] imsttfb 2.5.x
2003-04-15 19:33 ` James Simmons
@ 2003-04-15 20:05 ` Benjamin Herrenschmidt
2003-04-15 22:43 ` Boris Bezlaj
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2003-04-15 20:05 UTC (permalink / raw)
To: James Simmons; +Cc: Boris Bezlaj, Linux Fbdev development list
> 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.
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...
Ben.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] imsttfb 2.5.x
2003-04-15 20:05 ` Benjamin Herrenschmidt
@ 2003-04-15 22:43 ` Boris Bezlaj
2003-04-16 8:26 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Boris Bezlaj @ 2003-04-15 22:43 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: James Simmons, Linux Fbdev development list
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] imsttfb 2.5.x
2003-04-15 22:43 ` Boris Bezlaj
@ 2003-04-16 8:26 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2003-04-16 8:26 UTC (permalink / raw)
To: Boris Bezlaj; +Cc: James Simmons, Linux Fbdev development list
On Wed, 2003-04-16 at 00:43, Boris Bezlaj wrote:
> 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)
Possibly, I never tested
> Or would it be better to scrap the read/write_reg_le32 alltogether?
Go on ;)
Ben.
> 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
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-04-16 8:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2003-04-16 8:26 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).