forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/block/opal_proto.h
....@@ -1,18 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Copyright © 2016 Intel Corporation
34 *
45 * Authors:
56 * Rafael Antognolli <rafael.antognolli@intel.com>
67 * Scott Bauer <scott.bauer@intel.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms and conditions of the GNU General Public License,
10
- * version 2, as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope it will be useful, but WITHOUT
13
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
- * more details.
168 */
179 #include <linux/types.h>
1810
....@@ -44,6 +36,7 @@
4436
4537 #define DTAERROR_NO_METHOD_STATUS 0x89
4638 #define GENERIC_HOST_SESSION_NUM 0x41
39
+#define FIRST_TPER_SESSION_NUM 4096
4740
4841 #define TPER_SYNC_SUPPORTED 0x01
4942 #define MBR_ENABLED_MASK 0x10
....@@ -84,7 +77,6 @@
8477 * Derived from: TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
8578 * Section: 6.3 Assigned UIDs
8679 */
87
-#define OPAL_UID_LENGTH 8
8880 #define OPAL_METHOD_LENGTH 8
8981 #define OPAL_MSID_KEYLEN 15
9082 #define OPAL_UID_LENGTH_HALF 4
....@@ -106,6 +98,7 @@
10698 OPAL_ENTERPRISE_BANDMASTER0_UID,
10799 OPAL_ENTERPRISE_ERASEMASTER_UID,
108100 /* tables */
101
+ OPAL_TABLE_TABLE,
109102 OPAL_LOCKINGRANGE_GLOBAL,
110103 OPAL_LOCKINGRANGE_ACE_RDLOCKED,
111104 OPAL_LOCKINGRANGE_ACE_WRLOCKED,
....@@ -115,6 +108,7 @@
115108 OPAL_C_PIN_TABLE,
116109 OPAL_LOCKING_INFO_TABLE,
117110 OPAL_ENTERPRISE_LOCKING_INFO_TABLE,
111
+ OPAL_DATASTORE,
118112 /* C_PIN_TABLE object ID's */
119113 OPAL_C_PIN_MSID,
120114 OPAL_C_PIN_SID,
....@@ -125,8 +119,6 @@
125119 /* omitted optional parameter */
126120 OPAL_UID_HEXFF,
127121 };
128
-
129
-#define OPAL_METHOD_LENGTH 8
130122
131123 /* Enum for indexing the OPALMETHOD array */
132124 enum opal_method {
....@@ -160,6 +152,20 @@
160152 OPAL_STARTCOLUMN = 0x03,
161153 OPAL_ENDCOLUMN = 0x04,
162154 OPAL_VALUES = 0x01,
155
+ /* table table */
156
+ OPAL_TABLE_UID = 0x00,
157
+ OPAL_TABLE_NAME = 0x01,
158
+ OPAL_TABLE_COMMON = 0x02,
159
+ OPAL_TABLE_TEMPLATE = 0x03,
160
+ OPAL_TABLE_KIND = 0x04,
161
+ OPAL_TABLE_COLUMN = 0x05,
162
+ OPAL_TABLE_COLUMNS = 0x06,
163
+ OPAL_TABLE_ROWS = 0x07,
164
+ OPAL_TABLE_ROWS_FREE = 0x08,
165
+ OPAL_TABLE_ROW_BYTES = 0x09,
166
+ OPAL_TABLE_LASTID = 0x0A,
167
+ OPAL_TABLE_MIN = 0x0B,
168
+ OPAL_TABLE_MAX = 0x0C,
163169 /* authority table */
164170 OPAL_PIN = 0x03,
165171 /* locking tokens */
....@@ -170,9 +176,11 @@
170176 OPAL_READLOCKED = 0x07,
171177 OPAL_WRITELOCKED = 0x08,
172178 OPAL_ACTIVEKEY = 0x0A,
179
+ /* lockingsp table */
180
+ OPAL_LIFECYCLE = 0x06,
173181 /* locking info table */
174182 OPAL_MAXRANGES = 0x04,
175
- /* mbr control */
183
+ /* mbr control */
176184 OPAL_MBRENABLE = 0x01,
177185 OPAL_MBRDONE = 0x02,
178186 /* properties */
....@@ -198,6 +206,10 @@
198206 OPAL_LOCKING_LOCKED = 0x03,
199207 };
200208
209
+enum opal_parameter {
210
+ OPAL_SUM_SET_LIST = 0x060000,
211
+};
212
+
201213 /* Packets derived from:
202214 * TCG_Storage_Architecture_Core_Spec_v2.01_r1.00
203215 * Secion: 3.2.3 ComPackets, Packets & Subpackets