xref: /optee_os/lib/libutee/include/k3/otp_keywriting_ta.h (revision c6d054ebe21bb4031ada86bcbbb81a5aa679f6e2)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Texas Instruments System Control Interface Driver
4  *
5  * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
6  *	Manorit Chawdhry <m-chawdhry@ti.com>
7  */
8 
9 #ifndef __K3_OTP_KEYWRITING_TA_H__
10 #define __K3_OTP_KEYWRITING_TA_H__
11 
12 /* UUID of the trusted application */
13 #define PTA_K3_OTP_KEYWRITING_UUID \
14 	{ 0xacc50f40, 0x0613, 0x4abd, \
15 		{ 0x8d, 0xfe, 0xa9, 0x64, 0xcb, 0x74, 0xeb, 0x69} }
16 
17 #define PTA_K3_OTP_KEYWRITING_NAME "pta_k3_otp.ta"
18 
19 /*
20  * TA_OTP_KEYWRITING_CMD_READ_MMR - Read an extended OTP bit
21  * param[0] (value/input)  32-bit MMR index
22  * param[1] (value/output) OTP value written in efuse
23  * param[2] unused
24  * param[3] unused
25  */
26 #define TA_OTP_KEYWRITING_CMD_READ_MMR		0
27 
28 /*
29  * TA_OTP_KEYWRITING_CMD_WRITE_ROW - Write into extended OTP row
30  * param[0] (value/input) Row index
31  * param[1].a (value/input) Value to be written
32  * param[1].b (value/input) Mask for the value
33  * param[2] unused
34  * param[3] unused
35  */
36 #define TA_OTP_KEYWRITING_CMD_WRITE_ROW		1
37 
38 /*
39  * TA_OTP_KEYWRITING_CMD_LOCK_ROW - Lock an extended OTP row
40  * param[0].a (value/input) Row index
41  * param[0].b (value/input)
42  *	BIT(0) - soft_lock
43  *	BIT(1) - hw_read_lock
44  *	BIT(2) - hw_write_lock
45  * param[1] unused
46  * param[2] unused
47  * param[3] unused
48  */
49 #define TA_OTP_KEYWRITING_CMD_LOCK_ROW		2
50 
51 #define K3_OTP_KEYWRITING_SOFT_LOCK		BIT(0)
52 #define K3_OTP_KEYWRITING_HW_READ_LOCK		BIT(1)
53 #define K3_OTP_KEYWRITING_HW_WRITE_LOCK		BIT(2)
54 
55 #endif /* __K3_OTP_KEYWRITING_TA_H__ */
56