diff options
author | Robert Moore <Robert.Moore@intel.com> | 2023-02-10 12:32:30 -0800 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2023-02-10 12:32:30 -0800 |
commit | 1aaa3da8c7dd710eeb68fbeeda0b25f10009628f (patch) | |
tree | 8dcb3b1c24f6554f18fc240628cde44cbcd6996b | |
parent | 00d53103c4ac9b8c5a4b0485fcdd3631afcd689a (diff) | |
parent | 14999936bc5add815f1e8c6cefbdcc4297fd9397 (diff) | |
download | acpica-1aaa3da8c7dd710eeb68fbeeda0b25f10009628f.tar.gz |
Merge branch 'master' of ssh://ssh.github.com/acpica/acpica
29 files changed, 436 insertions, 16 deletions
diff --git a/source/common/dmrestag.c b/source/common/dmrestag.c index d9255c1ab..afacf6f70 100644 --- a/source/common/dmrestag.c +++ b/source/common/dmrestag.c @@ -480,6 +480,14 @@ static const ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] = {0, NULL} }; +/* Subtype tables for ClockInput descriptor */ + +static const ACPI_RESOURCE_TAG AcpiDmClockInputTags[] = +{ + {( 6 * 8), ACPI_RESTAG_FQD}, + {( 8 * 8), ACPI_RESTAG_FQN}, + {0, NULL} +}; /* * Dispatch table used to obtain the correct tag table for a descriptor. @@ -531,6 +539,7 @@ static const ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags[] = NULL, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */ AcpiDmPinGroupFunctionTags, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */ AcpiDmPinConfigTags, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG - Same as PinConfig */ + AcpiDmClockInputTags, /* 0x13, ACPI_RESOURCE_NAME_CLOCK_INPUT */ }; /* GPIO Subtypes */ diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h index e205696c8..ca20de452 100644 --- a/source/compiler/aslcompiler.h +++ b/source/compiler/aslcompiler.h @@ -1566,6 +1566,9 @@ ASL_RESOURCE_NODE * RsDoPinGroupConfigDescriptor ( ASL_RESOURCE_INFO *Info); +ASL_RESOURCE_NODE * +RsDoClockInputDescriptor ( + ASL_RESOURCE_INFO *Info); /* * aslrestype2d - DWord address descriptors diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index 8b79b61ac..fbc38a613 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -461,6 +461,7 @@ NamePathTail [.]{NameSeg} "PinGroup" { count (1); return (PARSEOP_PINGROUP); } "PinGroupConfig" { count (1); return (PARSEOP_PINGROUPCONFIG); } "PinGroupFunction" { count (1); return (PARSEOP_PINGROUPFUNCTION); } +"ClockInput" { count (1); return (PARSEOP_CLOCKINPUT); } "QWordIO" { count (1); return (PARSEOP_QWORDIO); } "QWordMemory" { count (1); return (PARSEOP_QWORDMEMORY); } "QWordSpace" { count (1); return (PARSEOP_QWORDSPACE); } @@ -665,6 +666,17 @@ NamePathTail [.]{NameSeg} "PullDown" { count (0); return (PARSEOP_PIN_PULLDOWN); } "PullNone" { count (0); return (PARSEOP_PIN_NOPULL); } + /* ClockScaleKeyword: Resource Descriptors (ACPI 6.5) */ + +"Hz" { count (0); return (PARSEOP_CLOCK_HZ); } +"KHz" { count (0); return (PARSEOP_CLOCK_KHZ); } +"MHz" { count (0); return (PARSEOP_CLOCK_MHZ); } + + /* ClockModeKeyword: Resource Descriptors (ACPI 6.5) */ + +"Fixed" { count (0); return (PARSEOP_CLOCK_FIXED); } +"Variable" { count (0); return (PARSEOP_CLOCK_VARIABLE); } + /* PolarityKeyword: Resource Descriptors (ACPI 5.0) */ "PolarityLow" { count (0); return (PARSEOP_DEVICEPOLARITY_LOW); } diff --git a/source/compiler/aslkeywords.y b/source/compiler/aslkeywords.y index c6bb19c75..d559fd0f4 100644 --- a/source/compiler/aslkeywords.y +++ b/source/compiler/aslkeywords.y @@ -462,3 +462,14 @@ XferTypeKeyword | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_8_16);} | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafOp (PARSEOP_XFERTYPE_16);} ; + +ClockScaleKeyword + : PARSEOP_CLOCK_HZ {$$ = TrCreateLeafOp (PARSEOP_CLOCK_HZ);} + | PARSEOP_CLOCK_KHZ {$$ = TrCreateLeafOp (PARSEOP_CLOCK_KHZ);} + | PARSEOP_CLOCK_MHZ {$$ = TrCreateLeafOp (PARSEOP_CLOCK_MHZ);} + ; + +ClockModeKeyword + : PARSEOP_CLOCK_FIXED {$$ = TrCreateLeafOp (PARSEOP_CLOCK_FIXED);} + | PARSEOP_CLOCK_VARIABLE {$$ = TrCreateLeafOp (PARSEOP_CLOCK_VARIABLE);} + ; diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index c2d35cb6f..71fb5f034 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -462,6 +462,12 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* PIN_PULLDEFAULT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* PIN_PULLDOWN */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), /* PIN_PULLUP */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* CLOCKINPUT */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), +/* CLOCK_HZ */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* CLOCK_KHZ */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), +/* CLOCK_MHZ */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0), +/* CLOCK_FIXED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), +/* CLOCK_VARIABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* POWERRESOURCE */ OP_TABLE_ENTRY (AML_POWER_RESOURCE_OP, 0, OP_AML_PACKAGE, 0), /* PROCESSOR */ OP_TABLE_ENTRY (AML_PROCESSOR_OP, 0, OP_AML_PACKAGE, 0), /* QWORDCONST */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER), diff --git a/source/compiler/aslparser.y b/source/compiler/aslparser.y index 7e7ea9679..3e1c661f4 100644 --- a/source/compiler/aslparser.y +++ b/source/compiler/aslparser.y @@ -208,7 +208,7 @@ AslLocalAllocate ( * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 127 +%expect 128 /*! [Begin] no source code translation */ diff --git a/source/compiler/aslresource.c b/source/compiler/aslresource.c index 2f0127a11..4d20c5e31 100644 --- a/source/compiler/aslresource.c +++ b/source/compiler/aslresource.c @@ -762,6 +762,12 @@ RsDoOneResourceDescriptor ( switch (Info->DescriptorTypeOp->Asl.ParseOpcode) { + + case PARSEOP_CLOCKINPUT: + + Rnode = RsDoClockInputDescriptor(Info); + break; + case PARSEOP_DMA: Rnode = RsDoDmaDescriptor (Info); diff --git a/source/compiler/aslresources.y b/source/compiler/aslresources.y index 38f744a06..52bff9c41 100644 --- a/source/compiler/aslresources.y +++ b/source/compiler/aslresources.y @@ -214,6 +214,7 @@ ResourceMacroTerm | Memory32Term {} | PinConfigTerm {} | PinFunctionTerm {} + | ClockInputTerm {} | PinGroupTerm {} | PinGroupConfigTerm {} | PinGroupFunctionTerm {} @@ -666,6 +667,21 @@ PinFunctionTerm error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} ; +ClockInputTerm + : PARSEOP_CLOCKINPUT + PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_CLOCKINPUT);} + DWordConstExpr /* 04: FrequencyNumerator */ + ',' WordConstExpr /* 06: FrequencyDivisor */ + ',' ClockScaleKeyword /* 08: Scale */ + ',' ClockModeKeyword /* 10: Mode*/ + OptionalStringData /* 11: ResourceSource */ + OptionalByteConstExpr /* 12: ResourceSourceIndex */ + PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} + | PARSEOP_CLOCKINPUT + PARSEOP_OPEN_PAREN + error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;} + ; + PinGroupTerm : PARSEOP_PINGROUP PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PINGROUP);} diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c index 6c904d031..cdb467ff1 100644 --- a/source/compiler/aslrestype2s.c +++ b/source/compiler/aslrestype2s.c @@ -1708,6 +1708,115 @@ RsDoPinFunctionDescriptor ( return (Rnode); } +/******************************************************************************* + * + * FUNCTION: RsDoClockInputDescriptor + * + * PARAMETERS: Info - Parse Op and resource template offset + * + * RETURN: Completed resource node + * + * DESCRIPTION: Construct a long "ClockInput" descriptor + * + ******************************************************************************/ + +ASL_RESOURCE_NODE * +RsDoClockInputDescriptor ( + ASL_RESOURCE_INFO *Info) +{ + AML_RESOURCE *Descriptor; + ACPI_PARSE_OBJECT *InitializerOp; + ASL_RESOURCE_NODE *Rnode; + char *ResourceSourceString = NULL; + UINT8 *ResourceSourceIndex = NULL; + UINT16 ResSourceLength; + UINT16 DescriptorSize; + UINT32 i; + UINT32 CurrentByteOffset; + + InitializerOp = Info->DescriptorTypeOp->Asl.Child; + CurrentByteOffset = Info->CurrentByteOffset; + + /* + * Calculate lengths for fields that have variable length: + * 1) Resource Source string + */ + ResSourceLength = RsGetStringDataLength (InitializerOp); + + DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_CLOCK_INPUT) + ResSourceLength + 1; + + /* Allocate the local resource node and initialize */ + + Rnode = RsAllocateResourceNode (DescriptorSize + + sizeof (AML_RESOURCE_LARGE_HEADER)); + + Descriptor = Rnode->Buffer; + Descriptor->ClockInput.ResourceLength = DescriptorSize; + Descriptor->ClockInput.DescriptorType = ACPI_RESOURCE_NAME_CLOCK_INPUT; + Descriptor->ClockInput.RevisionId = AML_RESOURCE_CLOCK_INPUT_REVISION; + + /* Build pointers to optional areas */ + + if (ResSourceLength){ + ResourceSourceIndex = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_CLOCK_INPUT)); + ResourceSourceString = ACPI_ADD_PTR (char, Descriptor, sizeof (AML_RESOURCE_CLOCK_INPUT) + 1); + } + + /* Process all child initialization nodes */ + + for (i = 0; InitializerOp; i++) + { + switch (i) + { + case 0: + Descriptor->ClockInput.FrequencyNumerator = (UINT32)InitializerOp->Asl.Value.Integer; + RsCreateDwordField (InitializerOp, ACPI_RESTAG_FQN, + CurrentByteOffset + ASL_RESDESC_OFFSET (ClockInput.FrequencyNumerator)); + + break; + + case 1: + Descriptor->ClockInput.FrequencyDivisor = (UINT16)InitializerOp->Asl.Value.Integer; + RsCreateWordField (InitializerOp, ACPI_RESTAG_FQD, + CurrentByteOffset + ASL_RESDESC_OFFSET (ClockInput.FrequencyDivisor)); + + break; + + case 2: + RsSetFlagBits16 (&Descriptor->ClockInput.Flags, InitializerOp, 1, 0); + break; + + case 3: + RsSetFlagBits16 (&Descriptor->ClockInput.Flags, InitializerOp, 0, 0); + break; + + case 4: /* ResSource String [Optional Field] */ + + if (ResourceSourceString) + { + /* Copy string to the descriptor */ + + strcpy (ResourceSourceString, InitializerOp->Asl.Value.String); + } + break; + + case 5: /* ResSource Index [Optional Field] */ + if (ResourceSourceIndex) + { + *ResourceSourceIndex = (UINT8) InitializerOp->Asl.Value.Integer; + } + break; + + default: + break; + } + + InitializerOp = RsCompleteNodeAndGetNext (InitializerOp); + } + + return (Rnode); +} + /******************************************************************************* * diff --git a/source/compiler/asltokens.y b/source/compiler/asltokens.y index dfd0d1659..48db2e221 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -399,6 +399,12 @@ NoEcho(' %token <i> PARSEOP_PIN_PULLDEFAULT %token <i> PARSEOP_PIN_PULLDOWN %token <i> PARSEOP_PIN_PULLUP +%token <i> PARSEOP_CLOCKINPUT +%token <i> PARSEOP_CLOCK_HZ +%token <i> PARSEOP_CLOCK_KHZ +%token <i> PARSEOP_CLOCK_MHZ +%token <i> PARSEOP_CLOCK_FIXED +%token <i> PARSEOP_CLOCK_VARIABLE %token <i> PARSEOP_POWERRESOURCE %token <i> PARSEOP_PROCESSOR %token <i> PARSEOP_QWORDCONST diff --git a/source/compiler/asltypes.y b/source/compiler/asltypes.y index bb0f0e9b4..d5f020d32 100644 --- a/source/compiler/asltypes.y +++ b/source/compiler/asltypes.y @@ -359,6 +359,8 @@ NoEcho(' %type <n> WireModeKeyword %type <n> XferSizeKeyword %type <n> XferTypeKeyword +%type <n> ClockScaleKeyword +%type <n> ClockModeKeyword /* Types */ @@ -411,6 +413,7 @@ NoEcho(' /* Resource Descriptors */ +%type <n> ClockInputTerm %type <n> ConnectionTerm %type <n> Csi2SerialBusTerm %type <n> DMATerm diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index e1dc3475c..644c8a99d 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -203,6 +203,7 @@ static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] = AcpiDmPinGroupDescriptor, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */ AcpiDmPinGroupFunctionDescriptor, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */ AcpiDmPinGroupConfigDescriptor, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */ + AcpiDmClockInputDescriptor, /* 0x13, ACPI_RESOURCE_NAME_CLOCK_INPUT */ }; diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index d21fd4e0c..1d732e21f 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -523,6 +523,46 @@ AcpiDmGpioDescriptor ( } } +void +AcpiDmClockInputDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level) +{ + char *DeviceName = NULL; + UINT8 *ResourceIndex = NULL; + AcpiDmIndent (Level); + + AcpiOsPrintf ("ClockInput ("); + + AcpiOsPrintf ("0x%8.8X, ", Resource->ClockInput.FrequencyNumerator); + + AcpiOsPrintf ("0x%4.4X, ", Resource->ClockInput.FrequencyDivisor); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ClockInputScale [ACPI_EXTRACT_2BIT_FLAG (Resource->ClockInput.Flags, 1)]); + + AcpiOsPrintf ("%s, ", + AcpiGbl_ClockInputMode [ACPI_GET_1BIT_FLAG (Resource->ClockInput.Flags)]); + + if (Length > sizeof(Resource->ClockInput)) + { + DeviceName = ACPI_ADD_PTR (char, + Resource, sizeof(Resource->ClockInput)+1), + AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX); + + AcpiOsPrintf (", "); + ResourceIndex = ACPI_ADD_PTR (UINT8, + Resource, sizeof(Resource->ClockInput)), + + AcpiOsPrintf ("0x%2.2X", *ResourceIndex); + } + + AcpiOsPrintf (")\n"); + +} + /******************************************************************************* * * FUNCTION: AcpiDmPinFunctionDescriptor diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c index a244ee32a..623364b10 100644 --- a/source/components/resources/rscalc.c +++ b/source/components/resources/rscalc.c @@ -480,6 +480,13 @@ AcpiRsGetAmlLength ( break; + case ACPI_RESOURCE_TYPE_CLOCK_INPUT: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + Resource->Data.ClockInput.ResourceSource.StringLength); + + break; + case ACPI_RESOURCE_TYPE_SERIAL_BUS: @@ -789,6 +796,12 @@ AcpiRsGetListLength ( break; + case ACPI_RESOURCE_NAME_CLOCK_INPUT: + ExtraStructBytes = AcpiRsStreamOptionLength ( + ResourceLength, MinimumAmlResourceLength); + + break; + default: break; diff --git a/source/components/resources/rsdumpinfo.c b/source/components/resources/rsdumpinfo.c index 42a5e33bb..f15b7b981 100644 --- a/source/components/resources/rsdumpinfo.c +++ b/source/components/resources/rsdumpinfo.c @@ -374,6 +374,17 @@ ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[10] = {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinFunction.VendorData), "VendorData", NULL}, }; +ACPI_RSDUMP_INFO AcpiRsDumpClockInput[7] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpClockInput), "ClockInput", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ClockInput.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (ClockInput.FrequencyNumerator), "FrequencyNumerator", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (ClockInput.FrequencyDivisor), "FrequencyDivisor", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ClockInput.Scale), "Scale", AcpiGbl_ClockInputScale}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ClockInput.Mode), "Mode", AcpiGbl_ClockInputMode}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ClockInput.ResourceSource), "ResourceSource", NULL}, +}; + ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[11] = { {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinConfig), "PinConfig", NULL}, diff --git a/source/components/resources/rsinfo.c b/source/components/resources/rsinfo.c index 976b7e7b3..551b647b7 100644 --- a/source/components/resources/rsinfo.c +++ b/source/components/resources/rsinfo.c @@ -197,6 +197,7 @@ ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[] = AcpiRsConvertPinGroup, /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */ AcpiRsConvertPinGroupFunction, /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ AcpiRsConvertPinGroupConfig, /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ + AcpiRsConvertClockInput, /* 0x19, ACPI_RESOURCE_TYPE_CLOCK_INPUT */ }; /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ @@ -243,6 +244,7 @@ ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[] = AcpiRsConvertPinGroup, /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */ AcpiRsConvertPinGroupFunction, /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */ AcpiRsConvertPinGroupConfig, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */ + AcpiRsConvertClockInput, /* 0x13, ACPI_RESOURCE_NAME_CLOCK_INPUT */ }; /* Subtype table for SerialBus -- I2C, SPI, UART, and CSI2 */ @@ -288,6 +290,7 @@ ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[] = AcpiRsDumpPinGroup, /* ACPI_RESOURCE_TYPE_PIN_GROUP */ AcpiRsDumpPinGroupFunction, /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ AcpiRsDumpPinGroupConfig, /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ + AcpiRsDumpClockInput, /* ACPI_RESOURCE_TYPE_CLOCK_INPUT */ }; ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[] = @@ -333,6 +336,7 @@ const UINT8 AcpiGbl_AmlResourceSizes[] = sizeof (AML_RESOURCE_PIN_GROUP), /* ACPI_RESOURCE_TYPE_PIN_GROUP */ sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */ sizeof (AML_RESOURCE_PIN_GROUP_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */ + sizeof (AML_RESOURCE_CLOCK_INPUT), /* ACPI_RESOURCE_TYPE_CLOCK_INPUT */ }; @@ -378,6 +382,7 @@ const UINT8 AcpiGbl_ResourceStructSizes[] = ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP), ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION), ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG), + ACPI_RS_SIZE (ACPI_RESOURCE_CLOCK_INPUT), }; const UINT8 AcpiGbl_AmlResourceSerialBusSizes[] = diff --git a/source/components/resources/rsserial.c b/source/components/resources/rsserial.c index 1b4b2180d..4c19f8908 100644 --- a/source/components/resources/rsserial.c +++ b/source/components/resources/rsserial.c @@ -256,6 +256,50 @@ ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] = /******************************************************************************* * + * AcpiRsConvertClockInput + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertClockInput[8] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_CLOCK_INPUT, + ACPI_RS_SIZE (ACPI_RESOURCE_CLOCK_INPUT), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertClockInput)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_CLOCK_INPUT, + sizeof (AML_RESOURCE_CLOCK_INPUT), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.ClockInput.RevisionId), + AML_OFFSET (ClockInput.RevisionId), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Mode), + AML_OFFSET (ClockInput.Flags), + 0}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Scale), + AML_OFFSET (ClockInput.Flags), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.ClockInput.FrequencyDivisor), + AML_OFFSET (ClockInput.FrequencyDivisor), + 2}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.ClockInput.FrequencyNumerator), + AML_OFFSET (ClockInput.FrequencyNumerator), + 4}, + + /* Resource Source */ + {ACPI_RSC_SOURCE, ACPI_RS_OFFSET (Data.ClockInput.ResourceSource), + 0, + sizeof(AML_RESOURCE_CLOCK_INPUT)}, + +}; + + +/******************************************************************************* + * * AcpiRsConvertPinfunction * ******************************************************************************/ diff --git a/source/components/utilities/utresdecode.c b/source/components/utilities/utresdecode.c index 3003925a9..667f12f8e 100644 --- a/source/components/utilities/utresdecode.c +++ b/source/components/utilities/utresdecode.c @@ -467,4 +467,17 @@ const char *AcpiGbl_PtypDecode[] = "Input Schmitt Trigger", }; +const char *AcpiGbl_ClockInputMode[] = +{ + "Fixed", + "Variable", +}; + +const char *AcpiGbl_ClockInputScale[] = +{ + "Hz", + "KHz", + "MHz", +}; + #endif diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c index 03e93be34..7898e9929 100644 --- a/source/components/utilities/utresrc.c +++ b/source/components/utilities/utresrc.c @@ -204,6 +204,8 @@ const UINT8 AcpiGbl_ResourceAmlSizes[] = ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP), ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_FUNCTION), ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_CONFIG), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_CLOCK_INPUT), + }; const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[] = @@ -264,6 +266,7 @@ static const UINT8 AcpiGbl_ResourceTypes[] = ACPI_VARIABLE_LENGTH, /* 10 PinGroup */ ACPI_VARIABLE_LENGTH, /* 11 PinGroupFunction */ ACPI_VARIABLE_LENGTH, /* 12 PinGroupConfig */ + ACPI_VARIABLE_LENGTH, /* 13 ClockInput */ }; diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index e8a559fda..32a8c818f 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -1339,6 +1339,12 @@ AcpiDmVendorCommon ( UINT32 Length, UINT32 Level); +void +AcpiDmClockInputDescriptor ( + ACPI_OP_WALK_INFO *Info, + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); /* * dmresrcs diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 08e18500d..9c090a07d 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -1452,7 +1452,8 @@ typedef struct acpi_port_info #define ACPI_RESOURCE_NAME_PIN_GROUP 0x90 #define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91 #define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92 -#define ACPI_RESOURCE_NAME_LARGE_MAX 0x92 +#define ACPI_RESOURCE_NAME_CLOCK_INPUT 0x93 +#define ACPI_RESOURCE_NAME_LARGE_MAX 0x94 /***************************************************************************** diff --git a/source/include/acresrc.h b/source/include/acresrc.h index 7d7fda538..85be65dc1 100644 --- a/source/include/acresrc.h +++ b/source/include/acresrc.h @@ -506,6 +506,7 @@ extern ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertClockInput[]; /* These resources require separate get/set tables */ @@ -562,6 +563,7 @@ extern ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[]; extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[]; extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[]; extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpClockInput[]; #endif #endif /* __ACRESRC_H__ */ diff --git a/source/include/acrestyp.h b/source/include/acrestyp.h index a8299fbc0..10e8ff89f 100644 --- a/source/include/acrestyp.h +++ b/source/include/acrestyp.h @@ -770,6 +770,16 @@ typedef struct acpi_resource_pin_config } ACPI_RESOURCE_PIN_CONFIG; +typedef struct acpi_resource_clock_input +{ + UINT8 RevisionId; + UINT8 Mode; + UINT8 Scale; + UINT16 FrequencyDivisor; + UINT32 FrequencyNumerator; + ACPI_RESOURCE_SOURCE ResourceSource; +} ACPI_RESOURCE_CLOCK_INPUT; + /* Values for PinConfigType field above */ #define ACPI_PIN_CONFIG_DEFAULT 0 @@ -853,7 +863,8 @@ typedef struct acpi_resource_pin_group_config #define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */ #define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */ #define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */ -#define ACPI_RESOURCE_TYPE_MAX 24 +#define ACPI_RESOURCE_TYPE_CLOCK_INPUT 25 /* ACPI 6.5 */ +#define ACPI_RESOURCE_TYPE_MAX 25 /* Master union for resource descriptors */ @@ -888,6 +899,7 @@ typedef union acpi_resource_data ACPI_RESOURCE_PIN_GROUP PinGroup; ACPI_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction; ACPI_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig; + ACPI_RESOURCE_CLOCK_INPUT ClockInput; /* Common fields */ diff --git a/source/include/actbl2.h b/source/include/actbl2.h index 43895b370..6dc2efd0c 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -236,7 +236,7 @@ typedef struct acpi_table_aest /* Common Subtable header - one per Node Structure (Subtable) */ -typedef struct acpi_aest_hdr +typedef struct acpi_aest_hdr { UINT8 Type; UINT16 Length; @@ -267,7 +267,7 @@ typedef struct acpi_aest_hdr /* 0: Processor Error */ -typedef struct acpi_aest_processor +typedef struct acpi_aest_processor { UINT32 ProcessorId; UINT8 ResourceType; @@ -287,7 +287,7 @@ typedef struct acpi_aest_processor /* 0R: Processor Cache Resource Substructure */ -typedef struct acpi_aest_processor_cache +typedef struct acpi_aest_processor_cache { UINT32 CacheReference; UINT32 Reserved; @@ -303,7 +303,7 @@ typedef struct acpi_aest_processor_cache /* 1R: Processor TLB Resource Substructure */ -typedef struct acpi_aest_processor_tlb +typedef struct acpi_aest_processor_tlb { UINT32 TlbLevel; UINT32 Reserved; @@ -312,7 +312,7 @@ typedef struct acpi_aest_processor_tlb /* 2R: Processor Generic Resource Substructure */ -typedef struct acpi_aest_processor_generic +typedef struct acpi_aest_processor_generic { UINT32 Resource; @@ -320,7 +320,7 @@ typedef struct acpi_aest_processor_generic /* 1: Memory Error */ -typedef struct acpi_aest_memory +typedef struct acpi_aest_memory { UINT32 SratProximityDomain; @@ -328,7 +328,7 @@ typedef struct acpi_aest_memory /* 2: Smmu Error */ -typedef struct acpi_aest_smmu +typedef struct acpi_aest_smmu { UINT32 IortNodeReference; UINT32 SubcomponentReference; @@ -337,7 +337,7 @@ typedef struct acpi_aest_smmu /* 3: Vendor Defined */ -typedef struct acpi_aest_vendor +typedef struct acpi_aest_vendor { UINT32 AcpiHid; UINT32 AcpiUid; @@ -347,7 +347,7 @@ typedef struct acpi_aest_vendor /* 4: Gic Error */ -typedef struct acpi_aest_gic +typedef struct acpi_aest_gic { UINT32 InterfaceType; UINT32 InstanceId; @@ -365,7 +365,7 @@ typedef struct acpi_aest_gic /* Node Interface Structure */ -typedef struct acpi_aest_node_interface +typedef struct acpi_aest_node_interface { UINT8 Type; UINT8 Reserved[3]; @@ -387,7 +387,7 @@ typedef struct acpi_aest_node_interface /* Node Interrupt Structure */ -typedef struct acpi_aest_node_interrupt +typedef struct acpi_aest_node_interrupt { UINT8 Type; UINT8 Reserved[2]; diff --git a/source/include/actypes.h b/source/include/actypes.h index 77fa92123..52d2d6dcf 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -1481,7 +1481,7 @@ typedef struct acpi_mem_space_context } ACPI_MEM_SPACE_CONTEXT; -typedef struct acpi_data_table_space_context +typedef struct acpi_data_table_mapping { void *Pointer; diff --git a/source/include/acutils.h b/source/include/acutils.h index e9e627499..bdca11c98 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -196,6 +196,8 @@ extern const char *AcpiGbl_SbDecode[]; extern const char *AcpiGbl_FcDecode[]; extern const char *AcpiGbl_PtDecode[]; extern const char *AcpiGbl_PtypDecode[]; +extern const char *AcpiGbl_ClockInputMode[]; +extern const char *AcpiGbl_ClockInputScale[]; #endif /* diff --git a/source/include/amlresrc.h b/source/include/amlresrc.h index 74cfafbf1..1ad70d171 100644 --- a/source/include/amlresrc.h +++ b/source/include/amlresrc.h @@ -213,6 +213,8 @@ #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ #define ACPI_RESTAG_VENDORDATA "_VEN" +#define ACPI_RESTAG_FQN "_FQN" +#define ACPI_RESTAG_FQD "_FQD" /* Default sizes for "small" resource descriptors */ @@ -703,6 +705,23 @@ typedef struct aml_resource_pin_config } AML_RESOURCE_PIN_CONFIG; +#define AML_RESOURCE_CLOCK_INPUT_REVISION 1 /* ACPI 6.5 */ + +typedef struct aml_resource_clock_input +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT16 Flags; + UINT16 FrequencyDivisor; + UINT32 FrequencyNumerator; + /* + * Optional fields follow immediately: + * 1) Resource Source index + * 2) Resource Source String + */ +} AML_RESOURCE_CLOCK_INPUT; + + #define AML_RESOURCE_PIN_CONFIG_REVISION 1 /* ACPI 6.2 */ typedef struct aml_resource_pin_group @@ -819,6 +838,7 @@ typedef union aml_resource AML_RESOURCE_PIN_GROUP PinGroup; AML_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction; AML_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig; + AML_RESOURCE_CLOCK_INPUT ClockInput; /* Utility overlays */ diff --git a/source/tools/acpisrc/asconvrt.c b/source/tools/acpisrc/asconvrt.c index ffa33aa22..ea97400a8 100644 --- a/source/tools/acpisrc/asconvrt.c +++ b/source/tools/acpisrc/asconvrt.c @@ -1618,6 +1618,8 @@ AsInsertPrefix ( int TrailingSpaces; char LowerKeyword[128]; int KeywordLength; + char *LineStart; + BOOLEAN FoundPrefix; switch (Type) @@ -1664,7 +1666,66 @@ AsInsertPrefix ( { /* Make sure the keyword isn't already prefixed with the insert */ - if (!strncmp (SubString - InsertLength, InsertString, InsertLength)) + /* We find the beginning of the line and try to find the InsertString + * from LineStart up to SubBuffer (our keyword). If it's not there, + * we assume it doesn't have a prefix; this is a limitation, as having + * a keyword on another line is absolutely valid C. + */ + + LineStart = SubString; + FoundPrefix = FALSE; + + /* Find the start of the line */ + + while (LineStart > Buffer) + { + if (*LineStart == '\n') + { + LineStart++; + break; + } + + LineStart--; + } + + /* Try to find InsertString from the start of the line up to SubBuffer */ + /* Note that this algorithm is a bit naive. */ + + while (SubBuffer > LineStart) + { + if (*LineStart != *InsertString) + { + LineStart++; + continue; + } + + if (strncmp (LineStart++, InsertString, InsertLength)) + { + continue; + } + + FoundPrefix = TRUE; + LineStart += InsertLength - 1; + + /* Now check if there's non-whitespace between InsertString and SubBuffer, as that + * means it's not a valid prefix in this case. */ + + while (LineStart != SubBuffer) + { + if (!strchr (" \t\r\n", *LineStart)) + { + /* We found non-whitespace while traversing up to SubBuffer, + * so this isn't a prefix. + */ + FoundPrefix = FALSE; + break; + } + + LineStart++; + } + } + + if (FoundPrefix) { /* Add spaces if not already at the end-of-line */ diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 92fa54bc6..f12ea3e2e 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -306,6 +306,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_CONVERSION_TABLE", SRC_TYPE_STRUCT}, {"ACPI_CPU_FLAGS", SRC_TYPE_SIMPLE}, {"ACPI_CREATE_FIELD_INFO", SRC_TYPE_STRUCT}, + {"ACPI_DATA_TABLE_MAPPING", SRC_TYPE_STRUCT}, {"ACPI_DB_ARGUMENT_INFO", SRC_TYPE_STRUCT}, {"ACPI_DB_COMMAND_HELP", SRC_TYPE_STRUCT}, {"ACPI_DB_COMMAND_INFO", SRC_TYPE_STRUCT}, @@ -339,6 +340,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_FIND_CONTEXT", SRC_TYPE_STRUCT}, {"ACPI_FIXED_EVENT_HANDLER", SRC_TYPE_STRUCT}, {"ACPI_FIXED_EVENT_INFO", SRC_TYPE_STRUCT}, + {"ACPI_FFH_INFO", SRC_TYPE_STRUCT}, {"ACPI_GBL_EVENT_HANDLER", SRC_TYPE_SIMPLE}, {"ACPI_GENERIC_ADDRESS", SRC_TYPE_STRUCT}, {"ACPI_GENERIC_STATE", SRC_TYPE_UNION}, @@ -373,6 +375,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_LPIT_HEADER", SRC_TYPE_STRUCT}, {"ACPI_LPIT_IO", SRC_TYPE_STRUCT}, {"ACPI_LPIT_NATIVE", SRC_TYPE_STRUCT}, + {"ACPI_MEM_MAPPING", SRC_TYPE_STRUCT}, {"ACPI_MEM_SPACE_CONTEXT", SRC_TYPE_STRUCT}, {"ACPI_MEMORY_ATTRIBUTE", SRC_TYPE_STRUCT}, {"ACPI_MEMORY_LIST", SRC_TYPE_STRUCT}, @@ -649,6 +652,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_TABLE_BGRT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_BOOT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_CCEL", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_CDAT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, {"ACPI_TABLE_CPEP", SRC_TYPE_STRUCT}, {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, @@ -959,6 +963,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"AH_ASL_KEYWORD", SRC_TYPE_STRUCT}, {"AH_DEVICE_ID", SRC_TYPE_STRUCT}, {"AH_PREDEFINED_NAME", SRC_TYPE_STRUCT}, + {"AH_TABLE", SRC_TYPE_STRUCT}, {"AH_UUID", SRC_TYPE_STRUCT}, /* AcpiXtract utility */ |