diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-05-09 16:10:35 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-05-11 19:28:59 +0000 |
commit | 5a82f0d3a9124c2c7603cb971f3d4e9eb4a74246 (patch) | |
tree | fd11cac06529cae82ecf9035eac3e9621b1ff3a8 | |
parent | 5d71a5aabb8a47a9f6d559391f16a93e5d5edd72 (diff) | |
download | coreboot-5a82f0d3a9124c2c7603cb971f3d4e9eb4a74246.tar.gz |
acpi/acpigen: add acpigen_resource_bus_number to generate bus number
Add the acpigen_resource_bus_number helper function to generate a bus
number range resource.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: Ib1f1da3dbe823c6bc4fc30c0622653410cfbf301
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75043
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
-rw-r--r-- | src/acpi/acpigen.c | 14 | ||||
-rw-r--r-- | src/include/acpi/acpigen.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 6f6e85a571..8d25114e13 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -2237,6 +2237,20 @@ void acpigen_resource_qword(u16 res_type, u16 gen_flags, u16 type_flags, u64 gra acpigen_emit_qword(length); } +void acpigen_resource_bus_number(u16 bus_base, u16 bus_limit) +{ + acpigen_resource_word(RSRC_TYPE_BUS, /* res_type */ + ADDR_SPACE_GENERAL_FLAG_MAX_FIXED + | ADDR_SPACE_GENERAL_FLAG_MIN_FIXED + | ADDR_SPACE_GENERAL_FLAG_DEC_POS, /* gen_flags */ + BUS_NUM_RANGE_RESOURCE_FLAG, /* type_flags */ + 0, /* gran */ + bus_base, /* range_min */ + bus_limit, /* range_max */ + 0x0, /* translation */ + bus_limit - bus_base + 1); /* length */ +} + void acpigen_write_ADR(uint64_t adr) { acpigen_write_name_qword("_ADR", adr); diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index 1b60006656..efd26e4d84 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -693,6 +693,8 @@ void acpigen_resource_dword(u16 res_type, u16 gen_flags, u16 type_flags, void acpigen_resource_qword(u16 res_type, u16 gen_flags, u16 type_flags, u64 gran, u64 range_min, u64 range_max, u64 translation, u64 length); +void acpigen_resource_bus_number(u16 bus_base, u16 bus_limit); + /* Emits Notify(namestr, value) */ void acpigen_notify(const char *namestr, int value); |