Skip to content

Commit

Permalink
PJ03164-2280 : Remove LPI as valid option
Browse files Browse the repository at this point in the history
-The tests now has check Spi and Espi interrupt
-The test will fail if the interrupt is LPI or PPI

Signed-off-by: Ajayswar S <[email protected]>
Change-Id: Ib083f3fb82753f7ec3060454ef2e5251392dd130
  • Loading branch information
ajayswar-s committed Aug 2, 2024
1 parent b46c39f commit 00f8f62
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
13 changes: 11 additions & 2 deletions test_pool/peripherals/operating_system/test_os_d003.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}

Expand All @@ -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));

Expand Down
16 changes: 13 additions & 3 deletions test_pool/timer/operating_system/test_os_t004.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}
}
Expand Down
19 changes: 15 additions & 4 deletions test_pool/watchdog/operating_system/test_os_w002.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand All @@ -87,15 +98,15 @@ 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;
}

while ((--timeout > 0) && (IS_RESULT_PENDING(val_get_status(index))));

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;
}

Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion val/common/sys_arch_src/gic/v3/gic_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions val/common/sys_arch_src/gic/v3/gic_v3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 00f8f62

Please sign in to comment.