I found a solution to my problem so I can now run a 64 bit kernel with my out of the tree wireless driver module compiled against the 6.1 branch of 64 bit kernel.
I set a Linux virtual machine in my desktop PC so I can use the power of my CPU for the compilation. Then I cloned the sources of the 6.1 kernel branch
Code: Select all
git clone --depth=1 https://github.com/raspberrypi/linux/tree/rpi-6.1.y
Then I set up a cross compiling environment based on the instructions here
https://www.raspberrypi.com/documentati ... the-kernel
I prepared the kernel source and compiled only the modules so to get the symver file.
Code: Select all
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules
I edited the out of the tree module Makefile and changed all the environment variables with fixed links to the paths where the kernel sources were located.
Finally I compiled successfully the module against the 6.1 kernel using the 64 bit toolchain and then copied everything back to raspberry pi 4.
There I changed the installation path for the module to match the version of the kernel and I installed and depmoded without problem.
Now my wireless adapter runs with a 64 bit kernel and driver.
However, I still can't understand why I had to do all these time consuming process. Before the last update of the kernel when everything was on 5.15 32 bit branch everything was just a recompile of the module every time a new kernel was installed. A matter of 5 minutes work.
I still can't find a logical explanation for the kernel sources and the errors during compilation. Why the cloned sources from the github worked while the deb package of the headers from official repo didn't.