Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/baremetal/acs.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ extern uint32_t g_acs_tests_fail;
extern uint64_t g_stack_pointer;
extern uint64_t g_exception_ret_addr;
extern uint64_t g_ret_addr;
extern uint32_t g_wakeup_timeout;
extern bool g_pcie_skip_dp_nic_ms;
extern uint32_t g_build_sbsa;
extern uint32_t g_build_pcbsa;
Expand Down
1 change: 0 additions & 1 deletion apps/baremetal/acs_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ uint32_t g_enable_module;
uint32_t g_acs_tests_total;
uint32_t g_acs_tests_pass;
uint32_t g_acs_tests_fail;
uint32_t g_wakeup_timeout;
uint32_t g_build_sbsa = 0;
uint32_t g_build_pcbsa = 0;
uint32_t g_its_init = 0;
Expand Down
4 changes: 1 addition & 3 deletions apps/baremetal/bsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ uint32_t apply_user_config_and_defaults(void)
g_skip_modules = g_skip_modules_arr;
}

/* Set default values for g_print_mmio and g_wakeup_timeout */
/* Set default values for g_print_mmio */
g_print_mmio = 0;
g_wakeup_timeout = 1;

/* If selected rule count is zero, default to BSA */
if (g_rule_count == 0) {
/* Standalone BSA Baremetal app, set g_arch_selection to BSA */
Expand Down
3 changes: 1 addition & 2 deletions apps/baremetal/pc_bsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ apply_user_config_and_defaults(void)
g_skip_modules = g_skip_modules_arr;
}

/* Set default values for g_print_mmio and g_wakeup_timeout */
/* Set default values for g_print_mmio */
g_print_mmio = 0;
g_wakeup_timeout = 1;

/* If selected rule count is zero, default to PCBSA */
if (g_rule_count == 0) {
Expand Down
3 changes: 1 addition & 2 deletions apps/baremetal/sbsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ uint32_t apply_user_config_and_defaults(void)
g_skip_modules = g_skip_modules_arr;
}

/* Set default values for g_print_mmio, g_wakeup_timeout */
/* Set default values for g_print_mmio */
g_print_mmio = 0;
g_wakeup_timeout = 1;

