Re: PReP and generic PCI resource assignment
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2001-08-08 10:27:31
The problem is that root in this case is the PCI memory resource of the host bridge, which correctly starts at 0xc0000000... but NOT in bus terms. In bus terms it starts at 0x0. (CPU physical 0xc0000000 = PCI bus 0x0 [IO mem].) So the new resource is assigned 0xc1000000, which is written back to the BAR with pcibios_update_resource... which is way wrong.
The resource is in CPU space. The problem must be with pcibios_update_resource, which is responsible for doing the proper offset. If you look closely, it substracts hose->pci_mem_offset from the resource before writing it to the BAR. If your hose pci_mem_offset is wrong, then it can't work. It should be 0xc0000000 on PReP.
Now if resources could be assigned properly in the first place this code path wouldn't be taken, but quite a few things fail (request_resource's and pci_find_parent_resource's) and it's proving difficult to track down why (maybe I've been staring at this too long). Anyways, when I change "root->start" above to be 0, the symptom is fixed, but that's clearly a hack. I don't see how anything PReP (system IO nor IO memory) could escape generic resource assignment unscathed though.
The fix is to have pci_mem_offset set properly when setting up the pci_controller structure. ben. ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/