Re: [edk2] [Patch] AdvancedFeaturePkg/AcpiDebug: Add new AcpiDebug modules.

2019-04-01 Thread Dong, Eric
Hi Laszlo,

yes, it's for edk2-platforms.  Sorry for this one, will follow this rule next 
time.

Thanks,
Eric
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Tuesday, April 2, 2019 12:53 AM
> To: Dong, Eric ; edk2-devel@lists.01.org
> Cc: Wu, Hao A 
> Subject: Re: [edk2] [Patch] AdvancedFeaturePkg/AcpiDebug: Add new
> AcpiDebug modules.
> 
> On 04/01/19 05:16, Eric Dong wrote:
> > Add new AcpiDebug modules which provide ACPI Debug feature.
> > Detail about this feature see the readme.txt in the patch.
> >
> > Change-Id: Ib977ece46f3494301574b04af32282b99045f673
> > Cc: Hao Wu 
> > Cc: Michael Kubacki 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Eric Dong 
> > ---
> >  .../AcpiDebug/AcpiDebug.asl   | 109 
> >  .../AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c  | 485
> ++
> >  .../AcpiDebug/AcpiDebugDxe.inf|  63 +++
> >  .../AcpiDebug/AcpiDebugSmm.inf|  65 +++
> >  .../AdvancedFeaturePkg/AcpiDebug/Readme.txt   |  47 ++
> >  .../AdvancedFeaturePkg/AdvancedFeaturePkg.dec |   6 +
> >  .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |   2 +
> >  7 files changed, 777 insertions(+)
> >  create mode 100644
> > Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl
> >  create mode 100644
> > Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c
> >  create mode 100644
> > Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
> >  create mode 100644
> > Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugSmm.inf
> >  create mode 100644
> > Platform/Intel/AdvancedFeaturePkg/AcpiDebug/Readme.txt
> 
> What repository is this for? Is it for edk2-platforms? Such patches should be
> posted with a subject prefix like [edk2-platforms PATCH], please.
> 
> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] AdvancedFeaturePkg/AcpiDebug: Add new AcpiDebug modules.

2019-04-01 Thread Laszlo Ersek
On 04/01/19 05:16, Eric Dong wrote:
> Add new AcpiDebug modules which provide ACPI Debug feature.
> Detail about this feature see the readme.txt in the patch.
> 
> Change-Id: Ib977ece46f3494301574b04af32282b99045f673
> Cc: Hao Wu 
> Cc: Michael Kubacki 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Dong 
> ---
>  .../AcpiDebug/AcpiDebug.asl   | 109 
>  .../AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c  | 485 ++
>  .../AcpiDebug/AcpiDebugDxe.inf|  63 +++
>  .../AcpiDebug/AcpiDebugSmm.inf|  65 +++
>  .../AdvancedFeaturePkg/AcpiDebug/Readme.txt   |  47 ++
>  .../AdvancedFeaturePkg/AdvancedFeaturePkg.dec |   6 +
>  .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |   2 +
>  7 files changed, 777 insertions(+)
>  create mode 100644 Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl
>  create mode 100644 Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c
>  create mode 100644 
> Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
>  create mode 100644 
> Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugSmm.inf
>  create mode 100644 Platform/Intel/AdvancedFeaturePkg/AcpiDebug/Readme.txt

What repository is this for? Is it for edk2-platforms? Such patches
should be posted with a subject prefix like [edk2-platforms PATCH], please.

Thanks
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] AdvancedFeaturePkg/AcpiDebug: Add new AcpiDebug modules.

2019-03-31 Thread Dong, Eric
Include Package owner Kubacki.  Already in the Cc list but don't know why not 
Cc him in former mail.

