From ce76b8c8ac8d4b18e8e9fcd4f8c2d1396fc693bf Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 7 Sep 2022 18:25:08 +0000 Subject: [PATCH] On the Lenovo X13s the named components don't have the single mapping flag set, which we so far had expected to be there. This is allowed by the IORT spec. In that case simply make use of the first mapping if there is a single one. With feedback from and ok kettenis@ --- sys/arch/arm64/dev/acpiiort.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/arch/arm64/dev/acpiiort.c b/sys/arch/arm64/dev/acpiiort.c index d7003d6bc59..04c47e42ddd 100644 --- a/sys/arch/arm64/dev/acpiiort.c +++ b/sys/arch/arm64/dev/acpiiort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiiort.c,v 1.8 2022/08/31 23:31:35 patrick Exp $ */ +/* $OpenBSD: acpiiort.c,v 1.9 2022/09/07 18:25:08 patrick Exp $ */ /* * Copyright (c) 2021 Patrick Wildt * @@ -171,6 +171,16 @@ acpiiort_device_map(struct aml_node *root, bus_dma_tag_t dmat) } } + /* + * The IORT spec allows NCs to use implementation-defined IDs, whose + * interpretation is up to the device driver. For now simply take the + * mapping if there's a single one. This might change in the future. + */ + if (i >= node->number_of_mappings && node->number_of_mappings == 1) { + i = 0; + rid = map[i].output_base; + } + /* No mapping found? Even weirder. */ if (i >= node->number_of_mappings) return dmat; -- 2.20.1