Firstly, it is not possible to compile the FEC driver into the M option in the kernel configuration
Forcibly modifying the makefile can generate fec.ko。But during insmod and rmmod, it may crash due to clcok matching issues
What is the way to make fec.ko load and unload normally
Hello @jerry2004,
I hope you are doing well.
Please make sure to check the module support is enabled.
CONFIG_MODULES=y
Otherwise, one won't be able to load the modules.
Please check the drivers that are sued for FEC are included in the device tree one is loading.
It is also recommended to check the FEC driver one is using and compiling is compatible with the kernel version that is being used, Please check that as well.
It is also recommended to use the latest kernel version, So if possible please upgrade the kernel to have updated drivers as well as fw.
Thanks & Regards,
Sanket parekh
Hello @Sanket_Parekh
Yes ,the module support is enabled.,CONFIG_MODULES=y.Because other driver modules can be loaded as modules。What I want to know is that FEC drivers themselves cannot be loaded as modules?
The kernel version of our product is relatively old, and this version has not yet enabled the device tree architecture. The version number is 3.0.101
We have formed a stable product and will not consider upgrading the kernel version. I just want to confirm whether the FEC driver can be compiled into a ko module on the current 3.0.101 version. Thank you
Hello @jerry2004,
I hope you are doing well.
What I want to know is that FEC drivers themselves cannot be loaded as modules?
->I have mentioned the changes one has to make in order to make drivers as a module or built-in to the kernel.
Please check the defconfig as mentioned below in your source code and make the below changes.
https://github.com/nxp-imx/linux-imx/blob/imx_3.0.101_caf/arch/arm/configs/imx6_defconfig
CONFIG_FEC=y
CONFIG_FEC_NAPI=y
(if one wants to build it as a module then set it as m)
Please also check the FEC driver compilation entry in the make file as given below.
https://github.com/nxp-imx/linux-imx/blob/imx_3.0.101_caf/drivers/net/Makefile
obj-$(CONFIG_FEC) += fec.o
Please make sure to check the Kconfig file and the config FEC node in the below link.
https://github.com/nxp-imx/linux-imx/blob/imx_3.0.101_caf/drivers/net/Kconfig
config FEC -> Select Y here if you want to use the built-in 10/100 Fast ethernet controller on some Motorola ColdFire and Freescale i.MX processors.
I hope this helps!
Thanks & Regards,
Sanket Parekh