NVIDIA: SAUCE: perf: arm_cspmu: nvidia: add revision id matching

This is a preparatory patch for new NVIDIA devices
that will need to be distinguished by revision and
variant bits in PMIIDR register in addition to
product id.

Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Noah Wager <noah.wager@canonical.com>
Acked-by: Jacob Martin <jacob.martin@canonical.com>
Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
Besar Wicaksono
2023-11-07 13:08:17 -06:00
committed by Noah Wager
parent ee45e264b7
commit 20ff1269e0
+9 -7
View File
@@ -22,7 +22,9 @@
#define NV_GENERIC_FILTER_ID_MASK GENMASK_ULL(31, 0)
#define NV_PRODID_MASK GENMASK(31, 0)
#define NV_PRODID_MASK (ARM_CSPMU_PMIIDR_PRODUCTID | \
ARM_CSPMU_PMIIDR_VARIANT | \
ARM_CSPMU_PMIIDR_REVISION)
#define NV_FORMAT_NAME_GENERIC 0
@@ -262,7 +264,7 @@ struct nv_cspmu_match {
static const struct nv_cspmu_match nv_cspmu_match[] = {
{
.prodid = 0x103,
.prodid = 0x10300000,
.prodid_mask = NV_PRODID_MASK,
.filter_mask = NV_PCIE_FILTER_ID_MASK,
.filter_default_val = NV_PCIE_FILTER_ID_MASK,
@@ -272,7 +274,7 @@ static const struct nv_cspmu_match nv_cspmu_match[] = {
.format_attr = pcie_pmu_format_attrs
},
{
.prodid = 0x104,
.prodid = 0x10400000,
.prodid_mask = NV_PRODID_MASK,
.filter_mask = 0x0,
.filter_default_val = NV_NVL_C2C_FILTER_ID_MASK,
@@ -282,7 +284,7 @@ static const struct nv_cspmu_match nv_cspmu_match[] = {
.format_attr = nvlink_c2c_pmu_format_attrs
},
{
.prodid = 0x105,
.prodid = 0x10500000,
.prodid_mask = NV_PRODID_MASK,
.filter_mask = 0x0,
.filter_default_val = NV_NVL_C2C_FILTER_ID_MASK,
@@ -292,7 +294,7 @@ static const struct nv_cspmu_match nv_cspmu_match[] = {
.format_attr = nvlink_c2c_pmu_format_attrs
},
{
.prodid = 0x106,
.prodid = 0x10600000,
.prodid_mask = NV_PRODID_MASK,
.filter_mask = NV_CNVL_FILTER_ID_MASK,
.filter_default_val = NV_CNVL_FILTER_ID_MASK,
@@ -302,7 +304,7 @@ static const struct nv_cspmu_match nv_cspmu_match[] = {
.format_attr = cnvlink_pmu_format_attrs
},
{
.prodid = 0x2CF,
.prodid = 0x2CF00000,
.prodid_mask = NV_PRODID_MASK,
.filter_mask = 0x0,
.filter_default_val = 0x0,
@@ -364,7 +366,7 @@ static int nv_cspmu_init_ops(struct arm_cspmu *cspmu)
if (!ctx)
return -ENOMEM;
prodid = FIELD_GET(ARM_CSPMU_PMIIDR_PRODUCTID, cspmu->impl.pmiidr);
prodid = cspmu->impl.pmiidr;
/* Find matching PMU. */
for (; match->prodid; match++) {