Changes in v2:
Patch 1/1: rearranged compatibles in alphabetical order, no changes in rest of the patches
This patchset adds support for cpu bwmon (bwmon4) and llcc bwmon (bwmon5) found
on sc7280 SoC.
Patchset is based on top of series [1] that adds support for llcc bwmon on sdm845
[1]
https://patchwork.kernel.org/project/linux-arm-msm/list/?series=663695&state=*
Rajendra Nayak (4):
dt-bindings: interconnect: qcom,msm8998-bwmon: Add support for sc7280
BWMONs
soc: qcom: icc-bwmon: add support for sc7280 LLCC BWMON
soc: qcom: icc-bwmon: force clear counter/irq registers
arm64: dts: qcom: sc7280: Add cpu and llcc BWMON
.../interconnect/qcom,msm8998-bwmon.yaml | 2 +
arch/arm64/boot/dts/qcom/sc7280.dtsi | 76 +++++++++++++++++++
drivers/soc/qcom/icc-bwmon.c | 21 +++++
3 files changed, 99 insertions(+)
--
2.17.1
In some SoCs we have to force clear the counter/irq clear registers as
they are not self clearing after they are written into.
sc7280 seems to be one such SoC, handle this with a quirk flag.
Signed-off-by: Rajendra Nayak <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
---
v2: no change
drivers/soc/qcom/icc-bwmon.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
index 44a10009b45e..17cba2648ae7 100644
--- a/drivers/soc/qcom/icc-bwmon.c
+++ b/drivers/soc/qcom/icc-bwmon.c
@@ -115,6 +115,7 @@
/* Quirks for specific BWMON types */
#define BWMON_HAS_GLOBAL_IRQ BIT(0)
+#define BWMON_NEEDS_FORCE_CLEAR BIT(1)
enum bwmon_fields {
F_GLOBAL_IRQ_CLEAR,
@@ -343,6 +344,8 @@ static void bwmon_clear_counters(struct icc_bwmon *bwmon, bool clear_all)
* before we try to clear the IRQ or do any other counter operations.
*/
regmap_field_force_write(bwmon->regs[F_CLEAR], val);
+ if (bwmon->data->quirks & BWMON_NEEDS_FORCE_CLEAR)
+ regmap_field_force_write(bwmon->regs[F_CLEAR], 0);
}
static void bwmon_clear_irq(struct icc_bwmon *bwmon)
@@ -364,6 +367,8 @@ static void bwmon_clear_irq(struct icc_bwmon *bwmon)
* interrupt is cleared.
*/
regmap_field_force_write(bwmon->regs[F_IRQ_CLEAR], BWMON_IRQ_ENABLE_MASK);
+ if (bwmon->data->quirks & BWMON_NEEDS_FORCE_CLEAR)
+ regmap_field_force_write(bwmon->regs[F_IRQ_CLEAR], 0);
if (bwmon->data->quirks & BWMON_HAS_GLOBAL_IRQ)
regmap_field_force_write(bwmon->regs[F_GLOBAL_IRQ_CLEAR],
BWMON_V4_GLOBAL_IRQ_ENABLE_ENABLE);
@@ -664,6 +669,7 @@ static const struct icc_bwmon_data sc7280_llcc_bwmon_data = {
.default_lowbw_kbps = 0,
.zone1_thres_count = 16,
.zone3_thres_count = 1,
+ .quirks = BWMON_NEEDS_FORCE_CLEAR,
.regmap_fields = sdm845_llcc_bwmon_reg_fields,
.regmap_cfg = &sdm845_llcc_bwmon_regmap_cfg,
};
--
2.17.1
Add a compatible for the cpu BWMON (version 4) instance and one
for the llcc BWMON (version 5) found in sc7280 SoC.
Signed-off-by: Rajendra Nayak <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
---
v2: rearranged compatibles in alphabetical order
.../devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml b/Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml
index 32e2892d736b..0ac5256876a8 100644
--- a/Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml
+++ b/Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml
@@ -24,9 +24,11 @@ properties:
oneOf:
- items:
- enum:
+ - qcom,sc7280-bwmon
- qcom,sdm845-bwmon
- const: qcom,msm8998-bwmon
- const: qcom,msm8998-bwmon # BWMON v4
+ - const: qcom,sc7280-llcc-bwmon # BWMON v5
- const: qcom,sdm845-llcc-bwmon # BWMON v5
interconnects:
--
2.17.1
On Fri, 2 Sep 2022 10:05:07 +0530, Rajendra Nayak wrote:
> Changes in v2:
> Patch 1/1: rearranged compatibles in alphabetical order, no changes in rest of the patches
>
> This patchset adds support for cpu bwmon (bwmon4) and llcc bwmon (bwmon5) found
> on sc7280 SoC.
>
> Patchset is based on top of series [1] that adds support for llcc bwmon on sdm845
>
> [...]
Applied, thanks!
[4/4] arm64: dts: qcom: sc7280: Add cpu and llcc BWMON
commit: b2f3eac1b77c6feba4daff83de9436fcf728a5e5
Best regards,
--
Bjorn Andersson <[email protected]>