[U-Boot] [PATCH 4/7] pci: Flip condition for detecting non-PCI parent devices
Simon Glass
sjg at chromium.org
Wed Jul 27 01:42:57 CEST 2016
On 26 July 2016 at 16:24, Paul Burton <paul.burton at imgtec.com> wrote:
> In pci_uclass_pre_probe an attempt is made to detect whether the parent
> of a device is a PCI device and that the device is thus a bridge. This
> was being done by checking whether the parent of the device is of the
> UCLASS_ROOT class. This causes problems if the PCI controller is a child
> of some other non-PCI node, for example a simple-bus node.
>
> For example, if the device tree contains something like the following
> then pci_uclass_pre_probe would incorrectly believe that the PCI
> controller is a bridge, with a PCI parent:
>
> / {
> some_child {
> compatible = "simple-bus";
> #address-cells = <1>;
> #size-cells = <1>;
> ranges = <>;
>
> pci_controller: pci at 10000000 {
> compatible = "my-pci-controller";
> device_type = "pci";
> reg = <0x10000000 0x2000000>;
> };
> };
> };
>
> Avoid this incorrect detection of bridges by instead checking whether
> the parent devices class is UCLASS_PCI and treating a device as a bridge
> when this is true.
>
> Signed-off-by: Paul Burton <paul.burton at imgtec.com>
> ---
>
> drivers/pci/pci-uclass.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list