IMX Bus freq: linux-imx (5.15) compilation failure if CONFIG_HAVE_IMX_BUSFREQ is not set

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX Bus freq: linux-imx (5.15) compilation failure if CONFIG_HAVE_IMX_BUSFREQ is not set

1,233 Views
SebastienFabre
Contributor II

Hello,

With linux-imx (5.15 version), if CONFIG_HAVE_IMX_BUSFREQ  is not set (so SOC_IMX7D and SOC_IMX7ULP are not set , the compilation fails because some methods (register_busfreq_notifier, unregister_busfreq_notifier, request_bus_freq, release_bus_freq and get_bus_freq_mode) are defined twice. Indeed, they are defined in busfreq-imx.c (https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/mach-imx/busfreq-imx.c?h=lf-5.15....) and in busfreq-imx.h (https://source.codeaurora.org/external/imx/linux-imx/tree/include/linux/busfreq-imx.h?h=lf-5.15.y). Moreover, according to the Makefile (https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/mach-imx/Makefile?h=lf-5.15.y), busfreq-imx.c is always compiled.

With linux-fslc-imx (5.15 version), the compilation success if CONFIG_HAVE_IMX_BUSFREQ  is not set, but, on my imx6qdlsabresd, bus freq is set to 24000000 after some 20 seconds because counters are equals to 0 (request_bus_freq is skipped). It seems to have an effect on ethernet (ping no more works)

With linux-fslc-imx (5.4 version), CONFIG_HAVE_IMX_BUSFREQ  is set in case on SOC_IMX6 (https://github.com/Freescale/linux-fslc/commit/60be4c62559482afeb650f9bdc73864ee3099f36)

Should we have CONFIG_HAVE_IMX_BUSFREQ for imx6qdlsabresd? If no, do you know why reducing the bus freq seems to have an effect on ethernet ?

Best regards,

Sébastien

0 Kudos
Reply
6 Replies

1,214 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

1. The  linux-fslc-imx contains this commit: https://github.com/Freescale/linux-fslc/commit/200ac21eb0f503eb4545e36d7489236d14c6204b

But linux-imx[L5.15.52] doesn't contain this commit, this commit will be imported in L5.15.71-2.2.0.

 

2. If your board open the CONFIG_HAVE_IMX_DDRC, the CONFIG_HAVE_IMX_BUSFREQ has been set. You can add this config.

0 Kudos
Reply

1,201 Views
SebastienFabre
Contributor II

1. Thanks

2. To add CONFIG_HAVE_IMX_BUSFREQ and CONFIG_HAVE_IMX_DDRC, we have to add CONFIG_SOC_IMX7D or CONFIG_SOC_IMX7ULP (I am using yocto). I am using imx6qdlsabresd board so we should not have to add configs related to IMX7.

As said before, without HAVE_IMX_BUSFREQ, bus freq is reduced to 24000000 after around 20 seconds and I have issues on ethernet. Should we select HAVE_IMX_BUSFREQ in case of SOC_IMX6 as in linux-fslc-imx version 5.4 (https://github.com/Freescale/linux-fslc/commit/60be4c62559482afeb650f9bdc73864ee3099f36) ?

0 Kudos
Reply

1,197 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

You don't need set this config.

From the commit https://source.codeaurora.org/external/imx/linux-imx/commit/?h=lf-5.15.y&id=f0c07aa4c5037dabb45a4f89... the driver can call request_bus_freq if you don't set this config.

Can  you share more trace log about 'request_bus_freq is skipped'?

0 Kudos
Reply

1,186 Views
SebastienFabre
Contributor II

If CONFIG_HAVE_IMX_BUSFREQ is not set (and the compilation failure is fixed for linux-imx), call of request_bus_freq will not have effect (the method only returns 0): high_bus_count, med_bus_count and audio_bus_count will not be increased.

So these counters will be equal to 0 in 'bus_freq_daemon_handler' method: 'set_low_bus_freq' will be called and bus freq is reduced to 24000000.

ping no more works after the following logs:

[ 23.997818]
Bus freq set to 24000000 start...
[ 23.998321] Bus freq set to 24000000 done! cpu=1
[ 23.998686] imx-pre 21cb000.pre: handshake abort
[ 24.045595] imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_5 = 0x00800000
[ 24.052972] imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x40000000
[ 24.179463] imx-ipuv3 2800000.ipu: IPU Warning - IPU_INT_STAT_10 = 0x00100000

 

After removing "set_low_bus_freq" call in "bus_freq_daemon_handler", these logs are no more printed and ping works.

1,160 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

You can also set bus_freq_scaling_is_active=0 in probe function to avoid frequence scale.

0 Kudos
Reply

1,150 Views
SebastienFabre
Contributor II

Yes, if we set bus_freq_scaling_is_active=0 in probe function or if we call "echo 0 > /sys/devices/platform/soc/soc:busfreq/enable" quickly after the boot, bus frequency will not be reduced and we don't have the issue.
Moreover, with linux-imx (5.15) without previous workaround, my imx6qp-wandboard is restarted when bus freq is reduced.

I don't know if the issue is generic to all IMX6 boards and if bus_freq_scaling_is_active should be initialized to 0 in case of SOC_IMX6

0 Kudos
Reply