• Pali Rohár's avatar
    PCI: mvebu: Fix configuring secondary bus of PCIe Root Port via emulated bridge · 91a8d79f
    Pali Rohár authored
    It looks like that mvebu PCIe controller has for each PCIe link fully
    independent PCIe host bridge and so every PCIe Root Port is isolated not
    only on its own bus but also isolated from each others. But in past device
    tree structure was defined to put all PCIe Root Ports (as PCI Bridge
    devices) into one root bus 0 and this bus is emulated by pci-mvebu.c
    driver.
    
    Probably reason for this decision was incorrect understanding of PCIe
    topology of these Armada SoCs and also reason of misunderstanding how is
    PCIe controller generating Type 0 and Type 1 config requests (it is fully
    different compared to other drivers). Probably incorrect setup leaded to
    very surprised things like having PCIe Root Port (PCI Bridge device, with
    even incorrect Device Class set to Memory Controller) and the PCIe device
    behind the Root Port on the same PCI bus, which obviously was needed to
    somehow hack (as these two devices cannot be in reality on the same bus).
    
    Properly set mvebu local bus number and mvebu local device number based on
    PCI Bridge secondary bus number configuration. Also correctly report
    configured secondary bus number in config space. And explain in driver
    comment why this setup is correct.
    
    Link: https://lore.kernel.org/r/20211125124605.25915-12-pali@kernel.org
    Fixes: 1f08673e ("PCI: mvebu: Convert to PCI emulated bridge config space")
    Signed-off-by: default avatarPali Rohár <pali@kernel.org>
    Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    91a8d79f
pci-mvebu.c 35 KB