[RFC 03/12] arm_mpam: resctrl: Define new schemata format for priority partition

From: Amit Singh Tomar
Date: Tue Aug 15 2023 - 11:28:40 EST


At the moment, "schemata" file contains information about cache portion
bitmap (CPBM), and memory bandwidth allocation (MBA) in the following
format.

MB:0=0100
L3:0=ffff

Lets' update the "schemata" file to accommodate information about
priority partition control that indicates downstream priority value.

For instance:

L3:0=ffff,f

CPBM is separated from downstream priority value using delimiter ",".

Signed-off-by: Amit Singh Tomar <amitsinght@xxxxxxxxxxx>
---
drivers/platform/mpam/mpam_resctrl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c
index 09618d9ceb1d..1081ceac41a8 100644
--- a/drivers/platform/mpam/mpam_resctrl.c
+++ b/drivers/platform/mpam/mpam_resctrl.c
@@ -711,7 +711,11 @@ static int mpam_resctrl_resource_init(struct mpam_resctrl_res *res)
r->cache.min_cbm_bits = 1;

/* TODO: kill these properties off as they are derivatives */
- r->format_str = "%d=%0*x";
+ if (mpam_has_feature(mpam_feat_dspri_part, &class->props))
+ r->format_str = "%d=%0*x,%0*x";
+ else
+ r->format_str = "%d=%0*x";
+
r->fflags = RFTYPE_RES_CACHE;
r->default_ctrl = BIT_MASK(class->props.cpbm_wd) - 1;
r->data_width = (class->props.cpbm_wd + 3) / 4;
--
2.25.1