c - Cross Compile Kernel Module for 4.1.2 can't find plat/dmtimer.h -


i using beaglebone black try , learn how write kernel modules. wanted start simple, thought writing module control hardware timer , blink led relatively simple thing accomplish. have downloaded 4.1.2-bone12 source, cross compiled it, , created sd card boot following guide written robert c nelson.

i have written .c file , makefile module. makefile follows:

arch=arm compiler_loc=/home/tom/ti/kernel/bb-kernel-4.1.2-bone12/dl/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/bin compiler=$(compiler_loc)/arm-linux-gnueabihf- kdir := /home/tom/ti/kernel/bb-kernel-4.1.2-bone12/kernel  obj-m := timer.o  default:         $(make) -c $(kdir) m=$$pwd arch=$(arch) cross_compile=$(compiler) modules  clean:         $(make) -c $(kdir) m=$$pwd arch=$(arch) clean 

when run make throws error:

make[1]: entering directory `/home/tom/ti/kernel/bb-kernel-4.1.2-bone12/kernel' cc [m]  /home/tom/ti/kernel/timer/timer.o /home/tom/ti/kernel/timer/timer.c:5:26: fatal error: plat/dmtimer.h: no such file or directory  #include <plat/dmtimer.h>                          ^ compilation terminated. make[2]: *** [/home/tom/ti/kernel/timer/timer.o] error 1 make[1]: *** [_module_/home/tom/ti/kernel/timer] error 2 make[1]: leaving directory `/home/tom/ti/kernel/bb-kernel-4.1.2-bone12/kernel' make: *** [default] error 2 

originally using 3.8.13-bone72 kernel , not having issue. made 2 changes in makefile, .c did not change when going 3.8.13-bone72 kernel 4.1.2-bone12. 2 changes are:

compiler_loc=/home/tom/ti/kernel/bb-kernel-3.8.13-bone72/dl/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin kdir := /home/tom/ti/kernel/bb-kernel-3.8.13-bone72/kernel 

both 3.8.13-bone72 , 4.1.2-bone12 sources have dmtimer.h located in ../kernel/arch/arm/plat-omap/include/plat/.

so question, why cross compiling 4.1.2-bone12 kernel fail when succeeded 3.8.13-bone72?

also, people wondering reason switched 3.8.13-bone72 4.1.2-bone12 because 3.8.13-bone72 not appear allow specific hardware timer use.. 4.1.2-bone12 allows specific timer used.

edit - 7/21/2015 have uploaded debug outputs make -d when building module both 3.8.13-bone72 , 4.1.2-bone12 kernels. there difference between two; seems inexperienced eye when building against 4.1.2 kernel not switching directories kernel source.
if @ debug3.8.txt, see after second "particular purpose." line begins doing things in /home/tom/ti/kernel/bb-kernel-3.8.13-bone72/kernel , subdirectories. not appear happen when building against 4.1.2 kernel though.

link: https://onedrive.live.com/redir?resid=c46e7b4f8242576!1497&authkey=!ao2gkaeow41svc8&ithint=folder%2ctxt


Comments