如何编译kernel-module-imx-gpu-viv?

时间:2018-07-04 14:53:09

标签: linux-kernel gpu kernel-module buildroot imx6

我无法为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 repo的单独目录中下载了源代码
  2. 修改了Makefile,以使用以下命令设置要构建的内核源KERNEL_SRC(3.14.52)的正确路径:

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

由于编译的结果,我根本没有galcore.ko,仅生成了这三个文件:

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

我也尝试过使用buildroot,但是最后,我在目录output/build/kernel-module-imx-gpu-viv-9bbacfe7753626956a449c6a4f7dffcf6285b4d7中有相同的文件

谢谢。

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:0)

最后,我忘记了在内核配置中设置MXC_GPU_VIV=m,这意味着将该驱动程序编译为模块。

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