Skip to contentSkip to conversation

cpufreq: imx6q: Only disabling 792MHz OPP for i.MX6ULL types below 792MHz

PATCH Applied Christoph Niedermaier 2 participants 3 messages Nov 22, 2023 – Nov 23, 2023

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

PATCH v2 1/1 cpufreq: imx6q: Only disabling 792MHz OPP for i.MX6ULL types below 792MHz

For a 900MHz i.MX6ULL CPU the 792MHz OPP is disabled. There is no convincing reason to disable this OPP. If a CPU can run at 900MHz, it should also be able to cope with 792MHz. Looking at the voltage level of 792MHz in [1] (page 24, table 10. "Operating Ranges") the current defined OPP is above the minimum. So the voltage level shouldn't be a problem. However in [2] (page 24, table 10. "Operating Ranges"), it is not mentioned that 792MHz OPP isn't allowed. Change it to only disable 792MHz OPP for i.MX6ULL types below 792 MHz.

[1] https://www.nxp.com/docs/en/data-sheet/IMX6ULLIEC.pdf
[2] https://www.nxp.com/docs/en/data-sheet/IMX6ULLCEC.pdf

Fixes 0aa9abd4c212 ("cpufreq: imx6q: check speed grades for i.MX6ULL")

---
V2: - Improve the commit message
- Add Fixes tag
- Add Reviewed-by tag
---
Cc: Viresh Kumar <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Sébastien Szymanski <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: [email protected]
Cc: [email protected]
To: [email protected]

---
 drivers/cpufreq/imx6q-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/imx6q-cpufreq.c +1 -1
index 494d044b9e72..33728c242f66 100644
@@ -327,7 +327,7 @@ static int imx6ul_opp_check_speed_grading(struct device *dev)
 			imx6x_disable_freq_in_opp(dev, 696000000);
 
 	if (of_machine_is_compatible("fsl,imx6ull")) {
-		if (val != OCOTP_CFG3_6ULL_SPEED_792MHZ)
+		if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ)
 			imx6x_disable_freq_in_opp(dev, 792000000);
 
 		if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)
Signature · 1 line
2.11.0
maintainer
#1 lore raw
Quoted 42 lines · Christoph Niedermaier

For a 900MHz i.MX6ULL CPU the 792MHz OPP is disabled. There is no convincing reason to disable this OPP. If a CPU can run at 900MHz, it should also be able to cope with 792MHz. Looking at the voltage level of 792MHz in [1] (page 24, table 10. "Operating Ranges") the current defined OPP is above the minimum. So the voltage level shouldn't be a problem. However in [2] (page 24, table 10. "Operating Ranges"), it is not mentioned that 792MHz OPP isn't allowed. Change it to only disable 792MHz OPP for i.MX6ULL types below 792 MHz.

[1] https://www.nxp.com/docs/en/data-sheet/IMX6ULLIEC.pdf
[2] https://www.nxp.com/docs/en/data-sheet/IMX6ULLCEC.pdf

Fixes 0aa9abd4c212 ("cpufreq: imx6q: check speed grades for i.MX6ULL")

---
V2: - Improve the commit message
- Add Fixes tag
- Add Reviewed-by tag
---
Cc: Viresh Kumar <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Sébastien Szymanski <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: [email protected]
Cc: [email protected]
To: [email protected]

---
 drivers/cpufreq/imx6q-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/imx6q-cpufreq.c +0 -0
index 494d044b9e72..33728c242f66 100644

drivers/cpufreq/imx6q-cpufreq.c static int imx6ul_opp_check_speed_grading(struct device *dev) · line 333

Quoted 8 lines
drivers/cpufreq/imx6q-cpufreq.c +1 -1
@@ -327,7 +327,7 @@ static int imx6ul_opp_check_speed_grading(struct device *dev)
 			imx6x_disable_freq_in_opp(dev, 696000000);
 
 	if (of_machine_is_compatible("fsl,imx6ull")) {
-		if (val != OCOTP_CFG3_6ULL_SPEED_792MHZ)
+		if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ)
 			imx6x_disable_freq_in_opp(dev, 792000000);
 
 		if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)

What about another similar check ?

		if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)
Signature · 1 line
viresh
maintainer Applied
#2 lore raw
Quoted 50 lines · Viresh Kumar
Quoted 49 lines · Christoph Niedermaier

For a 900MHz i.MX6ULL CPU the 792MHz OPP is disabled. There is no convincing reason to disable this OPP. If a CPU can run at 900MHz, it should also be able to cope with 792MHz. Looking at the voltage level of 792MHz in [1] (page 24, table 10. "Operating Ranges") the current defined OPP is above the minimum. So the voltage level shouldn't be a problem. However in [2] (page 24, table 10. "Operating Ranges"), it is not mentioned that 792MHz OPP isn't allowed. Change it to only disable 792MHz OPP for i.MX6ULL types below 792 MHz.

[1] https://www.nxp.com/docs/en/data-sheet/IMX6ULLIEC.pdf
[2] https://www.nxp.com/docs/en/data-sheet/IMX6ULLCEC.pdf

Fixes 0aa9abd4c212 ("cpufreq: imx6q: check speed grades for i.MX6ULL")

---
V2: - Improve the commit message
- Add Fixes tag
- Add Reviewed-by tag
---
Cc: Viresh Kumar <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Sébastien Szymanski <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: [email protected]
Cc: [email protected]
To: [email protected]

---
 drivers/cpufreq/imx6q-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/imx6q-cpufreq.c +1 -1
index 494d044b9e72..33728c242f66 100644
@@ -327,7 +327,7 @@ static int imx6ul_opp_check_speed_grading(struct device *dev)
 			imx6x_disable_freq_in_opp(dev, 696000000);
 
 	if (of_machine_is_compatible("fsl,imx6ull")) {
-		if (val != OCOTP_CFG3_6ULL_SPEED_792MHZ)
+		if (val < OCOTP_CFG3_6ULL_SPEED_792MHZ)
 			imx6x_disable_freq_in_opp(dev, 792000000);
 
Quoted 5 lines

drivers/cpufreq/imx6q-cpufreq.c static int imx6ul_opp_check_speed_grading(struct device *dev) · line 333

Quoted 1 line
drivers/cpufreq/imx6q-cpufreq.c +0 -0
 		if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)

What about another similar check ?

		if (val != OCOTP_CFG3_6ULL_SPEED_900MHZ)

Yeah, that isn't required I guess.

Applied. Thanks.

Signature · 1 line
viresh