Skip to contentSkip to conversation

SDM670 cache controller support

PATCH Applied Richard Acayan 4 participants 13 messages Feb 10 – Mar 30

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover SDM670 cache controller support

This adds support for the Low-Level Cache Controller (LLCC) on SDM670.

Richard Acayan (3):
dt-bindings: cache: qcom,llcc: Add SDM670 compatible
soc: qcom: llcc: Add configuration data for SDM670
arm64: dts: qcom: sdm670: add llcc

 .../devicetree/bindings/cache/qcom,llcc.yaml  |   2 +
 arch/arm64/boot/dts/qcom/sdm670.dtsi          |  11 ++
 drivers/soc/qcom/llcc-qcom.c                  | 105 ++++++++++++++++++
 3 files changed, 118 insertions(+)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/3 dt-bindings: cache: qcom,llcc: Add SDM670 compatible

Document the Last Level Cache Controller on SDM670.

---
 Documentation/devicetree/bindings/cache/qcom,llcc.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/cache/qcom,llcc.yaml +2 -0
index a620a2ff5c56..0de39b7b3f48 100644
@@ -32,6 +32,7 @@ properties:
       - qcom,sc7280-llcc
       - qcom,sc8180x-llcc
       - qcom,sc8280xp-llcc
+      - qcom,sdm670-llcc
       - qcom,sdm845-llcc
       - qcom,sm6350-llcc
       - qcom,sm7150-llcc
@@ -162,6 +163,7 @@ allOf:
           contains:
             enum:
               - qcom,sc7280-llcc
+              - qcom,sdm670-llcc
     then:
       properties:
         reg:
Signature · 1 line
2.53.0
#3 lore raw

PATCH 2/3 soc: qcom: llcc: Add configuration data for SDM670

In reply to Richard Acayan

Add system cache table and configs for the SDM670 SoC.

---
 drivers/soc/qcom/llcc-qcom.c | 105 +++++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
drivers/soc/qcom/llcc-qcom.c +105 -0
index 13e174267294..c5f7647ec8de 100644
@@ -1591,6 +1591,94 @@ static const struct llcc_slice_config sc8280xp_data[] = {
 	},
 };
 
