cxl: Add functions to get an instance of / count regblocks of a given type
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 26 May 2023 09:58:21 +0000 (10:58 +0100)
committerDan Williams <dan.j.williams@intel.com>
Tue, 30 May 2023 18:20:35 +0000 (11:20 -0700)
commitd717d7f3df18494baafd9595fb4bcb9c380d7389
treea85db24346118496f9f723791c5dac631bbc99de
parent143f83e2003a4c3ca0c2558254129569048e0759
cxl: Add functions to get an instance of / count regblocks of a given type

Until the recently release CXL 3.0 specification, there
was only ever one instance of any given register block pointed
to by the Register Block Locator DVSEC. Now, the specification allows
for multiple CXL PMU instances, each with their own register block.

To enable this add cxl_find_regblock_instance() that takes an index
parameter and use that to implement cxl_count_regblock() and
cxl_find_regblock().

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20230526095824.16336-3-Jonathan.Cameron@huawei.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/regs.c
drivers/cxl/cxl.h