1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _RUN_INTEGRATION_PAL_OTP_H_
8 #define _RUN_INTEGRATION_PAL_OTP_H_
9 
10 /************************************************************
11  *
12  * macros
13  *
14  ************************************************************/
15 /** Write OTP value */
16 #define RUNIT_WRITE_OTP(wordOffset, val) { \
17                 volatile uint32_t ii1; \
18                 (*(volatile uint32_t *)(processMap.processTeeHwEnvBaseAddr + RUNIT_ENV_OTP_START_OFFSET+ ((wordOffset)*sizeof(uint32_t)))) = (uint32_t)(val); \
19                 for(ii1=0; ii1<500; ii1++);\
20 }
21 
22 /** Read OTP value */
23 #define RUNIT_READ_OTP(wordOffset) \
24                 *(volatile uint32_t *)(processMap.processTeeHwEnvBaseAddr + RUNIT_ENV_OTP_START_OFFSET + ((wordOffset)*sizeof(uint32_t)))
25 
26 #endif //_RUN_INTEGRATION_PAL_OTP_H_
27