summaryrefslogtreecommitdiff
path: root/Board/EM/Platform/SsdtAcpiDebug
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Board/EM/Platform/SsdtAcpiDebug
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Board/EM/Platform/SsdtAcpiDebug')
-rw-r--r--Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl52
-rw-r--r--Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif10
-rw-r--r--Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak80
-rw-r--r--Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.sdl31
4 files changed, 173 insertions, 0 deletions
diff --git a/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl
new file mode 100644
index 0000000..e9df479
--- /dev/null
+++ b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.asl
@@ -0,0 +1,52 @@
+
+DefinitionBlock (
+ "AcpiDebug.aml",
+ "SSDT",
+ 1,
+ "Intel_",
+ "ADebTabl",
+ 0x1000
+ )
+{
+ Scope(\)
+ {
+ //
+ // These pointers are patched during POST.
+ //
+ Name(DPTR, 0x80000000) // Address of Acpi debug memory buffer, fixed up during POST
+ Name(EPTR, 0x80000000) // End of Acpi debug memory buffer, fixed up during POST
+ Name(CPTR, 0x80000000) // Current pointer used as an index into the buffer(starts after the buffer signature), fixed up during POST
+
+ //
+ //Use a Mutex to prevent multiple calls from simutaneously writing to the same memory.
+ //
+ Mutex(MMUT, 0)
+
+ //
+ // Write a string to a memory buffer
+ //
+ Method(MDBG,1,Serialized)
+ {
+ 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, 16) // Operation region to allow writes to ACPI debug buffer
+ Field(ABLK, ByteAcc, NoLock, Preserve)
+ {
+ Offset(0x0),
+ AAAA, 128 // 16 byte string or data
+ }
+ Store(Arg0,AAAA) // anything past string buffer size is ignored by ACPI
+
+ Add(CPTR,16,CPTR) // advance current pointer to next string location in memory buffer
+ If (LGreaterEqual(CPTR,EPTR) ) // check for end of 64kb Acpi debug buffer
+ {
+ Add(DPTR,16,CPTR) // wrap around to beginning of buffer if the end has been reached
+ }
+ Release(MMUT)
+ }
+ Return(Local0) // return error code indicating whether Mutex was acquired
+ }
+
+ } // End Scope
+} // End SSDT
diff --git a/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif
new file mode 100644
index 0000000..9c26ea5
--- /dev/null
+++ b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "SsdtAcpiDebug"
+ category = ModulePart
+ LocalRoot = "Board\EM\Platform\SsdtAcpiDebug"
+ RefName = "SsdtAcpiDebug"
+[files]
+"SsdtAcpiDebug.sdl"
+"SsdtAcpiDebug.mak"
+"SsdtAcpiDebug.asl"
+<endComponent>
diff --git a/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak
new file mode 100644
index 0000000..98910bc
--- /dev/null
+++ b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.mak
@@ -0,0 +1,80 @@
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
+
+#*************************************************************************
+#<AMI_FHDR_START>
+#
+# Name: SsdtAcpiDebug.mak
+#
+# Description: MAke file to build Aptio ACPI ASL components
+#
+#
+#<AMI_FHDR_END>
+#*************************************************************************
+all : BuildACPIDEBUG
+
+BuildACPIDEBUG : $(BUILD_DIR)\ACPIDEBUG.ffs
+
+#-----------------------------------------------------------------------
+# ASL compiler definition
+#-----------------------------------------------------------------------
+!IF "$(ACPIPLATFORM_ASL_COMPILER)"==""
+!ERROR It is an invalid path, please check your ASL compiler path.
+!ENDIF
+
+IASL = $(ACPIPLATFORM_ASL_COMPILER)
+#-----------------------------------------------------------------------
+$(BUILD_DIR)\SsdtAcpiDebug.aml : $(INTEL_ACPIDEBUG_ASL_FILE)
+ @cl /C /EP $(INTEL_ACPIDEBUG_ASL_FILE) > $(BUILD_DIR)\SsdtAcpiDebug.asl
+ $(IASL) -p $(BUILD_DIR)\SsdtAcpiDebug.aml $(BUILD_DIR)\SsdtAcpiDebug.asl
+
+$(BUILD_DIR)\SsdtAcpiDebug.sec: $(BUILD_DIR)\SsdtAcpiDebug.aml
+ $(GENSECTION) -I $*.aml -O $@ -S EFI_SECTION_RAW
+
+#Note. Expand the package with SsdtAcpiDebug tables.
+# DXE phase will load the tables
+# and update Aml contents if provided in Acpiplatform.c
+
+$(BUILD_DIR)\ACPIDEBUG.ffs: $(BUILD_DIR)\SsdtAcpiDebug.sec
+ $(GENFFSFILE) -B $(BUILD_DIR) -V -o $@ -P1 <<$(BUILD_DIR)\SsdtAcpiDebug.pkg
+
+PACKAGE.INF
+[.]
+BASE_NAME = ACPIDEBUG
+FFS_FILEGUID = 94AB6AED-9719-48ef-831C-2E9C29758C33
+FFS_FILETYPE = EFI_FV_FILETYPE_FREEFORM
+FFS_ATTRIB_CHECKSUM = TRUE
+
+IMAGE_SCRIPT =
+{
+ Compress (dummy) {
+ $(PROJECT_DIR)\$(BUILD_DIR)\SsdtAcpiDebug.sec
+ }
+}
+<<KEEP
+
+
+#*************************************************************************
+#*************************************************************************
+#** **
+#** (C)Copyright 1985-2011, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#*************************************************************************
+#*************************************************************************
diff --git a/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.sdl b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.sdl
new file mode 100644
index 0000000..a754a9b
--- /dev/null
+++ b/Board/EM/Platform/SsdtAcpiDebug/SsdtAcpiDebug.sdl
@@ -0,0 +1,31 @@
+TOKEN
+ Name = "ACPIDEBUG_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable SsdtAcpiDebug support in Project"
+ TokenType = Boolean
+ TargetMAK = Yes
+ TargetH = Yes
+ Master = Yes
+End
+
+PATH
+ Name = "INTEL_SSDTACPIDEBUG_DIR"
+End
+
+TOKEN
+ Name = "INTEL_ACPIDEBUG_ASL_FILE"
+ Value = "$(INTEL_SSDTACPIDEBUG_DIR)\SsdtAcpiDebug.asl"
+ TokenType = Expression
+ TargetMAK = Yes
+End
+
+MODULE
+ Help = "Includes SsdtAcpiDebug.mak to Project"
+ File = "SsdtAcpiDebug.mak"
+End
+
+ELINK
+ Name = "$(BUILD_DIR)\ACPIDEBUG.ffs"
+ Parent = "FV_MAIN"
+ InvokeOrder = AfterParent
+End