From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fed1rmmtao05.cox.net (fed1rmmtao05.cox.net [68.230.241.34]) by ozlabs.org (Postfix) with ESMTP id D9DED67E8D for ; Mon, 15 Aug 2005 02:14:19 +1000 (EST) Date: Sun, 14 Aug 2005 09:14:16 -0700 From: Matt Porter To: Shawn Jin Message-ID: <20050814091416.B20320@cox.net> References: <20050812203335.K30033@cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: ; from shawnxjin@gmail.com on Sat, Aug 13, 2005 at 08:56:50PM -0700 Cc: ppcembed Subject: Re: writel(), readl() in List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sat, Aug 13, 2005 at 08:56:50PM -0700, Shawn Jin wrote: > > read*()/write*() are accessors for PCI and PCI only. PCI is little > > If read*()/write*() are designed for PCI access only as you claimed, > that explains why they call in/out_leXX() funcitons. > > The problem is that read*()/write*() are misused in some places, e.g., > serial drivers such as serial8250. The serial_in() and serial_out() > call read*() and write*() respectively. So what's your recommendation > in such a case? Keep misusing them. There's no generic accessors for memory mapped I/O. People just started using them in generic drivers because they are convenient. I use the the __raw_read*() for non byte swapped access (or in/outbe32() depending on my memory barrier requirements. Also, portions of the 8250 serial driver using readl/writel are assuming that the serial port in on PCI or other little endian bus. readb/writeb usage doesn't matter in that driver. -Matt