MGS-2486 [#imx-311] set physBase and physSize with device node
authorXianzhong <xianzhong.li@nxp.com>
Wed, 21 Dec 2016 08:10:58 +0000 (16:10 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:58:04 +0000 (14:58 -0500)
phys_baseaddr in device node can be used to set physBase and physSize,
still keep the old configuration when phys_baseaddr is not valid.

Date: Dec 21, 2016
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit 7b3cfa451f64409264c84c61561901279c503244)

drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6.c

index bf4fa10..a1e360b 100644 (file)
@@ -427,7 +427,10 @@ gckPLATFORM_AdjustParam(
 
     res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phys_baseaddr");
     if (res)
+    {
         Args->baseAddress = res->start;
+        Args->physSize = res->end - res->start + 1;
+    }
 
     res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "irq_3d");
     if (res)
@@ -511,12 +514,12 @@ gckPLATFORM_AdjustParam(
 
     Args->gpu3DMinClock = initgpu3DMinClock;
 
+    if(Args->physSize == 0)
+    {
 #if IMX8_PHYS_BASE
-    Args->baseAddress = IMX8_PHYS_BASE;
+        Args->baseAddress = IMX8_PHYS_BASE;
 #endif
 
-    if(Args->physSize == 0)
-    {
 #if IMX8_PHYS_SIZE
         Args->physSize = IMX8_PHYS_SIZE;
 #else