feat(amd): add test for get reset status EEMI API
Add a test for the get reset status EEMI API within the TF-A test
framework. The test validates the functionality of the API to read the
device reset state.
Change-Id: I3f35e27eb25fc7d6bbb2b71b7c3e46db775420c8
Signed-off-by: Madhav Bhatt <madhav.bhatt@amd.com>
diff --git a/tftf/tests/plat/amd/common/common_files/eemi_api.c b/tftf/tests/plat/amd/common/common_files/eemi_api.c
index 1d95bc6..6fac33e 100644
--- a/tftf/tests/plat/amd/common/common_files/eemi_api.c
+++ b/tftf/tests/plat/amd/common/common_files/eemi_api.c
@@ -542,3 +542,14 @@
return eemi_call(PM_REQUEST_WAKEUP, ((uint64_t)set_address << 32 | node_id),
((uint64_t)ack << 32 | address), 0, 0, 0, 0, 0, ret_payload);
}
+
+int xpm_reset_get_status(const uint32_t reset_id, uint32_t *status)
+{
+ uint32_t ret_payload[PAYLOAD_ARG_CNT];
+ int32_t ret;
+
+ ret = eemi_call(PM_RESET_GET_STATUS, reset_id, 0, 0, 0, 0, 0, 0, ret_payload);
+ *status = ret_payload[1];
+
+ return ret;
+}
diff --git a/tftf/tests/plat/amd/common/common_files/eemi_api.h b/tftf/tests/plat/amd/common/common_files/eemi_api.h
index 5fb7b1f..8527a2e 100644
--- a/tftf/tests/plat/amd/common/common_files/eemi_api.h
+++ b/tftf/tests/plat/amd/common/common_files/eemi_api.h
@@ -105,5 +105,6 @@
int xpm_force_powerdown(const uint32_t node_id, const uint32_t ack);
int xpm_request_wakeup(const uint32_t node_id, const uint32_t set_address, const uint32_t address,
const uint32_t ack);
+int xpm_reset_get_status(const uint32_t reset_id, uint32_t *status);
#endif /* __EEMI_API_H__ */
diff --git a/tftf/tests/plat/amd/common/reset_get_status/reset_get_status.c b/tftf/tests/plat/amd/common/reset_get_status/reset_get_status.c
new file mode 100644
index 0000000..2db9e1b
--- /dev/null
+++ b/tftf/tests/plat/amd/common/reset_get_status/reset_get_status.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "eemi_api.h"
+#include "xpm_defs.h"
+#include "xpm_nodeid.h"
+
+/*
+ * This function reads the device reset state.
+ */
+test_result_t test_reset_get_status(void)
+{
+ int32_t status;
+ uint32_t result;
+ uint32_t reset_id = PM_RST_GEM_0;
+
+ status = xpm_reset_get_status(reset_id, &result);
+ if (status != PM_RET_SUCCESS) {
+ tftf_testcase_printf("%s ERROR getting reset status for reset_id: 0x%x, "
+ "Status: 0x%x\n", __func__, reset_id, status);
+ return TEST_RESULT_FAIL;
+ }
+
+ tftf_testcase_printf("State = %x\n", result);
+
+ return TEST_RESULT_SUCCESS;
+}
diff --git a/tftf/tests/tests-versal.xml b/tftf/tests/tests-versal.xml
index c18e558..28201e9 100644
--- a/tftf/tests/tests-versal.xml
+++ b/tftf/tests/tests-versal.xml
@@ -44,6 +44,8 @@
<testcase name="Query Data" function="test_query_data" />
<testcase name="Force Powerdown" function="test_force_powerdown" />
<testcase name="Request Wakeup" function="test_request_wake_up" />
+ <testcase name="Get Reset Status" function="test_reset_get_status" />
+
</testsuite>
</testsuites>