1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright 2019 Broadcom.
4  */
5 
6 #ifndef BCM_SOTP_H
7 #define BCM_SOTP_H
8 
9 #include <stdint.h>
10 #include <tee_api.h>
11 
12 #define SOTP_ECC_ERR_DETECT	BIT64(63)
13 
14 /**
15  * Reads from sotp fuse at given row address.
16  * @row_addr: row address
17  * @sotp_add_ecc: ecc memory support flag
18  * @rdata: pointer to sotp data value
19  * @returns TEE_Result value
20  */
21 TEE_Result bcm_iproc_sotp_mem_read(uint32_t row_addr, bool sotp_add_ecc,
22 				   uint64_t *rdata);
23 
24 /**
25  * Writes to sotp fuse at given row address.
26  * @row_addr: row address
27  * @sotp_add_ecc: ecc memory support flag
28  * @wdata: data to be written to sotp fuse
29  * @returns TEE_Result value
30  */
31 TEE_Result bcm_iproc_sotp_mem_write(uint32_t row_addr, bool sotp_add_ecc,
32 				    uint64_t wdata);
33 
34 #endif
35