dm: pci: Use the correct hose when configuring devices

Only the PCI controller has access to the PCI region information. Make sure
to use the controller (rather than any attached bridges) when configuring
devices.

This corrects a failure to scan and configure devices when driver model is
enabled for PCI.

Also add a comment to explain the problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2015-06-07 08:50:40 -06:00
parent cdb6babec6
commit aec241dfb4
3 changed files with 21 additions and 1 deletions

View file

@ -513,6 +513,16 @@ struct pci_controller {
int indirect_type;
/*
* TODO(sjg@chromium.org): With driver model we use struct
* pci_controller for both the controller and any bridge devices
* attached to it. But there is only one region list and it is in the
* top-level controller.
*
* This could be changed so that struct pci_controller is only used
* for PCI controllers and a separate UCLASS (or perhaps
* UCLASS_PCI_GENERIC) is used for bridges.
*/
struct pci_region regions[MAX_PCI_REGIONS];
int region_count;