Browse Source

refactor(tc): print RSS interface test PSA status

Adding PSA status to print statement upon failing communication
initialization, non-volatile counter, and rotpk read interface calls in
platform_tests.

Change-Id: Ia949cc2d18e93efb68f663d0c4e5500ca9021a94
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
pull/2000/head
laurenw-arm 1 year ago
parent
commit
cb6b750505
  1. 14
      plat/arm/board/tc/nv_counter_test.c
  2. 4
      plat/arm/board/tc/rotpk_test.c

14
plat/arm/board/tc/nv_counter_test.c

@ -22,29 +22,29 @@ int nv_counter_test(void)
status = rss_comms_init(PLAT_RSS_AP_SND_MHU_BASE, PLAT_RSS_AP_RCV_MHU_BASE);
if (status != PSA_SUCCESS) {
printf("Failed to initialize RSS communication channel\n");
printf("Failed to initialize RSS communication channel - psa_status = %d\n", status);
return -1;
}
for (id = 0; id < 3; id++) {
status = rss_platform_nv_counter_read(id, sizeof(old_val), (uint8_t *)&old_val);
if (status != PSA_SUCCESS) {
printf("Failed during first id=(%d) rss_platform_nv_counter_read\n",
id);
printf("Failed during first id=(%d) rss_platform_nv_counter_read - psa_status = %d\n",
id, status);
return -1;
}
status = rss_platform_nv_counter_increment(id);
if (status != PSA_SUCCESS) {
printf("Failed during id=(%d) rss_platform_nv_counter_increment\n",
id);
printf("Failed during id=(%d) rss_platform_nv_counter_increment - psa_status = %d\n",
id, status);
return -1;
}
status = rss_platform_nv_counter_read(id, sizeof(new_val), (uint8_t *)&new_val);
if (status != PSA_SUCCESS) {
printf("Failed during second id=(%d) rss_platform_nv_counter_read\n",
id);
printf("Failed during second id=(%d) rss_platform_nv_counter_read - psa_status = %d\n",
id, status);
return -1;
}

4
plat/arm/board/tc/rotpk_test.c

@ -35,7 +35,7 @@ int rotpk_test(void)
status = rss_comms_init(PLAT_RSS_AP_SND_MHU_BASE, PLAT_RSS_AP_RCV_MHU_BASE);
if (status != PSA_SUCCESS) {
printf("Failed to initialize RSS communication channel\n");
printf("Failed to initialize RSS communication channel - psa_status = %d\n", status);
return -1;
}
@ -43,7 +43,7 @@ int rotpk_test(void)
status = rss_platform_key_read(key_ids[i].key_id, key_buf,
sizeof(key_buf), &key_size);
if (status != PSA_SUCCESS) {
printf("Failed to retrieve %s\n", key_ids[i].key_id_name);
printf("Failed to retrieve %s - psa_status = %d\n", key_ids[i].key_id_name, status);
return -1;
}
print_hex(key_ids[i].key_id_name, key_size, key_buf);

Loading…
Cancel
Save