From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH] imsttfb 2.5.x Date: 15 Apr 2003 22:05:29 +0200 Sender: linux-fbdev-devel-admin@lists.sourceforge.net Message-ID: <1050437129.2266.6.camel@zion.wanadoo.fr> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Received: from amarseille-201-1-6-42.abo.wanadoo.fr ([80.11.137.42] helo=zion.wanadoo.fr) by sc8-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 195WhZ-0007yv-00 for ; Tue, 15 Apr 2003 13:06:45 -0700 In-Reply-To: Errors-To: linux-fbdev-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii" 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