• Robert Richter's avatar
    cxl/acpi: Directly bind the CEDT detected CHBCR to the Host Bridge's port · d02034b4
    Robert Richter authored
    During a Host Bridge's downstream port enumeration the CHBS entries in
    the CEDT table are parsed, its Component Register base address
    extracted and then stored in struct cxl_dport. The CHBS may contain
    either the RCRB (RCH mode) or the Host Bridge's Component Registers
    (CHBCR, VH mode). The RCRB further contains the CXL downstream port
    register base address, while in VH mode the CXL Downstream Switch
    Ports are visible in the PCI hierarchy and the DP's component regs are
    disovered using the CXL DVSEC register locator capability. The
    Component Registers derived from the CHBS for both modes are different
    and thus also must be treated differently. That is, in RCH mode, the
    component regs base should be bound to the dport, but in VH mode to
    the CXL host bridge's port object.
    
    The current implementation stores the CHBCR in addition in struct
    cxl_dport and copies it later from there to struct cxl_port. As a
    result, the dport contains the wrong Component Registers base address
    and, e.g. the RAS capability of a CXL Root Port cannot be detected.
    
    To fix the CHBCR binding, attach it directly to the Host Bridge's
    @cxl_port structure. Do this during port creation of the Host Bridge
    in add_host_bridge_uport(). Factor out CHBS parsing code in
    add_host_bridge_dport() and use it in both functions.
    Co-developed-by: default avatarDan Williams <dan.j.williams@intel.com>
    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-10-terry.bowman@amd.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    d02034b4
acpi.c 18.4 KB