linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC
@ 2022-01-28  7:09 Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 1/9] soc: qcom: llcc: Add support for 16 ways of allocation Sai Prakash Ranjan
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan

This patch series adds support for LLCC on SM8450 SoC. It mainly
consists of LLCC driver changes to incorporate newer LLCC HW found
on SM8450 SoC and the corresponding DT bits to enable LLCC.
Based on qcom/for-next branch.

Huang Yiwei (1):
  soc: qcom: llcc: Add support for 16 ways of allocation

Sai Prakash Ranjan (8):
  soc: qcom: llcc: Update the logic for version info extraction
  soc: qcom: llcc: Add write-cache cacheable support
  soc: qcom: llcc: Add missing llcc configuration data
  soc: qcom: llcc: Update register offsets for newer LLCC HW
  soc: qcom: llcc: Add configuration data for SM8450 SoC
  dt-bindings: arm: msm: Add LLCC compatible for SM8350
  dt-bindings: arm: msm: Add LLCC compatible for SM8450
  arm64: dts: qcom: sm8450: Add LLCC/system-cache-controller node

 .../bindings/arm/msm/qcom,llcc.yaml           |   2 +
 arch/arm64/boot/dts/qcom/sm8450.dtsi          |   7 ++
 drivers/soc/qcom/llcc-qcom.c                  | 102 +++++++++++++++---
 include/linux/soc/qcom/llcc-qcom.h            |   9 +-
 4 files changed, 104 insertions(+), 16 deletions(-)


base-commit: 073a39a2a63abd46339a50eb07bd23958d99efbe
prerequisite-patch-id: 33fc8487573f4dd2ef21bfdfcf57d1437f456df3
prerequisite-patch-id: 026a0e76224498cec9ad15cbbc452f8f4fcdbca9
prerequisite-patch-id: 626323d13e5cc60434e225544b71314fd84adf90
prerequisite-patch-id: a1d79b7d366eb3a749621998580d8607a852a432
prerequisite-patch-id: 51d51021554581d9ccf510a8c9087748b9a77019
prerequisite-patch-id: ecbbd03ca61082e78754d52d1b3e99848185b4d1
prerequisite-patch-id: 6120d52065436b3d5fcc4aa509af2046bea1e344
prerequisite-patch-id: 388f5c230d39b7181a0f563b6fc5b3e35d4d7f75
-- 
2.33.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/9] soc: qcom: llcc: Add support for 16 ways of allocation
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 2/9] soc: qcom: llcc: Update the logic for version info extraction Sai Prakash Ranjan
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak, Huang Yiwei,
	Sai Prakash Ranjan

From: Huang Yiwei <hyiwei@codeaurora.org>

Add support for 16 ways of allocation for LLCC HW version 2.1.0
and later.

Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 drivers/soc/qcom/llcc-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index ec52f29c8867..b3a34f117a7c 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -29,8 +29,8 @@
 #define ATTR1_FIXED_SIZE_SHIFT        0x03
 #define ATTR1_PRIORITY_SHIFT          0x04
 #define ATTR1_MAX_CAP_SHIFT           0x10
-#define ATTR0_RES_WAYS_MASK           GENMASK(11, 0)
-#define ATTR0_BONUS_WAYS_MASK         GENMASK(27, 16)
+#define ATTR0_RES_WAYS_MASK           GENMASK(15, 0)
+#define ATTR0_BONUS_WAYS_MASK         GENMASK(31, 16)
 #define ATTR0_BONUS_WAYS_SHIFT        0x10
 #define LLCC_STATUS_READ_DELAY        100
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/9] soc: qcom: llcc: Update the logic for version info extraction
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 1/9] soc: qcom: llcc: Add support for 16 ways of allocation Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:29   ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 3/9] soc: qcom: llcc: Add write-cache cacheable support Sai Prakash Ranjan
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan

