platform: add secure debug public key to the otp
The commit adds secure debug public key hash to the OTP
layout. The commit provides the implementation of reading
and writing the key from cc312 based OTP backend.
Change-Id: Ic130aa9a301c79d49d61ae3b2e7162772de17893
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
diff --git a/platform/ext/common/template/otp_flash.c b/platform/ext/common/template/otp_flash.c
index dc6a0b7..56ffce7 100644
--- a/platform/ext/common/template/otp_flash.c
+++ b/platform/ext/common/template/otp_flash.c
@@ -101,6 +101,9 @@
case PLAT_OTP_ID_ENTROPY_SEED:
return write_to_output(id, offsetof(struct flash_otp_nv_counters_region_t, entropy_seed), out_len, out);
+ case PLAT_OTP_ID_SECURE_DEBUG_PK:
+ return write_to_output(id, offsetof(struct flash_otp_nv_counters_region_t, secure_debug_pk), out_len, out);
+
default:
return TFM_PLAT_ERR_UNSUPPORTED;
}
@@ -200,6 +203,9 @@
case PLAT_OTP_ID_ENTROPY_SEED:
return read_from_input(id, offsetof(struct flash_otp_nv_counters_region_t, entropy_seed), in_len, in);
+ case PLAT_OTP_ID_SECURE_DEBUG_PK:
+ return read_from_input(id, offsetof(struct flash_otp_nv_counters_region_t, secure_debug_pk), in_len, in);
+
default:
return TFM_PLAT_ERR_UNSUPPORTED;
}
@@ -290,6 +296,10 @@
*size = sizeof(((struct flash_otp_nv_counters_region_t*)0)->entropy_seed);
break;
+ case PLAT_OTP_ID_SECURE_DEBUG_PK:
+ *size = sizeof(((struct flash_otp_nv_counters_region_t*)0)->secure_debug_pk);
+ break;
+
default:
return TFM_PLAT_ERR_UNSUPPORTED;
}