This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to build bifrost(Mali-G71) kernel driver on Hikey960 (96boards)

Hi,

I am new to Arm, and recently I have a project on Hikey960 board.

I need to enable opencl on it and I think driver of GPU is necessary. I have download the open source of bifrost driver and also the kernel source of hikey960 on git.

I am confused that in  BX301A01B-SW-99002-r13p0-01rel0.tgz, there is a build.bp file. I am not sure how to use that to compile the driver.

I can succeed to compile the kernel code from https://github.com/96boards-hikey/linux/

What is the next step to make the driver module? Is the bp file used like Makefile?How to compile the source code by the bp file?

Thanks in advance.

Parents
  • Hi,

    Thank you very much for trying Mali kernel driver from developer.arm.com

    build.bp file is to build the driver using blueprint buildsystem. Typically used to build usersapce driver. More information about blueprint can be found here https://opensource.google.com/projects/blueprint https://github.com/google/blueprint

    To Integrate Mali kernel driver for Hikey960, please follow the steps below

    extract tarball

    $ tar -xvf BX301A01B-SW-99002-r13p0-01rel0.tgz

    copy Mali driver to kernel tree

    $ cp -r BX301A01B-SW-99002-r13p0-01rel0/driver/product/kernel/drivers/gpu/arm to drivers/gpu/

    Changes to build Mali kernel driver

    Please make following changes

    diff --git a/drivers/Kconfig b/drivers/Kconfig
    index 95b9ccc..d8f64e8 100644
    --- a/drivers/Kconfig
    +++ b/drivers/Kconfig
    @@ -217,4 +217,6 @@ source "drivers/siox/Kconfig"

    source "drivers/slimbus/Kconfig"

    +source "drivers/gpu/arm/midgard/Kconfig
    +
    endmenu
    diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
    index e9ed439..35dadc8 100644
    --- a/drivers/gpu/Makefile
    +++ b/drivers/gpu/Makefile
    @@ -3,4 +3,5 @@
    # to ensure this currently.
    obj-$(CONFIG_TEGRA_HOST1X) += host1x/
    obj-y += drm/ vga/
    +obj-y += arm/midgard/
    obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/

    Enable MALI kernel config

    $ run menuconfig and select CONFIG_MALI_MIDGARD. You can build gpu driver as a module(CONFIG_MALI_MIDGARD=m) or build it statically with kernel(CONFIG_MALI_MIDGARD=y)

    Build kernel

    $ make -j8

    Reference

     https://android.googlesource.com/kernel/hikey-linaro/+/android-hikey-linaro-4.9/drivers/gpu/arm_gpu/

Reply
  • Hi,

    Thank you very much for trying Mali kernel driver from developer.arm.com

    build.bp file is to build the driver using blueprint buildsystem. Typically used to build usersapce driver. More information about blueprint can be found here https://opensource.google.com/projects/blueprint https://github.com/google/blueprint

    To Integrate Mali kernel driver for Hikey960, please follow the steps below

    extract tarball

    $ tar -xvf BX301A01B-SW-99002-r13p0-01rel0.tgz

    copy Mali driver to kernel tree

    $ cp -r BX301A01B-SW-99002-r13p0-01rel0/driver/product/kernel/drivers/gpu/arm to drivers/gpu/

    Changes to build Mali kernel driver

    Please make following changes

    diff --git a/drivers/Kconfig b/drivers/Kconfig
    index 95b9ccc..d8f64e8 100644
    --- a/drivers/Kconfig
    +++ b/drivers/Kconfig
    @@ -217,4 +217,6 @@ source "drivers/siox/Kconfig"

    source "drivers/slimbus/Kconfig"

    +source "drivers/gpu/arm/midgard/Kconfig
    +
    endmenu
    diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
    index e9ed439..35dadc8 100644
    --- a/drivers/gpu/Makefile
    +++ b/drivers/gpu/Makefile
    @@ -3,4 +3,5 @@
    # to ensure this currently.
    obj-$(CONFIG_TEGRA_HOST1X) += host1x/
    obj-y += drm/ vga/
    +obj-y += arm/midgard/
    obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/

    Enable MALI kernel config

    $ run menuconfig and select CONFIG_MALI_MIDGARD. You can build gpu driver as a module(CONFIG_MALI_MIDGARD=m) or build it statically with kernel(CONFIG_MALI_MIDGARD=y)

    Build kernel

    $ make -j8

    Reference

     https://android.googlesource.com/kernel/hikey-linaro/+/android-hikey-linaro-4.9/drivers/gpu/arm_gpu/

Children
No data