LLCC HW version info is made up of major, branch, minor and echo
version bits each of which are 8bits. Several features in newer
LLCC HW are based on the full version rather than just major or
minor versions such as write-subcache enable which is applicable
for versions greater than v2.0.0.0 and upcoming write-subcache
cacheable for SM8450 SoC which is only present in versions v2.1.0.0
and later, so it makes it easier and cleaner to just directly
compare with the full version than adding additional major/branch/
minor/echo version checks. So remove the earlier major version check
and add full version check for those features.

Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 drivers/soc/qcom/llcc-qcom.c       | 9 ++++-----
 include/linux/soc/qcom/llcc-qcom.h | 4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index b3a34f117a7c..a06764f16023 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -37,7 +37,6 @@
 #define CACHE_LINE_SIZE_SHIFT         6
 
 #define LLCC_COMMON_HW_INFO           0x00030000
-#define LLCC_MAJOR_VERSION_MASK       GENMASK(31, 24)
 
 #define LLCC_COMMON_STATUS0           0x0003000c
 #define LLCC_LB_CNT_MASK              GENMASK(31, 28)
@@ -55,6 +54,8 @@
 
 #define BANK_OFFSET_STRIDE	      0x80000
 
+#define LLCC_VERSION_2_0_0_0          0x02000000
+
 /**
  * struct llcc_slice_config - Data associated with the llcc slice
  * @usecase_id: Unique id for the client's use case
@@ -504,7 +505,7 @@ static int _qcom_llcc_cfg_program(const struct llcc_slice_config *config,
 			return ret;
 	}
 
-	if (drv_data->major_version == 2) {
+	if (drv_data->version >= LLCC_VERSION_2_0_0_0) {
 		u32 wren;
 
 		wren = config->write_scid_en << config->slice_id;
@@ -598,13 +599,11 @@ static int qcom_llcc_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	/* Extract major version of the IP */
+	/* Extract version of the IP */
 	ret = regmap_read(drv_data->bcast_regmap, LLCC_COMMON_HW_INFO, &version);
 	if (ret)
 		goto err;
 
-	drv_data->major_version = FIELD_GET(LLCC_MAJOR_VERSION_MASK, version);
-
 	ret = regmap_read(drv_data->regmap, LLCC_COMMON_STATUS0,
 						&num_banks);
 	if (ret)
diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
index 9e8fd92c96b7..beecf00b707d 100644
--- a/include/linux/soc/qcom/llcc-qcom.h
+++ b/include/linux/soc/qcom/llcc-qcom.h
@@ -83,7 +83,7 @@ struct llcc_edac_reg_data {
  * @bitmap: Bit map to track the active slice ids
  * @offsets: Pointer to the bank offsets array
  * @ecc_irq: interrupt for llcc cache error detection and reporting
- * @major_version: Indicates the LLCC major version
+ * @version: Indicates the LLCC version
  */
 struct llcc_drv_data {
 	struct regmap *regmap;
@@ -96,7 +96,7 @@ struct llcc_drv_data {
 	unsigned long *bitmap;
 	u32 *offsets;
 	int ecc_irq;
-	u32 major_version;
+	u32 version;
 };
 
 #if IS_ENABLED(CONFIG_QCOM_LLCC)
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/9] soc: qcom: llcc: Add write-cache cacheable support
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 1/9] soc: qcom: llcc: Add support for 16 ways of allocation Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 2/9] soc: qcom: llcc: Update the logic for version info extraction Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 4/9] soc: qcom: llcc: Add missing llcc configuration data Sai Prakash Ranjan
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan

Newer SoCs with LLCC IP version 2.1.0 and later support write
sub-cache cacheable feature. Use a separate llcc_slice_config member
"write_scid_cacheable_en" to identify this feature and program
LLCC_TRP_SCID_WRSC_CACHEABLE_EN register to enable it.

Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 drivers/soc/qcom/llcc-qcom.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index a06764f16023..79fce5a2ff06 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -51,10 +51,12 @@
 #define LLCC_TRP_SCID_DIS_CAP_ALLOC   0x21f00
 #define LLCC_TRP_PCB_ACT              0x21f04
 #define LLCC_TRP_WRSC_EN              0x21f20
+#define LLCC_TRP_WRSC_CACHEABLE_EN    0x21f2c
 
 #define BANK_OFFSET_STRIDE	      0x80000
 
 #define LLCC_VERSION_2_0_0_0          0x02000000