+static const struct llcc_slice_config sdm670_data[] = {
+	{
+		.usecase_id = LLCC_CPUSS,
+		.slice_id = 1,
+		.max_cap = 512,
+		.priority = 1,
+		.bonus_ways = 0xf,
+		.res_ways = 0x0,
+		.cache_mode = 0,
+		.dis_cap_alloc = true,
+		.retain_on_pc = true,
+		.activate_on_init = true,
+	}, {
+		.usecase_id = LLCC_ROTATOR,
+		.slice_id = 4,
+		.max_cap = 384,
+		.priority = 2,
+		.fixed_size = true,
+		.bonus_ways = 0x0,
+		.res_ways = 0xe,
+		.cache_mode = 2,
+		.dis_cap_alloc = true,
+		.retain_on_pc = true,
+	}, {
+		.usecase_id = LLCC_VOICE,
+		.slice_id = 5,
+		.max_cap = 512,
+		.priority = 1,
+		.bonus_ways = 0xf,
+		.res_ways = 0x0,
+		.cache_mode = 0,
+		.dis_cap_alloc = true,
+		.retain_on_pc = true,
+	}, {
+		.usecase_id = LLCC_AUDIO,
+		.slice_id = 6,
+		.max_cap = 512,
+		.priority = 1,
+		.bonus_ways = 0xf,
+		.res_ways = 0x0,
+		.cache_mode = 0,
+		.dis_cap_alloc = true,
+		.retain_on_pc = true,
+	}, {
+		.usecase_id = LLCC_MDM,
+		.slice_id = 8,
+		.max_cap = 512,
+		.priority = 1,
+		.bonus_ways = 0xf,
+		.res_ways = 0x0,
+		.cache_mode = 0,
+		.dis_cap_alloc = true,
+		.retain_on_pc = true,
+	}, {
+		.usecase_id = LLCC_GPU,
+		.slice_id = 12,
+		.max_cap = 384,
+		.priority = 1,
+		.fixed_size = true,
+		.bonus_ways = 0x0,
+		.res_ways = 0x0,
+		.cache_mode = 0,
+		.dis_cap_alloc = true,
+		.retain_on_pc = true,
+	}, {
+		.usecase_id = LLCC_MMUHWT,
+		.slice_id = 13,
+		.max_cap = 512,
+		.priority = 1,
+		.bonus_ways = 0xf,
+		.res_ways = 0x0,
+		.cache_mode = 0,
+		.dis_cap_alloc = true,
+		.activate_on_init = true,
+	}, {
+		.usecase_id = LLCC_AUDHW,
+		.slice_id = 22,
+		.max_cap = 512,
+		.priority = 1,
+		.fixed_size = true,
+		.bonus_ways = 0xf,
+		.res_ways = 0x0,
+		.cache_mode = 0,
+		.dis_cap_alloc = true,
+		.retain_on_pc = true,
+	},
+};
+
 static const struct llcc_slice_config sdm845_data[] =  {{
 		.usecase_id = LLCC_CPUSS,
 		.slice_id = 1,
@@ -3995,6 +4083,17 @@ static const struct qcom_llcc_config sc8280xp_cfg[] = {
 	},
 };
 
+static const struct qcom_llcc_config sdm670_cfg[] = {
+	{
+		.sct_data	= sdm670_data,
+		.size		= ARRAY_SIZE(sdm670_data),
+		.skip_llcc_cfg	= true,
+		.reg_offset	= llcc_v1_reg_offset,
+		.edac_reg_offset = &llcc_v1_edac_reg_offset,
+		.no_edac	= true,
+	},
+};
+
 static const struct qcom_llcc_config sdm845_cfg[] = {
 	{
 		.sct_data	= sdm845_data,
@@ -4158,6 +4257,11 @@ static const struct qcom_sct_config sc8280xp_cfgs = {
 	.num_config	= ARRAY_SIZE(sc8280xp_cfg),
 };
 
+static const struct qcom_sct_config sdm670_cfgs = {
+	.llcc_config	= sdm670_cfg,
+	.num_config	= ARRAY_SIZE(sdm670_cfg),
+};
+
 static const struct qcom_sct_config sdm845_cfgs = {
 	.llcc_config	= sdm845_cfg,
 	.num_config	= ARRAY_SIZE(sdm845_cfg),
@@ -4953,6 +5057,7 @@ static const struct of_device_id qcom_llcc_of_match[] = {
 	{ .compatible = "qcom,sc7280-llcc", .data = &sc7280_cfgs },
 	{ .compatible = "qcom,sc8180x-llcc", .data = &sc8180x_cfgs },
 	{ .compatible = "qcom,sc8280xp-llcc", .data = &sc8280xp_cfgs },
+	{ .compatible = "qcom,sdm670-llcc", .data = &sdm670_cfgs },
 	{ .compatible = "qcom,sdm845-llcc", .data = &sdm845_cfgs },
 	{ .compatible = "qcom,sm6350-llcc", .data = &sm6350_cfgs },
 	{ .compatible = "qcom,sm7150-llcc", .data = &sm7150_cfgs },
Signature · 1 line
2.53.0
#4 lore raw

Re: [PATCH 2/3] soc: qcom: llcc: Add configuration data for SDM670

Quoted 4 lines · Richard Acayan

Add system cache table and configs for the SDM670 SoC.

---

I have a clone of some msm-4.9 on my ssd and it roughly matches this patch

However

In docs, I see a version with only CPU_SS, MODEM and MMUHWT left (your settings here seem to match), dated later than the last commit to llcc-sdm670.c in that downstream kernel clone..

Because this SoC seems to only have 512KiB of LLC in total, it may be that it was found in testing for that configuration to have a better perf profile

Could you please give it a shot and check if you see any immediate gains/losses?

Konrad

#5 lore raw

Re: [PATCH 2/3] soc: qcom: llcc: Add configuration data for SDM670

Quoted 15 lines · Konrad Dybcio
Quoted 4 lines · Richard Acayan

Add system cache table and configs for the SDM670 SoC.

---

I have a clone of some msm-4.9 on my ssd and it roughly matches this patch

However

In docs, I see a version with only CPU_SS, MODEM and MMUHWT left (your settings here seem to match), dated later than the last commit to llcc-sdm670.c in that downstream kernel clone..

Quoted 6 lines

Because this SoC seems to only have 512KiB of LLC in total, it may be that it was found in testing for that configuration to have a better perf profile

Could you please give it a shot and check if you see any immediate gains/losses?

I don't notice a difference outside the margin of error. The Unixbench workload reported 4550.4 with all configs, and 4550.9 with only LLCC_CPUSS, LLCC_MDM, and LLCC_MMUHWT. My 15-second workload on Hexagon/CDSP was half a second faster when commenting out the cache use cases.

I don't see better startup times either.

Reviewed-by
#6 lore raw

Re: [PATCH 2/3] soc: qcom: llcc: Add configuration data for SDM670

Quoted 23 lines · Richard Acayan
Quoted 15 lines · Konrad Dybcio
Quoted 4 lines · Richard Acayan

Add system cache table and configs for the SDM670 SoC.

---

I have a clone of some msm-4.9 on my ssd and it roughly matches this patch

However

In docs, I see a version with only CPU_SS, MODEM and MMUHWT left (your settings here seem to match), dated later than the last commit to llcc-sdm670.c in that downstream kernel clone..

Quoted 6 lines

Because this SoC seems to only have 512KiB of LLC in total, it may be that it was found in testing for that configuration to have a better perf profile

Could you please give it a shot and check if you see any immediate gains/losses?

Quoted 7 lines

I don't notice a difference outside the margin of error. The Unixbench workload reported 4550.4 with all configs, and 4550.9 with only LLCC_CPUSS, LLCC_MDM, and LLCC_MMUHWT. My 15-second workload on Hexagon/CDSP was half a second faster when commenting out the cache use cases.

I don't see better startup times either.

Okay, let's stick with the one you posted then. I (briefly) skimmed through it and seems to be in line with that aforementioned downstream tree

Konrad

#7 lore raw

Re: [PATCH 2/3] soc: qcom: llcc: Add configuration data for SDM670

In reply to Richard Acayan
Quoted 4 lines · Richard Acayan

Add system cache table and configs for the SDM670 SoC.

---

[...]

drivers/soc/qcom/llcc-qcom.c static const struct qcom_llcc_config sc8280xp_cfg[] = { · line 4093

Quoted 8 lines
drivers/soc/qcom/llcc-qcom.c +8 -0
+static const struct qcom_llcc_config sdm670_cfg[] = {
+	{
+		.sct_data	= sdm670_data,
+		.size		= ARRAY_SIZE(sdm670_data),
+		.skip_llcc_cfg	= true,
+		.reg_offset	= llcc_v1_reg_offset,
+		.edac_reg_offset = &llcc_v1_edac_reg_offset,
+		.no_edac	= true,

Does the EDAC driver crash the device?

Konrad

#8 lore raw

Re: [PATCH 2/3] soc: qcom: llcc: Add configuration data for SDM670

Quoted 8 lines · Konrad Dybcio
Quoted 4 lines · Richard Acayan

Add system cache table and configs for the SDM670 SoC.

---

[...]

Quoted 10 lines

drivers/soc/qcom/llcc-qcom.c static const struct qcom_llcc_config sc8280xp_cfg[] = { · line 4093

Quoted 8 lines
drivers/soc/qcom/llcc-qcom.c +8 -0
+static const struct qcom_llcc_config sdm670_cfg[] = {
+	{
+		.sct_data	= sdm670_data,
+		.size		= ARRAY_SIZE(sdm670_data),
+		.skip_llcc_cfg	= true,
+		.reg_offset	= llcc_v1_reg_offset,
+		.edac_reg_offset = &llcc_v1_edac_reg_offset,
+		.no_edac	= true,

Does the EDAC driver crash the device?

Yes, this is needed if the EDAC driver is an available module.

#9 lore raw

PATCH 3/3 arm64: dts: qcom: sdm670: add llcc

In reply to Richard Acayan

Add the Last Level Cache Controller (LLCC) for the SDM670.

---
 arch/arm64/boot/dts/qcom/sdm670.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/qcom/sdm670.dtsi +11 -0
index b8a8dcbdfbe3..b5f832ca42f4 100644
@@ -1130,6 +1130,17 @@ refgen: regulator@ff1000 {
 			reg = <0x0 0x00ff1000 0x0 0x60>;
 		};
 
+		llcc: system-cache-controller@1100000 {
+			compatible = "qcom,sdm670-llcc";
+			reg = <0 0x01100000 0 0x50000>,
+			      <0 0x01180000 0 0x50000>,
+			      <0 0x01300000 0 0x50000>;
+			reg-names = "llcc0_base",
+				    "llcc1_base",
+				    "llcc_broadcast_base";
+			interrupts = <GIC_SPI 582 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
 		mem_noc: interconnect@1380000 {
 			compatible = "qcom,sdm670-mem-noc";
 			reg = <0 0x01380000 0 0x27200>;
Signature · 1 line
2.53.0
maintainer Applied
#11 lore raw

Re: (subset) [PATCH 0/3] SDM670 cache controller support

In reply to Richard Acayan
Quoted 8 lines · Richard Acayan

This adds support for the Low-Level Cache Controller (LLCC) on SDM670.

Richard Acayan (3):
dt-bindings: cache: qcom,llcc: Add SDM670 compatible
soc: qcom: llcc: Add configuration data for SDM670
arm64: dts: qcom: sdm670: add llcc

[...]

Applied, thanks!

[1/3] dt-bindings: cache: qcom,llcc: Add SDM670 compatible

      commit: 12cf1b5de820bc302f92221d87ae13ec1c760c84
[2/3] soc: qcom: llcc: Add configuration data for SDM670
      commit: 11080cc4af8f0ee4b88d0e51384765bb78f05bf5

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>
maintainer Applied
#12 lore raw

Re: (subset) [PATCH 0/3] SDM670 cache controller support

In reply to Richard Acayan
Quoted 8 lines · Richard Acayan

This adds support for the Low-Level Cache Controller (LLCC) on SDM670.

Richard Acayan (3):
dt-bindings: cache: qcom,llcc: Add SDM670 compatible
soc: qcom: llcc: Add configuration data for SDM670
arm64: dts: qcom: sdm670: add llcc

[...]

Applied, thanks!

[3/3] arm64: dts: qcom: sdm670: add llcc

      commit: 3aa997129993135ff1e11128e216af814e72f0a0

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>