thermal driver fails with compilation for IMX8mq.

cancel
Showing results for 
Search instead for 
Did you mean: 

thermal driver fails with compilation for IMX8mq.

575 Views
sandeep_yenugul
Contributor III

Hi,

As suggested in  i.MX_Reference_Manual.pdf document, at higher temp. frequency scaling should be done using Thermal driver. So I enabled the "Temperature sensor driver for Freescale i.MX SoCs" in kernel defconfig and on compilation I got below error.

| /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work-shared/imx8mqthor96/kernel-source/drivers/thermal/imx_thermal.c: In function 'imx_thermal_probe':
| /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work-shared/imx8mqthor96/kernel-source/drivers/thermal/imx_thermal.c:928:3: error: implicit declaration of function 'register_busfreq_notifier'; did you mean 'register_module_notifier'? [-Werror=implicit-function-declaration]
|    register_busfreq_notifier(&thermal_notifier);
|    ^~~~~~~~~~~~~~~~~~~~~~~~~
|    register_module_notifier
| /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work-shared/imx8mqthor96/kernel-source/drivers/thermal/imx_thermal.c: In function 'imx_thermal_remove':
| /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work-shared/imx8mqthor96/kernel-source/drivers/thermal/imx_thermal.c:946:3: error: implicit declaration of function 'unregister_busfreq_notifier'; did you mean 'unregister_module_notifier'? [-Werror=implicit-function-declaration]
|    unregister_busfreq_notifier(&thermal_notifier);
|    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|    unregister_module_notifier
| cc1: some warnings being treated as errors
| /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work-shared/imx8mqthor96/kernel-source/scripts/Makefile.build:328: recipe for target 'drivers/thermal/imx_thermal.o' failed
| make[4]: *** [drivers/thermal/imx_thermal.o] Error 1
| /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work-shared/imx8mqthor96/kernel-source/scripts/Makefile.build:587: recipe for target 'drivers/thermal' failed
| make[3]: *** [drivers/thermal] Error 2
| make[3]: *** Waiting for unfinished jobs....
| /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work-shared/imx8mqthor96/kernel-source/Makefile:1039: recipe for target 'drivers' failed
| make[2]: *** [drivers] Error 2
| Makefile:146: recipe for target 'sub-make' failed
| make[1]: *** [sub-make] Error 2
| Makefile:24: recipe for target '__sub-make' failed
| make: *** [__sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/imx8/NXP/xml_Dev/meta-layer_preparing/build-thor96-meta/tmp/work/imx8mqthor96-poky-linux/linux-imx/4.14.78-r0/temp/log.do_compile.69217)

To resolve this compilation I looked in to the code and found below code, which means register_busfreq_notifier does not support arm64 arch.

1 #if defined(CONFIG_CPU_FREQ) && !defined(CONFIG_ARM64)
2 extern struct regulator *arm_reg;
3 extern struct regulator *soc_reg;
4 void request_bus_freq(enum bus_freq_mode mode);
5 void release_bus_freq(enum bus_freq_mode mode);
6 int register_busfreq_notifier(struct notifier_block *nb);
7 int unregister_busfreq_notifier(struct notifier_block *nb);
8 int get_bus_freq_mode(void);
9 #elif defined(CONFIG_ARCH_FSL_IMX8MQ)
10 void request_bus_freq(enum bus_freq_mode mode);
11 void release_bus_freq(enum bus_freq_mode mode);
12 int get_bus_freq_mode(void);
13 #else

* Still I tried to compile by moving 6th and 7th line to #elif part. But had below  error which means I am tring to compile arm32 arch code for arm64 arch.

Error:

"relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol "

Please help me to solve this issue.

Labels (1)
0 Kudos
1 Reply

302 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Sandeep

one can try to add CONFIG_IMX8M_THERMAL to defconfig :
linux/arch/arm64/configs/defconfig
defconfig\configs\arm64\arch - linux-imx - i.MX Linux kernel 
and follow sect.2.9 Thermal and sect.2.5.4 Dynamic Bus Frequency attached
Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos