All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tiejun.chen" <tiejun.chen@windriver.com>
To: Scott Wood <scottwood@freescale.com>
Cc: wolfking <wolfking2000@msn.com>, linuxppc-dev@ozlabs.org
Subject: Re: can't access PCIe card under sbc8548
Date: Fri, 31 May 2013 09:34:15 +0800	[thread overview]
Message-ID: <51A7FE17.2040803@windriver.com> (raw)
In-Reply-To: <1369931094.14679.6@snotra>

On 05/31/2013 12:24 AM, Scott Wood wrote:
> On 05/30/2013 07:49:48 AM, wolfking wrote:
>> tiejun.chen wrote
>> > On 05/30/2013 03:32 PM, wolfking wrote:
>> >> (continued)
>> >>    I traced the 8139too.c when it uses pci_iomap, the pci_iomap called
>> >> the
>> >> ioport_map. The difference between 8139 and my PCIe card lies in the
>> >> "port" value :
>> >> void __iomem *ioport_map(unsigned long port, unsigned int len)
>> >> {
>> >>     return (void __iomem *) (port + _IO_BASE);
>> >
>> > _IO_BASE is equal to isa_io_base. So if this is not zero, I think there's
>> > a isa
>> > bridge in your platform. So you can access these I/O ports based on that
>> > isa
>> > bridge/bus with ioreadx/iowritex.
>> >
>> > I tried ioread8/iowriet8 after ioremap, it doesn't work
>> >
>> >> }
>> >>    in 8139too.c, the "port" value is 0x1000; for my PCIe card, the "port"
>> >> value
>> >> is 0xfefff000. And the value is got from pci_resource_start. So you see,
>> >> the
>> >
>> > But this means the port is as memory-mapped
>
> Are you sure?  It could mean that it's on a non-primary bus and I/O for this bus

We can take a further look at '/proc/ioports', '/proc/iomem' and other message.

> is mapped at a lower address than the primary.  Just because the addition is
> wrapping around doesn't mean it's wrong.
>
>> > so ioremap() should be workable in this case. Then out_bex/in_bex should be
>> fine.
>
> ioremap() and out_bex/in_bex are not appropriate for PCI I/O regions (and
> presumably that's what it is, if pci_iomap is calling ioport_map).  Big-endian
> is not appropriate for PCI in any case.

Yes, I should correct that PCI interprets all accesses as little-endian.

Tiejun

  reply	other threads:[~2013-05-31  1:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  3:42 can't access PCIe card under sbc8548 wolfking
2013-05-30  5:56 ` tiejun.chen
2013-05-30  7:19   ` wolfking
2013-05-30  8:47     ` tiejun.chen
2013-05-30  9:15       ` wolfking
2013-05-30  9:30         ` tiejun.chen
2013-05-30  7:32   ` wolfking
2013-05-30 10:42     ` tiejun.chen
2013-05-30 12:49       ` wolfking
2013-05-30 16:24         ` Scott Wood
2013-05-31  1:34           ` tiejun.chen [this message]
2013-05-31  2:27             ` wolfking
2013-05-31 10:00           ` Benjamin Herrenschmidt
2013-05-30 10:02 ` wolfking
2013-05-30 10:08   ` tiejun.chen
2013-05-30 12:45     ` wolfking
2013-05-30 16:29 ` Scott Wood
2013-05-31  0:40   ` wolfking
2013-05-31 10:01     ` Benjamin Herrenschmidt
2013-05-31 12:46       ` wolfking
2013-06-08  7:00         ` wolfking

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=51A7FE17.2040803@windriver.com \
    --to=tiejun.chen@windriver.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    --cc=wolfking2000@msn.com \
    /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.