1 /* 2 * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 8 #ifndef _BSV_OTP_API_H 9 #define _BSV_OTP_API_H 10 11 #ifdef __cplusplus 12 extern "C" 13 { 14 #endif 15 16 17 /*! @file 18 @brief This file contains functions that access the OTP memory for read and write operations. 19 \note This implementation can be replaced by the partner, depending on memory requirements. 20 */ 21 22 /*! 23 @brief This function retrieves a 32-bit OTP memory word from a given address. 24 25 @return CC_OK on success. 26 @return A non-zero value from bsv_error.h on failure. 27 */ 28 CCError_t CC_BsvOTPWordRead( 29 unsigned long hwBaseAddress, /*!< [in] CryptoCell HW registers' base address. */ 30 uint32_t otpAddress, /*!< [in] Word address in the OTP memory to read from. */ 31 uint32_t *pOtpWord /*!< [out] The OTP memory word's contents. */ 32 ); 33 34 35 /*! 36 @brief This function writes a 32-bit OTP memory word to a given address. Prior to writing, 37 the function reads the current value in the OTP memory word, and performs bit-wise OR to generate the expected value. 38 After writing, the word is read and compared to the expected value. 39 40 41 @return CC_OK on success. 42 @return A non-zero value from sbrom_bsv_error.h on failure. 43 */ 44 CCError_t CC_BsvOTPWordWrite( 45 unsigned long hwBaseAddress, /*!< [in] CryptoCell HW registers' base address. */ 46 uint32_t otpAddress, /*!< [in] Word address in the OTP memory to write to. */ 47 uint32_t otpWord /*!< [in] The OTP memory word's contents. */ 48 ); 49 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif 56 57 58 59