From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- .../AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.asl | 134 +++++++++++++++++++++ .../AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.cif | 11 ++ .../AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.mak | 89 ++++++++++++++ .../AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.sdl | 59 +++++++++ .../SampleCode/SsdtZpOdd/SsdtZpOddULT.asl | 110 +++++++++++++++++ 5 files changed, 403 insertions(+) create mode 100644 ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.asl create mode 100644 ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.cif create mode 100644 ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.mak create mode 100644 ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.sdl create mode 100644 ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOddULT.asl (limited to 'ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd') diff --git a/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.asl b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.asl new file mode 100644 index 0000000..bd69431 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.asl @@ -0,0 +1,134 @@ + +DefinitionBlock ( + "SsdtZpOdd.aml", + "SSDT", + 1, + "Intel", + "zpodd", + 0x1000 + ) +{ +External(PFLV) +External(FDTP) +External(GPE3) +External(\GL00) +External(\GL08) +External(GPS3) +External(\_SB.PCI0.SAT0.PRT2, DeviceObj) +External(\GIV0) +External(RTD3, IntObj) + + If(LEqual(RTD3, Zero)) + { + Scope(\_SB.PCI0.SAT0.PRT2) + { + + // + // _DSM Device Specific Method supporting SATA ZPODD function + // + // Arg0: UUID Unique function identifier + // Arg1: Integer Revision Level + // Arg2: Integer Function Index + // Arg3: Package Parameters + // + Method (_DSM, 4, NotSerialized, 0, UnknownObj, {BuffObj, IntObj, IntObj, PkgObj}) { + If (LEqual(Arg0, ToUUID ("bdfaef30-aebb-11de-8a39-0800200c9a66"))) { + // + // Switch by function index + // + Switch (ToInteger(Arg2)) { + // + // Standard query - A bitmask of functions supported + // Supports function 0-5 + // + Case (0) { + switch(ToInteger(Arg1)) { + case(1) { + // + // Return - 0 (No Functions supported) for Desktop Platforms + // + If(LEqual(PFLV,FDTP)) { + Return (Buffer () {0}) + } + Return (Buffer () {0xF}) + } + Default {Return (Buffer () {0})} + } + } // Case (0) + // + // Enable ZPODD feature + // + Case (1) { + Return (1) + } // Case (1) + // + // Power Off Device + // + Case (2) { + // + // Drive GPIO to low to power off device. + // + Store(0,GPE3) + If(LEqual(And(\GL00, 0x08), 0x08)) + { + Or(\GIV0, 0x08, \GIV0) + } Else { + And(\GIV0, 0xF7, \GIV0) + } + And(\GL08, 0xEF, \GL08) + Sleep(0xC8) + Store(1,GPS3) + Store(1,GPE3) + Return (1) + } // Case (2) + // + // Power ON Device + // + Case (3) { + Store(0,GPE3) + Store(1,GPS3) + Or(\GL08, 0x10, \GL08) + Return (1) + } // Case (3) + + Default { + Return (0) + } + } // Switch (ToInteger(Arg2)) + } Else { + Return (0) + } // bdfaef30-aebb-11de-8a39-0800200c9a66 + } // _DSM + } // (\_SB.PCI0.SAT0) +// +// GPE Event Handler +// +Scope(\_GPE) { + // + // SATA_ODD_DA + // + Method(_L13) { + // + // Do nothing if Desktop platform + // + If(LEqual(PFLV,FDTP)) { + Return () + } + // + // Power on drive, disable SCI on GPI + // Disable SCI on GPIO3 (PMBASE+0x28 - BIT19) + // + Store(0,GPE3) + // + // Drive GPIO68 to High to power on device. + // + Or(\GL08, 0x10, \GL08) + // + // Notify the OSPM + // + Notify(\_SB.PCI0.SAT0, 0x82) + Return () + } +} // \_GPE +} // If(LEqual(RTD3, Zero)) +} // End SSDT diff --git a/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.cif b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.cif new file mode 100644 index 0000000..02be8d2 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.cif @@ -0,0 +1,11 @@ + + name = "SsdtZpOdd" + category = ModulePart + LocalRoot = "ReferenceCode\AcpiTables\SampleCode\SsdtZpOdd\" + RefName = "SsdtZpOdd" +[files] +"SsdtZpOdd.sdl" +"SsdtZpOdd.mak" +"SsdtZpOdd.asl" +"SsdtZpOddULT.asl" + diff --git a/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.mak b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.mak new file mode 100644 index 0000000..81eb0d1 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.mak @@ -0,0 +1,89 @@ +#************************************************************************* +#************************************************************************* +#** ** +#** (C)Copyright 1985-2011, American Megatrends, Inc. ** +#** ** +#** All Rights Reserved. ** +#** ** +#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +#** ** +#** Phone: (770)-246-8600 ** +#** ** +#************************************************************************* +#************************************************************************* + +#************************************************************************* +# +# +# Name: SsdtZpOdd.mak +# +# Description: MAke file to build Aptio ACPI ASL components +# +# +# +#************************************************************************* +all : BuildZPODD + +BuildZPODD : $(BUILD_DIR)\SsdtZpOdd.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)\SsdtZpOdd.aml $(BUILD_DIR)\SsdtZpOddult.aml: $(BUILD_DIR)\SsdtZpOdd.asl $(BUILD_DIR)\SsdtZpOddult.asl + $(SILENT)$(IASL) -p $@ $*.asl + +$(BUILD_DIR)\SsdtZpOdd.sec $(BUILD_DIR)\SsdtZpOddult.sec: $(BUILD_DIR)\SsdtZpOdd.aml $(BUILD_DIR)\SsdtZpOddult.aml + $(GENSECTION) -I $*.aml -O $@ -S EFI_SECTION_RAW + +#Note. Expand the package with ZpOdd tables. +# DXE phase will load the tables +# and update Aml contents if provided in Acpiplatform.c + +$(BUILD_DIR)\SsdtZpOdd.ffs: $(BUILD_DIR)\SsdtZpOdd.sec $(BUILD_DIR)\SsdtZpOddult.sec + $(GENFFSFILE) -B $(BUILD_DIR) -V -o $@ -P1 <<$(BUILD_DIR)\SsdtZpOdd.pkg + +PACKAGE.INF +[.] +BASE_NAME = ZpOdd +FFS_FILEGUID = E42A76A1-D4B3-4c26-A1BB-84A3502A779F + FFS_FILETYPE = EFI_FV_FILETYPE_FREEFORM +FFS_ATTRIB_CHECKSUM = TRUE + +IMAGE_SCRIPT = +{ + Compress (dummy) { + $(PROJECT_DIR)\$(BUILD_DIR)\SsdtZpOdd.sec + $(PROJECT_DIR)\$(BUILD_DIR)\SsdtZpOddult.sec + } +} +< $(BUILD_DIR)\SsdtZpOdd.asl + +$(BUILD_DIR)\SsdtZpOddult.asl : $(INTEL_ZPODDULT_ASL_FILE) + $(CP) /I$(INTEL_SSDTZPODD_DIR) /FItoken.h /C $(INTEL_ZPODDULT_ASL_FILE) > $(BUILD_DIR)\SsdtZpOddult.asl + + +#************************************************************************* +#************************************************************************* +#** ** +#** (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/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.sdl b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.sdl new file mode 100644 index 0000000..98dbe92 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOdd.sdl @@ -0,0 +1,59 @@ +TOKEN + Name = "ZPODD_SUPPORT" + Value = "1" + Help = "Main switch to enable ZpODD support in Project" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes + Master = Yes + Token = "PCH_SKU" "=" "1" +End + +TOKEN + Name = "STD_ZPODD_SUPPORT" + Value = "1" + Help = "Main switch to enable Stand ZpODD support in Project" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes + Token = "ZPODD_SUPPORT" "=" "1" +End + +TOKEN + Name = "ULT_ZPODD_SUPPORT" + Value = "1" + Help = "Main switch to enable ULT ZpODD support in Project" + TokenType = Boolean + TargetMAK = Yes + TargetH = Yes + Token = "ZPODD_SUPPORT" "=" "1" +End + +PATH + Name = "INTEL_SSDTZPODD_DIR" +End + +TOKEN + Name = "INTEL_ZPODD_ASL_FILE" + Value = "$(INTEL_SSDTZPODD_DIR)\SsdtZpOdd.asl" + TokenType = Expression + TargetMAK = Yes +End + +TOKEN + Name = "INTEL_ZPODDULT_ASL_FILE" + Value = "$(INTEL_SSDTZPODD_DIR)\SsdtZpOddult.asl" + TokenType = Expression + TargetMAK = Yes +End + +MODULE + Help = "Includes SsdtZpOdd.mak to Project" + File = "SsdtZpOdd.mak" +End + +ELINK + Name = "$(BUILD_DIR)\SsdtZpOdd.ffs" + Parent = "FV_MAIN" + InvokeOrder = AfterParent +End diff --git a/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOddULT.asl b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOddULT.asl new file mode 100644 index 0000000..dd393d4 --- /dev/null +++ b/ReferenceCode/AcpiTables/SampleCode/SsdtZpOdd/SsdtZpOddULT.asl @@ -0,0 +1,110 @@ + +DefinitionBlock ( + "SsdtZpOddult.aml", + "SSDT", + 1, + "Intel", + "zpoddult", + 0x1000 + ) +{ +External(\GO17) +External(\_SB.PCI0.SAT0.PRT1, DeviceObj) +External(RTD3, IntObj) +External(ECON, IntObj) +External(\_SB.WTGP, MethodObj) + + + If(LEqual(RTD3, Zero)) + { + Scope(\_SB.PCI0.SAT0.PRT1) + { + + // + // _DSM Device Specific Method supporting SATA ZPODD function + // + // Arg0: UUID Unique function identifier + // Arg1: Integer Revision Level + // Arg2: Integer Function Index + // Arg3: Package Parameters + // + Method (_DSM, 4, NotSerialized, 0, UnknownObj, {BuffObj, IntObj, IntObj, PkgObj}) { + If (LEqual(Arg0, ToUUID ("bdfaef30-aebb-11de-8a39-0800200c9a66"))) { + // + // Switch by function index + // + Switch (ToInteger(Arg2)) { + // + // Standard query - A bitmask of functions supported + // Supports function 0-5 + // + Case (0) { + switch(ToInteger(Arg1)) { + case(1) { + // + // Return - 0 (No Functions supported) for Desktop Platforms + // + If(LEqual(ECON, Zero)) { + Return (Buffer () {0}) + } + Return (Buffer () {0xF}) + } + Default {Return (Buffer () {0})} + } + } // Case (0) + // + // Enable ZPODD feature + // + Case (1) { + Return (1) + } // Case (1) + // + // Power Off Device + // + Case (2) { + // + // Drive GPIO to low to power off device. + // + \_SB.WTGP(86,1) // Power Off the device + Store(0,\GO17) // Enable GPIO86 + Return (1) + } // Case (2) + // + // Power ON Device + // + Case (3) { + \_SB.WTGP(86,0) // Power ON Device + Store(1,\GO17) // Enable GPIO86 + Sleep(0x0A) // To turn the FET + Return (1) + } // Case (3) + + Default { + Return (0) + } + } // Switch (ToInteger(Arg2)) + } Else { + Return (0) + } // bdfaef30-aebb-11de-8a39-0800200c9a66 + } // _DSM + } // (\_SB.PCI0.SAT0) + +// +// GPE Event Handler +// +Scope(\_GPE) { + // + // GPI03 = SATA_ODD_DA + // + Method(_L11) { + If(LEqual(ECON, Zero)) { + Return () + } + + Store(1,\GO17) // Enable GPIO86 + Notify(\_SB.PCI0.SAT0, 0x81) + Return () + } +} // \_GPE +} // If(LEqual(RTD3, Zero)) +} // End SSDT -- cgit v1.2.3