summaryrefslogtreecommitdiffstats
path: root/drivers/cxl/cxlpci.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2023-05-18 23:54:34 +0200
committerDan Williams <dan.j.williams@intel.com>2023-05-19 01:42:41 +0200
commitce17ad0d54985e2595a3e615fda31df61808a08c (patch)
treeceec13baa960bc056518ed8cfd5dcb879e6671c7 /drivers/cxl/cxlpci.h
parentcxl/port: Enable the HDM decoder capability for switch ports (diff)
downloadlinux-ce17ad0d54985e2595a3e615fda31df61808a08c.tar.xz
linux-ce17ad0d54985e2595a3e615fda31df61808a08c.zip
cxl: Wait Memory_Info_Valid before access memory related info
The Memory_Info_Valid bit (CXL 3.0 8.1.3.8.2) indicates that the CXL Range Size High and Size Low registers are valid. The bit must be set within 1 second of reset deassertion to the device. Check valid bit before we check the Memory_Active bit when waiting for cxl_await_media_ready() to ensure that the memory info is valid for consumption. Also ensures both DVSEC ranges 1 and 2 are ready if DVSEC Capability indicates they are both supported. Fixes: 523e594d9cc0 ("cxl/pci: Implement wait for media active") Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/168444687469.3134781.11033518965387297327.stgit@djiang5-mobl3 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/cxl/cxlpci.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/cxl/cxlpci.h b/drivers/cxl/cxlpci.h
index 0465ef963cd6..7c02e55b8042 100644
--- a/drivers/cxl/cxlpci.h
+++ b/drivers/cxl/cxlpci.h
@@ -31,6 +31,8 @@
#define CXL_DVSEC_RANGE_BASE_LOW(i) (0x24 + (i * 0x10))
#define CXL_DVSEC_MEM_BASE_LOW_MASK GENMASK(31, 28)
+#define CXL_DVSEC_RANGE_MAX 2
+
/* CXL 2.0 8.1.4: Non-CXL Function Map DVSEC */
#define CXL_DVSEC_FUNCTION_MAP 2