From: Yoichi Yuasa <yuasa@linux-mips.org>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: yuasa@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org
Subject: Re: Reverting old hack
Date: Tue, 23 Feb 2010 09:50:51 +0900 [thread overview]
Message-ID: <20100223095051.26a5049b.yuasa@linux-mips.org> (raw)
In-Reply-To: <201002221715.24674.bjorn.helgaas@hp.com>
On Mon, 22 Feb 2010 17:15:24 -0700
Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> On Monday 22 February 2010 04:51:43 pm Yoichi Yuasa wrote:
> > Hi Bjorn,
> >
> > On Mon, 22 Feb 2010 13:55:28 -0700
> > Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> >
> > > On Sunday 21 February 2010 12:45:31 am Yoichi Yuasa wrote:
> > > > > I'd like to understand the PCI architecture of Cobalt better. Would you
> > > > > mind turning on CONFIG_PCI_DEBUG and posting the dmesg log?
> > > >
> > > > If you want to know what happen, you can see my old e-mail.
> > > >
> > > > http://marc.info/?l=linux-kernel&m=118792430424186&w=2
> > >
> > > There's not much detail there. It would save me a lot of time if
> > > you could collect the complete dmesg log, /proc/iomem, and /proc/ioports.
> >
> > It cannot boot without old hack.
>
> I know; I meant that the information from a kernel with the old
> hack would be useful. But I think I'm starting to understand anyway.
>
> The Linux I/O port number space is defined here:
>
> static struct resource cobalt_io_resource = {
> .start = 0x1000,
> .end = GT_DEF_PCI0_IO_SIZE - 1, /* 0x1ffffff */
>
> [As an aside, I'm not sure 0x1000 is the correct start -- for example,
> I think Linux I/O port 0x1f0 is forwarded by the host bridge.]
This is the space(0x0-0xfff) for the fixed address devices(PIC, RTC, DMA(just reserved)...).
$ cat /proc/ioports
00000000-0000001f : reserved
00000020-00000021 : pic1
00000060-0000006f : reserved
00000070-00000077 : rtc_cmos
00000070-00000077 : rtc0
00000080-0000008f : reserved
000000a0-000000a1 : pic2
000000c0-000000df : reserved
00000170-00000177 : pata_via
000001f0-000001f7 : pata_via
00000376-00000376 : pata_via
000003f6-000003f6 : pata_via
00001000-01ffffff : PCI I/O
00001000-0000107f : 0000:00:07.0
00001000-0000107f : tulip
00001080-000010ff : 0000:00:0c.0
00001080-000010ff : tulip
00001400-0000141f : 0000:00:09.2
00001420-0000142f : 0000:00:09.1
00001420-0000142f : pata_via
> The corresponding PCI I/O port numbers are determined by the PCI
> I/O decoder address, so I agree that we need the io_offset to convert
> between the Linux port numbers and ports that appear on the PCI bus.
>
> I think the IDE device is a problem because pci_setup_device() fills
> in legacy resources with ports 0x1f0-0x1f7, etc. We expect those
> resources to contain PCI bus addresses at this point, but we could
> never see those addresses on the Cobalt PCI bus (we would only see
> things in the range 0x10000000-0x11ffffff).
>
> When we convert 0x1f0 with pcibios_bus_to_resource() (or with
> pcibios_fixup_device_resources() without the IORESOURCE_PCI_FIXED
> hack), we get 0x1f0 + 0xf0000000 == 0xf00001f0, when we want 0x1f0
> instead.
>
> > pata_via 0000:00:09.1: BAR 0: can't reserve [io 0xf00001f0-0xf00001f7]
>
> I still don't know the best way to fix this, but does this make sense
> so far?
That makes sense.
Yoichi
next prev parent reply other threads:[~2010-02-23 0:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-20 11:31 Reverting old hack Ralf Baechle
2010-02-20 12:18 ` Yoichi Yuasa
2010-02-20 14:57 ` Bjorn Helgaas
2010-02-21 7:45 ` Yoichi Yuasa
2010-02-22 20:55 ` Bjorn Helgaas
2010-02-22 23:51 ` Yoichi Yuasa
2010-02-23 0:15 ` Bjorn Helgaas
2010-02-23 0:50 ` Yoichi Yuasa [this message]
2010-02-21 2:57 ` Bjorn Helgaas
2010-02-22 0:09 ` Bjorn Helgaas
2010-02-22 5:07 ` Bjorn Helgaas
2010-02-22 6:39 ` Yoichi Yuasa
2010-02-22 13:28 ` Ralf Baechle
2010-02-23 23:01 ` Bjorn Helgaas
2010-02-24 0:03 ` Yoichi Yuasa
2010-02-24 16:41 ` Ralf Baechle
2010-02-24 16:59 ` Bjorn Helgaas
2010-02-24 17:41 ` Ralf Baechle
2010-02-24 20:53 ` Benjamin Herrenschmidt
2010-02-25 8:39 ` Yoichi Yuasa
2010-02-25 14:29 ` Ralf Baechle
2010-02-24 16:13 ` Ralf Baechle
2010-02-24 16:23 ` Bjorn Helgaas
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=20100223095051.26a5049b.yuasa@linux-mips.org \
--to=yuasa@linux-mips.org \
--cc=bjorn.helgaas@hp.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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