Skip to content

Commit ee64b82

Browse files
sudeep-hollarafaeljw
authored andcommitted
ACPICA: Add support for FFH Opregion special context data
ACPICA commit fad527b6e76babc7527c41325bfbef6bd1a1132b 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 op_region 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. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3598 # [1] Link: acpica/acpica@fad527b6 Signed-off-by: Sudeep Holla <[email protected]> Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent e92e4a4 commit ee64b82

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

drivers/acpi/acpica/evregion.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
172172
ctx->subspace_id = (u8)region_obj->region.address;
173173
}
174174

175+
if (region_obj->region.space_id ==
176+
ACPI_ADR_SPACE_FIXED_HARDWARE) {
177+
struct acpi_ffh_info *ctx =
178+
handler_desc->address_space.context;
179+
180+
ctx->length = region_obj->region.length;
181+
ctx->offset = region_obj->region.address;
182+
}
183+
175184
/*
176185
* We must exit the interpreter because the region setup will
177186
* potentially execute control methods (for example, the _REG method

drivers/acpi/acpica/exfield.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
141141
|| obj_desc->field.region_obj->region.space_id ==
142142
ACPI_ADR_SPACE_IPMI
143143
|| obj_desc->field.region_obj->region.space_id ==
144-
ACPI_ADR_SPACE_PLATFORM_RT)) {
144+
ACPI_ADR_SPACE_PLATFORM_RT
145+
|| obj_desc->field.region_obj->region.space_id ==
146+
ACPI_ADR_SPACE_FIXED_HARDWARE)) {
145147

146148
/* SMBus, GSBus, IPMI serial */
147149

@@ -305,7 +307,9 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
305307
|| obj_desc->field.region_obj->region.space_id ==
306308
ACPI_ADR_SPACE_IPMI
307309
|| obj_desc->field.region_obj->region.space_id ==
308-
ACPI_ADR_SPACE_PLATFORM_RT)) {
310+
ACPI_ADR_SPACE_PLATFORM_RT
311+
|| obj_desc->field.region_obj->region.space_id ==
312+
ACPI_ADR_SPACE_FIXED_HARDWARE)) {
309313

310314
/* SMBus, GSBus, IPMI serial */
311315

drivers/acpi/acpica/exserial.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
323323
function = ACPI_WRITE;
324324
break;
325325

326+
case ACPI_ADR_SPACE_FIXED_HARDWARE:
327+
328+
buffer_length = ACPI_FFH_INPUT_BUFFER_SIZE;
329+
function = ACPI_WRITE;
330+
break;
331+
326332
default:
327333
return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
328334
}

include/acpi/acconfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@
190190

191191
#define ACPI_PRM_INPUT_BUFFER_SIZE 26
192192

193+
#define ACPI_FFH_INPUT_BUFFER_SIZE 256
194+
193195
/* _sx_d and _sx_w control methods */
194196

195197
#define ACPI_NUM_sx_d_METHODS 4

include/acpi/actypes.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,13 @@ struct acpi_pcc_info {
11161116
u8 *internal_buffer;
11171117
};
11181118

1119+
/* Special Context data for FFH Opregion (ACPI 6.5) */
1120+
1121+
struct acpi_ffh_info {
1122+
u64 offset;
1123+
u64 length;
1124+
};
1125+
11191126
typedef
11201127
acpi_status (*acpi_adr_space_setup) (acpi_handle region_handle,
11211128
u32 function,

0 commit comments

Comments
 (0)