diff mbox series

[1/2] cpu: imx8: fix type and rate detection

Message ID 20200516203420.24409-1-agust@denx.de
State Accepted
Commit 69365540cf607d5212ebd014869e4f55c1de8044
Headers show
Series [1/2] cpu: imx8: fix type and rate detection | expand

Commit Message

Anatolij Gustschin May 16, 2020, 8:34 p.m. UTC
CPU type and rate detection is broken, for A35 cpu we get A53:
...
sc_pm_get_clock_rate: resource:0 clk:2: res:3
Could not read CPU frequency: -22
CPU:   NXP i.MX8QXP RevB A53 at 0 MHz at 47C

Fixes: 55bc96f3b675 ("cpu: imx8: fix get core name and rate")
Signed-off-by: Anatolij Gustschin <agust at denx.de>
---
 drivers/cpu/imx8_cpu.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Peng Fan May 17, 2020, 10:02 a.m. UTC | #1
> Subject: [PATCH 1/2] cpu: imx8: fix type and rate detection
> 
> CPU type and rate detection is broken, for A35 cpu we get A53:
> ...
> sc_pm_get_clock_rate: resource:0 clk:2: res:3 Could not read CPU frequency:
> -22
> CPU:   NXP i.MX8QXP RevB A53 at 0 MHz at 47C
> 
> Fixes: 55bc96f3b675 ("cpu: imx8: fix get core name and rate")
> Signed-off-by: Anatolij Gustschin <agust at denx.de>
> ---
>  drivers/cpu/imx8_cpu.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c index
> 95c14c98d8..896e1ac776 100644
> --- a/drivers/cpu/imx8_cpu.c
> +++ b/drivers/cpu/imx8_cpu.c
> @@ -52,11 +52,11 @@ const char *get_imx8_rev(u32 rev)
> 
>  const char *get_core_name(struct udevice *dev)  {
> -	if (!device_is_compatible(dev, "arm,cortex-a35"))
> +	if (device_is_compatible(dev, "arm,cortex-a35"))
>  		return "A35";
> -	else if (!device_is_compatible(dev, "arm,cortex-a53"))
> +	else if (device_is_compatible(dev, "arm,cortex-a53"))
>  		return "A53";
> -	else if (!device_is_compatible(dev, "arm,cortex-a72"))
> +	else if (device_is_compatible(dev, "arm,cortex-a72"))
>  		return "A72";
>  	else
>  		return "?";
> @@ -183,11 +183,11 @@ static ulong imx8_get_cpu_rate(struct udevice
> *dev)
>  	ulong rate;
>  	int ret, type;
> 
> -	if (!device_is_compatible(dev, "arm,cortex-a35"))
> +	if (device_is_compatible(dev, "arm,cortex-a35"))
>  		type = SC_R_A35;
> -	else if (!device_is_compatible(dev, "arm,cortex-a53"))
> +	else if (device_is_compatible(dev, "arm,cortex-a53"))
>  		type = SC_R_A53;
> -	else if (!device_is_compatible(dev, "arm,cortex-a72"))
> +	else if (device_is_compatible(dev, "arm,cortex-a72"))
>  		type = SC_R_A72;
>  	else
>  		return 0;
> --
> 2.17.1

Reviewed-by: Peng Fan <peng.fan at nxp.com>
Anatolij Gustschin May 22, 2020, 9:13 p.m. UTC | #2
On Sat, 16 May 2020 22:34:19 +0200
Anatolij Gustschin agust at denx.de wrote:

> CPU type and rate detection is broken, for A35 cpu we get A53:
> ...
> sc_pm_get_clock_rate: resource:0 clk:2: res:3
> Could not read CPU frequency: -22
> CPU:   NXP i.MX8QXP RevB A53 at 0 MHz at 47C
> 
> Fixes: 55bc96f3b675 ("cpu: imx8: fix get core name and rate")
> Signed-off-by: Anatolij Gustschin <agust at denx.de>
> ---
>  drivers/cpu/imx8_cpu.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Applied.

--
Anatolij
diff mbox series

Patch

diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c
index 95c14c98d8..896e1ac776 100644
--- a/drivers/cpu/imx8_cpu.c
+++ b/drivers/cpu/imx8_cpu.c
@@ -52,11 +52,11 @@  const char *get_imx8_rev(u32 rev)
 
 const char *get_core_name(struct udevice *dev)
 {
-	if (!device_is_compatible(dev, "arm,cortex-a35"))
+	if (device_is_compatible(dev, "arm,cortex-a35"))
 		return "A35";
-	else if (!device_is_compatible(dev, "arm,cortex-a53"))
+	else if (device_is_compatible(dev, "arm,cortex-a53"))
 		return "A53";
-	else if (!device_is_compatible(dev, "arm,cortex-a72"))
+	else if (device_is_compatible(dev, "arm,cortex-a72"))
 		return "A72";
 	else
 		return "?";
@@ -183,11 +183,11 @@  static ulong imx8_get_cpu_rate(struct udevice *dev)
 	ulong rate;
 	int ret, type;
 
-	if (!device_is_compatible(dev, "arm,cortex-a35"))
+	if (device_is_compatible(dev, "arm,cortex-a35"))
 		type = SC_R_A35;
-	else if (!device_is_compatible(dev, "arm,cortex-a53"))
+	else if (device_is_compatible(dev, "arm,cortex-a53"))
 		type = SC_R_A53;
-	else if (!device_is_compatible(dev, "arm,cortex-a72"))
+	else if (device_is_compatible(dev, "arm,cortex-a72"))
 		type = SC_R_A72;
 	else
 		return 0;