summaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-04-08 16:57:38 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-04-16 14:36:28 +0800
commit91fe8b79f6912ab7622169bc1673e2df222e0b57 (patch)
treeca9baeb3b60980b85c1982b8c3b0f22100987816 /test/dm
parent89c2798f1f2f690cdd269e38ef386ff720435816 (diff)
acpi: Add a central location for table version numbers
Each ACPI table has its own version number. Add the version numbers in a single function so we can keep them consistent and easily see what versions are supported. Start a new acpi_table file in a generic directory to house this function. We can move things over to this file from x86 as needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/acpi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dm/acpi.c b/test/dm/acpi.c
index 3677cdd0cc..85c846b0d7 100644
--- a/test/dm/acpi.c
+++ b/test/dm/acpi.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <dm.h>
+#include <acpi/acpi_table.h>
#include <dm/acpi.h>
#include <dm/test.h>
#include <test/ut.h>
@@ -53,3 +54,16 @@ static int dm_test_acpi_get_name(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_acpi_get_name, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test acpi_get_table_revision() */
+static int dm_test_acpi_get_table_revision(struct unit_test_state *uts)
+{
+ ut_asserteq(1, acpi_get_table_revision(ACPITAB_MCFG));
+ ut_asserteq(2, acpi_get_table_revision(ACPITAB_RSDP));
+ ut_asserteq(4, acpi_get_table_revision(ACPITAB_TPM2));
+ ut_asserteq(-EINVAL, acpi_get_table_revision(ACPITAB_COUNT));
+
+ return 0;
+}
+DM_TEST(dm_test_acpi_get_table_revision,
+ DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);