sq_tbbr.c 808 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2022, Socionext Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <plat/common/platform.h>
  7. extern char sq_rotpk_hash[], sq_rotpk_hash_end[];
  8. int plat_get_rotpk_info(void *cookie, void **key_ptr, unsigned int *key_len,
  9. unsigned int *flags)
  10. {
  11. *key_ptr = sq_rotpk_hash;
  12. *key_len = sq_rotpk_hash_end - sq_rotpk_hash;
  13. *flags = ROTPK_IS_HASH;
  14. return 0;
  15. }
  16. int plat_get_nv_ctr(void *cookie, unsigned int *nv_ctr)
  17. {
  18. /*
  19. * No support for non-volatile counter. Update the ROT key to protect
  20. * the system against rollback.
  21. */
  22. *nv_ctr = 0;
  23. return 0;
  24. }
  25. int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
  26. {
  27. return 0;
  28. }
  29. int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
  30. {
  31. return get_mbedtls_heap_helper(heap_addr, heap_size);
  32. }