cxl/pci: Add HDM decoder capabilities
authorBen Widawsky <ben.widawsky@intel.com>
Fri, 28 May 2021 00:49:22 +0000 (17:49 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 6 Jun 2021 00:39:12 +0000 (17:39 -0700)
commit08422378c4adacf528d573bb1631d4818f8f9a01
treeb3c79e80f4868ac1b9e96d91f6627bd3cdd239cd
parent9a016527dcb71e2ecadfeacf52122a79b428790c
cxl/pci: Add HDM decoder capabilities

An HDM decoder is defined in the CXL 2.0 specification as a mechanism
that allow devices and upstream ports to claim memory address ranges and
participate in interleave sets. HDM decoder registers are within the
component register block defined in CXL 2.0 8.2.3 CXL 2.0 Component
Registers as part of the CXL.cache and CXL.mem subregion.

The Component Register Block is found via the Register Locator DVSEC
in a similar fashion to how the CXL Device Register Block is found. The
primary difference is the capability id size of the Component Register
Block is a single DWORD instead of 4 DWORDS.

It's now possible to configure a CXL type 3 device's HDM decoder. Such
programming is expected for CXL devices with persistent memory, and hot
plugged CXL devices that participate in CXL.mem with volatile memory.

Add probe and mapping functions for the component register blocks.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Co-developed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Co-developed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Link: https://lore.kernel.org/r/20210528004922.3980613-6-ira.weiny@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core.c
drivers/cxl/cxl.h
drivers/cxl/pci.c