/* If selected rule count is zero, default to SBSA */
if (g_rule_count == 0) {
Expand Down
5 changes: 3 additions & 2 deletions apps/uefi/acs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2016-2025, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2016-2026, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0

* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -152,7 +152,8 @@ extern UINT32 g_num_skip;
extern UINT64 g_stack_pointer;
extern UINT64 g_exception_ret_addr;
extern UINT64 g_ret_addr;
extern UINT32 g_wakeup_timeout;
extern UINT32 g_timeout_pass;
extern UINT32 g_timeout_fail;
extern UINT32 g_build_sbsa;
extern UINT32 g_build_pcbsa;
extern UINT32 g_print_mmio;
Expand Down
5 changes: 3 additions & 2 deletions apps/uefi/acs_globals.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0

* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -32,7 +32,8 @@ UINT32 g_num_skip;
UINT64 g_stack_pointer;
UINT64 g_exception_ret_addr;
UINT64 g_ret_addr;
UINT32 g_wakeup_timeout;
UINT32 g_timeout_pass;
UINT32 g_timeout_fail;

/* Following g_build_* is retained to have compatibility with tests which use it, and used pass
on -a selection hint to tests */
Expand Down
46 changes: 40 additions & 6 deletions apps/uefi/acs_helpers.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0

* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -548,12 +548,46 @@ command_init (void)
/* Parse -timeout */
CmdLineArg = ShellCommandLineGetValue (ParamPackage, L"-timeout");
if (CmdLineArg == NULL) {
g_wakeup_timeout = 1;
g_timeout_pass = WAKEUP_WD_PASS_TIMEOUT_DEFAULT;
g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER;
} else {
g_wakeup_timeout = StrDecimalToUintn(CmdLineArg);
Print(L"Wakeup timeout multiple %d.\n", g_wakeup_timeout);
if (g_wakeup_timeout > 5)
g_wakeup_timeout = 5;
/* Accept a single value; ignore any trailing delimiters */
CHAR16 buf[64];
UINTN len = StrLen(CmdLineArg);
UINTN i;

if (len >= (sizeof(buf) / sizeof(buf[0])))
len = (sizeof(buf) / sizeof(buf[0])) - 1;

for (i = 0; i < len; i++) {
buf[i] = CmdLineArg[i];
}
buf[i] = L'\0';

if (i == 0) {
Print(L"Invalid -timeout: provide a timeout value\n");
return SHELL_INVALID_PARAMETER;
}

/* trim leading/trailing spaces */
while (buf[0] == L' ' || buf[0] == L'\t') {
for (i = 0; buf[i] != L'\0'; i++) buf[i] = buf[i + 1];
}
i = StrLen(buf);
while (i > 0 && (buf[i - 1] == L' ' || buf[i - 1] == L'\t')) {
buf[i - 1] = L'\0';
i--;
}

g_timeout_pass = (UINT32)StrDecimalToUintn(buf);
g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER;
if (!(g_timeout_pass >= WAKEUP_WD_PASS_TIMEOUT_THRESHOLD &&
g_timeout_pass <= WAKEUP_WD_PASS_TIMEOUT_MAX_THRESHOLD)) {
Print(L"Invalid -timeout: pass timeout range should be within 500ms and 2sec\n");
return SHELL_INVALID_PARAMETER;
}

Print(L"Timeouts (us): PASS=%d, FAIL=%d\n", g_timeout_pass, g_timeout_fail);
}

/* Parse verbosity level */
Expand Down
4 changes: 2 additions & 2 deletions apps/uefi/bsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ HelpMsg (VOID)
" Skip the specified modules (comma-separated names).\n"
" Example: -skipmodule PE,GIC,PCIE\n"
"-timeout <n> \n"
" Set timeout multiple for wakeup tests\n"
" 1 - min value 5 - max value, Defaults to 1 \n"
" Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n"
" Example: -timeout 2000 \n"
"-v <n> Verbosity of the prints\n"
" 1 prints all, 5 prints only the errors\n");
}
Expand Down
56 changes: 46 additions & 10 deletions apps/uefi/mem_test_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ UINT32 g_acs_tests_fail;
UINT64 g_stack_pointer;
UINT64 g_exception_ret_addr;
UINT64 g_ret_addr;
UINT32 g_wakeup_timeout;
UINT32 g_timeout_pass;
UINT32 g_timeout_fail;
UINT32 g_build_sbsa = 0;
UINT32 g_build_pcbsa = 0;
UINT32 g_print_mmio;
Expand Down Expand Up @@ -100,8 +101,9 @@ HelpMsg (
"-no_crypto_ext Pass this flag if cryptography extension not supported due to export restrictions\n"
"-p2p Pass this flag to indicate that PCIe Hierarchy Supports Peer-to-Peer\n"
"-cache Pass this flag to indicate that if the test system supports PCIe address translation cache\n"
"-timeout Set timeout multiple for wakeup tests\n"
" 1 - min value 5 - max value\n"
"-timeout <n> \n"
" Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n"
" Example: -timeout 2000 \n"
"-os Enable the execution of operating system tests\n"
"-hyp Enable the execution of hypervisor tests\n"
"-ps Enable the execution of platform security tests\n"
Expand Down Expand Up @@ -204,16 +206,50 @@ command_init ()
}
}

// Options with Values
/* Parse -timeout */
CmdLineArg = ShellCommandLineGetValue (ParamPackage, L"-timeout");
if (CmdLineArg == NULL) {
g_wakeup_timeout = 1;
g_timeout_pass = WAKEUP_WD_PASS_TIMEOUT_DEFAULT;
g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER;
} else {
g_wakeup_timeout = StrDecimalToUintn(CmdLineArg);
Print(L"Wakeup timeout multiple %d.\n", g_wakeup_timeout);
if (g_wakeup_timeout > 5)
g_wakeup_timeout = 5;
}
/* Accept a single value; ignore any trailing delimiters */
CHAR16 buf[64];
UINTN len = StrLen(CmdLineArg);
UINTN i;

if (len >= (sizeof(buf) / sizeof(buf[0])))
len = (sizeof(buf) / sizeof(buf[0])) - 1;

for (i = 0; i < len; i++) {
buf[i] = CmdLineArg[i];
}
buf[i] = L'\0';

if (i == 0) {
Print(L"Invalid -timeout: provide a timeout value\n");
return SHELL_INVALID_PARAMETER;
}

/* trim leading/trailing spaces */
while (buf[0] == L' ' || buf[0] == L'\t') {
for (i = 0; buf[i] != L'\0'; i++) buf[i] = buf[i + 1];
}
i = StrLen(buf);
while (i > 0 && (buf[i - 1] == L' ' || buf[i - 1] == L'\t')) {
buf[i - 1] = L'\0';
i--;
}

