• Robert Richter's avatar
    cxl/pci: Early setup RCH dport component registers from RCRB · 733b57f2
    Robert Richter authored
    CXL RAS capabilities must be enabled and accessible as soon as the CXL
    endpoint is detected in the PCI hierarchy and bound to the cxl_pci
    driver. This needs to be independent of other modules such as cxl_port
    or cxl_mem.
    
    CXL RAS capabilities reside in the Component Registers. For an RCH
    this is determined by probing RCRB which is implemented very late once
    the CXL Memory Device is created.
    
    Change this by moving the RCRB probe to the cxl_pci driver. Do this by
    using a new introduced function cxl_pci_find_port() similar to
    cxl_mem_find_port() to determine the involved dport by the endpoint's
    PCI handle. Plug this into the existing cxl_pci_setup_regs() function
    to setup Component Registers. Probe the RCRB in case the Component
    Registers cannot be located through the CXL Register Locator
    capability.
    
    This unifies code and early sets up the Component Registers at the
    same time for both, VH and RCH mode. Only the cxl_pci driver is
    involved for this. This allows an early mapping of the CXL RAS
    capability registers.
    Signed-off-by: default avatarRobert Richter <rrichter@amd.com>
    Signed-off-by: default avatarTerry Bowman <terry.bowman@amd.com>
    Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    Link: https://lore.kernel.org/r/20230622205523.85375-14-terry.bowman@amd.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    733b57f2
port.c 49.8 KB