xref: /rk3399_ARM-atf/plat/socionext/uniphier/uniphier_tbbr.c (revision 72db70ca184c0db10d920923288bc2f1e009e19f)
1d8e919c7SMasahiro Yamada /*
2*2374ab17SAmbroise Vincent  * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
3d8e919c7SMasahiro Yamada  *
4d8e919c7SMasahiro Yamada  * SPDX-License-Identifier: BSD-3-Clause
5d8e919c7SMasahiro Yamada  */
6d8e919c7SMasahiro Yamada 
709d40e0eSAntonio Nino Diaz #include <plat/common/platform.h>
8d8e919c7SMasahiro Yamada 
963634800SMasahiro Yamada extern char uniphier_rotpk_hash[], uniphier_rotpk_hash_end[];
1063634800SMasahiro Yamada 
plat_get_rotpk_info(void * cookie,void ** key_ptr,unsigned int * key_len,unsigned int * flags)11d8e919c7SMasahiro Yamada int plat_get_rotpk_info(void *cookie, void **key_ptr, unsigned int *key_len,
12d8e919c7SMasahiro Yamada 			unsigned int *flags)
13d8e919c7SMasahiro Yamada {
1463634800SMasahiro Yamada 	*key_ptr = uniphier_rotpk_hash;
1563634800SMasahiro Yamada 	*key_len = uniphier_rotpk_hash_end - uniphier_rotpk_hash;
1663634800SMasahiro Yamada 	*flags = ROTPK_IS_HASH;
17d8e919c7SMasahiro Yamada 
18d8e919c7SMasahiro Yamada 	return 0;
19d8e919c7SMasahiro Yamada }
20d8e919c7SMasahiro Yamada 
plat_get_nv_ctr(void * cookie,unsigned int * nv_ctr)21d8e919c7SMasahiro Yamada int plat_get_nv_ctr(void *cookie, unsigned int *nv_ctr)
22d8e919c7SMasahiro Yamada {
23d8e919c7SMasahiro Yamada 	/*
24d8e919c7SMasahiro Yamada 	 * No support for non-volatile counter.  Update the ROT key to protect
25d8e919c7SMasahiro Yamada 	 * the system against rollback.
26d8e919c7SMasahiro Yamada 	 */
27d8e919c7SMasahiro Yamada 	*nv_ctr = 0;
28d8e919c7SMasahiro Yamada 
29d8e919c7SMasahiro Yamada 	return 0;
30d8e919c7SMasahiro Yamada }
31d8e919c7SMasahiro Yamada 
plat_set_nv_ctr(void * cookie,unsigned int nv_ctr)32d8e919c7SMasahiro Yamada int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
33d8e919c7SMasahiro Yamada {
34d8e919c7SMasahiro Yamada 	return 0;
35d8e919c7SMasahiro Yamada }
36*2374ab17SAmbroise Vincent 
plat_get_mbedtls_heap(void ** heap_addr,size_t * heap_size)37*2374ab17SAmbroise Vincent int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
38*2374ab17SAmbroise Vincent {
39*2374ab17SAmbroise Vincent 	return get_mbedtls_heap_helper(heap_addr, heap_size);
40*2374ab17SAmbroise Vincent }
41