g_timeout_pass = (UINT32)StrDecimalToUintn(buf);
g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER;
if (!(g_timeout_pass >= WAKEUP_WD_PASS_TIMEOUT_THRESHOLD &&
g_timeout_pass <= WAKEUP_WD_PASS_TIMEOUT_MAX_THRESHOLD)) {
Print(L"Invalid -timeout: pass timeout range should be within 500ms and 2sec\n");
return SHELL_INVALID_PARAMETER;
}

Print(L"Timeouts (us): PASS=%d, FAIL=%d\n", g_timeout_pass, g_timeout_fail);
}

// Options with Values
CmdLineArg = ShellCommandLineGetValue (ParamPackage, L"-v");
Expand Down
4 changes: 2 additions & 2 deletions apps/uefi/pc_bsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ HelpMsg (VOID)
" Skip the specified modules (comma-separated names).\n"
" Example: -skipmodule PE,GIC,PCIE\n"
"-timeout <n> \n"
" Set timeout multiple for wakeup tests\n"
" 1 - min value 5 - max value, Defaults to 1 \n"
" Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n"
" Example: -timeout 2000 \n"
"-v <n> Verbosity of the prints\n"
" 1 prints all, 5 prints only the errors\n");
}
Expand Down
4 changes: 2 additions & 2 deletions apps/uefi/sbsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ HelpMsg (VOID)
"-slc Provide system last level cache type\n"
" 1 - PPTT PE-side cache, 2 - HMAT mem-side cache\n"
"-timeout <n> \n"
" Set timeout multiple for wakeup tests\n"
" 1 - min value 5 - max value, Defaults to 1 \n"
" Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n"
" Example: -timeout 2000 \n"
"-v <n> Verbosity of the prints\n"
" 1 prints all, 5 prints only the errors\n");
}
Expand Down
7 changes: 4 additions & 3 deletions apps/uefi/sbsa_nist_main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0

* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -315,8 +315,9 @@ HelpMsg (
"-no_crypto_ext Pass this flag if cryptography extension not supported due to export restrictions\n"
"-p2p Pass this flag to indicate that PCIe Hierarchy Supports Peer-to-Peer\n"
"-cache Pass this flag to indicate that if the test system supports PCIe address translation cache\n"
"-timeout Set timeout multiple for wakeup tests\n"
" 1 - min value 5 - max value\n"
"-timeout <n> \n"
" Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n"
" Example: -timeout 2000 \n"
"-slc Provide system last level cache type\n"
" 1 - PPTT PE-side cache, 2 - HMAT mem-side cache\n"
" defaults to 0, if not set depicting SLC type unknown\n"
Expand Down
4 changes: 2 additions & 2 deletions apps/uefi/vbsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ HelpMsg (VOID)
"-skip-dp-nic-ms \n"
" Skip PCIe tests for DisplayPort, Network, Mass Storage devices and Unclassified devices\n"
"-timeout <n> \n"
" Set timeout multiple for wakeup tests\n"
" 1 - min value 5 - max value, Defaults to 1 \n"
" Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n"
" Example: -timeout 2000 \n"
"-v <n> Verbosity of the prints\n"
" 1 prints all, 5 prints only the errors\n");
}
Expand Down
4 changes: 2 additions & 2 deletions apps/uefi/xbsa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ HelpMsg (VOID)
" Skip the specified modules (comma-separated names).\n"
" Example: -skipmodule PE,GIC,PCIE\n"
"-timeout <n> \n"
" Set timeout multiple for wakeup tests\n"
" 1 - min value 5 - max value, Defaults to 1 \n"
" Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n"
" Example: -timeout 2000 \n"
"-v <n> Verbosity of the prints\n"
" 1 prints all, 5 prints only the errors\n"
);
Expand Down
10 changes: 9 additions & 1 deletion pal/baremetal/target/RDN2/include/platform_override_fvp.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,15 @@

#define PLATFORM_OVERRIDE_MAX_SID 24

#define PLATFORM_OVERRIDE_TIMEOUT 0
/* TIMEOUT should be in Microsecond 5us to 2 sec */
#define PLATFORM_OVERRIDE_TIMEOUT 1000 /* time out for DUT */

/* FAIL safe timeout (> PLATFORM_OVERRIDE_TIMEOUT) */
#define PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT (PLATFORM_OVERRIDE_TIMEOUT * 2)

/*Max timeout set for systimer*/
#define PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX 0xFFFFFFFF

