MGS-1972 [#imx-142] Enable GPU MMU flat mapping to cover CMA range on DV
authorYong Gan <yong.gan@nxp.com>
Fri, 14 Oct 2016 19:49:15 +0000 (03:49 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:52:33 +0000 (14:52 -0500)
Limited baseAddress offset only for GPU without MC20 feature.

Date: Oct 14, 2016
Signed-off-by: Yong Gan <yong.gan@nxp.com>
drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.config

index 30863c5..923b070 100644 (file)
@@ -1502,8 +1502,11 @@ gckHARDWARE_Construct(
     /* Identify the hardware. */
     gcmkONERROR(_IdentifyHardwareByDatabase(hardware, Os, Core, &hardware->identity));
 
-    /* Get the system's physical base address. */
-    gcmkONERROR(gckOS_GetBaseAddress(Os, &hardware->baseAddress));
+    /* Get the system's physical base address for old MMU */
+    if (hardware->mmuVersion == 0)
+    {
+        gcmkONERROR(gckOS_GetBaseAddress(Os, &hardware->baseAddress));
+    }
 
     /* Determine the hardware type */
     if (gckHARDWARE_IsFeatureAvailable(hardware, gcvFEATURE_PIPE_3D)
index 1551f1b..28d017b 100644 (file)
@@ -1930,10 +1930,10 @@ gckKERNEL_Dispatch(
     {
     case gcvHAL_GET_BASE_ADDRESS:
         /* Get base address. */
-        Interface->u.GetBaseAddress.baseAddress = Kernel->hardware->baseAddress;
+        gcmkONERROR(
+            gckHARDWARE_GetBaseAddress(kernel->hardware, &Interface->u.GetBaseAddress.baseAddress));
 
         Interface->u.GetBaseAddress.flatMappingStart = Kernel->mmu->flatMappingStart;
-
         Interface->u.GetBaseAddress.flatMappingEnd = Kernel->mmu->flatMappingEnd;
         break;
 
index fcfde0d..f6753a5 100644 (file)
@@ -12,7 +12,7 @@ endif
 endif
 
 ifneq ($(CONFIG_ARCH_FSL_IMX8DV),)
-EXTRA_CFLAGS += -DIMX8_SCU_CONTROL=1 -DIMX8_DISABLE_PM=1 -DIMX8_PHYS_BASE=0x00000000 -DIMX8_PHYS_SIZE=0xC8000000
+EXTRA_CFLAGS += -DIMX8_SCU_CONTROL=1 -DIMX8_DISABLE_PM=1 -DIMX8_PHYS_BASE=0xA0000000 -DIMX8_PHYS_SIZE=0x28000000
 EXTRA_CFLAGS += -DIMX8_CMA_LIMIT=1
 else
 EXTRA_CFLAGS += -DIMX8_SCU_CONTROL=0 -DIMX8_DISABLE_PM=0 -DIMX8_PHYS_BASE=0x00000000 -DIMX8_PHYS_SIZE=0x00000000