summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-08-13 22:52:19 +0300
committerSimon Glass <sjg@chromium.org>2023-08-21 00:55:27 +0300
commit25a9be71ec1ca779aac8bcb1d8a363725ff0ac7f (patch)
treeea63551e19d373bbbd1f7b9ca65a3da76392564e
parentddfda552e7f700d748aa46ab91ec6c661b018710 (diff)
downloadu-boot-25a9be71ec1ca779aac8bcb1d8a363725ff0ac7f.tar.xz
test: cpu: Handle both 32bit and 64bit CPUs
Handle both 32bit and 64bit systems, i.e. sandbox and sandbox64 the same way drivers/cpu/cpu_sandbox.c does, that is in case CONFIG_PHYS_64BIT is enabled, assume 64bit address width, else assume 32bit address width. This fixes ut_dm_dm_test_cpu test failure on sandbox64. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--test/dm/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/dm/cpu.c b/test/dm/cpu.c
index d7e596ee39..5734cd0a92 100644
--- a/test/dm/cpu.c
+++ b/test/dm/cpu.c
@@ -37,7 +37,7 @@ static int dm_test_cpu(struct unit_test_state *uts)
ut_assertok(cpu_get_info(dev, &info));
ut_asserteq(info.cpu_freq, 42 * 42 * 42 * 42 * 42);
ut_asserteq(info.features, 0x42424242);
- ut_asserteq(info.address_width, 32);
+ ut_asserteq(info.address_width, IS_ENABLED(CONFIG_PHYS_64BIT) ? 64 : 32);
ut_asserteq(cpu_get_count(dev), 42);