[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230815152712.1760046-13-amitsinght@marvell.com>
Date: Tue, 15 Aug 2023 20:57:12 +0530
From: Amit Singh Tomar <amitsinght@...vell.com>
To: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
CC: <fenghua.yu@...el.com>, <reinette.chatre@...el.com>,
<james.morse@....com>, <gcherian@...vell.com>, <robh@...nel.org>,
<peternewman@...gle.com>, Amit Singh Tomar <amitsinght@...vell.com>
Subject: [RFC 12/12] arm_mpam: Program Downstream priority value
Now that Downstream priorities values can be passed from resource control
schemata file, let's program it into memory mapped Priority Partition
Configuration Register.
Signed-off-by: Amit Singh Tomar <amitsinght@...vell.com>
---
TODO:
* Invert Priority value based on DSPRI_0_IS_LOW, suggested
by James.
---
drivers/platform/mpam/mpam_devices.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c
index 59022e42920c..8af6424bb27b 100644
--- a/drivers/platform/mpam/mpam_devices.c
+++ b/drivers/platform/mpam/mpam_devices.c
@@ -1153,8 +1153,12 @@ static void mpam_reprogram_ris_partid(struct mpam_msc_ris *ris, u16 partid,
if (mpam_has_feature(mpam_feat_intpri_part, rprops))
pri_val |= FIELD_PREP(MPAMCFG_PRI_INTPRI, intpri);
- if (mpam_has_feature(mpam_feat_dspri_part, rprops))
- pri_val |= FIELD_PREP(MPAMCFG_PRI_DSPRI, dspri);
+ if (mpam_has_feature(mpam_feat_dspri_part, rprops)) {
+ if (mpam_has_feature(mpam_feat_dspri_part, cfg)) {
+ pri_val |= FIELD_PREP(MPAMCFG_PRI_DSPRI, cfg->dspri & dspri);
+ } else
+ pri_val |= FIELD_PREP(MPAMCFG_PRI_DSPRI, dspri);
+ }
mpam_write_partsel_reg(msc, PRI, pri_val);
}
--
2.25.1
Powered by blists - more mailing lists