/* Define the Timeout values to be used */
#define PLATFORM_BM_OVERRIDE_TIMEOUT_LARGE 0x10000
#define PLATFORM_BM_OVERRIDE_TIMEOUT_MEDIUM 0x1000
Expand Down
3 changes: 3 additions & 0 deletions pal/baremetal/target/RDN2/src/platform_cfg_fvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ uint32_t g_level_filter_mode = LVL_FILTER_MAX; /* Default set to LVL_FILTER_MAX
*/
uint32_t g_sys_last_lvl_cache = PLATFORM_OVERRRIDE_SLC;

uint32_t g_timeout_pass = PLATFORM_OVERRIDE_TIMEOUT;
uint32_t g_timeout_fail = PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT;

PE_SMBIOS_PROCESSOR_INFO_TABLE platform_smbios_cfg = {
.slot_count = PLATFORM_OVERRIDE_SMBIOS_SLOT_COUNT,

Expand Down
9 changes: 8 additions & 1 deletion pal/baremetal/target/RDV3/include/platform_override_fvp.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,14 @@
// This value is arbitrary and may have to be adjusted
#define PLATFORM_BM_OVERRIDE_MAX_IRQ_CNT 0xFFFF /* Max IRQs any device may raise */

#define PLATFORM_OVERRIDE_TIMEOUT 0 /* Override default wakeup timeout */
/* TIMEOUT should be in Microsecond 5us to 2 sec */
#define PLATFORM_OVERRIDE_TIMEOUT 1000 /* time out for DUT */

/* FAIL safe timeout (> PLATFORM_OVERRIDE_TIMEOUT) */
#define PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT (PLATFORM_OVERRIDE_TIMEOUT * 2)

/*Max timeout set for systimer*/
#define PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX 0xFFFFFFFF

/* Generic timeout helpers for bare-metal tests */
#define PLATFORM_BM_OVERRIDE_TIMEOUT_LARGE 0x10000
Expand Down
3 changes: 3 additions & 0 deletions pal/baremetal/target/RDV3/src/platform_cfg_fvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ uint32_t g_level_filter_mode = LVL_FILTER_MAX; /* Default set to LVL_FILTER_MAX
*/
uint32_t g_sys_last_lvl_cache = PLATFORM_OVERRRIDE_SLC;

uint32_t g_timeout_pass = PLATFORM_OVERRIDE_TIMEOUT;
uint32_t g_timeout_fail = PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT;

PE_SMBIOS_PROCESSOR_INFO_TABLE platform_smbios_cfg = {
.slot_count = PLATFORM_OVERRIDE_SMBIOS_SLOT_COUNT,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,14 @@
// This value is arbitrary and may have to be adjusted
#define PLATFORM_BM_OVERRIDE_MAX_IRQ_CNT 0xFFFF /* Max IRQs any device may raise */

#define PLATFORM_OVERRIDE_TIMEOUT 0 /* Override default wakeup timeout */
/* TIMEOUT should be in Microsecond 5us to 2 sec */
#define PLATFORM_OVERRIDE_TIMEOUT 1000 /* time out for DUT */

/* FAIL safe timeout (> PLATFORM_OVERRIDE_TIMEOUT) */
#define PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT (PLATFORM_OVERRIDE_TIMEOUT * 2)

/*Max timeout set for systimer*/
#define PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX 0xFFFFFFFF

/* Generic timeout helpers for bare-metal tests */
#define PLATFORM_BM_OVERRIDE_TIMEOUT_LARGE 0x10000
Expand Down
3 changes: 3 additions & 0 deletions pal/baremetal/target/RDV3CFG1/src/platform_cfg_fvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ uint32_t g_level_filter_mode = LVL_FILTER_MAX; /* Default set to LVL_FILTER_MAX
*/
uint32_t g_sys_last_lvl_cache = PLATFORM_OVERRRIDE_SLC;

uint32_t g_timeout_pass = PLATFORM_OVERRIDE_TIMEOUT;
uint32_t g_timeout_fail = PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT;

PE_SMBIOS_PROCESSOR_INFO_TABLE platform_smbios_cfg = {
.slot_count = PLATFORM_OVERRIDE_SMBIOS_SLOT_COUNT,

Expand Down
5 changes: 4 additions & 1 deletion pal/include/platform_override.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @file
* Copyright (c) 2022-2025, Arm Limited or its affiliates. All rights reserved.
* Copyright (c) 2022-2026, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0

* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -72,5 +72,8 @@
/* Size used to Map the SMMU Register Space, if not mapped */
#define PLATFORM_OVERRIDE_SMMU_MAP_SIZE 0x20000 //2*64 KB

/*Max timeout set for systimer*/
#define PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX 0xFFFFFFFF

extern UINT32 g_pcie_p2p;
extern UINT32 g_pcie_cache_present;
Loading