[meta-freescale] [meta-fsl-arm][PATCH 3/5] fsl-vivante-kernel-driver-handler.bbclass: Handle Vivante kernel driver provider

Daiane Angolini daiane.list at gmail.com
Wed Aug 19 07:56:57 PDT 2015


On Wed, Aug 19, 2015 at 6:26 AM, Otavio Salvador
<otavio at ossystems.com.br> wrote:
> Enable the kernel to provide or not the Vivante kernel driver and
> dynamically set the proper providers per machine.
>
> The following options are supported:
>
>   MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT
>
>       Machine does not has support for the Vivante kernel driver

Do you mean the variable MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT
tells us if the machine has or not support for Vivante kernel driver?
And it can have value 0 or 1?

I think this is the obvious, however there is no coherence between the
variable name and the description

The patch looks ok to me

Daiane

>
>   MACHINE_USE_VIVANTE_KERNEL_DRIVER_MODULE
>
>       Machine use the Vivante kernel driver as module, options are:
>
>        0 - enable the builtin kernel driver module
>        1 - enable the external kernel module
>
> Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> ---
>  classes/fsl-vivante-kernel-driver-handler.bbclass | 63 +++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
>  create mode 100644 classes/fsl-vivante-kernel-driver-handler.bbclass
>
> diff --git a/classes/fsl-vivante-kernel-driver-handler.bbclass b/classes/fsl-vivante-kernel-driver-handler.bbclass
> new file mode 100644
> index 0000000..ee29018
> --- /dev/null
> +++ b/classes/fsl-vivante-kernel-driver-handler.bbclass
> @@ -0,0 +1,63 @@
> +# Freescale Kernel Vivante Kernel Driver handler
> +#
> +# Enable the kernel to provide or not the Vivante kernel driver and
> +#  dynamically set the proper providers per machine.
> +#
> +# The following options are supported:
> +#
> +#  MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT
> +#
> +#      Machine does not has support for the Vivante kernel driver
> +#
> +#  MACHINE_USE_VIVANTE_KERNEL_DRIVER_MODULE
> +#
> +#      Machine use the Vivante kernel driver as module, options are:
> +#
> +#       0 - enable the builtin kernel driver module
> +#       1 - enable the external kernel module
> +#
> +# Copyright 2015 (C) O.S. Systems Software LTDA.
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +# Handle Vivante kernel driver setting
> +MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT       ?= "0"
> +MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6q  ?= "1"
> +MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6dl ?= "1"
> +MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6sx ?= "1"
> +MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6sl ?= "1"
> +
> +# Use vivante kernel driver module:
> +#   0 - enable the builtin kernel driver module
> +#   1 - enable the external kernel module
> +MACHINE_USE_VIVANTE_KERNEL_DRIVER_MODULE       ??= "1"
> +
> +python fsl_vivante_kernel_driver_handler () {
> +    has_vivante_kernel_driver_support = e.data.getVar('MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT', True) or "0"
> +    use_vivante_kernel_driver_module = e.data.getVar('MACHINE_USE_VIVANTE_KERNEL_DRIVER_MODULE', True) or "0"
> +
> +    if has_vivante_kernel_driver_support != "1":
> +        return
> +
> +    if use_vivante_kernel_driver_module != "1":
> +        e.data.appendVar('RPROVIDES_kernel-base', ' kernel-module-imx-gpu-viv')
> +        e.data.appendVar('RREPLACES_kernel-base', ' kernel-module-imx-gpu-viv')
> +        e.data.appendVar('RCONFLICTS_kernel-base', ' kernel-module-imx-gpu-viv')
> +}
> +
> +addhandler fsl_vivante_kernel_driver_handler
> +fsl_vivante_kernel_driver_handler[eventmask] = "bb.event.RecipePreFinalise"
> +
> +do_configure_prepend () {
> +    if [ "${MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT}" = "1" ]; then
> +        fsl_viv_handler_defconfig="${WORKDIR}/defconfig"
> +        if [ -e ${B}/.config ]; then
> +            fsl_viv_handler_defconfig="${B}/.config"
> +        fi
> +        sed -i "/CONFIG_MXC_GPU_VIV[ =]/d" $fsl_viv_handler_defconfig
> +        if [ "${MACHINE_USE_VIVANTE_KERNEL_DRIVER_MODULE}" = "1" ]; then
> +            echo "# CONFIG_MXC_GPU_VIV is not set" >> $fsl_viv_handler_defconfig
> +        else
> +            echo "CONFIG_MXC_GPU_VIV=y" >> $fsl_viv_handler_defconfig
> +        fi
> +    fi
> +}
> --
> 2.5.0
>
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale


More information about the meta-freescale mailing list