+#define LLCC_VERSION_2_1_0_0          0x02010000
 
 /**
  * struct llcc_slice_config - Data associated with the llcc slice
@@ -80,6 +82,8 @@
  *               collapse.
  * @activate_on_init: Activate the slice immediately after it is programmed
  * @write_scid_en: Bit enables write cache support for a given scid.
+ * @write_scid_cacheable_en: Enables write cache cacheable support for a
+ *			     given scid (not supported on v2 or older hardware).
  */
 struct llcc_slice_config {
 	u32 usecase_id;
@@ -95,6 +99,7 @@ struct llcc_slice_config {
 	bool retain_on_pc;
 	bool activate_on_init;
 	bool write_scid_en;
+	bool write_scid_cacheable_en;
 };
 
 struct qcom_llcc_config {
@@ -515,6 +520,16 @@ static int _qcom_llcc_cfg_program(const struct llcc_slice_config *config,
 			return ret;
 	}
 
+	if (drv_data->version >= LLCC_VERSION_2_1_0_0) {
+		u32 wr_cache_en;
+
+		wr_cache_en = config->write_scid_cacheable_en << config->slice_id;
+		ret = regmap_update_bits(drv_data->bcast_regmap, LLCC_TRP_WRSC_CACHEABLE_EN,
+					 BIT(config->slice_id), wr_cache_en);
+		if (ret)
+			return ret;
+	}
+
 	if (config->activate_on_init) {
 		desc.slice_id = config->slice_id;
 		ret = llcc_slice_activate(&desc);
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/9] soc: qcom: llcc: Add missing llcc configuration data
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
                   ` (2 preceding siblings ...)
  2022-01-28  7:09 ` [PATCH 3/9] soc: qcom: llcc: Add write-cache cacheable support Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 5/9] soc: qcom: llcc: Update register offsets for newer LLCC HW Sai Prakash Ranjan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan

Add missing llcc configuration data for few chipsets which
were not added during initial post.

Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 drivers/soc/qcom/llcc-qcom.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index 79fce5a2ff06..d14d20d824b2 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -244,21 +244,25 @@ static const struct qcom_llcc_config sdm845_cfg = {
 static const struct qcom_llcc_config sm6350_cfg = {
 	.sct_data	= sm6350_data,
 	.size		= ARRAY_SIZE(sm6350_data),
+	.need_llcc_cfg	= true,
 };
 
 static const struct qcom_llcc_config sm8150_cfg = {
 	.sct_data       = sm8150_data,
 	.size           = ARRAY_SIZE(sm8150_data),
+	.need_llcc_cfg	= true,
 };
 
 static const struct qcom_llcc_config sm8250_cfg = {
 	.sct_data       = sm8250_data,
 	.size           = ARRAY_SIZE(sm8250_data),
+	.need_llcc_cfg	= true,
 };
 
 static const struct qcom_llcc_config sm8350_cfg = {
 	.sct_data       = sm8350_data,
 	.size           = ARRAY_SIZE(sm8350_data),
+	.need_llcc_cfg	= true,
 };
 
 static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER;
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/9] soc: qcom: llcc: Update register offsets for newer LLCC HW
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
                   ` (3 preceding siblings ...)
  2022-01-28  7:09 ` [PATCH 4/9] soc: qcom: llcc: Add missing llcc configuration data Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 6/9] soc: qcom: llcc: Add configuration data for SM8450 SoC Sai Prakash Ranjan
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan

Newer LLCC HW have different register offsets for several registers,
currently of which LLCC hardware info and status are used to identify
the LLCC version information and other data. So use separate table to
keep track of these register offsets which vary by different LLCC HW
versions and eases any future addition in variations of register offsets
for newer hardware.

Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 drivers/soc/qcom/llcc-qcom.c | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index d14d20d824b2..2306536fbc76 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -36,9 +36,6 @@
 
 #define CACHE_LINE_SIZE_SHIFT         6
 
-#define LLCC_COMMON_HW_INFO           0x00030000
-
-#define LLCC_COMMON_STATUS0           0x0003000c
 #define LLCC_LB_CNT_MASK              GENMASK(31, 28)
 #define LLCC_LB_CNT_SHIFT             28
 
