Search code examples
linux-kernelgpukernel-modulebuildrootimx6

How to compile kernel-module-imx-gpu-viv?


I am not able to compile the following kernel module https://github.com/Freescale/kernel-module-imx-gpu-viv/tree/upstream/6.2.4.p1.2/kernel-module-imx-gpu-viv-src for my IMX6Q board.

What i have done so far is :

  1. Downloaded the sources from the git repo above in a separate directory
  2. Modified the Makefile to set the correct path to the kernel sources KERNEL_SRC i am building (3.14.52) with :

Makefile :

obj-m := galcore.o
SRC := $(shell pwd)
KERNEL_SRC := /path/to/kernel_imx/

all:
        $(MAKE) -C $(KERNEL_SRC) M=$(SRC)/kernel-module-imx-gpu-viv-src AQROOT=${PWD}/kernel-module-imx-gpu-viv-src
        cp $(SRC)/kernel-module-imx-gpu-viv-src/Module.symvers $(PWD)
        cp $(SRC)/kernel-module-imx-gpu-viv-src/modules.order $(PWD)

modules_install:
        $(MAKE) -C $(KERNEL_SRC) M=$(SRC)/kernel-module-imx-gpu-viv-src modules_install

clean:
         rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
         rm -f Module.markers Module.symvers modules.order
         rm -rf .tmp_versions Modules.symvers
  1. compiled with : make ARCH=arm CROSS_COMPILE=/path/to/buildroot/buildroot/output/host/usr/bin/arm-linux-gnueabihf-

As a result of the compilation, i have no galcore.ko at all, only those 3 files generated :

built-in.o
modules.order ( empty )
Module.symvers ( empty )

I have tried also using buildroot but in the end, i have the same files in the directory output/build/kernel-module-imx-gpu-viv-9bbacfe7753626956a449c6a4f7dffcf6285b4d7

Thanks.


Solution

  • Finally i forgot to set MXC_GPU_VIV=m in the kernel configuration, that means to compile this driver as a module.

    Now i have the expected galcore.ko correctly built.