diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2022-06-15 11:15:14 +0100 |
---|---|---|
committer | Sudeep Holla <sudeep.holla@arm.com> | 2022-06-22 14:21:40 +0100 |
commit | fad527b6e76babc7527c41325bfbef6bd1a1132b (patch) | |
tree | 90bf643d752fba6ef220ada2350256c897c1d14b | |
parent | 883f1249188621155ab4acbe0e1faa7fc4957b98 (diff) | |
download | acpica-fad527b6e76babc7527c41325bfbef6bd1a1132b.tar.gz |
Add support for FFH Opregion special context data
FFH(Fixed Function Hardware) Opregion is approved to be added in ACPI 6.5 via
code first approach[1]. It requires special context data similar to GPIO and
Generic Serial Bus as it needs to know platform specific offset and length.
Add support for the special context data needed by FFH Opregion.
FFH OpRegion enables advanced use of FFH on some architectures. For example,
it could be used to easily proxy AML code to architecture-specific behavior
(to ensure it is OS initiated)
Actual behavior of FFH is ofcourse architecture specific and depends on
the FFH bindings. The offset and length could have arch specific meaning
or usage.
[1] https://bugzilla.tianocore.org/show_bug.cgi?id=3598
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r-- | source/components/events/evregion.c | 8 | ||||
-rw-r--r-- | source/components/executer/exfield.c | 6 | ||||
-rw-r--r-- | source/components/executer/exserial.c | 6 | ||||
-rw-r--r-- | source/include/acconfig.h | 2 | ||||
-rw-r--r-- | source/include/actypes.h | 6 |
5 files changed, 26 insertions, 2 deletions
diff --git a/source/components/events/evregion.c b/source/components/events/evregion.c index 6cf77791f..fb0cc4361 100644 --- a/source/components/events/evregion.c +++ b/source/components/events/evregion.c @@ -329,6 +329,14 @@ AcpiEvAddressSpaceDispatch ( Ctx->SubspaceId = (UINT8) RegionObj->Region.Address; } + if (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE) + { + ACPI_FFH_INFO *Ctx = HandlerDesc->AddressSpace.Context; + + Ctx->Length = RegionObj->Region.Length; + Ctx->Offset = RegionObj->Region.Address; + } + /* * We must exit the interpreter because the region setup will * potentially execute control methods (for example, the _REG method diff --git a/source/components/executer/exfield.c b/source/components/executer/exfield.c index 2834e7b38..4175b8eed 100644 --- a/source/components/executer/exfield.c +++ b/source/components/executer/exfield.c @@ -296,7 +296,8 @@ AcpiExReadDataFromField ( (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI || - ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT)) + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)) { /* SMBus, GSBus, IPMI serial */ @@ -469,7 +470,8 @@ AcpiExWriteDataToField ( (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI || - ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT)) + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)) { /* SMBus, GSBus, IPMI serial */ diff --git a/source/components/executer/exserial.c b/source/components/executer/exserial.c index 4dfd65992..c92a895ad 100644 --- a/source/components/executer/exserial.c +++ b/source/components/executer/exserial.c @@ -484,6 +484,12 @@ AcpiExWriteSerialBus ( Function = ACPI_WRITE; break; + case ACPI_ADR_SPACE_FIXED_HARDWARE: + + BufferLength = ACPI_FFH_INPUT_BUFFER_SIZE; + Function = ACPI_WRITE; + break; + default: return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); } diff --git a/source/include/acconfig.h b/source/include/acconfig.h index 8ba7dc284..04f7f4f0c 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -335,6 +335,8 @@ #define ACPI_PRM_INPUT_BUFFER_SIZE 26 +#define ACPI_FFH_INPUT_BUFFER_SIZE 256 + /* _SxD and _SxW control methods */ #define ACPI_NUM_SxD_METHODS 4 diff --git a/source/include/actypes.h b/source/include/actypes.h index fff6c1659..92da002ab 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -1336,6 +1336,12 @@ typedef struct acpi_pcc_info { UINT8 *InternalBuffer; } ACPI_PCC_INFO; +/* Special Context data for FFH Opregion (ACPI 6.5) */ + +typedef struct acpi_ffh_info { + UINT64 Offset; + UINT64 Length; +} ACPI_FFH_INFO; typedef ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) ( |