public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurentp@cse-semaphore.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: linux-serial@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] 8250: Add PowerPC-style MMIO support to the 8250 driver
Date: Thu, 24 Jul 2008 14:34:24 +0200	[thread overview]
Message-ID: <200807241434.31671.laurentp@cse-semaphore.com> (raw)
In-Reply-To: <20080724121425.GB9327@flint.arm.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

On Thursday 24 July 2008, Russell King wrote:
> On Thu, Jul 24, 2008 at 02:11:15PM +0200, Laurent Pinchart wrote:
> > This patch adds support for memory-mapped 8250-like UARTs on PowerPC
> > platforms. 
> 
> What is different about in_8() from readb() ?  Why can't PowerPC use
> readb()?

If I'm not mistaken, readb/readw/readl/writeb/writew/writel are PCI accessors, at least on the PowerPC platform.

I took a closer look at the read*/write* functions. When both PCI indirect IO and PCI extended error handling are disabled, read*/write* are translated to little-endian MMIO accessors (in_8, in_le16, in_le32, out_8, out_le16, out_le32). This is the case for most embedded PowerPC platforms where a 8250-like UART is likely to be connected directly to the MMIO space.

When PCI indirect IO or PCI extended error handling are enabled, the read*/write* functions perform PCI-specific logic. They can't be used as generic MMIO accessors.

As my platform (an MPC8248 processor) has no PCI support, and as all 8250 access operations are 8-bit wide, readb/writeb will perform correctly.

I suppose we can drop the patch until someone with an embedded PowerPC platform requiring PCI indirect IO or PCI extended error handling comes up and complain. Those platforms are quite unlikely to have a 8250-like UART connected directly to the MMIO space.

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

      reply	other threads:[~2008-07-24 12:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-24 12:11 [PATCH] 8250: Add PowerPC-style MMIO support to the 8250 driver Laurent Pinchart
2008-07-24 12:14 ` Russell King
2008-07-24 12:34   ` Laurent Pinchart [this message]

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=200807241434.31671.laurentp@cse-semaphore.com \
    --to=laurentp@cse-semaphore.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-serial@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox