cxl/acpi: Map component registers for Root Ports
authorBen Widawsky <ben.widawsky@intel.com>
Mon, 24 Jan 2022 00:29:10 +0000 (16:29 -0800)
committerDan Williams <dan.j.williams@intel.com>
Wed, 9 Feb 2022 06:57:28 +0000 (22:57 -0800)
commit303ebc1b1741b6a18349d8e5753c2d25fdb41a21
tree25c8a89c652a2fef648efc8fbfddb2d20ccbd291
parent8baa787b93dbda6b24081297b934e8edd886d4bb
cxl/acpi: Map component registers for Root Ports

This implements the TODO in cxl_acpi for mapping component registers.
cxl_acpi becomes the second consumer of CXL register block enumeration
(cxl_pci being the first). Moving the functionality to cxl_core allows
both of these drivers to use the functionality. Equally importantly it
allows cxl_core to use the functionality in the future.

CXL 2.0 root ports are similar to CXL 2.0 Downstream Ports with the main
distinction being they're a part of the CXL 2.0 host bridge. While
mapping their component registers is not immediately useful for the CXL
drivers, the movement of register block enumeration into core is a vital
step towards HDM decoder programming.

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[djbw: fix cxl_regmap_to_base() failure cases]
Link: https://lore.kernel.org/r/164298415080.3018233.14694957480228676592.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/acpi.c
drivers/cxl/core/regs.c
drivers/cxl/cxl.h
drivers/cxl/pci.c
drivers/cxl/pci.h