mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-19 12:39:03 +02:00

A downstream port must be connected to a component register block. For restricted hosts the base address is determined from the RCRB. The RCRB is provided by the host's CEDT CHBS entry. Rework CEDT parser to get the RCRB and add code to extract the component register block from it. RCRB's BAR[0..1] point to the component block containing CXL subsystem component registers. MEMBAR extraction follows the PCI base spec here, esp. 64 bit extraction and memory range alignment (6.0, 7.5.1.2.1). The RCRB base address is cached in the cxl_dport per-host bridge so that the upstream port component registers can be retrieved later by an RCD (RCIEP) associated with the host bridge. Note: Right now the component register block is used for HDM decoder capability only which is optional for RCDs. If unsupported by the RCD, the HDM init will fail. It is future work to bypass it in this case. Co-developed-by: Terry Bowman <terry.bowman@amd.com> Signed-off-by: Terry Bowman <terry.bowman@amd.com> Signed-off-by: Robert Richter <rrichter@amd.com> Link: https://lore.kernel.org/r/Y4dsGZ24aJlxSfI1@rric.localdomain [djbw: introduce devm_cxl_add_rch_dport()] Link: https://lore.kernel.org/r/166993044524.1882361.2539922887413208807.stgit@dwillia2-xfh.jf.intel.com Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
35 lines
1.3 KiB
C
35 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/acpi.h>
|
|
#include <cxl.h>
|
|
|
|
struct cxl_mock_ops {
|
|
struct list_head list;
|
|
bool (*is_mock_adev)(struct acpi_device *dev);
|
|
int (*acpi_table_parse_cedt)(enum acpi_cedt_type id,
|
|
acpi_tbl_entry_handler_arg handler_arg,
|
|
void *arg);
|
|
bool (*is_mock_bridge)(struct device *dev);
|
|
acpi_status (*acpi_evaluate_integer)(acpi_handle handle,
|
|
acpi_string pathname,
|
|
struct acpi_object_list *arguments,
|
|
unsigned long long *data);
|
|
resource_size_t (*cxl_rcrb_to_component)(struct device *dev,
|
|
resource_size_t rcrb,
|
|
enum cxl_rcrb which);
|
|
struct acpi_pci_root *(*acpi_pci_find_root)(acpi_handle handle);
|
|
bool (*is_mock_bus)(struct pci_bus *bus);
|
|
bool (*is_mock_port)(struct device *dev);
|
|
bool (*is_mock_dev)(struct device *dev);
|
|
int (*devm_cxl_port_enumerate_dports)(struct cxl_port *port);
|
|
struct cxl_hdm *(*devm_cxl_setup_hdm)(struct cxl_port *port);
|
|
int (*devm_cxl_add_passthrough_decoder)(struct cxl_port *port);
|
|
int (*devm_cxl_enumerate_decoders)(struct cxl_hdm *hdm);
|
|
};
|
|
|
|
void register_cxl_mock_ops(struct cxl_mock_ops *ops);
|
|
void unregister_cxl_mock_ops(struct cxl_mock_ops *ops);
|
|
struct cxl_mock_ops *get_cxl_mock_ops(int *index);
|
|
void put_cxl_mock_ops(int index);
|