acpi: Add IO Remapping Table structures

Input Output Remapping Table (IORT) represents the IO topology of an Arm
based system.

Document number: ARM DEN 0049E.e, Sep 2022

Change-Id: I4e8e3323caa714a56882939914cac510bf95d30b
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77884
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Naresh Solanki
2023-09-13 12:01:58 +02:00
committed by Lean Sheng Tan
parent 67b3c8f278
commit 6920c6f232
4 changed files with 144 additions and 0 deletions

View File

@@ -86,6 +86,12 @@ config ACPI_GTDT
help
Selected by platforms that implement ARM generic timers
config ACPI_IORT
def_bool n
depends on ARCH_ARM64 && HAVE_ACPI_TABLES
help
Selected by platforms that implement ARM IO Remap table.
config MAX_ACPI_TABLE_SIZE_KB
int
default 144

View File

@@ -14,6 +14,7 @@
*/
#include <acpi/acpi.h>
#include <acpi/acpi_iort.h>
#include <acpi/acpi_ivrs.h>
#include <acpi/acpigen.h>
#include <cbfs.h>
@@ -1194,6 +1195,26 @@ unsigned long acpi_gtdt_add_watchdog(unsigned long current, uint64_t refresh_fra
return current + sizeof(struct acpi_gtdt_watchdog);
}
static void acpi_create_iort(acpi_header_t *header, void *unused)
{
if (!CONFIG(ACPI_IORT))
return;
acpi_iort_t *iort = (acpi_iort_t *)header;
unsigned long current = (unsigned long)iort + sizeof(acpi_iort_t);
if (acpi_fill_header(header, "IORT", IORT, sizeof(acpi_iort_t)) != CB_SUCCESS)
return;
iort->node_count = 0;
iort->node_offset = current - (unsigned long)iort;
current = acpi_soc_fill_iort(iort, current);
/* (Re)calculate length */
header->length = current - (unsigned long)iort;
}
unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t uid)
{
memset(lpi_desc, 0, sizeof(acpi_lpi_desc_ncst_t));
@@ -1409,6 +1430,7 @@ unsigned long write_acpi_tables(const unsigned long start)
{ acpi_create_spcr, NULL, sizeof(acpi_spcr_t) },
{ acpi_create_gtdt, NULL, sizeof(acpi_gtdt_t) },
{ acpi_create_pptt, NULL, sizeof(acpi_pptt_t) },
{ acpi_create_iort, NULL, sizeof(acpi_iort_t) },
};
current = start;
@@ -1760,6 +1782,8 @@ int get_acpi_table_revision(enum acpi_tables table)
return 3;
case PPTT: /* ACPI 6.4 */
return 3;
case IORT: /* IO Remapping Table E.e */
return 6;
default:
return -1;
}