Thanks,
Eric

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Eric Dong
> Sent: Monday, April 1, 2019 11:17 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A 
> Subject: [edk2] [Patch] AdvancedFeaturePkg/AcpiDebug: Add new
> AcpiDebug modules.
> 
> Add new AcpiDebug modules which provide ACPI Debug feature.
> Detail about this feature see the readme.txt in the patch.
> 
> Change-Id: Ib977ece46f3494301574b04af32282b99045f673
> Cc: Hao Wu 
> Cc: Michael Kubacki 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Dong 
> ---
>  .../AcpiDebug/AcpiDebug.asl   | 109 
>  .../AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c  | 485
> ++
>  .../AcpiDebug/AcpiDebugDxe.inf|  63 +++
>  .../AcpiDebug/AcpiDebugSmm.inf|  65 +++
>  .../AdvancedFeaturePkg/AcpiDebug/Readme.txt   |  47 ++
>  .../AdvancedFeaturePkg/AdvancedFeaturePkg.dec |   6 +
>  .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |   2 +
>  7 files changed, 777 insertions(+)
>  create mode 100644
> Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl
>  create mode 100644
> Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c
>  create mode 100644
> Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
>  create mode 100644
> Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugSmm.inf
>  create mode 100644
> Platform/Intel/AdvancedFeaturePkg/AcpiDebug/Readme.txt
> 
> diff --git a/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl
> b/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl
> new file mode 100644
> index 000..62d2a1b
> --- /dev/null
> +++ b/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl
> @@ -0,0 +1,109 @@
> +/** @file
> +  Acpi Debug ASL code.
> +
> +Copyright (c) 2019, Intel Corporation. All rights reserved. This
> +program and the accompanying materials are licensed and made available
> +under the terms and conditions of the BSD License which accompanies
> +this distribution.  The full text of the license may be found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +
> +**/
> +
> +DefinitionBlock (
> +  "AcpiDebug.aml",
> +  "SSDT",
> +  2,
> +  "Intel ",
> +  "ADebTabl",
> +  0x1000
> +  )
> +{
> +  Scope(\)
> +  {
> +//
> +// These pointers are patched during POST.
> +//
> +Name (DPTR, 0x8000) // Address of Acpi debug memory buffer, fixed
> up during POST
> +Name (EPTR, 0x8000) // End of Acpi debug memory buffer, fixed up
> during POST
> +Name (CPTR, 0x8000) // Current pointer used as an index into
> +the buffer(starts after the Acpi Debug head), fixed up during POST
> +
> +//
> +// Use a Mutex to prevent multiple calls from simutaneously writing to
> the same memory.
> +//
> +Mutex (MMUT, 0)
> +
> +//
> +// Operational region for SMI port access
> +//
> +OperationRegion (ADBP, SystemIO, 0xB2, 2)
> +Field (ADBP, ByteAcc, NoLock, Preserve)
> +{
> +B2PT, 8,
> +B3PT, 8,
> +}
> +
> +//
> +// Write a string to a memory buffer
> +//
> +Method (MDBG, 1, Serialized)
> +{
> +  OperationRegion (ADHD, SystemMemory, DPTR, 32) // Operation region
> for Acpi Debug buffer first 0x20 bytes
> +  Field (ADHD, ByteAcc, NoLock, Preserve)
> +  {
> +Offset (0x0),
> +ASIG, 128,  // 16 bytes is Signature
> +Offset (0x10),
> +ASIZ, 32,   // 4 bytes is buffer size
> +ACHP, 32,   // 4 bytes is current head pointer, normally is DPTR 
> + 0x20,
> +//   if there's SMM handler to print, then it's the 
> starting of the
> info hasn't been printed yet.
> +ACTP, 32,   // 4 bytes is current tail pointer, is the same as 
> CPTR
> +SMIN, 8,// 1 byte of SMI Number for trigger callback
> +WRAP, 8,// 1 byte of wrap status
> +SMMV, 8,// 1 byte of SMM version status
> +TRUN, 8 // 1 byte of truncate status
> +  }
> +
> +  Store (Acquire (MMUT, 1000), Local0) // save Acquire result so we can
> check for Mutex acquired
> +  If (LEqual (Local0, Zero)) // check for Mutex acquired
> +  {
> +OperationRegion (ABLK, SystemMemory, CPTR, 32) // Operation region
> to allow writes to ACPI debug buffer
> +Field (ABLK, ByteAcc, NoLock, Preserve)
> +{
> +  Offset (0x0),
> +  , 256 // 32 bytes is max size for string or data
> +}
> +ToHexString (Arg0, Local1) // convert argument to Hexadecimal String
> +Store (0, TRUN)
> +If (LGreaterEqual (SizeOf (Local1), 32))
> +{
> +