From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Wang Jian <lark@linux.net.cn>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: mpc8541 pci1 ioport allocation address space problem
Date: Mon, 22 Sep 2008 15:47:44 +1000 [thread overview]
Message-ID: <1222062464.12085.25.camel@pasglop> (raw)
In-Reply-To: <48D4DB89.3040607@linux.net.cn>
On Sat, 2008-09-20 at 19:16 +0800, Wang Jian wrote:
> Hi,
>
> Here I have a 8541 dev board, with 2 e1000 attached to pci0 and a
> homebrewed addon board inserted into pci1. I am trying to make it work
> under 2.6.26-rc8 (2.6.26 broken so I am working at rc8).
>
> The ioports allocation reads
>
> $ cat /proc/ioports
> 00000000-000fffff : /pci@e0008000
> 00001000-0000103f : 0000:00:0a.0
> 00001040-0000107f : 0000:00:0b.0
> ffefe000-ffffdfff : /pci@e0009000
> ffeff000-ffeff00f : 0001:01:0a.0
> ffeff010-ffeff01f : 0001:01:0b.0
> ffeff020-ffeff02f : 0001:01:0c.0
> ffeff030-ffeff03f : 0001:01:0d.0
>
> The port allocation for pci1 looks ridiculous. The addon board doesn't work.
>
> After poking around, I find pci_process_bridge_OF_ranges() in
> arch/powerpc/kernel/pci-common.c
.../...
This is expected and should work. Depending on the relative
physical addresses of IO space and the order in which the bridges are
discovered, the bridge IO ports will look at either positive or negative
values. This should be fine, as port numbers are supposed to be 32 bits
and in-kernel arithmetic should do the right thing... I suppose unless a
driver stores those in a 64 bits integer and doesn't sign extend.
I would like to change that whole thing to something more similar to
64 bits where I reserve a portion of the address space for IO ports,
though address space on 32 bits platforms is scarce, but nothing I have
time to toy with right now.
Cheers,
Ben.
next prev parent reply other threads:[~2008-09-22 5:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-20 11:16 mpc8541 pci1 ioport allocation address space problem Wang Jian
2008-09-21 1:19 ` Wang Jian
2008-09-23 6:55 ` Benjamin Herrenschmidt
2008-09-22 5:47 ` Benjamin Herrenschmidt [this message]
2008-09-23 14:24 ` Wang Jian
2008-09-23 21:16 ` Benjamin Herrenschmidt
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=1222062464.12085.25.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=lark@linux.net.cn \
--cc=linuxppc-dev@ozlabs.org \
/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;
as well as URLs for NNTP newsgroup(s).