[edk2-devel] [edk2-platforms Patch 25/28] Vlv2DeviceRefCodePlg/AcpiTablesPCAT: Fix ASL error

Michael D Kinney posted 28 patches 22 weeks ago

[edk2-devel] [edk2-platforms Patch 25/28] Vlv2DeviceRefCodePlg/AcpiTablesPCAT: Fix ASL error

Posted by Michael D Kinney 22 weeks ago
Remove use of a method to read a register from a BAR
and instead access the register directly.  Resolves the
following error from the latest iasl compiler.

  Or(ShiftLeft(Derefof(Index(CDCT, \_SB.PCI0.GFX0.MCHK.DCFE)), 21),PARM, PARM)

Error 6163 - Object is created temporarily in another method
             and cannot be accessed ^ (\_SB.PCI0.GFX0.MCHK.DCFE)

Cc: Zailiang Sun <zailiang.sun@intel.com>
Cc: Yi Qian <yi.qian@intel.com>
Cc: Gary Lin <glin@suse.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../AcpiTablesPCAT/IgdOGBDA.ASL                | 14 ++++++++++++--
 .../AcpiTablesPCAT/IgdOpRn.ASL                 | 18 +-----------------
 2 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
index 4482db6906..379fca7379 100644
--- a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
+++ b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
@@ -1,6 +1,6 @@
 /*++
 
-Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
+Copyright (c)  1999  - 2019, Intel Corporation. All rights reserved
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -125,7 +125,17 @@ Method (GBDA, 0, Serialized)
 
     // Report the graphics frequency based on DISPLAY_CLOCK_FREQUENCY_ENCODING [MMADR+0x20C8]
 
-    Or(ShiftLeft(Derefof(Index(CDCT, \_SB.PCI0.GFX0.MCHK.DCFE)), 21),PARM, PARM)
+    If (LNotEqual (MADR, 0xFFFFFFFF))
+      {
+        OperationRegion(IGMM,SystemMemory,MADR,0x3000)
+        Field(IGMM,AnyAcc, NoLock, Preserve)
+        {
+          Offset(0X20C8),
+          ,    4,
+          DCFE,    4,                     // DISPLAY_CLOCK_FREQUENCY_ENCODING
+        }
+        Or(ShiftLeft(Derefof(Index(CDCT, DCFE)), 21),PARM, PARM)
+      }
 
     Store(1, GESF)                  // Set the modified settings flag
     Return(SUCC)
diff --git a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
index 8575fbfe6c..386ad3e65e 100644
--- a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
+++ b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
@@ -1,6 +1,6 @@
 /*++
 
-Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
+Copyright (c)  1999  - 2019, Intel Corporation. All rights reserved
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -70,22 +70,6 @@ Field(IGDP, AnyAcc, NoLock, Preserve)
   ASLS,   32,    // Reg 0xFC, Address of the IGD OpRegion
 }
 
-Method (MCHK, 0, Serialized)
-{
-
-  If (LNotEqual (MADR, 0xFFFFFFFF))
-  {
-    OperationRegion(IGMM,SystemMemory,MADR,0x3000)
-    Field(IGMM,AnyAcc, NoLock, Preserve)
-    {
-      Offset(0X20C8),
-      ,    4,
-      DCFE,    4,                     // DISPLAY_CLOCK_FREQUENCY_ENCODING
-    }
-  }
-}
-
-
 //  Define an OperationRegion to cover the IGD OpRegion layout.
 
 OperationRegion(IGDM, SystemMemory, ASLB, 0x2000)
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43521): https://edk2.groups.io/g/devel/message/43521
Mute This Topic: https://groups.io/mt/32419754/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms Patch 25/28] Vlv2DeviceRefCodePlg/AcpiTablesPCAT: Fix ASL error

Posted by Sun, Zailiang 22 weeks ago
Reviewed-By: Zailiang Sun <zailiang.sun@intel.com>

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Thursday, July 11, 2019 3:05 AM
> To: devel@edk2.groups.io
> Cc: Sun, Zailiang <zailiang.sun@intel.com>; Qian, Yi <yi.qian@intel.com>;
> Gary Lin <glin@suse.com>
> Subject: [edk2-platforms Patch 25/28]
> Vlv2DeviceRefCodePlg/AcpiTablesPCAT: Fix ASL error
> 
> Remove use of a method to read a register from a BAR and instead access
> the register directly.  Resolves the following error from the latest iasl
> compiler.
> 
>   Or(ShiftLeft(Derefof(Index(CDCT, \_SB.PCI0.GFX0.MCHK.DCFE)), 21),PARM,
> PARM)
> 
> Error 6163 - Object is created temporarily in another method
>              and cannot be accessed ^ (\_SB.PCI0.GFX0.MCHK.DCFE)
> 
> Cc: Zailiang Sun <zailiang.sun@intel.com>
> Cc: Yi Qian <yi.qian@intel.com>
> Cc: Gary Lin <glin@suse.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  .../AcpiTablesPCAT/IgdOGBDA.ASL                | 14 ++++++++++++--
>  .../AcpiTablesPCAT/IgdOpRn.ASL                 | 18 +-----------------
>  2 files changed, 13 insertions(+), 19 deletions(-)
> 
> diff --git
> a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
> b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
> index 4482db6906..379fca7379 100644
> --- a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
> +++ b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOGBDA.ASL
> @@ -1,6 +1,6 @@
>  /*++
> 
> -Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
> +Copyright (c)  1999  - 2019, Intel Corporation. All rights reserved
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -125,7 +125,17 @@ Method (GBDA, 0, Serialized)
> 
>      // Report the graphics frequency based on
> DISPLAY_CLOCK_FREQUENCY_ENCODING [MMADR+0x20C8]
> 
> -    Or(ShiftLeft(Derefof(Index(CDCT, \_SB.PCI0.GFX0.MCHK.DCFE)),
> 21),PARM, PARM)
> +    If (LNotEqual (MADR, 0xFFFFFFFF))
> +      {
> +        OperationRegion(IGMM,SystemMemory,MADR,0x3000)
> +        Field(IGMM,AnyAcc, NoLock, Preserve)
> +        {
> +          Offset(0X20C8),
> +          ,    4,
> +          DCFE,    4,                     // DISPLAY_CLOCK_FREQUENCY_ENCODING
> +        }
> +        Or(ShiftLeft(Derefof(Index(CDCT, DCFE)), 21),PARM, PARM)
> +      }
> 
>      Store(1, GESF)                  // Set the modified settings flag
>      Return(SUCC)
> diff --git
> a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
> b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
> index 8575fbfe6c..386ad3e65e 100644
> --- a/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
> +++ b/Silicon/Intel/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/IgdOpRn.ASL
> @@ -1,6 +1,6 @@
>  /*++
> 
> -Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
> +Copyright (c)  1999  - 2019, Intel Corporation. All rights reserved
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -70,22 +70,6 @@ Field(IGDP, AnyAcc, NoLock, Preserve)
>    ASLS,   32,    // Reg 0xFC, Address of the IGD OpRegion
>  }
> 
> -Method (MCHK, 0, Serialized)
> -{
> -
> -  If (LNotEqual (MADR, 0xFFFFFFFF))
> -  {
> -    OperationRegion(IGMM,SystemMemory,MADR,0x3000)
> -    Field(IGMM,AnyAcc, NoLock, Preserve)
> -    {
> -      Offset(0X20C8),
> -      ,    4,
> -      DCFE,    4,                     // DISPLAY_CLOCK_FREQUENCY_ENCODING
> -    }
> -  }
> -}
> -
> -
>  //  Define an OperationRegion to cover the IGD OpRegion layout.
> 
>  OperationRegion(IGDM, SystemMemory, ASLB, 0x2000)
> --
> 2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43571): https://edk2.groups.io/g/devel/message/43571
Mute This Topic: https://groups.io/mt/32419754/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-