如何编译内核模块-imx-gpu-viv?

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

我无法为我的 IMX6Q 板编译以下内核模块https://github.com/Freescale/kernel-module-imx-gpu-viv/tree/upstream/6.2.4.p1.2/kernel-module-imx-gpu-viv-src

到目前为止我所做的是:

  1. 已从上面的 git 存储库中的单独目录中下载源代码
  2. 修改了 Makefile 以设置内核源代码的正确路径 KERNEL_SRC 我正在构建 (3.14.52) 使用 :

生成文件:

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. 编译为:make ARCH=arm CROSS_COMPILE=/path/to/buildroot/buildroot/output/host/usr/bin/arm-linux-gnueabihf-

作为编译的结果,我根本没有 galcore.ko,只生成了那 3 个文件:

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

我也尝试过使用 buildroot 但最后,我在目录 output/build/kernel-module-imx-gpu-viv-9bbacfe7753626956a449c6a4f7dffcf6285b4d7

中有相同的文件

谢谢。

最后我忘了在内核配置中设置MXC_GPU_VIV=m,意思是把这个驱动程序编译成一个模块。

现在我已经正确构建了预期的 galcore.ko

这个内核驱动程序已经有一个 Buildroot 包:https://git.buildroot.org/buildroot/tree/package/freescale-imx/kernel-module-imx-gpu-viv