cpu: imx8: fix type and rate detection
authorAnatolij Gustschin <agust@denx.de>
Sat, 16 May 2020 20:34:19 +0000 (22:34 +0200)
committerAnatolij Gustschin <agust@denx.de>
Fri, 22 May 2020 11:26:33 +0000 (13:26 +0200)
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@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/cpu/imx8_cpu.c

index dddd12d1e400a6e685568597312e3b0e5cffdf74..8b297b2b0f936173194552a29ac86cb1364cd6ab 100644 (file)
@@ -54,11 +54,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 "?";
@@ -185,11 +185,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;