From 3a5a92f5427e79632e71728c8015f6577d70ced4 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Thu, 19 Oct 2017 08:47:28 +0200 Subject: [PATCH] kernel-module-imx-gpu-viv: update to recipe v6.2.2.p0 This commit adds the recipe to update the Vivante GPU driver to the latest version and refresh patches. https://jira.digi.com/browse/DEL-5082 Signed-off-by: Arturo Buzarra --- meta-digi-arm/conf/machine/ccimx6sbc.conf | 2 + ...mmended-values-for-minimum-GPU-frequ.patch | 0 ...Use-busfreq-imx6.h-up-to-3.15-kernel.patch | 0 ...-gpu-Get-GPU-reserved-memory-from-DT.patch | 0 ...mmended-values-for-minimum-GPU-frequ.patch | 71 +++++++++++++++++++ ...Use-busfreq-imx6.h-up-to-3.15-kernel.patch | 26 +++++++ ...-gpu-Get-GPU-reserved-memory-from-DT.patch | 38 ++++++++++ .../kernel-module-imx-gpu-viv_%.bbappend | 9 --- ...dule-imx-gpu-viv_5.0.11.p8.6+fslc.bbappend | 11 +++ ...kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bb | 18 +++++ ...-module-imx-gpu-viv_6.2.2.p0+fslc.bbappend | 11 +++ 11 files changed, 177 insertions(+), 9 deletions(-) rename meta-digi-arm/recipes-kernel/kernel-modules/{kernel-module-imx-gpu-viv => kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc}/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch (100%) rename meta-digi-arm/recipes-kernel/kernel-modules/{kernel-module-imx-gpu-viv => kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc}/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch (100%) rename meta-digi-arm/recipes-kernel/kernel-modules/{kernel-module-imx-gpu-viv => kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc}/0003-gpu-Get-GPU-reserved-memory-from-DT.patch (100%) create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0003-gpu-Get-GPU-reserved-memory-from-DT.patch delete mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_%.bbappend create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_5.0.11.p8.6+fslc.bbappend create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bb create mode 100644 meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bbappend diff --git a/meta-digi-arm/conf/machine/ccimx6sbc.conf b/meta-digi-arm/conf/machine/ccimx6sbc.conf index 1f1a96d93..f7ee17754 100644 --- a/meta-digi-arm/conf/machine/ccimx6sbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6sbc.conf @@ -12,6 +12,8 @@ MACHINE_EXTRA_RRECOMMENDS += "rng-tools" MACHINE_FIRMWARE_append = " ${@base_conditional('HAVE_BT', '1' , 'firmware-atheros-ar3k', '', d)}" MACHINE_FIRMWARE_append = " ${@base_conditional('HAVE_WIFI', '1' , 'firmware-atheros-ath6kl', '', d)}" +PREFERRED_VERSION_kernel-module-imx-gpu-viv ?= "5.0.11.p8.6+fslc%" + # U-Boot configurations # Last one is the default (the one the symlinks point at) UBOOT_CONFIG ??= "ccimx6dlsbc512MB ccimx6dlsbc ccimx6qsbc2GB ccimx6qsbc512MB ccimx6qsbc" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch rename to meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch rename to meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv/0003-gpu-Get-GPU-reserved-memory-from-DT.patch b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc/0003-gpu-Get-GPU-reserved-memory-from-DT.patch similarity index 100% rename from meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv/0003-gpu-Get-GPU-reserved-memory-from-DT.patch rename to meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-5.0.11.p8.6+fslc/0003-gpu-Get-GPU-reserved-memory-from-DT.patch diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch new file mode 100644 index 000000000..bd664fb07 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch @@ -0,0 +1,71 @@ +From: Javier Viguera +Date: Tue, 10 Nov 2015 17:45:37 +0100 +Subject: [PATCH] mxc: gpu: use recommended values for minimum GPU frequency + divisor + +Freescale recommends the following default minimum GPU frequency divisors +depending on the CPU family: + - 3 for Dual/Quad + - 8 for DualLite/Solo + +Adapted for the external Vivante GPU driver from commit a790ad3 in linux +git repository. + +Signed-off-by: Javier Viguera +--- + .../hal/os/linux/kernel/gc_hal_kernel_driver.c | 14 +++++++++++++- + .../platform/freescale/gc_hal_kernel_platform_imx6.c | 2 +- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c +index 816aae0..15a8753 100644 +--- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c ++++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c +@@ -54,6 +54,7 @@ + + + #include ++#include + #include + #include + +@@ -199,7 +200,7 @@ static uint type = 0; + module_param(type, uint, 0664); + MODULE_PARM_DESC(type, "0 - Char Driver (Default), 1 - Misc Driver"); + +-static int gpu3DMinClock = 1; ++static int gpu3DMinClock = 0; + + static int contiguousRequested = 0; + +@@ -1138,6 +1139,17 @@ static int __devinit gpu_probe(struct platform_device *pdev) + } + } + else { ++ /* If undefined, set Freescale recommended value. Else use the min freq. */ ++ if (gpu3DMinClock == 0) { ++ if (of_machine_is_compatible("fsl,imx6dl")) ++ gpu3DMinClock = 8; ++ else if (of_machine_is_compatible("fsl,imx6q") || ++ of_machine_is_compatible("fsl,imx6qp")) ++ gpu3DMinClock = 3; ++ else ++ gpu3DMinClock = 1; ++ } ++ + ret = drv_init(); + if (!ret) { + platform_set_drvdata(pdev, galDevice); +diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c +index 89706ec..65a54e2 100644 +--- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c ++++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c +@@ -123,7 +123,7 @@ extern int unregister_thermal_notifier(struct notifier_block *nb); + #define gcdFSL_CONTIGUOUS_SIZE (4 << 20) + #endif + +-static int initgpu3DMinClock = 1; ++static int initgpu3DMinClock = 0; + module_param(initgpu3DMinClock, int, 0644); + + struct platform_device *pdevice; diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch new file mode 100644 index 000000000..4273613a2 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch @@ -0,0 +1,26 @@ +From: Hector Palacios +Date: Tue, 1 Dec 2015 11:36:24 +0100 +Subject: [PATCH] Use busfreq-imx6.h up to 3.15 kernel + +For CC6 we're using Freescale 3.14.28 BSP. Even though we apply stability +patches that move the kernel version beyond 3.14.29 we still want to use +the GPU vivante external module build with the original BSP. + +Signed-off-by: Hector Palacios +--- + .../os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c +index 0eae8262c2ce..f166680affa2 100644 +--- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c ++++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c +@@ -81,7 +81,7 @@ + #include + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) + #include +-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 29) ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) + #include + #include + #else diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0003-gpu-Get-GPU-reserved-memory-from-DT.patch b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0003-gpu-Get-GPU-reserved-memory-from-DT.patch new file mode 100644 index 000000000..4615d9d93 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv-6.2.2.p0+fslc/0003-gpu-Get-GPU-reserved-memory-from-DT.patch @@ -0,0 +1,38 @@ +From: Mike Engel +Date: Tue, 11 Apr 2017 11:13:23 +0200 +Subject: [PATCH] gpu: Get GPU reserved memory from DT. + +This commit adds support to specify the GPU reserved memory in +the DT. + +Signed-off-by: Mike Engel + +https://jira.digi.com/browse/DEL-3868 +--- + .../linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c +index dc7c976..fd2dbd3 100644 +--- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c ++++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c +@@ -568,7 +568,7 @@ gckPLATFORM_AdjustParam( + Args->registerMemSizeVG = res->end - res->start + 1; + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "contiguous_mem"); + if (res) + { +@@ -577,8 +577,6 @@ gckPLATFORM_AdjustParam( + if( Args->contiguousSize == ~0U ) + Args->contiguousSize = res->end - res->start + 1; + } +-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) +- Args->contiguousBase = 0; + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) + prop = of_get_property(dn, "contiguousbase", NULL); + if(prop) + + diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_%.bbappend b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_%.bbappend deleted file mode 100644 index a6c6597d8..000000000 --- a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_%.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) 2015-2017 Digi International - -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" - -SRC_URI += " \ - file://0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch \ - file://0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch \ - file://0003-gpu-Get-GPU-reserved-memory-from-DT.patch \ -" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_5.0.11.p8.6+fslc.bbappend b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_5.0.11.p8.6+fslc.bbappend new file mode 100644 index 000000000..a0c759e21 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_5.0.11.p8.6+fslc.bbappend @@ -0,0 +1,11 @@ +# Copyright (C) 2015-2017 Digi International + +VER_DIR = "${@d.getVar('PV', True).split('+git')[0]}" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}-${VER_DIR}:" + +SRC_URI += " \ + file://0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch \ + file://0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch \ + file://0003-gpu-Get-GPU-reserved-memory-from-DT.patch \ +" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bb b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bb new file mode 100644 index 000000000..158d147a0 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bb @@ -0,0 +1,18 @@ +# Copyright (C) 2017 Digi International + +SUMMARY = "Kernel loadable module for Vivante GPU" +DESCRIPTION = "This package uses an exact copy of the GPU kernel driver source code of \ +the same version as base and include fixes and improvements developed by FSL Community" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" + +PV .= "+git${SRCPV}" + +SRCREV = "3b9e057f29853fd29364aa666328a92b807007d7" +SRC_URI = "git://github.com/Freescale/kernel-module-imx-gpu-viv.git;protocol=https" + +S = "${WORKDIR}/git" + +inherit module + +KERNEL_MODULE_AUTOLOAD = "galcore" diff --git a/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bbappend b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bbappend new file mode 100644 index 000000000..bbf63d7d9 --- /dev/null +++ b/meta-digi-arm/recipes-kernel/kernel-modules/kernel-module-imx-gpu-viv_6.2.2.p0+fslc.bbappend @@ -0,0 +1,11 @@ +# Copyright (C) 2017 Digi International + +VER_DIR = "${@d.getVar('PV', True).split('+git')[0]}" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}-${VER_DIR}:" + +SRC_URI += " \ + file://0001-mxc-gpu-use-recommended-values-for-minimum-GPU-frequ.patch \ + file://0002-Use-busfreq-imx6.h-up-to-3.15-kernel.patch \ + file://0003-gpu-Get-GPU-reserved-memory-from-DT.patch \ +"