linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Problem with PCI bus rescan on 460EX
@ 2010-03-02 13:27 Felix Radensky
  0 siblings, 0 replies; 29+ messages in thread
From: Felix Radensky @ 2010-03-02 13:27 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org

Hi,

I'm running linux-2.6.33 on a custom board based on 460EX.
There's a PCI-PCI bridge on this board, PLX 6254, and a single
hot-pluggable device behind the bridge.

When this device is plugged in before system boots everything works
fine: bridge and device are properly recognized by kernel, resources are
allocated and device memory regions are accessible. Below is relevant
kernel messages and lspci output:

PCI: Probing PCI hardware
pci_bus 0000:00: scanning bus
pci 0000:00:02.0: found [3388:0020] class 000604 header type 01
pci 0000:00:02.0: calling pcibios_fixup_resources+0x0/0xf4
pci 0000:00:02.0: calling fixup_ppc4xx_pci_bridge+0x0/0x154
pci 0000:00:02.0: calling quirk_resource_alignment+0x0/0x200
pci 0000:00:02.0: supports D1 D2
pci 0000:00:02.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:02.0: PME# disabled
pci_bus 0000:00: fixups for bus
pci 0000:00:02.0: scanning behind bridge, config 010100, pass 0
pci_bus 0000:01: scanning bus
pci 0000:01:00.0: found [1575:0002] class 00ff00 header type 00
pci 0000:01:00.0: reg 10: [mem 0x80000000-0x800fffff]
pci 0000:01:00.0: reg 14: [mem 0x84000000-0x87ffffff]
pci 0000:01:00.0: reg 18: [mem 0x88000000-0x8bffffff]
pci 0000:01:00.0: reg 1c: [mem 0x8c000000-0x8c003fff]
pci 0000:01:00.0: calling pcibios_fixup_resources+0x0/0xf4
pci 0000:01:00.0: calling fixup_ppc4xx_pci_bridge+0x0/0x154
pci 0000:01:00.0: calling quirk_resource_alignment+0x0/0x200
pci_bus 0000:01: fixups for bus
pci 0000:00:02.0: PCI bridge to [bus 01-01]
pci 0000:00:02.0:   bridge window [mem 0x80000000-0x8c0fffff]
pci_bus 0000:01: bus scan returning with max=01
pci 0000:00:02.0: scanning behind bridge, config 010100, pass 1
pci_bus 0000:00: bus scan returning with max=01
pci 0000:00:02.0: BAR 8: assigned [mem 0xd80000000-0xd89ffffff]
pci 0000:01:00.0: BAR 1: assigned [mem 0xd80000000-0xd83ffffff]
pci 0000:01:00.0: BAR 1: set to [mem 0xd80000000-0xd83ffffff] (PCI 
address [0x80000000-0x83ffffff]
pci 0000:01:00.0: BAR 2: assigned [mem 0xd84000000-0xd87ffffff]
pci 0000:01:00.0: BAR 2: set to [mem 0xd84000000-0xd87ffffff] (PCI 
address [0x84000000-0x87ffffff]
pci 0000:01:00.0: BAR 0: assigned [mem 0xd88000000-0xd880fffff]
pci 0000:01:00.0: BAR 0: set to [mem 0xd88000000-0xd880fffff] (PCI 
address [0x88000000-0x880fffff]
pci 0000:01:00.0: BAR 3: assigned [mem 0xd88100000-0xd88103fff]
pci 0000:01:00.0: BAR 3: set to [mem 0xd88100000-0xd88103fff] (PCI 
address [0x88100000-0x88103fff]
pci 0000:00:02.0: PCI bridge to [bus 01-01]
pci 0000:00:02.0:   bridge window [io  disabled]
pci 0000:00:02.0:   bridge window [mem 0xd80000000-0xd89ffffff]
pci 0000:00:02.0:   bridge window [mem pref disabled]
pci_bus 0000:00: resource 0 [io  0x0000-0xffff]
pci_bus 0000:00: resource 1 [mem 0xd80000000-0xdffffffff]
pci_bus 0000:01: resource 1 [mem 0xd80000000-0xd89ffffff]

00:02.0 PCI bridge: Hint Corp HB6 Universal PCI-PCI bridge (transparent 
mode) (rev 04)
00: 88 33 20 00 87 00 b0 02 04 00 04 06 08 80 01 00
10: 00 00 00 00 00 00 00 00 00 01 01 00 f1 01 a0 02
20: 00 80 f0 89 f1 ff 01 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 dc 00 00 00 00 00 00 00 00 00 00 00


The problem arises when device is plugged in after boot. After doing
echo 1 > /sys/bus/pci/rescan
the device is identified, but bridge memory window is not allocated,
and reads from device memory regions return 0xffffffff. Below is
relevant output:

PCI: Probing PCI hardware
pci_bus 0000:00: scanning bus
pci 0000:00:02.0: found [3388:0020] class 000604 header type 01
pci 0000:00:02.0: calling pcibios_fixup_resources+0x0/0xf4
pci 0000:00:02.0: calling fixup_ppc4xx_pci_bridge+0x0/0x154
pci 0000:00:02.0: calling quirk_resource_alignment+0x0/0x200
pci 0000:00:02.0: supports D1 D2
pci 0000:00:02.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:02.0: PME# disabled
pci_bus 0000:00: fixups for bus
pci 0000:00:02.0: scanning behind bridge, config 010100, pass 0
pci_bus 0000:01: scanning bus
pci_bus 0000:01: fixups for bus
pci 0000:00:02.0: PCI bridge to [bus 01-01]
pci_bus 0000:01: bus scan returning with max=01
pci 0000:00:02.0: scanning behind bridge, config 010100, pass 1
pci_bus 0000:00: bus scan returning with max=01
pci 0000:00:02.0: PCI bridge to [bus 01-01]
pci 0000:00:02.0:   bridge window [io  disabled]
pci 0000:00:02.0:   bridge window [mem disabled]
pci 0000:00:02.0:   bridge window [mem pref disabled]
pci_bus 0000:00: resource 0 [io  0x0000-0xffff]
pci_bus 0000:00: resource 1 [mem 0xd80000000-0xdffffffff]
pci 0000:00:02.0: calling quirk_cardbus_legacy+0x0/0x54
pci 0000:00:02.0: calling quirk_usb_early_handoff+0x0/0x6cc
PCI: CLS 32 bytes, default 32

pci_bus 0000:00: scanning bus
pci 0000:00:02.0: scanning behind bridge, config 010100, pass 0
pci_bus 0000:01: scanning bus
pci 0000:01:00.0: found [1575:0002] class 00ff00 header type 00
pci 0000:01:00.0: reg 10: [mem 0x00000000-0x000fffff]
pci 0000:01:00.0: reg 14: [mem 0x00000000-0x03ffffff]
pci 0000:01:00.0: reg 18: [mem 0x00000000-0x03ffffff]
pci 0000:01:00.0: reg 1c: [mem 0x00000000-0x00003fff]
pci 0000:01:00.0: calling pcibios_fixup_resources+0x0/0xf4
pci 0000:01:00.0: calling fixup_ppc4xx_pci_bridge+0x0/0x154
pci 0000:01:00.0: calling quirk_resource_alignment+0x0/0x200
pci_bus 0000:01: bus scan returning with max=01
pci 0000:00:02.0: scanning behind bridge, config 010100, pass 1
pci_bus 0000:00: bus scan returning with max=01
pci 0000:00:02.0: BAR 8: assigned [mem 0xd80000000-0xd89ffffff]
pci 0000:01:00.0: BAR 1: assigned [mem 0xd80000000-0xd83ffffff]
pci 0000:01:00.0: BAR 1: set to [mem 0xd80000000-0xd83ffffff] (PCI 
address [0x80000000-0x83ffffff]
pci 0000:01:00.0: BAR 2: assigned [mem 0xd84000000-0xd87ffffff]
pci 0000:01:00.0: BAR 2: set to [mem 0xd84000000-0xd87ffffff] (PCI 
address [0x84000000-0x87ffffff]
pci 0000:01:00.0: BAR 0: assigned [mem 0xd88000000-0xd880fffff]
pci 0000:01:00.0: BAR 0: set to [mem 0xd88000000-0xd880fffff] (PCI 
address [0x88000000-0x880fffff]
pci 0000:01:00.0: BAR 3: assigned [mem 0xd88100000-0xd88103fff]
pci 0000:01:00.0: BAR 3: set to [mem 0xd88100000-0xd88103fff] (PCI 
address [0x88100000-0x88103fff]

00:02.0 PCI bridge: Hint Corp HB6 Universal PCI-PCI bridge (transparent 
mode) (rev 04)
00: 88 33 20 00 87 00 b0 02 04 00 04 06 08 80 01 00
10: 00 00 00 00 00 00 00 00 00 01 01 00 f1 01 a0 02
20: f0 ff 00 00 f1 ff 01 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 dc 00 00 00 00 00 00 00 00 00 00 00

As you can see, the PLX BAR at address 0x20 is not properly configured.
Writing the value 0x89f08000 using setpci fixes access to hot-plugged 
device.

Any idea why PCI bus rescan fails to allocate bridge memory window ?

Thanks a lot.

Felix.

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2010-03-29  7:35 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4B8E6FA3.70503@embedded-sol.com>
     [not found] ` <20100310225100.GB27324@ldl.fc.hp.com>
2010-03-11  7:45   ` Problem with PCI bus rescan on 460EX Felix Radensky
2010-03-11 20:32     ` Benjamin Herrenschmidt
2010-03-11 21:41       ` Felix Radensky
2010-03-11 21:49         ` Benjamin Herrenschmidt
2010-03-11  7:50   ` Felix Radensky
2010-03-12  9:22     ` Kenji Kaneshige
2010-03-12 23:04       ` Felix Radensky
2010-03-15  5:39         ` Kenji Kaneshige
2010-03-15  5:46           ` Benjamin Herrenschmidt
2010-03-15  5:54             ` Benjamin Herrenschmidt
2010-03-15  6:09           ` Felix Radensky
2010-03-15  9:00             ` Kenji Kaneshige
2010-03-15 11:23               ` Felix Radensky
2010-03-16  5:40                 ` Kenji Kaneshige
2010-03-16  8:39                   ` Felix Radensky
2010-03-16 21:40                   ` Felix Radensky
2010-03-17  1:03                     ` Kenji Kaneshige
2010-03-17  7:38                       ` Felix Radensky
2010-03-17  7:47                         ` Benjamin Herrenschmidt
2010-03-17  7:57                           ` Felix Radensky
2010-03-17 23:04                             ` Benjamin Herrenschmidt
2010-03-18  0:09                             ` Benjamin Herrenschmidt
2010-03-28  9:13                       ` Felix Radensky
2010-03-28  9:56                         ` Benjamin Herrenschmidt
2010-03-28 13:07                           ` Felix Radensky
2010-03-29  0:05                         ` Yinghai Lu
2010-03-29  7:01                           ` Kenji Kaneshige
2010-03-29  7:35                             ` Felix Radensky
2010-03-02 13:27 Felix Radensky

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).