@@ -106,6 +103,12 @@ struct qcom_llcc_config {
 	const struct llcc_slice_config *sct_data;
 	int size;
 	bool need_llcc_cfg;
+	const u32 *reg_offset;
+};
+
+enum llcc_reg_offset {
+	LLCC_COMMON_HW_INFO,
+	LLCC_COMMON_STATUS0,
 };
 
 static const struct llcc_slice_config sc7180_data[] =  {
@@ -223,46 +226,63 @@ static const struct llcc_slice_config sm8350_data[] =  {
 	{ LLCC_CPUHWT,   5, 512,   1, 1, 0xfff, 0x0, 0, 0, 0, 0, 0, 1 },
 };
 
+static const u32 llcc_v1_2_reg_offset[] = {
+	[LLCC_COMMON_HW_INFO]	= 0x00030000,
+	[LLCC_COMMON_STATUS0]	= 0x0003000c,
+};
+
+static const u32 llcc_v21_reg_offset[] = {
+	[LLCC_COMMON_HW_INFO]	= 0x00034000,
+	[LLCC_COMMON_STATUS0]	= 0x0003400c,
+};
+
 static const struct qcom_llcc_config sc7180_cfg = {
 	.sct_data	= sc7180_data,
 	.size		= ARRAY_SIZE(sc7180_data),
 	.need_llcc_cfg	= true,
+	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
 static const struct qcom_llcc_config sc7280_cfg = {
 	.sct_data	= sc7280_data,
 	.size		= ARRAY_SIZE(sc7280_data),
 	.need_llcc_cfg	= true,
+	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
 static const struct qcom_llcc_config sdm845_cfg = {
 	.sct_data	= sdm845_data,
 	.size		= ARRAY_SIZE(sdm845_data),
 	.need_llcc_cfg	= false,
+	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
 static const struct qcom_llcc_config sm6350_cfg = {
 	.sct_data	= sm6350_data,
 	.size		= ARRAY_SIZE(sm6350_data),
 	.need_llcc_cfg	= true,
+	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
 static const struct qcom_llcc_config sm8150_cfg = {
 	.sct_data       = sm8150_data,
 	.size           = ARRAY_SIZE(sm8150_data),
 	.need_llcc_cfg	= true,
+	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
 static const struct qcom_llcc_config sm8250_cfg = {
 	.sct_data       = sm8250_data,
 	.size           = ARRAY_SIZE(sm8250_data),
 	.need_llcc_cfg	= true,
+	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
 static const struct qcom_llcc_config sm8350_cfg = {
 	.sct_data       = sm8350_data,
 	.size           = ARRAY_SIZE(sm8350_data),
 	.need_llcc_cfg	= true,
+	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
 static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER;
@@ -618,13 +638,16 @@ static int qcom_llcc_probe(struct platform_device *pdev)
 		goto err;
 	}
 
+	cfg = of_device_get_match_data(&pdev->dev);
+
 	/* Extract version of the IP */
-	ret = regmap_read(drv_data->bcast_regmap, LLCC_COMMON_HW_INFO, &version);
+	ret = regmap_read(drv_data->bcast_regmap, cfg->reg_offset[LLCC_COMMON_HW_INFO],
+			  &version);
 	if (ret)
 		goto err;
 
-	ret = regmap_read(drv_data->regmap, LLCC_COMMON_STATUS0,
-						&num_banks);
+	ret = regmap_read(drv_data->regmap, cfg->reg_offset[LLCC_COMMON_STATUS0],
+			  &num_banks);
 	if (ret)
 		goto err;
 
@@ -632,7 +655,6 @@ static int qcom_llcc_probe(struct platform_device *pdev)
 	num_banks >>= LLCC_LB_CNT_SHIFT;
 	drv_data->num_banks = num_banks;
 
-	cfg = of_device_get_match_data(&pdev->dev);
 	llcc_cfg = cfg->sct_data;
 	sz = cfg->size;
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/9] soc: qcom: llcc: Add configuration data for SM8450 SoC
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
                   ` (4 preceding siblings ...)
  2022-01-28  7:09 ` [PATCH 5/9] soc: qcom: llcc: Update register offsets for newer LLCC HW Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 7/9] dt-bindings: arm: msm: Add LLCC compatible for SM8350 Sai Prakash Ranjan
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan

Add LLCC configuration data for SM8450 SoC.

Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 drivers/soc/qcom/llcc-qcom.c       | 34 ++++++++++++++++++++++++++++++
 include/linux/soc/qcom/llcc-qcom.h |  5 +++++
 2 files changed, 39 insertions(+)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index 2306536fbc76..ea88f171686b 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -226,6 +226,32 @@ static const struct llcc_slice_config sm8350_data[] =  {
 	{ LLCC_CPUHWT,   5, 512,   1, 1, 0xfff, 0x0, 0, 0, 0, 0, 0, 1 },
 };
 
+static const struct llcc_slice_config sm8450_data[] =  {
+	{LLCC_CPUSS,     1, 3072, 1, 0, 0xFFFF, 0x0,   0, 0, 0, 1, 1, 0, 0 },
+	{LLCC_VIDSC0,    2,  512, 3, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_AUDIO,     6, 1024, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 0, 0, 0, 0 },
+	{LLCC_MDMHPGRW,  7, 1024, 3, 0, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_MODHW,     9, 1024, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_CMPT,     10, 4096, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_GPUHTW,   11,  512, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_GPU,      12, 2048, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 1, 0 },
+	{LLCC_MMUHWT,   13,  768, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 0, 1, 0, 0 },
+	{LLCC_DISP,     16, 4096, 2, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_MDMPNG,   21, 1024, 1, 1, 0xF000, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_AUDHW,    22, 1024, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 0, 0, 0, 0 },
+	{LLCC_CVP,      28,  256, 3, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_MODPE,    29,   64, 1, 1, 0xF000, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_APTCM,    30, 1024, 3, 1, 0x0,    0xF0,  1, 0, 0, 1, 0, 0, 0 },
+	{LLCC_WRCACHE,  31,  512, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 0, 1, 0, 0 },
+	{LLCC_CVPFW,    17,  512, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_CPUSS1,    3, 1024, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_CAMEXP0,   4,  256, 3, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_CPUMTE,   23,  256, 1, 1, 0x0FFF, 0x0,   0, 0, 0, 0, 1, 0, 0 },
+	{LLCC_CPUHWT,    5,  512, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 1, 0, 0 },
+	{LLCC_CAMEXP1,  27,  256, 3, 1, 0xFFFF, 0x0,   0, 0, 0, 1, 0, 0, 0 },
+	{LLCC_AENPU,     8, 2048, 1, 1, 0xFFFF, 0x0,   0, 0, 0, 0, 0, 0, 0 },
+};
+
 static const u32 llcc_v1_2_reg_offset[] = {
 	[LLCC_COMMON_HW_INFO]	= 0x00030000,
 	[LLCC_COMMON_STATUS0]	= 0x0003000c,
@@ -285,6 +311,13 @@ static const struct qcom_llcc_config sm8350_cfg = {
 	.reg_offset	= llcc_v1_2_reg_offset,
 };
 
+static const struct qcom_llcc_config sm8450_cfg = {
+	.sct_data       = sm8450_data,
+	.size           = ARRAY_SIZE(sm8450_data),
+	.need_llcc_cfg	= true,
+	.reg_offset	= llcc_v21_reg_offset,
+};
+
 static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER;
 
 /**
@@ -712,6 +745,7 @@ static const struct of_device_id qcom_llcc_of_match[] = {
 	{ .compatible = "qcom,sm8150-llcc", .data = &sm8150_cfg },
 	{ .compatible = "qcom,sm8250-llcc", .data = &sm8250_cfg },
 	{ .compatible = "qcom,sm8350-llcc", .data = &sm8350_cfg },
+	{ .compatible = "qcom,sm8450-llcc", .data = &sm8450_cfg },
 	{ }
 };
 
diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
index beecf00b707d..0bc21ee58fac 100644
--- a/include/linux/soc/qcom/llcc-qcom.h
+++ b/include/linux/soc/qcom/llcc-qcom.h
@@ -35,7 +35,12 @@
 #define LLCC_WRCACHE     31
 #define LLCC_CVPFW       32
 #define LLCC_CPUSS1      33
+#define LLCC_CAMEXP0     34
+#define LLCC_CPUMTE      35
 #define LLCC_CPUHWT      36
+#define LLCC_MDMCLAD2    37
+#define LLCC_CAMEXP1     38
+#define LLCC_AENPU       45
 
 /**
  * struct llcc_slice_desc - Cache slice descriptor
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/9] dt-bindings: arm: msm: Add LLCC compatible for SM8350
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
                   ` (5 preceding siblings ...)
  2022-01-28  7:09 ` [PATCH 6/9] soc: qcom: llcc: Add configuration data for SM8450 SoC Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 8/9] dt-bindings: arm: msm: Add LLCC compatible for SM8450 Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 9/9] arm64: dts: qcom: sm8450: Add LLCC/system-cache-controller node Sai Prakash Ranjan
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan, Rob Herring

Add LLCC compatible for SM8350 SoC.

Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml b/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
index 03882aac8d2d..c1eded3a3257 100644
--- a/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
+++ b/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
@@ -27,6 +27,7 @@ properties:
       - qcom,sm6350-llcc
       - qcom,sm8150-llcc
       - qcom,sm8250-llcc
+      - qcom,sm8350-llcc
 
   reg:
     items:
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/9] dt-bindings: arm: msm: Add LLCC compatible for SM8450
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
                   ` (6 preceding siblings ...)
  2022-01-28  7:09 ` [PATCH 7/9] dt-bindings: arm: msm: Add LLCC compatible for SM8350 Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  2022-01-28  7:09 ` [PATCH 9/9] arm64: dts: qcom: sm8450: Add LLCC/system-cache-controller node Sai Prakash Ranjan
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan, Rob Herring

Add LLCC compatible for SM8450 SoC.

Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml b/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
index c1eded3a3257..30fcbe2ad8a3 100644
--- a/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
+++ b/Documentation/devicetree/bindings/arm/msm/qcom,llcc.yaml
@@ -28,6 +28,7 @@ properties:
       - qcom,sm8150-llcc
       - qcom,sm8250-llcc
       - qcom,sm8350-llcc
+      - qcom,sm8450-llcc
 
   reg:
     items:
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 9/9] arm64: dts: qcom: sm8450: Add LLCC/system-cache-controller node
  2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
                   ` (7 preceding siblings ...)
  2022-01-28  7:09 ` [PATCH 8/9] dt-bindings: arm: msm: Add LLCC compatible for SM8450 Sai Prakash Ranjan
@ 2022-01-28  7:09 ` Sai Prakash Ranjan
  8 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak,
	Sai Prakash Ranjan

Add a DT node for Last level cache (aka. system cache) controller
which provides control over the last level cache present on SM8450
SoC.

Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sm8450.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
index 10c25ad2d0c7..5a3d050b94f7 100644
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
@@ -1102,6 +1102,13 @@ usb_1_dwc3: usb@a600000 {
 				phy-names = "usb2-phy", "usb3-phy";
 			};
 		};
+
+		system-cache-controller@19200000 {
+			compatible = "qcom,sm8450-llcc";
+			reg = <0 0x19200000 0 0x580000>, <0 0x19a00000 0 0x80000>;
+			reg-names = "llcc_base", "llcc_broadcast_base";
+			interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>;
+		};
 	};
 
 	timer {
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/9] soc: qcom: llcc: Update the logic for version info extraction
  2022-01-28  7:09 ` [PATCH 2/9] soc: qcom: llcc: Update the logic for version info extraction Sai Prakash Ranjan
@ 2022-01-28  7:29   ` Sai Prakash Ranjan
  0 siblings, 0 replies; 11+ messages in thread
From: Sai Prakash Ranjan @ 2022-01-28  7:29 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Vinod Koul, Manivannan Sadhasivam, Rajendra Nayak

On 1/28/2022 12:39 PM, Sai Prakash Ranjan wrote:
> LLCC HW version info is made up of major, branch, minor and echo
> version bits each of which are 8bits. Several features in newer
> LLCC HW are based on the full version rather than just major or
> minor versions such as write-subcache enable which is applicable
> for versions greater than v2.0.0.0 and upcoming write-subcache
> cacheable for SM8450 SoC which is only present in versions v2.1.0.0
> and later, so it makes it easier and cleaner to just directly
> compare with the full version than adding additional major/branch/
> minor/echo version checks. So remove the earlier major version check
> and add full version check for those features.
>
> Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
> ---
>   drivers/soc/qcom/llcc-qcom.c       | 9 ++++-----
>   include/linux/soc/qcom/llcc-qcom.h | 4 ++--
>   2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> index b3a34f117a7c..a06764f16023 100644
> --- a/drivers/soc/qcom/llcc-qcom.c
> +++ b/drivers/soc/qcom/llcc-qcom.c
> @@ -37,7 +37,6 @@
>   #define CACHE_LINE_SIZE_SHIFT         6
>   
>   #define LLCC_COMMON_HW_INFO           0x00030000
> -#define LLCC_MAJOR_VERSION_MASK       GENMASK(31, 24)
>   
>   #define LLCC_COMMON_STATUS0           0x0003000c
>   #define LLCC_LB_CNT_MASK              GENMASK(31, 28)
> @@ -55,6 +54,8 @@
>   
>   #define BANK_OFFSET_STRIDE	      0x80000
>   
> +#define LLCC_VERSION_2_0_0_0          0x02000000
> +
>   /**
>    * struct llcc_slice_config - Data associated with the llcc slice
>    * @usecase_id: Unique id for the client's use case
> @@ -504,7 +505,7 @@ static int _qcom_llcc_cfg_program(const struct llcc_slice_config *config,
>   			return ret;
>   	}
>   
> -	if (drv_data->major_version == 2) {
> +	if (drv_data->version >= LLCC_VERSION_2_0_0_0) {
>   		u32 wren;
>   
>   		wren = config->write_scid_en << config->slice_id;
> @@ -598,13 +599,11 @@ static int qcom_llcc_probe(struct platform_device *pdev)
>   		goto err;
>   	}
>   
> -	/* Extract major version of the IP */
> +	/* Extract version of the IP */
>   	ret = regmap_read(drv_data->bcast_regmap, LLCC_COMMON_HW_INFO, &version);
>   	if (ret)
>   		goto err;
>   
> -	drv_data->major_version = FIELD_GET(LLCC_MAJOR_VERSION_MASK, version);
> -

Sorry, I missed assigning version info to drv_data here in this version. 
I am sending a v2 with the fix.

Thanks,
Sai

>   	ret = regmap_read(drv_data->regmap, LLCC_COMMON_STATUS0,
>   						&num_banks);
>   	if (ret)
> diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
> index 9e8fd92c96b7..beecf00b707d 100644
> --- a/include/linux/soc/qcom/llcc-qcom.h
> +++ b/include/linux/soc/qcom/llcc-qcom.h
> @@ -83,7 +83,7 @@ struct llcc_edac_reg_data {
>    * @bitmap: Bit map to track the active slice ids
>    * @offsets: Pointer to the bank offsets array
>    * @ecc_irq: interrupt for llcc cache error detection and reporting
> - * @major_version: Indicates the LLCC major version
> + * @version: Indicates the LLCC version
>    */
>   struct llcc_drv_data {
>   	struct regmap *regmap;
> @@ -96,7 +96,7 @@ struct llcc_drv_data {
>   	unsigned long *bitmap;
>   	u32 *offsets;
>   	int ecc_irq;
> -	u32 major_version;
> +	u32 version;
>   };
>   
>   #if IS_ENABLED(CONFIG_QCOM_LLCC)



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-28  7:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28  7:09 [PATCH 0/9] soc: qcom: llcc: Add LLCC support for SM8450 SoC Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 1/9] soc: qcom: llcc: Add support for 16 ways of allocation Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 2/9] soc: qcom: llcc: Update the logic for version info extraction Sai Prakash Ranjan
2022-01-28  7:29   ` Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 3/9] soc: qcom: llcc: Add write-cache cacheable support Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 4/9] soc: qcom: llcc: Add missing llcc configuration data Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 5/9] soc: qcom: llcc: Update register offsets for newer LLCC HW Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 6/9] soc: qcom: llcc: Add configuration data for SM8450 SoC Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 7/9] dt-bindings: arm: msm: Add LLCC compatible for SM8350 Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 8/9] dt-bindings: arm: msm: Add LLCC compatible for SM8450 Sai Prakash Ranjan
2022-01-28  7:09 ` [PATCH 9/9] arm64: dts: qcom: sm8450: Add LLCC/system-cache-controller node Sai Prakash Ranjan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).