Skip to contentSkip to conversation

memory: brcmstb_memc: Expand LPDDR4 check to cover for LPDDR5

PATCH Applied Florian Fainelli 2 participants 4 messages Jan 22 – Feb 26

Subsystems (2)
lore
Share & tools
lore

Florian Fainelli

author maintainer
#0 lore raw

PATCH 1/1 memory: brcmstb_memc: Expand LPDDR4 check to cover for LPDDR5

The same limitations that apply to LPDDR4 also apply to LPDDR5. Expand the check and rename accordingly.

---
 drivers/memory/brcmstb_memc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/memory/brcmstb_memc.c +5 -3
index ba73470b1b13..c28fe9093616 100644
@@ -14,6 +14,7 @@
 
 #define REG_MEMC_CNTRLR_CONFIG		0x00
 #define  CNTRLR_CONFIG_LPDDR4_SHIFT	5
+#define  CNTRLR_CONFIG_LPDDR5_SHIFT	6
 #define  CNTRLR_CONFIG_MASK		0xf
 #define REG_MEMC_SRPD_CFG_21		0x20
 #define REG_MEMC_SRPD_CFG_20		0x34
@@ -34,14 +35,15 @@ struct brcmstb_memc {
 	u32 srpd_offset;
 };
 
-static int brcmstb_memc_uses_lpddr4(struct brcmstb_memc *memc)
+static int brcmstb_memc_uses_lpddr45(struct brcmstb_memc *memc)
 {
 	void __iomem *config = memc->ddr_ctrl + REG_MEMC_CNTRLR_CONFIG;
 	u32 reg;
 
 	reg = readl_relaxed(config) & CNTRLR_CONFIG_MASK;
 
-	return reg == CNTRLR_CONFIG_LPDDR4_SHIFT;
+	return reg == CNTRLR_CONFIG_LPDDR4_SHIFT ||
+	       reg == CNTRLR_CONFIG_LPDDR5_SHIFT;
 }
 
 static int brcmstb_memc_srpd_config(struct brcmstb_memc *memc,
@@ -95,7 +97,7 @@ static ssize_t srpd_store(struct device *dev, struct device_attribute *attr,
 	 * dynamic tuning process will also get affected by the inactivity
 	 * timeout, thus making it non functional.
 	 */
-	if (brcmstb_memc_uses_lpddr4(memc))
+	if (brcmstb_memc_uses_lpddr45(memc))
 		return -EOPNOTSUPP;
 
 	ret = kstrtouint(buf, 10, &val);
Signature · 1 line
2.43.0
author maintainer
#1 lore raw
Quoted 4 lines · Florian Fainelli

The same limitations that apply to LPDDR4 also apply to LPDDR5. Expand the check and rename accordingly.

Krzysztof, can you take this patch? Thanks!

Signature · 1 line
Florian
#2 lore raw
Quoted 7 lines · Florian Fainelli
Quoted 4 lines · Florian Fainelli

The same limitations that apply to LPDDR4 also apply to LPDDR5. Expand the check and rename accordingly.

Krzysztof, can you take this patch? Thanks!

I will take it, but it was too late in the cycle and now is merge window. I still have it in my queue, I will take it after the merge window.

Best regards,
Krzysztof