diff --git a/test_pool/peripherals/operating_system/test_os_d003.c b/test_pool/peripherals/operating_system/test_os_d003.c index 317a50ab..cbd62778 100644 --- a/test_pool/peripherals/operating_system/test_os_d003.c +++ b/test_pool/peripherals/operating_system/test_os_d003.c @@ -22,6 +22,7 @@ #include "val/common/include/acs_peripherals.h" #include "val/common/include/acs_gic.h" +#include "val/common/sys_arch_src/gic/v3/gic_v3.h" #define TEST_NUM (ACS_PER_TEST_NUM_BASE + 3) #define TEST_RULE "B_PER_05" @@ -206,9 +207,17 @@ payload1() /* PASS will be set from ISR */ val_set_status(index, RESULT_PENDING(TEST_NUM1)); + /* Check int_id is SPI or ESPI */ + if (!(IsSpi(int_id)) && !(val_gic_is_valid_espi(int_id))) { + val_print(ACS_PRINT_ERR, "\n Interrupt-%d is neither SPI nor ESPI", int_id); + val_set_status(index, RESULT_FAIL(TEST_NUM1, 2)); + return; + } + + /* Install ISR */ if (val_gic_install_isr(int_id, isr)) { val_print(ACS_PRINT_ERR, "\n GIC Install Handler Failed...", 0); - val_set_status(index, RESULT_FAIL(TEST_NUM1, 2)); + val_set_status(index, RESULT_FAIL(TEST_NUM1, 3)); return; } @@ -234,7 +243,7 @@ payload1() } if (test_fail) - val_set_status(index, RESULT_FAIL(TEST_NUM1, 3)); + val_set_status(index, RESULT_FAIL(TEST_NUM1, 4)); else val_set_status(index, RESULT_PASS(TEST_NUM1, 2)); diff --git a/test_pool/timer/operating_system/test_os_t004.c b/test_pool/timer/operating_system/test_os_t004.c index 73237a15..7c66e8ac 100644 --- a/test_pool/timer/operating_system/test_os_t004.c +++ b/test_pool/timer/operating_system/test_os_t004.c @@ -20,6 +20,8 @@ #include "val/common/include/acs_timer.h" #include "val/bsa/include/bsa_acs_wakeup.h" +#include "val/common/include/acs_gic.h" +#include "val/common/sys_arch_src/gic/v3/gic_v3.h" #define TEST_NUM (ACS_TIMER_TEST_NUM_BASE + 4) #define TEST_RULE "B_TIME_08" @@ -84,11 +86,19 @@ payload() return; } - /* Install ISR */ intid = val_timer_get_info(TIMER_INFO_SYS_INTID, timer_num); + + /* Check intid is SPI or ESPI */ + if (!(IsSpi(intid)) && !(val_gic_is_valid_espi(intid))) { + val_print(ACS_PRINT_ERR, "\n Interrupt-%d is neither SPI nor ESPI", intid); + val_set_status(index, RESULT_FAIL(TEST_NUM, 1)); + return; + } + + /* Install ISR */ if (val_gic_install_isr(intid, isr)) { val_print(ACS_PRINT_ERR, "\n GIC Install Handler Failed...", 0); - val_set_status(index, RESULT_FAIL(TEST_NUM, 1)); + val_set_status(index, RESULT_FAIL(TEST_NUM, 2)); return; } @@ -100,7 +110,7 @@ payload() if (timeout == 0) { val_print(ACS_PRINT_ERR, "\n Sys timer interrupt not received on %d ", intid); - val_set_status(index, RESULT_FAIL(TEST_NUM, 2)); + val_set_status(index, RESULT_FAIL(TEST_NUM, 3)); return; } } diff --git a/test_pool/watchdog/operating_system/test_os_w002.c b/test_pool/watchdog/operating_system/test_os_w002.c index f72e1c96..87996134 100644 --- a/test_pool/watchdog/operating_system/test_os_w002.c +++ b/test_pool/watchdog/operating_system/test_os_w002.c @@ -19,6 +19,9 @@ #include "val/common/include/acs_val.h" #include "val/bsa/include/bsa_val_interface.h" +#include "val/common/include/acs_gic.h" +#include "val/common/sys_arch_src/gic/v3/gic_v3.h" + #include "val/common/include/acs_wd.h" #define TEST_NUM (ACS_WD_TEST_NUM_BASE + 2) @@ -72,9 +75,17 @@ payload() int_id = val_wd_get_info(wd_num, WD_INFO_GSIV); val_print(ACS_PRINT_DEBUG, "\n WS0 Interrupt id %d ", int_id); + /* Check intid is SPI or ESPI */ + if (!(IsSpi(int_id)) && !(val_gic_is_valid_espi(int_id))) { + val_print(ACS_PRINT_ERR, "\n Interrupt-%d is neither SPI nor ESPI", int_id); + val_set_status(index, RESULT_FAIL(TEST_NUM, 2)); + return; + } + + /* Install ISR */ if (val_gic_install_isr(int_id, isr)) { val_print(ACS_PRINT_ERR, "\n GIC Install Handler Failed...", 0); - val_set_status(index, RESULT_FAIL(TEST_NUM, 2)); + val_set_status(index, RESULT_FAIL(TEST_NUM, 3)); return; } @@ -87,7 +98,7 @@ payload() status = val_wd_set_ws0(wd_num, timer_expire_ticks); if (status) { val_print(ACS_PRINT_ERR, "\n Setting watchdog timeout failed", 0); - val_set_status(index, RESULT_FAIL(TEST_NUM, 3)); + val_set_status(index, RESULT_FAIL(TEST_NUM, 4)); return; } @@ -95,7 +106,7 @@ payload() if (timeout == 0) { val_print(ACS_PRINT_ERR, "\n WS0 Interrupt not received on %d ", int_id); - val_set_status(index, RESULT_FAIL(TEST_NUM, 4)); + val_set_status(index, RESULT_FAIL(TEST_NUM, 5)); return; } @@ -104,7 +115,7 @@ payload() if (!ns_wdg) { if (g_build_sbsa) { val_print(ACS_PRINT_ERR, "\n No non-secure Watchdogs reported", 0); - val_set_status(index, RESULT_FAIL(TEST_NUM, 5)); + val_set_status(index, RESULT_FAIL(TEST_NUM, 6)); } else { val_print(ACS_PRINT_WARN, "\n No non-secure Watchdogs reported", 0); val_set_status(index, RESULT_SKIP(TEST_NUM, 3)); diff --git a/val/common/sys_arch_src/gic/v3/gic_v3.c b/val/common/sys_arch_src/gic/v3/gic_v3.c index c57e69d5..21e300d1 100644 --- a/val/common/sys_arch_src/gic/v3/gic_v3.c +++ b/val/common/sys_arch_src/gic/v3/gic_v3.c @@ -28,7 +28,7 @@ @param int id @return true if SPI **/ -static uint32_t +uint32_t IsSpi(uint32_t int_id) { if (int_id >= 32 && int_id < 1020) diff --git a/val/common/sys_arch_src/gic/v3/gic_v3.h b/val/common/sys_arch_src/gic/v3/gic_v3.h index 76ef67ef..5d7d0d28 100644 --- a/val/common/sys_arch_src/gic/v3/gic_v3.h +++ b/val/common/sys_arch_src/gic/v3/gic_v3.h @@ -39,6 +39,7 @@ void v3_EndofInterrupt(uint32_t int_id); uint32_t v3_read_gicdTyper(void); uint64_t v3_get_pe_gicr_base(void); uint64_t v3_read_gicr_typer(void); +uint32_t IsSpi(uint32_t int_id); uint32_t v3_is_extended_spi(uint32_t int_id); uint32_t v3_is_extended_ppi(uint32_t int_id);