Message ID | 20190430100629.9212-5-marcel@ziswiler.com |
---|---|
State | Superseded |
Delegated to: | Stefano Babic |
Headers | show |
Series | apalis imx8qm 4gb wb it v1.0b module support | expand |
See review comment below. With the issue resolved: Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com> On Tue, 2019-04-30 at 12:06 +0200, Marcel Ziswiler wrote: > CPU frequency reporting failed with the following error message being > printed: > > sc_pm_get_clock_rate: resource:507 clk:2: res:3 > Could not read CPU frequency: -22 > CPU: NXP i.MX8QM RevB A53 at 0 MHz > > Fix this by differentiating between the A35 as found on the i.MX 8QXP > and the A53 as found on the i.MX 8QM SoCs. > > Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> > > --- > > arch/arm/mach-imx/imx8/cpu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c > index 12716e7e9e..0d01e3fc3b 100644 > --- a/arch/arm/mach-imx/imx8/cpu.c > +++ b/arch/arm/mach-imx/imx8/cpu.c > @@ -654,8 +654,9 @@ static ulong imx8_get_cpu_rate(void) > { > ulong rate; > int ret; > + int type = is_cortex_a35() ? SC_R_A35 : SC_R_A53; The related get_core_name() below foresees that the code could run on a cortex_a72. So we should here also test with is_cortex_a72 and then use SC_R_A72 to avoid a follow-up patch for a future i.MX8 SKU or changed configuration. Regards, Max > > - ret = sc_pm_get_clock_rate(-1, SC_R_A35, SC_PM_CLK_CPU, > + ret = sc_pm_get_clock_rate(-1, type, SC_PM_CLK_CPU, > (sc_pm_clock_rate_t *)&rate); > if (ret) { > printf("Could not read CPU frequency: %d\n", ret);
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 12716e7e9e..0d01e3fc3b 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -654,8 +654,9 @@ static ulong imx8_get_cpu_rate(void) { ulong rate; int ret; + int type = is_cortex_a35() ? SC_R_A35 : SC_R_A53; - ret = sc_pm_get_clock_rate(-1, SC_R_A35, SC_PM_CLK_CPU, + ret = sc_pm_get_clock_rate(-1, type, SC_PM_CLK_CPU, (sc_pm_clock_rate_t *)&rate); if (ret) { printf("Could not read CPU frequency: %d\n", ret);
CPU frequency reporting failed with the following error message being printed: sc_pm_get_clock_rate: resource:507 clk:2: res:3 Could not read CPU frequency: -22 CPU: NXP i.MX8QM RevB A53 at 0 MHz Fix this by differentiating between the A35 as found on the i.MX 8QXP and the A53 as found on the i.MX 8QM SoCs. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> --- arch/arm/mach-imx/imx8/cpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)