desc.h 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * CAAM descriptor composition header
  4. * Definitions to support CAAM descriptor instruction generation
  5. *
  6. * Copyright 2008-2011 Freescale Semiconductor, Inc.
  7. */
  8. #ifndef DESC_H
  9. #define DESC_H
  10. /*
  11. * 16-byte hardware scatter/gather table
  12. * An 8-byte table exists in the hardware spec, but has never been
  13. * implemented to date. The 8/16 option is selected at RTL-compile-time.
  14. * and this selection is visible in the Compile Time Parameters Register
  15. */
  16. #define SEC4_SG_LEN_EXT 0x80000000 /* Entry points to table */
  17. #define SEC4_SG_LEN_FIN 0x40000000 /* Last ent in table */
  18. #define SEC4_SG_BPID_MASK 0x000000ff
  19. #define SEC4_SG_BPID_SHIFT 16
  20. #define SEC4_SG_LEN_MASK 0x3fffffff /* Excludes EXT and FINAL */
  21. #define SEC4_SG_OFFSET_MASK 0x00001fff
  22. /* Max size of any CAAM descriptor in 32-bit words, inclusive of header */
  23. #define MAX_CAAM_DESCSIZE 64
  24. /* Block size of any entity covered/uncovered with a KEK/TKEK */
  25. #define KEK_BLOCKSIZE 16
  26. /*
  27. * Supported descriptor command types as they show up
  28. * inside a descriptor command word.
  29. */
  30. #define CMD_SHIFT 27
  31. #define CMD_MASK 0xf8000000
  32. #define CMD_KEY (0x00 << CMD_SHIFT)
  33. #define CMD_SEQ_KEY (0x01 << CMD_SHIFT)
  34. #define CMD_LOAD (0x02 << CMD_SHIFT)
  35. #define CMD_SEQ_LOAD (0x03 << CMD_SHIFT)
  36. #define CMD_FIFO_LOAD (0x04 << CMD_SHIFT)
  37. #define CMD_SEQ_FIFO_LOAD (0x05 << CMD_SHIFT)
  38. #define CMD_STORE (0x0a << CMD_SHIFT)
  39. #define CMD_SEQ_STORE (0x0b << CMD_SHIFT)
  40. #define CMD_FIFO_STORE (0x0c << CMD_SHIFT)
  41. #define CMD_SEQ_FIFO_STORE (0x0d << CMD_SHIFT)
  42. #define CMD_MOVE_LEN (0x0e << CMD_SHIFT)
  43. #define CMD_MOVE (0x0f << CMD_SHIFT)
  44. #define CMD_OPERATION (0x10 << CMD_SHIFT)
  45. #define CMD_SIGNATURE (0x12 << CMD_SHIFT)
  46. #define CMD_JUMP (0x14 << CMD_SHIFT)
  47. #define CMD_MATH (0x15 << CMD_SHIFT)
  48. #define CMD_DESC_HDR (0x16 << CMD_SHIFT)
  49. #define CMD_SHARED_DESC_HDR (0x17 << CMD_SHIFT)
  50. #define CMD_SEQ_IN_PTR (0x1e << CMD_SHIFT)
  51. #define CMD_SEQ_OUT_PTR (0x1f << CMD_SHIFT)
  52. /* General-purpose class selector for all commands */
  53. #define CLASS_SHIFT 25
  54. #define CLASS_MASK (0x03 << CLASS_SHIFT)
  55. #define CLASS_NONE (0x00 << CLASS_SHIFT)
  56. #define CLASS_1 (0x01 << CLASS_SHIFT)
  57. #define CLASS_2 (0x02 << CLASS_SHIFT)
  58. #define CLASS_BOTH (0x03 << CLASS_SHIFT)
  59. /*
  60. * Descriptor header command constructs
  61. * Covers shared, job, and trusted descriptor headers
  62. */
  63. /*
  64. * Do Not Run - marks a descriptor inexecutable if there was
  65. * a preceding error somewhere
  66. */
  67. #define HDR_DNR 0x01000000
  68. /*
  69. * ONE - should always be set. Combination of ONE (always
  70. * set) and ZRO (always clear) forms an endianness sanity check
  71. */
  72. #define HDR_ONE 0x00800000
  73. #define HDR_ZRO 0x00008000
  74. /* Start Index or SharedDesc Length */
  75. #define HDR_START_IDX_SHIFT 16
  76. #define HDR_START_IDX_MASK (0x3f << HDR_START_IDX_SHIFT)
  77. /* If shared descriptor header, 6-bit length */
  78. #define HDR_DESCLEN_SHR_MASK 0x3f
  79. /* If non-shared header, 7-bit length */
  80. #define HDR_DESCLEN_MASK 0x7f
  81. /* This is a TrustedDesc (if not SharedDesc) */
  82. #define HDR_TRUSTED 0x00004000
  83. /* Make into TrustedDesc (if not SharedDesc) */
  84. #define HDR_MAKE_TRUSTED 0x00002000
  85. /* Save context if self-shared (if SharedDesc) */
  86. #define HDR_SAVECTX 0x00001000
  87. /* Next item points to SharedDesc */
  88. #define HDR_SHARED 0x00001000
  89. /*
  90. * Reverse Execution Order - execute JobDesc first, then
  91. * execute SharedDesc (normally SharedDesc goes first).
  92. */
  93. #define HDR_REVERSE 0x00000800
  94. /* Propogate DNR property to SharedDesc */
  95. #define HDR_PROP_DNR 0x00000800
  96. /* JobDesc/SharedDesc share property */
  97. #define HDR_SD_SHARE_SHIFT 8
  98. #define HDR_SD_SHARE_MASK (0x03 << HDR_SD_SHARE_SHIFT)
  99. #define HDR_JD_SHARE_SHIFT 8
  100. #define HDR_JD_SHARE_MASK (0x07 << HDR_JD_SHARE_SHIFT)
  101. #define HDR_SHARE_NEVER (0x00 << HDR_SD_SHARE_SHIFT)
  102. #define HDR_SHARE_WAIT (0x01 << HDR_SD_SHARE_SHIFT)
  103. #define HDR_SHARE_SERIAL (0x02 << HDR_SD_SHARE_SHIFT)
  104. #define HDR_SHARE_ALWAYS (0x03 << HDR_SD_SHARE_SHIFT)
  105. #define HDR_SHARE_DEFER (0x04 << HDR_SD_SHARE_SHIFT)
  106. /* JobDesc/SharedDesc descriptor length */
  107. #define HDR_JD_LENGTH_MASK 0x7f
  108. #define HDR_SD_LENGTH_MASK 0x3f
  109. /*
  110. * KEY/SEQ_KEY Command Constructs
  111. */
  112. /* Key Destination Class: 01 = Class 1, 02 - Class 2 */
  113. #define KEY_DEST_CLASS_SHIFT 25 /* use CLASS_1 or CLASS_2 */
  114. #define KEY_DEST_CLASS_MASK (0x03 << KEY_DEST_CLASS_SHIFT)
  115. /* Scatter-Gather Table/Variable Length Field */
  116. #define KEY_SGF 0x01000000
  117. #define KEY_VLF 0x01000000
  118. /* Immediate - Key follows command in the descriptor */
  119. #define KEY_IMM 0x00800000
  120. /*
  121. * Encrypted - Key is encrypted either with the KEK, or
  122. * with the TDKEK if TK is set
  123. */
  124. #define KEY_ENC 0x00400000
  125. /*
  126. * No Write Back - Do not allow key to be FIFO STOREd
  127. */
  128. #define KEY_NWB 0x00200000
  129. /*
  130. * Enhanced Encryption of Key
  131. */
  132. #define KEY_EKT 0x00100000
  133. /*
  134. * Encrypted with Trusted Key
  135. */
  136. #define KEY_TK 0x00008000
  137. /*
  138. * KDEST - Key Destination: 0 - class key register,
  139. * 1 - PKHA 'e', 2 - AFHA Sbox, 3 - MDHA split-key
  140. */
  141. #define KEY_DEST_SHIFT 16
  142. #define KEY_DEST_MASK (0x03 << KEY_DEST_SHIFT)
  143. #define KEY_DEST_CLASS_REG (0x00 << KEY_DEST_SHIFT)
  144. #define KEY_DEST_PKHA_E (0x01 << KEY_DEST_SHIFT)
  145. #define KEY_DEST_AFHA_SBOX (0x02 << KEY_DEST_SHIFT)
  146. #define KEY_DEST_MDHA_SPLIT (0x03 << KEY_DEST_SHIFT)
  147. /* Length in bytes */
  148. #define KEY_LENGTH_MASK 0x000003ff
  149. /*
  150. * LOAD/SEQ_LOAD/STORE/SEQ_STORE Command Constructs
  151. */
  152. /*
  153. * Load/Store Destination: 0 = class independent CCB,
  154. * 1 = class 1 CCB, 2 = class 2 CCB, 3 = DECO
  155. */
  156. #define LDST_CLASS_SHIFT 25
  157. #define LDST_CLASS_MASK (0x03 << LDST_CLASS_SHIFT)
  158. #define LDST_CLASS_IND_CCB (0x00 << LDST_CLASS_SHIFT)
  159. #define LDST_CLASS_1_CCB (0x01 << LDST_CLASS_SHIFT)
  160. #define LDST_CLASS_2_CCB (0x02 << LDST_CLASS_SHIFT)
  161. #define LDST_CLASS_DECO (0x03 << LDST_CLASS_SHIFT)
  162. /* Scatter-Gather Table/Variable Length Field */
  163. #define LDST_SGF 0x01000000
  164. #define LDST_VLF LDST_SGF
  165. /* Immediate - Key follows this command in descriptor */
  166. #define LDST_IMM_MASK 1
  167. #define LDST_IMM_SHIFT 23
  168. #define LDST_IMM (LDST_IMM_MASK << LDST_IMM_SHIFT)
  169. /* SRC/DST - Destination for LOAD, Source for STORE */
  170. #define LDST_SRCDST_SHIFT 16
  171. #define LDST_SRCDST_MASK (0x7f << LDST_SRCDST_SHIFT)
  172. #define LDST_SRCDST_BYTE_CONTEXT (0x20 << LDST_SRCDST_SHIFT)
  173. #define LDST_SRCDST_BYTE_KEY (0x40 << LDST_SRCDST_SHIFT)
  174. #define LDST_SRCDST_BYTE_INFIFO (0x7c << LDST_SRCDST_SHIFT)
  175. #define LDST_SRCDST_BYTE_OUTFIFO (0x7e << LDST_SRCDST_SHIFT)
  176. #define LDST_SRCDST_WORD_MODE_REG (0x00 << LDST_SRCDST_SHIFT)
  177. #define LDST_SRCDST_WORD_KEYSZ_REG (0x01 << LDST_SRCDST_SHIFT)
  178. #define LDST_SRCDST_WORD_DATASZ_REG (0x02 << LDST_SRCDST_SHIFT)
  179. #define LDST_SRCDST_WORD_ICVSZ_REG (0x03 << LDST_SRCDST_SHIFT)
  180. #define LDST_SRCDST_WORD_CHACTRL (0x06 << LDST_SRCDST_SHIFT)
  181. #define LDST_SRCDST_WORD_DECOCTRL (0x06 << LDST_SRCDST_SHIFT)
  182. #define LDST_SRCDST_WORD_IRQCTRL (0x07 << LDST_SRCDST_SHIFT)
  183. #define LDST_SRCDST_WORD_DECO_PCLOVRD (0x07 << LDST_SRCDST_SHIFT)
  184. #define LDST_SRCDST_WORD_CLRW (0x08 << LDST_SRCDST_SHIFT)
  185. #define LDST_SRCDST_WORD_DECO_MATH0 (0x08 << LDST_SRCDST_SHIFT)
  186. #define LDST_SRCDST_WORD_STAT (0x09 << LDST_SRCDST_SHIFT)
  187. #define LDST_SRCDST_WORD_DECO_MATH1 (0x09 << LDST_SRCDST_SHIFT)
  188. #define LDST_SRCDST_WORD_DECO_MATH2 (0x0a << LDST_SRCDST_SHIFT)
  189. #define LDST_SRCDST_WORD_DECO_AAD_SZ (0x0b << LDST_SRCDST_SHIFT)
  190. #define LDST_SRCDST_WORD_DECO_MATH3 (0x0b << LDST_SRCDST_SHIFT)
  191. #define LDST_SRCDST_WORD_CLASS1_IV_SZ (0x0c << LDST_SRCDST_SHIFT)
  192. #define LDST_SRCDST_WORD_ALTDS_CLASS1 (0x0f << LDST_SRCDST_SHIFT)
  193. #define LDST_SRCDST_WORD_PKHA_A_SZ (0x10 << LDST_SRCDST_SHIFT)
  194. #define LDST_SRCDST_WORD_PKHA_B_SZ (0x11 << LDST_SRCDST_SHIFT)
  195. #define LDST_SRCDST_WORD_PKHA_N_SZ (0x12 << LDST_SRCDST_SHIFT)
  196. #define LDST_SRCDST_WORD_PKHA_E_SZ (0x13 << LDST_SRCDST_SHIFT)
  197. #define LDST_SRCDST_WORD_CLASS_CTX (0x20 << LDST_SRCDST_SHIFT)
  198. #define LDST_SRCDST_WORD_DESCBUF (0x40 << LDST_SRCDST_SHIFT)
  199. #define LDST_SRCDST_WORD_DESCBUF_JOB (0x41 << LDST_SRCDST_SHIFT)
  200. #define LDST_SRCDST_WORD_DESCBUF_SHARED (0x42 << LDST_SRCDST_SHIFT)
  201. #define LDST_SRCDST_WORD_DESCBUF_JOB_WE (0x45 << LDST_SRCDST_SHIFT)
  202. #define LDST_SRCDST_WORD_DESCBUF_SHARED_WE (0x46 << LDST_SRCDST_SHIFT)
  203. #define LDST_SRCDST_WORD_INFO_FIFO (0x7a << LDST_SRCDST_SHIFT)
  204. /* Offset in source/destination */
  205. #define LDST_OFFSET_SHIFT 8
  206. #define LDST_OFFSET_MASK (0xff << LDST_OFFSET_SHIFT)
  207. /* LDOFF definitions used when DST = LDST_SRCDST_WORD_DECOCTRL */
  208. /* These could also be shifted by LDST_OFFSET_SHIFT - this reads better */
  209. #define LDOFF_CHG_SHARE_SHIFT 0
  210. #define LDOFF_CHG_SHARE_MASK (0x3 << LDOFF_CHG_SHARE_SHIFT)
  211. #define LDOFF_CHG_SHARE_NEVER (0x1 << LDOFF_CHG_SHARE_SHIFT)
  212. #define LDOFF_CHG_SHARE_OK_PROP (0x2 << LDOFF_CHG_SHARE_SHIFT)
  213. #define LDOFF_CHG_SHARE_OK_NO_PROP (0x3 << LDOFF_CHG_SHARE_SHIFT)
  214. #define LDOFF_ENABLE_AUTO_NFIFO (1 << 2)
  215. #define LDOFF_DISABLE_AUTO_NFIFO (1 << 3)
  216. #define LDOFF_CHG_NONSEQLIODN_SHIFT 4
  217. #define LDOFF_CHG_NONSEQLIODN_MASK (0x3 << LDOFF_CHG_NONSEQLIODN_SHIFT)
  218. #define LDOFF_CHG_NONSEQLIODN_SEQ (0x1 << LDOFF_CHG_NONSEQLIODN_SHIFT)
  219. #define LDOFF_CHG_NONSEQLIODN_NON_SEQ (0x2 << LDOFF_CHG_NONSEQLIODN_SHIFT)
  220. #define LDOFF_CHG_NONSEQLIODN_TRUSTED (0x3 << LDOFF_CHG_NONSEQLIODN_SHIFT)
  221. #define LDOFF_CHG_SEQLIODN_SHIFT 6
  222. #define LDOFF_CHG_SEQLIODN_MASK (0x3 << LDOFF_CHG_SEQLIODN_SHIFT)
  223. #define LDOFF_CHG_SEQLIODN_SEQ (0x1 << LDOFF_CHG_SEQLIODN_SHIFT)
  224. #define LDOFF_CHG_SEQLIODN_NON_SEQ (0x2 << LDOFF_CHG_SEQLIODN_SHIFT)
  225. #define LDOFF_CHG_SEQLIODN_TRUSTED (0x3 << LDOFF_CHG_SEQLIODN_SHIFT)
  226. /* Data length in bytes */
  227. #define LDST_LEN_SHIFT 0
  228. #define LDST_LEN_MASK (0xff << LDST_LEN_SHIFT)
  229. /* Special Length definitions when dst=deco-ctrl */
  230. #define LDLEN_ENABLE_OSL_COUNT (1 << 7)
  231. #define LDLEN_RST_CHA_OFIFO_PTR (1 << 6)
  232. #define LDLEN_RST_OFIFO (1 << 5)
  233. #define LDLEN_SET_OFIFO_OFF_VALID (1 << 4)
  234. #define LDLEN_SET_OFIFO_OFF_RSVD (1 << 3)
  235. #define LDLEN_SET_OFIFO_OFFSET_SHIFT 0
  236. #define LDLEN_SET_OFIFO_OFFSET_MASK (3 << LDLEN_SET_OFIFO_OFFSET_SHIFT)
  237. /*
  238. * FIFO_LOAD/FIFO_STORE/SEQ_FIFO_LOAD/SEQ_FIFO_STORE
  239. * Command Constructs
  240. */
  241. /*
  242. * Load Destination: 0 = skip (SEQ_FIFO_LOAD only),
  243. * 1 = Load for Class1, 2 = Load for Class2, 3 = Load both
  244. * Store Source: 0 = normal, 1 = Class1key, 2 = Class2key
  245. */
  246. #define FIFOLD_CLASS_SHIFT 25
  247. #define FIFOLD_CLASS_MASK (0x03 << FIFOLD_CLASS_SHIFT)
  248. #define FIFOLD_CLASS_SKIP (0x00 << FIFOLD_CLASS_SHIFT)
  249. #define FIFOLD_CLASS_CLASS1 (0x01 << FIFOLD_CLASS_SHIFT)
  250. #define FIFOLD_CLASS_CLASS2 (0x02 << FIFOLD_CLASS_SHIFT)
  251. #define FIFOLD_CLASS_BOTH (0x03 << FIFOLD_CLASS_SHIFT)
  252. #define FIFOST_CLASS_SHIFT 25
  253. #define FIFOST_CLASS_MASK (0x03 << FIFOST_CLASS_SHIFT)
  254. #define FIFOST_CLASS_NORMAL (0x00 << FIFOST_CLASS_SHIFT)
  255. #define FIFOST_CLASS_CLASS1KEY (0x01 << FIFOST_CLASS_SHIFT)
  256. #define FIFOST_CLASS_CLASS2KEY (0x02 << FIFOST_CLASS_SHIFT)
  257. /*
  258. * Scatter-Gather Table/Variable Length Field
  259. * If set for FIFO_LOAD, refers to a SG table. Within
  260. * SEQ_FIFO_LOAD, is variable input sequence
  261. */
  262. #define FIFOLDST_SGF_SHIFT 24
  263. #define FIFOLDST_SGF_MASK (1 << FIFOLDST_SGF_SHIFT)
  264. #define FIFOLDST_VLF_MASK (1 << FIFOLDST_SGF_SHIFT)
  265. #define FIFOLDST_SGF (1 << FIFOLDST_SGF_SHIFT)
  266. #define FIFOLDST_VLF (1 << FIFOLDST_SGF_SHIFT)
  267. /* Immediate - Data follows command in descriptor */
  268. #define FIFOLD_IMM_SHIFT 23
  269. #define FIFOLD_IMM_MASK (1 << FIFOLD_IMM_SHIFT)
  270. #define FIFOLD_IMM (1 << FIFOLD_IMM_SHIFT)
  271. /* Continue - Not the last FIFO store to come */
  272. #define FIFOST_CONT_SHIFT 23
  273. #define FIFOST_CONT_MASK (1 << FIFOST_CONT_SHIFT)
  274. /*
  275. * Extended Length - use 32-bit extended length that
  276. * follows the pointer field. Illegal with IMM set
  277. */
  278. #define FIFOLDST_EXT_SHIFT 22
  279. #define FIFOLDST_EXT_MASK (1 << FIFOLDST_EXT_SHIFT)
  280. #define FIFOLDST_EXT (1 << FIFOLDST_EXT_SHIFT)
  281. /* Input data type.*/
  282. #define FIFOLD_TYPE_SHIFT 16
  283. #define FIFOLD_CONT_TYPE_SHIFT 19 /* shift past last-flush bits */
  284. #define FIFOLD_TYPE_MASK (0x3f << FIFOLD_TYPE_SHIFT)
  285. /* PK types */
  286. #define FIFOLD_TYPE_PK (0x00 << FIFOLD_TYPE_SHIFT)
  287. #define FIFOLD_TYPE_PK_MASK (0x30 << FIFOLD_TYPE_SHIFT)
  288. #define FIFOLD_TYPE_PK_TYPEMASK (0x0f << FIFOLD_TYPE_SHIFT)
  289. #define FIFOLD_TYPE_PK_A0 (0x00 << FIFOLD_TYPE_SHIFT)
  290. #define FIFOLD_TYPE_PK_A1 (0x01 << FIFOLD_TYPE_SHIFT)
  291. #define FIFOLD_TYPE_PK_A2 (0x02 << FIFOLD_TYPE_SHIFT)
  292. #define FIFOLD_TYPE_PK_A3 (0x03 << FIFOLD_TYPE_SHIFT)
  293. #define FIFOLD_TYPE_PK_B0 (0x04 << FIFOLD_TYPE_SHIFT)
  294. #define FIFOLD_TYPE_PK_B1 (0x05 << FIFOLD_TYPE_SHIFT)
  295. #define FIFOLD_TYPE_PK_B2 (0x06 << FIFOLD_TYPE_SHIFT)
  296. #define FIFOLD_TYPE_PK_B3 (0x07 << FIFOLD_TYPE_SHIFT)
  297. #define FIFOLD_TYPE_PK_N (0x08 << FIFOLD_TYPE_SHIFT)
  298. #define FIFOLD_TYPE_PK_A (0x0c << FIFOLD_TYPE_SHIFT)
  299. #define FIFOLD_TYPE_PK_B (0x0d << FIFOLD_TYPE_SHIFT)
  300. /* Other types. Need to OR in last/flush bits as desired */
  301. #define FIFOLD_TYPE_MSG_MASK (0x38 << FIFOLD_TYPE_SHIFT)
  302. #define FIFOLD_TYPE_MSG (0x10 << FIFOLD_TYPE_SHIFT)
  303. #define FIFOLD_TYPE_MSG1OUT2 (0x18 << FIFOLD_TYPE_SHIFT)
  304. #define FIFOLD_TYPE_IV (0x20 << FIFOLD_TYPE_SHIFT)
  305. #define FIFOLD_TYPE_BITDATA (0x28 << FIFOLD_TYPE_SHIFT)
  306. #define FIFOLD_TYPE_AAD (0x30 << FIFOLD_TYPE_SHIFT)
  307. #define FIFOLD_TYPE_ICV (0x38 << FIFOLD_TYPE_SHIFT)
  308. /* Last/Flush bits for use with "other" types above */
  309. #define FIFOLD_TYPE_ACT_MASK (0x07 << FIFOLD_TYPE_SHIFT)
  310. #define FIFOLD_TYPE_NOACTION (0x00 << FIFOLD_TYPE_SHIFT)
  311. #define FIFOLD_TYPE_FLUSH1 (0x01 << FIFOLD_TYPE_SHIFT)
  312. #define FIFOLD_TYPE_LAST1 (0x02 << FIFOLD_TYPE_SHIFT)
  313. #define FIFOLD_TYPE_LAST2FLUSH (0x03 << FIFOLD_TYPE_SHIFT)
  314. #define FIFOLD_TYPE_LAST2 (0x04 << FIFOLD_TYPE_SHIFT)
  315. #define FIFOLD_TYPE_LAST2FLUSH1 (0x05 << FIFOLD_TYPE_SHIFT)
  316. #define FIFOLD_TYPE_LASTBOTH (0x06 << FIFOLD_TYPE_SHIFT)
  317. #define FIFOLD_TYPE_LASTBOTHFL (0x07 << FIFOLD_TYPE_SHIFT)
  318. #define FIFOLD_TYPE_NOINFOFIFO (0x0F << FIFOLD_TYPE_SHIFT)
  319. #define FIFOLDST_LEN_MASK 0xffff
  320. #define FIFOLDST_EXT_LEN_MASK 0xffffffff
  321. /* Output data types */
  322. #define FIFOST_TYPE_SHIFT 16
  323. #define FIFOST_TYPE_MASK (0x3f << FIFOST_TYPE_SHIFT)
  324. #define FIFOST_TYPE_PKHA_A0 (0x00 << FIFOST_TYPE_SHIFT)
  325. #define FIFOST_TYPE_PKHA_A1 (0x01 << FIFOST_TYPE_SHIFT)
  326. #define FIFOST_TYPE_PKHA_A2 (0x02 << FIFOST_TYPE_SHIFT)
  327. #define FIFOST_TYPE_PKHA_A3 (0x03 << FIFOST_TYPE_SHIFT)
  328. #define FIFOST_TYPE_PKHA_B0 (0x04 << FIFOST_TYPE_SHIFT)
  329. #define FIFOST_TYPE_PKHA_B1 (0x05 << FIFOST_TYPE_SHIFT)
  330. #define FIFOST_TYPE_PKHA_B2 (0x06 << FIFOST_TYPE_SHIFT)
  331. #define FIFOST_TYPE_PKHA_B3 (0x07 << FIFOST_TYPE_SHIFT)
  332. #define FIFOST_TYPE_PKHA_N (0x08 << FIFOST_TYPE_SHIFT)
  333. #define FIFOST_TYPE_PKHA_A (0x0c << FIFOST_TYPE_SHIFT)
  334. #define FIFOST_TYPE_PKHA_B (0x0d << FIFOST_TYPE_SHIFT)
  335. #define FIFOST_TYPE_AF_SBOX_JKEK (0x20 << FIFOST_TYPE_SHIFT)
  336. #define FIFOST_TYPE_AF_SBOX_TKEK (0x21 << FIFOST_TYPE_SHIFT)
  337. #define FIFOST_TYPE_PKHA_E_JKEK (0x22 << FIFOST_TYPE_SHIFT)
  338. #define FIFOST_TYPE_PKHA_E_TKEK (0x23 << FIFOST_TYPE_SHIFT)
  339. #define FIFOST_TYPE_KEY_KEK (0x24 << FIFOST_TYPE_SHIFT)
  340. #define FIFOST_TYPE_KEY_TKEK (0x25 << FIFOST_TYPE_SHIFT)
  341. #define FIFOST_TYPE_SPLIT_KEK (0x26 << FIFOST_TYPE_SHIFT)
  342. #define FIFOST_TYPE_SPLIT_TKEK (0x27 << FIFOST_TYPE_SHIFT)
  343. #define FIFOST_TYPE_OUTFIFO_KEK (0x28 << FIFOST_TYPE_SHIFT)
  344. #define FIFOST_TYPE_OUTFIFO_TKEK (0x29 << FIFOST_TYPE_SHIFT)
  345. #define FIFOST_TYPE_MESSAGE_DATA (0x30 << FIFOST_TYPE_SHIFT)
  346. #define FIFOST_TYPE_RNGSTORE (0x34 << FIFOST_TYPE_SHIFT)
  347. #define FIFOST_TYPE_RNGFIFO (0x35 << FIFOST_TYPE_SHIFT)
  348. #define FIFOST_TYPE_SKIP (0x3f << FIFOST_TYPE_SHIFT)
  349. /*
  350. * OPERATION Command Constructs
  351. */
  352. /* Operation type selectors - OP TYPE */
  353. #define OP_TYPE_SHIFT 24
  354. #define OP_TYPE_MASK (0x07 << OP_TYPE_SHIFT)
  355. #define OP_TYPE_UNI_PROTOCOL (0x00 << OP_TYPE_SHIFT)
  356. #define OP_TYPE_PK (0x01 << OP_TYPE_SHIFT)
  357. #define OP_TYPE_CLASS1_ALG (0x02 << OP_TYPE_SHIFT)
  358. #define OP_TYPE_CLASS2_ALG (0x04 << OP_TYPE_SHIFT)
  359. #define OP_TYPE_DECAP_PROTOCOL (0x06 << OP_TYPE_SHIFT)
  360. #define OP_TYPE_ENCAP_PROTOCOL (0x07 << OP_TYPE_SHIFT)
  361. /* ProtocolID selectors - PROTID */
  362. #define OP_PCLID_SHIFT 16
  363. #define OP_PCLID_MASK (0xff << 16)
  364. /* Assuming OP_TYPE = OP_TYPE_UNI_PROTOCOL */
  365. #define OP_PCLID_IKEV1_PRF (0x01 << OP_PCLID_SHIFT)
  366. #define OP_PCLID_IKEV2_PRF (0x02 << OP_PCLID_SHIFT)
  367. #define OP_PCLID_SSL30_PRF (0x08 << OP_PCLID_SHIFT)
  368. #define OP_PCLID_TLS10_PRF (0x09 << OP_PCLID_SHIFT)
  369. #define OP_PCLID_TLS11_PRF (0x0a << OP_PCLID_SHIFT)
  370. #define OP_PCLID_DTLS10_PRF (0x0c << OP_PCLID_SHIFT)
  371. #define OP_PCLID_PRF (0x06 << OP_PCLID_SHIFT)
  372. #define OP_PCLID_BLOB (0x0d << OP_PCLID_SHIFT)
  373. #define OP_PCLID_SECRETKEY (0x11 << OP_PCLID_SHIFT)
  374. #define OP_PCLID_PUBLICKEYPAIR (0x14 << OP_PCLID_SHIFT)
  375. #define OP_PCLID_DSASIGN (0x15 << OP_PCLID_SHIFT)
  376. #define OP_PCLID_DSAVERIFY (0x16 << OP_PCLID_SHIFT)
  377. #define OP_PCLID_RSAENC_PUBKEY (0x18 << OP_PCLID_SHIFT)
  378. #define OP_PCLID_RSADEC_PRVKEY (0x19 << OP_PCLID_SHIFT)
  379. #define OP_PCLID_DKP_MD5 (0x20 << OP_PCLID_SHIFT)
  380. #define OP_PCLID_DKP_SHA1 (0x21 << OP_PCLID_SHIFT)
  381. #define OP_PCLID_DKP_SHA224 (0x22 << OP_PCLID_SHIFT)
  382. #define OP_PCLID_DKP_SHA256 (0x23 << OP_PCLID_SHIFT)
  383. #define OP_PCLID_DKP_SHA384 (0x24 << OP_PCLID_SHIFT)
  384. #define OP_PCLID_DKP_SHA512 (0x25 << OP_PCLID_SHIFT)
  385. #define OP_PCLID_DKP_RIF_MD5 (0x60 << OP_PCLID_SHIFT)
  386. #define OP_PCLID_DKP_RIF_SHA1 (0x61 << OP_PCLID_SHIFT)
  387. #define OP_PCLID_DKP_RIF_SHA224 (0x62 << OP_PCLID_SHIFT)
  388. #define OP_PCLID_DKP_RIF_SHA256 (0x63 << OP_PCLID_SHIFT)
  389. #define OP_PCLID_DKP_RIF_SHA384 (0x64 << OP_PCLID_SHIFT)
  390. #define OP_PCLID_DKP_RIF_SHA512 (0x65 << OP_PCLID_SHIFT)
  391. /* Assuming OP_TYPE = OP_TYPE_DECAP_PROTOCOL/ENCAP_PROTOCOL */
  392. #define OP_PCLID_IPSEC (0x01 << OP_PCLID_SHIFT)
  393. #define OP_PCLID_SRTP (0x02 << OP_PCLID_SHIFT)
  394. #define OP_PCLID_MACSEC (0x03 << OP_PCLID_SHIFT)
  395. #define OP_PCLID_WIFI (0x04 << OP_PCLID_SHIFT)
  396. #define OP_PCLID_WIMAX (0x05 << OP_PCLID_SHIFT)
  397. #define OP_PCLID_SSL30 (0x08 << OP_PCLID_SHIFT)
  398. #define OP_PCLID_TLS10 (0x09 << OP_PCLID_SHIFT)
  399. #define OP_PCLID_TLS11 (0x0a << OP_PCLID_SHIFT)
  400. #define OP_PCLID_TLS12 (0x0b << OP_PCLID_SHIFT)
  401. #define OP_PCLID_DTLS (0x0c << OP_PCLID_SHIFT)
  402. /*
  403. * ProtocolInfo selectors
  404. */
  405. #define OP_PCLINFO_MASK 0xffff
  406. /* for OP_PCLID_IPSEC */
  407. #define OP_PCL_IPSEC_CIPHER_MASK 0xff00
  408. #define OP_PCL_IPSEC_AUTH_MASK 0x00ff
  409. #define OP_PCL_IPSEC_DES_IV64 0x0100
  410. #define OP_PCL_IPSEC_DES 0x0200
  411. #define OP_PCL_IPSEC_3DES 0x0300
  412. #define OP_PCL_IPSEC_AES_CBC 0x0c00
  413. #define OP_PCL_IPSEC_AES_CTR 0x0d00
  414. #define OP_PCL_IPSEC_AES_XTS 0x1600
  415. #define OP_PCL_IPSEC_AES_CCM8 0x0e00
  416. #define OP_PCL_IPSEC_AES_CCM12 0x0f00
  417. #define OP_PCL_IPSEC_AES_CCM16 0x1000
  418. #define OP_PCL_IPSEC_AES_GCM8 0x1200
  419. #define OP_PCL_IPSEC_AES_GCM12 0x1300
  420. #define OP_PCL_IPSEC_AES_GCM16 0x1400
  421. #define OP_PCL_IPSEC_HMAC_NULL 0x0000
  422. #define OP_PCL_IPSEC_HMAC_MD5_96 0x0001
  423. #define OP_PCL_IPSEC_HMAC_SHA1_96 0x0002
  424. #define OP_PCL_IPSEC_AES_XCBC_MAC_96 0x0005
  425. #define OP_PCL_IPSEC_HMAC_MD5_128 0x0006
  426. #define OP_PCL_IPSEC_HMAC_SHA1_160 0x0007
  427. #define OP_PCL_IPSEC_HMAC_SHA2_256_128 0x000c
  428. #define OP_PCL_IPSEC_HMAC_SHA2_384_192 0x000d
  429. #define OP_PCL_IPSEC_HMAC_SHA2_512_256 0x000e
  430. /* For SRTP - OP_PCLID_SRTP */
  431. #define OP_PCL_SRTP_CIPHER_MASK 0xff00
  432. #define OP_PCL_SRTP_AUTH_MASK 0x00ff
  433. #define OP_PCL_SRTP_AES_CTR 0x0d00
  434. #define OP_PCL_SRTP_HMAC_SHA1_160 0x0007
  435. /* For SSL 3.0 - OP_PCLID_SSL30 */
  436. #define OP_PCL_SSL30_AES_128_CBC_SHA 0x002f
  437. #define OP_PCL_SSL30_AES_128_CBC_SHA_2 0x0030
  438. #define OP_PCL_SSL30_AES_128_CBC_SHA_3 0x0031
  439. #define OP_PCL_SSL30_AES_128_CBC_SHA_4 0x0032
  440. #define OP_PCL_SSL30_AES_128_CBC_SHA_5 0x0033
  441. #define OP_PCL_SSL30_AES_128_CBC_SHA_6 0x0034
  442. #define OP_PCL_SSL30_AES_128_CBC_SHA_7 0x008c
  443. #define OP_PCL_SSL30_AES_128_CBC_SHA_8 0x0090
  444. #define OP_PCL_SSL30_AES_128_CBC_SHA_9 0x0094
  445. #define OP_PCL_SSL30_AES_128_CBC_SHA_10 0xc004
  446. #define OP_PCL_SSL30_AES_128_CBC_SHA_11 0xc009
  447. #define OP_PCL_SSL30_AES_128_CBC_SHA_12 0xc00e
  448. #define OP_PCL_SSL30_AES_128_CBC_SHA_13 0xc013
  449. #define OP_PCL_SSL30_AES_128_CBC_SHA_14 0xc018
  450. #define OP_PCL_SSL30_AES_128_CBC_SHA_15 0xc01d
  451. #define OP_PCL_SSL30_AES_128_CBC_SHA_16 0xc01e
  452. #define OP_PCL_SSL30_AES_128_CBC_SHA_17 0xc01f
  453. #define OP_PCL_SSL30_AES_256_CBC_SHA 0x0035
  454. #define OP_PCL_SSL30_AES_256_CBC_SHA_2 0x0036
  455. #define OP_PCL_SSL30_AES_256_CBC_SHA_3 0x0037
  456. #define OP_PCL_SSL30_AES_256_CBC_SHA_4 0x0038
  457. #define OP_PCL_SSL30_AES_256_CBC_SHA_5 0x0039
  458. #define OP_PCL_SSL30_AES_256_CBC_SHA_6 0x003a
  459. #define OP_PCL_SSL30_AES_256_CBC_SHA_7 0x008d
  460. #define OP_PCL_SSL30_AES_256_CBC_SHA_8 0x0091
  461. #define OP_PCL_SSL30_AES_256_CBC_SHA_9 0x0095
  462. #define OP_PCL_SSL30_AES_256_CBC_SHA_10 0xc005
  463. #define OP_PCL_SSL30_AES_256_CBC_SHA_11 0xc00a
  464. #define OP_PCL_SSL30_AES_256_CBC_SHA_12 0xc00f
  465. #define OP_PCL_SSL30_AES_256_CBC_SHA_13 0xc014
  466. #define OP_PCL_SSL30_AES_256_CBC_SHA_14 0xc019
  467. #define OP_PCL_SSL30_AES_256_CBC_SHA_15 0xc020
  468. #define OP_PCL_SSL30_AES_256_CBC_SHA_16 0xc021
  469. #define OP_PCL_SSL30_AES_256_CBC_SHA_17 0xc022
  470. #define OP_PCL_SSL30_3DES_EDE_CBC_MD5 0x0023
  471. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA 0x001f
  472. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_2 0x008b
  473. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_3 0x008f
  474. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_4 0x0093
  475. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_5 0x000a
  476. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_6 0x000d
  477. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_7 0x0010
  478. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_8 0x0013
  479. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_9 0x0016
  480. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_10 0x001b
  481. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_11 0xc003
  482. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_12 0xc008
  483. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_13 0xc00d
  484. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_14 0xc012
  485. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_15 0xc017
  486. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_16 0xc01a
  487. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_17 0xc01b
  488. #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_18 0xc01c
  489. #define OP_PCL_SSL30_DES40_CBC_MD5 0x0029
  490. #define OP_PCL_SSL30_DES_CBC_MD5 0x0022
  491. #define OP_PCL_SSL30_DES40_CBC_SHA 0x0008
  492. #define OP_PCL_SSL30_DES40_CBC_SHA_2 0x000b
  493. #define OP_PCL_SSL30_DES40_CBC_SHA_3 0x000e
  494. #define OP_PCL_SSL30_DES40_CBC_SHA_4 0x0011
  495. #define OP_PCL_SSL30_DES40_CBC_SHA_5 0x0014
  496. #define OP_PCL_SSL30_DES40_CBC_SHA_6 0x0019
  497. #define OP_PCL_SSL30_DES40_CBC_SHA_7 0x0026
  498. #define OP_PCL_SSL30_DES_CBC_SHA 0x001e
  499. #define OP_PCL_SSL30_DES_CBC_SHA_2 0x0009
  500. #define OP_PCL_SSL30_DES_CBC_SHA_3 0x000c
  501. #define OP_PCL_SSL30_DES_CBC_SHA_4 0x000f
  502. #define OP_PCL_SSL30_DES_CBC_SHA_5 0x0012
  503. #define OP_PCL_SSL30_DES_CBC_SHA_6 0x0015
  504. #define OP_PCL_SSL30_DES_CBC_SHA_7 0x001a
  505. #define OP_PCL_SSL30_RC4_128_MD5 0x0024
  506. #define OP_PCL_SSL30_RC4_128_MD5_2 0x0004
  507. #define OP_PCL_SSL30_RC4_128_MD5_3 0x0018
  508. #define OP_PCL_SSL30_RC4_40_MD5 0x002b
  509. #define OP_PCL_SSL30_RC4_40_MD5_2 0x0003
  510. #define OP_PCL_SSL30_RC4_40_MD5_3 0x0017
  511. #define OP_PCL_SSL30_RC4_128_SHA 0x0020
  512. #define OP_PCL_SSL30_RC4_128_SHA_2 0x008a
  513. #define OP_PCL_SSL30_RC4_128_SHA_3 0x008e
  514. #define OP_PCL_SSL30_RC4_128_SHA_4 0x0092
  515. #define OP_PCL_SSL30_RC4_128_SHA_5 0x0005
  516. #define OP_PCL_SSL30_RC4_128_SHA_6 0xc002
  517. #define OP_PCL_SSL30_RC4_128_SHA_7 0xc007
  518. #define OP_PCL_SSL30_RC4_128_SHA_8 0xc00c
  519. #define OP_PCL_SSL30_RC4_128_SHA_9 0xc011
  520. #define OP_PCL_SSL30_RC4_128_SHA_10 0xc016
  521. #define OP_PCL_SSL30_RC4_40_SHA 0x0028
  522. /* For TLS 1.0 - OP_PCLID_TLS10 */
  523. #define OP_PCL_TLS10_AES_128_CBC_SHA 0x002f
  524. #define OP_PCL_TLS10_AES_128_CBC_SHA_2 0x0030
  525. #define OP_PCL_TLS10_AES_128_CBC_SHA_3 0x0031
  526. #define OP_PCL_TLS10_AES_128_CBC_SHA_4 0x0032
  527. #define OP_PCL_TLS10_AES_128_CBC_SHA_5 0x0033
  528. #define OP_PCL_TLS10_AES_128_CBC_SHA_6 0x0034
  529. #define OP_PCL_TLS10_AES_128_CBC_SHA_7 0x008c
  530. #define OP_PCL_TLS10_AES_128_CBC_SHA_8 0x0090
  531. #define OP_PCL_TLS10_AES_128_CBC_SHA_9 0x0094
  532. #define OP_PCL_TLS10_AES_128_CBC_SHA_10 0xc004
  533. #define OP_PCL_TLS10_AES_128_CBC_SHA_11 0xc009
  534. #define OP_PCL_TLS10_AES_128_CBC_SHA_12 0xc00e
  535. #define OP_PCL_TLS10_AES_128_CBC_SHA_13 0xc013
  536. #define OP_PCL_TLS10_AES_128_CBC_SHA_14 0xc018
  537. #define OP_PCL_TLS10_AES_128_CBC_SHA_15 0xc01d
  538. #define OP_PCL_TLS10_AES_128_CBC_SHA_16 0xc01e
  539. #define OP_PCL_TLS10_AES_128_CBC_SHA_17 0xc01f
  540. #define OP_PCL_TLS10_AES_256_CBC_SHA 0x0035
  541. #define OP_PCL_TLS10_AES_256_CBC_SHA_2 0x0036
  542. #define OP_PCL_TLS10_AES_256_CBC_SHA_3 0x0037
  543. #define OP_PCL_TLS10_AES_256_CBC_SHA_4 0x0038
  544. #define OP_PCL_TLS10_AES_256_CBC_SHA_5 0x0039
  545. #define OP_PCL_TLS10_AES_256_CBC_SHA_6 0x003a
  546. #define OP_PCL_TLS10_AES_256_CBC_SHA_7 0x008d
  547. #define OP_PCL_TLS10_AES_256_CBC_SHA_8 0x0091
  548. #define OP_PCL_TLS10_AES_256_CBC_SHA_9 0x0095
  549. #define OP_PCL_TLS10_AES_256_CBC_SHA_10 0xc005
  550. #define OP_PCL_TLS10_AES_256_CBC_SHA_11 0xc00a
  551. #define OP_PCL_TLS10_AES_256_CBC_SHA_12 0xc00f
  552. #define OP_PCL_TLS10_AES_256_CBC_SHA_13 0xc014
  553. #define OP_PCL_TLS10_AES_256_CBC_SHA_14 0xc019
  554. #define OP_PCL_TLS10_AES_256_CBC_SHA_15 0xc020
  555. #define OP_PCL_TLS10_AES_256_CBC_SHA_16 0xc021
  556. #define OP_PCL_TLS10_AES_256_CBC_SHA_17 0xc022
  557. /* #define OP_PCL_TLS10_3DES_EDE_CBC_MD5 0x0023 */
  558. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA 0x001f
  559. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_2 0x008b
  560. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_3 0x008f
  561. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_4 0x0093
  562. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_5 0x000a
  563. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_6 0x000d
  564. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_7 0x0010
  565. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_8 0x0013
  566. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_9 0x0016
  567. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_10 0x001b
  568. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_11 0xc003
  569. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_12 0xc008
  570. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_13 0xc00d
  571. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_14 0xc012
  572. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_15 0xc017
  573. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_16 0xc01a
  574. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_17 0xc01b
  575. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_18 0xc01c
  576. #define OP_PCL_TLS10_DES40_CBC_MD5 0x0029
  577. #define OP_PCL_TLS10_DES_CBC_MD5 0x0022
  578. #define OP_PCL_TLS10_DES40_CBC_SHA 0x0008
  579. #define OP_PCL_TLS10_DES40_CBC_SHA_2 0x000b
  580. #define OP_PCL_TLS10_DES40_CBC_SHA_3 0x000e
  581. #define OP_PCL_TLS10_DES40_CBC_SHA_4 0x0011
  582. #define OP_PCL_TLS10_DES40_CBC_SHA_5 0x0014
  583. #define OP_PCL_TLS10_DES40_CBC_SHA_6 0x0019
  584. #define OP_PCL_TLS10_DES40_CBC_SHA_7 0x0026
  585. #define OP_PCL_TLS10_DES_CBC_SHA 0x001e
  586. #define OP_PCL_TLS10_DES_CBC_SHA_2 0x0009
  587. #define OP_PCL_TLS10_DES_CBC_SHA_3 0x000c
  588. #define OP_PCL_TLS10_DES_CBC_SHA_4 0x000f
  589. #define OP_PCL_TLS10_DES_CBC_SHA_5 0x0012
  590. #define OP_PCL_TLS10_DES_CBC_SHA_6 0x0015
  591. #define OP_PCL_TLS10_DES_CBC_SHA_7 0x001a
  592. #define OP_PCL_TLS10_RC4_128_MD5 0x0024
  593. #define OP_PCL_TLS10_RC4_128_MD5_2 0x0004
  594. #define OP_PCL_TLS10_RC4_128_MD5_3 0x0018
  595. #define OP_PCL_TLS10_RC4_40_MD5 0x002b
  596. #define OP_PCL_TLS10_RC4_40_MD5_2 0x0003
  597. #define OP_PCL_TLS10_RC4_40_MD5_3 0x0017
  598. #define OP_PCL_TLS10_RC4_128_SHA 0x0020
  599. #define OP_PCL_TLS10_RC4_128_SHA_2 0x008a
  600. #define OP_PCL_TLS10_RC4_128_SHA_3 0x008e
  601. #define OP_PCL_TLS10_RC4_128_SHA_4 0x0092
  602. #define OP_PCL_TLS10_RC4_128_SHA_5 0x0005
  603. #define OP_PCL_TLS10_RC4_128_SHA_6 0xc002
  604. #define OP_PCL_TLS10_RC4_128_SHA_7 0xc007
  605. #define OP_PCL_TLS10_RC4_128_SHA_8 0xc00c
  606. #define OP_PCL_TLS10_RC4_128_SHA_9 0xc011
  607. #define OP_PCL_TLS10_RC4_128_SHA_10 0xc016
  608. #define OP_PCL_TLS10_RC4_40_SHA 0x0028
  609. #define OP_PCL_TLS10_3DES_EDE_CBC_MD5 0xff23
  610. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA160 0xff30
  611. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA224 0xff34
  612. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA256 0xff36
  613. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA384 0xff33
  614. #define OP_PCL_TLS10_3DES_EDE_CBC_SHA512 0xff35
  615. #define OP_PCL_TLS10_AES_128_CBC_SHA160 0xff80
  616. #define OP_PCL_TLS10_AES_128_CBC_SHA224 0xff84
  617. #define OP_PCL_TLS10_AES_128_CBC_SHA256 0xff86
  618. #define OP_PCL_TLS10_AES_128_CBC_SHA384 0xff83
  619. #define OP_PCL_TLS10_AES_128_CBC_SHA512 0xff85
  620. #define OP_PCL_TLS10_AES_192_CBC_SHA160 0xff20
  621. #define OP_PCL_TLS10_AES_192_CBC_SHA224 0xff24
  622. #define OP_PCL_TLS10_AES_192_CBC_SHA256 0xff26
  623. #define OP_PCL_TLS10_AES_192_CBC_SHA384 0xff23
  624. #define OP_PCL_TLS10_AES_192_CBC_SHA512 0xff25
  625. #define OP_PCL_TLS10_AES_256_CBC_SHA160 0xff60
  626. #define OP_PCL_TLS10_AES_256_CBC_SHA224 0xff64
  627. #define OP_PCL_TLS10_AES_256_CBC_SHA256 0xff66
  628. #define OP_PCL_TLS10_AES_256_CBC_SHA384 0xff63
  629. #define OP_PCL_TLS10_AES_256_CBC_SHA512 0xff65
  630. /* For TLS 1.1 - OP_PCLID_TLS11 */
  631. #define OP_PCL_TLS11_AES_128_CBC_SHA 0x002f
  632. #define OP_PCL_TLS11_AES_128_CBC_SHA_2 0x0030
  633. #define OP_PCL_TLS11_AES_128_CBC_SHA_3 0x0031
  634. #define OP_PCL_TLS11_AES_128_CBC_SHA_4 0x0032
  635. #define OP_PCL_TLS11_AES_128_CBC_SHA_5 0x0033
  636. #define OP_PCL_TLS11_AES_128_CBC_SHA_6 0x0034
  637. #define OP_PCL_TLS11_AES_128_CBC_SHA_7 0x008c
  638. #define OP_PCL_TLS11_AES_128_CBC_SHA_8 0x0090
  639. #define OP_PCL_TLS11_AES_128_CBC_SHA_9 0x0094
  640. #define OP_PCL_TLS11_AES_128_CBC_SHA_10 0xc004
  641. #define OP_PCL_TLS11_AES_128_CBC_SHA_11 0xc009
  642. #define OP_PCL_TLS11_AES_128_CBC_SHA_12 0xc00e
  643. #define OP_PCL_TLS11_AES_128_CBC_SHA_13 0xc013
  644. #define OP_PCL_TLS11_AES_128_CBC_SHA_14 0xc018
  645. #define OP_PCL_TLS11_AES_128_CBC_SHA_15 0xc01d
  646. #define OP_PCL_TLS11_AES_128_CBC_SHA_16 0xc01e
  647. #define OP_PCL_TLS11_AES_128_CBC_SHA_17 0xc01f
  648. #define OP_PCL_TLS11_AES_256_CBC_SHA 0x0035
  649. #define OP_PCL_TLS11_AES_256_CBC_SHA_2 0x0036
  650. #define OP_PCL_TLS11_AES_256_CBC_SHA_3 0x0037
  651. #define OP_PCL_TLS11_AES_256_CBC_SHA_4 0x0038
  652. #define OP_PCL_TLS11_AES_256_CBC_SHA_5 0x0039
  653. #define OP_PCL_TLS11_AES_256_CBC_SHA_6 0x003a
  654. #define OP_PCL_TLS11_AES_256_CBC_SHA_7 0x008d
  655. #define OP_PCL_TLS11_AES_256_CBC_SHA_8 0x0091
  656. #define OP_PCL_TLS11_AES_256_CBC_SHA_9 0x0095
  657. #define OP_PCL_TLS11_AES_256_CBC_SHA_10 0xc005
  658. #define OP_PCL_TLS11_AES_256_CBC_SHA_11 0xc00a
  659. #define OP_PCL_TLS11_AES_256_CBC_SHA_12 0xc00f
  660. #define OP_PCL_TLS11_AES_256_CBC_SHA_13 0xc014
  661. #define OP_PCL_TLS11_AES_256_CBC_SHA_14 0xc019
  662. #define OP_PCL_TLS11_AES_256_CBC_SHA_15 0xc020
  663. #define OP_PCL_TLS11_AES_256_CBC_SHA_16 0xc021
  664. #define OP_PCL_TLS11_AES_256_CBC_SHA_17 0xc022
  665. /* #define OP_PCL_TLS11_3DES_EDE_CBC_MD5 0x0023 */
  666. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA 0x001f
  667. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_2 0x008b
  668. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_3 0x008f
  669. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_4 0x0093
  670. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_5 0x000a
  671. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_6 0x000d
  672. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_7 0x0010
  673. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_8 0x0013
  674. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_9 0x0016
  675. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_10 0x001b
  676. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_11 0xc003
  677. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_12 0xc008
  678. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_13 0xc00d
  679. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_14 0xc012
  680. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_15 0xc017
  681. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_16 0xc01a
  682. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_17 0xc01b
  683. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_18 0xc01c
  684. #define OP_PCL_TLS11_DES40_CBC_MD5 0x0029
  685. #define OP_PCL_TLS11_DES_CBC_MD5 0x0022
  686. #define OP_PCL_TLS11_DES40_CBC_SHA 0x0008
  687. #define OP_PCL_TLS11_DES40_CBC_SHA_2 0x000b
  688. #define OP_PCL_TLS11_DES40_CBC_SHA_3 0x000e
  689. #define OP_PCL_TLS11_DES40_CBC_SHA_4 0x0011
  690. #define OP_PCL_TLS11_DES40_CBC_SHA_5 0x0014
  691. #define OP_PCL_TLS11_DES40_CBC_SHA_6 0x0019
  692. #define OP_PCL_TLS11_DES40_CBC_SHA_7 0x0026
  693. #define OP_PCL_TLS11_DES_CBC_SHA 0x001e
  694. #define OP_PCL_TLS11_DES_CBC_SHA_2 0x0009
  695. #define OP_PCL_TLS11_DES_CBC_SHA_3 0x000c
  696. #define OP_PCL_TLS11_DES_CBC_SHA_4 0x000f
  697. #define OP_PCL_TLS11_DES_CBC_SHA_5 0x0012
  698. #define OP_PCL_TLS11_DES_CBC_SHA_6 0x0015
  699. #define OP_PCL_TLS11_DES_CBC_SHA_7 0x001a
  700. #define OP_PCL_TLS11_RC4_128_MD5 0x0024
  701. #define OP_PCL_TLS11_RC4_128_MD5_2 0x0004
  702. #define OP_PCL_TLS11_RC4_128_MD5_3 0x0018
  703. #define OP_PCL_TLS11_RC4_40_MD5 0x002b
  704. #define OP_PCL_TLS11_RC4_40_MD5_2 0x0003
  705. #define OP_PCL_TLS11_RC4_40_MD5_3 0x0017
  706. #define OP_PCL_TLS11_RC4_128_SHA 0x0020
  707. #define OP_PCL_TLS11_RC4_128_SHA_2 0x008a
  708. #define OP_PCL_TLS11_RC4_128_SHA_3 0x008e
  709. #define OP_PCL_TLS11_RC4_128_SHA_4 0x0092
  710. #define OP_PCL_TLS11_RC4_128_SHA_5 0x0005
  711. #define OP_PCL_TLS11_RC4_128_SHA_6 0xc002
  712. #define OP_PCL_TLS11_RC4_128_SHA_7 0xc007
  713. #define OP_PCL_TLS11_RC4_128_SHA_8 0xc00c
  714. #define OP_PCL_TLS11_RC4_128_SHA_9 0xc011
  715. #define OP_PCL_TLS11_RC4_128_SHA_10 0xc016
  716. #define OP_PCL_TLS11_RC4_40_SHA 0x0028
  717. #define OP_PCL_TLS11_3DES_EDE_CBC_MD5 0xff23
  718. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA160 0xff30
  719. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA224 0xff34
  720. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA256 0xff36
  721. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA384 0xff33
  722. #define OP_PCL_TLS11_3DES_EDE_CBC_SHA512 0xff35
  723. #define OP_PCL_TLS11_AES_128_CBC_SHA160 0xff80
  724. #define OP_PCL_TLS11_AES_128_CBC_SHA224 0xff84
  725. #define OP_PCL_TLS11_AES_128_CBC_SHA256 0xff86
  726. #define OP_PCL_TLS11_AES_128_CBC_SHA384 0xff83
  727. #define OP_PCL_TLS11_AES_128_CBC_SHA512 0xff85
  728. #define OP_PCL_TLS11_AES_192_CBC_SHA160 0xff20
  729. #define OP_PCL_TLS11_AES_192_CBC_SHA224 0xff24
  730. #define OP_PCL_TLS11_AES_192_CBC_SHA256 0xff26
  731. #define OP_PCL_TLS11_AES_192_CBC_SHA384 0xff23
  732. #define OP_PCL_TLS11_AES_192_CBC_SHA512 0xff25
  733. #define OP_PCL_TLS11_AES_256_CBC_SHA160 0xff60
  734. #define OP_PCL_TLS11_AES_256_CBC_SHA224 0xff64
  735. #define OP_PCL_TLS11_AES_256_CBC_SHA256 0xff66
  736. #define OP_PCL_TLS11_AES_256_CBC_SHA384 0xff63
  737. #define OP_PCL_TLS11_AES_256_CBC_SHA512 0xff65
  738. /* For TLS 1.2 - OP_PCLID_TLS12 */
  739. #define OP_PCL_TLS12_AES_128_CBC_SHA 0x002f
  740. #define OP_PCL_TLS12_AES_128_CBC_SHA_2 0x0030
  741. #define OP_PCL_TLS12_AES_128_CBC_SHA_3 0x0031
  742. #define OP_PCL_TLS12_AES_128_CBC_SHA_4 0x0032
  743. #define OP_PCL_TLS12_AES_128_CBC_SHA_5 0x0033
  744. #define OP_PCL_TLS12_AES_128_CBC_SHA_6 0x0034
  745. #define OP_PCL_TLS12_AES_128_CBC_SHA_7 0x008c
  746. #define OP_PCL_TLS12_AES_128_CBC_SHA_8 0x0090
  747. #define OP_PCL_TLS12_AES_128_CBC_SHA_9 0x0094
  748. #define OP_PCL_TLS12_AES_128_CBC_SHA_10 0xc004
  749. #define OP_PCL_TLS12_AES_128_CBC_SHA_11 0xc009
  750. #define OP_PCL_TLS12_AES_128_CBC_SHA_12 0xc00e
  751. #define OP_PCL_TLS12_AES_128_CBC_SHA_13 0xc013
  752. #define OP_PCL_TLS12_AES_128_CBC_SHA_14 0xc018
  753. #define OP_PCL_TLS12_AES_128_CBC_SHA_15 0xc01d
  754. #define OP_PCL_TLS12_AES_128_CBC_SHA_16 0xc01e
  755. #define OP_PCL_TLS12_AES_128_CBC_SHA_17 0xc01f
  756. #define OP_PCL_TLS12_AES_256_CBC_SHA 0x0035
  757. #define OP_PCL_TLS12_AES_256_CBC_SHA_2 0x0036
  758. #define OP_PCL_TLS12_AES_256_CBC_SHA_3 0x0037
  759. #define OP_PCL_TLS12_AES_256_CBC_SHA_4 0x0038
  760. #define OP_PCL_TLS12_AES_256_CBC_SHA_5 0x0039
  761. #define OP_PCL_TLS12_AES_256_CBC_SHA_6 0x003a
  762. #define OP_PCL_TLS12_AES_256_CBC_SHA_7 0x008d
  763. #define OP_PCL_TLS12_AES_256_CBC_SHA_8 0x0091
  764. #define OP_PCL_TLS12_AES_256_CBC_SHA_9 0x0095
  765. #define OP_PCL_TLS12_AES_256_CBC_SHA_10 0xc005
  766. #define OP_PCL_TLS12_AES_256_CBC_SHA_11 0xc00a
  767. #define OP_PCL_TLS12_AES_256_CBC_SHA_12 0xc00f
  768. #define OP_PCL_TLS12_AES_256_CBC_SHA_13 0xc014
  769. #define OP_PCL_TLS12_AES_256_CBC_SHA_14 0xc019
  770. #define OP_PCL_TLS12_AES_256_CBC_SHA_15 0xc020
  771. #define OP_PCL_TLS12_AES_256_CBC_SHA_16 0xc021
  772. #define OP_PCL_TLS12_AES_256_CBC_SHA_17 0xc022
  773. /* #define OP_PCL_TLS12_3DES_EDE_CBC_MD5 0x0023 */
  774. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA 0x001f
  775. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_2 0x008b
  776. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_3 0x008f
  777. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_4 0x0093
  778. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_5 0x000a
  779. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_6 0x000d
  780. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_7 0x0010
  781. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_8 0x0013
  782. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_9 0x0016
  783. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_10 0x001b
  784. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_11 0xc003
  785. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_12 0xc008
  786. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_13 0xc00d
  787. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_14 0xc012
  788. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_15 0xc017
  789. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_16 0xc01a
  790. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_17 0xc01b
  791. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_18 0xc01c
  792. #define OP_PCL_TLS12_DES40_CBC_MD5 0x0029
  793. #define OP_PCL_TLS12_DES_CBC_MD5 0x0022
  794. #define OP_PCL_TLS12_DES40_CBC_SHA 0x0008
  795. #define OP_PCL_TLS12_DES40_CBC_SHA_2 0x000b
  796. #define OP_PCL_TLS12_DES40_CBC_SHA_3 0x000e
  797. #define OP_PCL_TLS12_DES40_CBC_SHA_4 0x0011
  798. #define OP_PCL_TLS12_DES40_CBC_SHA_5 0x0014
  799. #define OP_PCL_TLS12_DES40_CBC_SHA_6 0x0019
  800. #define OP_PCL_TLS12_DES40_CBC_SHA_7 0x0026
  801. #define OP_PCL_TLS12_DES_CBC_SHA 0x001e
  802. #define OP_PCL_TLS12_DES_CBC_SHA_2 0x0009
  803. #define OP_PCL_TLS12_DES_CBC_SHA_3 0x000c
  804. #define OP_PCL_TLS12_DES_CBC_SHA_4 0x000f
  805. #define OP_PCL_TLS12_DES_CBC_SHA_5 0x0012
  806. #define OP_PCL_TLS12_DES_CBC_SHA_6 0x0015
  807. #define OP_PCL_TLS12_DES_CBC_SHA_7 0x001a
  808. #define OP_PCL_TLS12_RC4_128_MD5 0x0024
  809. #define OP_PCL_TLS12_RC4_128_MD5_2 0x0004
  810. #define OP_PCL_TLS12_RC4_128_MD5_3 0x0018
  811. #define OP_PCL_TLS12_RC4_40_MD5 0x002b
  812. #define OP_PCL_TLS12_RC4_40_MD5_2 0x0003
  813. #define OP_PCL_TLS12_RC4_40_MD5_3 0x0017
  814. #define OP_PCL_TLS12_RC4_128_SHA 0x0020
  815. #define OP_PCL_TLS12_RC4_128_SHA_2 0x008a
  816. #define OP_PCL_TLS12_RC4_128_SHA_3 0x008e
  817. #define OP_PCL_TLS12_RC4_128_SHA_4 0x0092
  818. #define OP_PCL_TLS12_RC4_128_SHA_5 0x0005
  819. #define OP_PCL_TLS12_RC4_128_SHA_6 0xc002
  820. #define OP_PCL_TLS12_RC4_128_SHA_7 0xc007
  821. #define OP_PCL_TLS12_RC4_128_SHA_8 0xc00c
  822. #define OP_PCL_TLS12_RC4_128_SHA_9 0xc011
  823. #define OP_PCL_TLS12_RC4_128_SHA_10 0xc016
  824. #define OP_PCL_TLS12_RC4_40_SHA 0x0028
  825. /* #define OP_PCL_TLS12_AES_128_CBC_SHA256 0x003c */
  826. #define OP_PCL_TLS12_AES_128_CBC_SHA256_2 0x003e
  827. #define OP_PCL_TLS12_AES_128_CBC_SHA256_3 0x003f
  828. #define OP_PCL_TLS12_AES_128_CBC_SHA256_4 0x0040
  829. #define OP_PCL_TLS12_AES_128_CBC_SHA256_5 0x0067
  830. #define OP_PCL_TLS12_AES_128_CBC_SHA256_6 0x006c
  831. /* #define OP_PCL_TLS12_AES_256_CBC_SHA256 0x003d */
  832. #define OP_PCL_TLS12_AES_256_CBC_SHA256_2 0x0068
  833. #define OP_PCL_TLS12_AES_256_CBC_SHA256_3 0x0069
  834. #define OP_PCL_TLS12_AES_256_CBC_SHA256_4 0x006a
  835. #define OP_PCL_TLS12_AES_256_CBC_SHA256_5 0x006b
  836. #define OP_PCL_TLS12_AES_256_CBC_SHA256_6 0x006d
  837. /* AEAD_AES_xxx_CCM/GCM remain to be defined... */
  838. #define OP_PCL_TLS12_3DES_EDE_CBC_MD5 0xff23
  839. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA160 0xff30
  840. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA224 0xff34
  841. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA256 0xff36
  842. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA384 0xff33
  843. #define OP_PCL_TLS12_3DES_EDE_CBC_SHA512 0xff35
  844. #define OP_PCL_TLS12_AES_128_CBC_SHA160 0xff80
  845. #define OP_PCL_TLS12_AES_128_CBC_SHA224 0xff84
  846. #define OP_PCL_TLS12_AES_128_CBC_SHA256 0xff86
  847. #define OP_PCL_TLS12_AES_128_CBC_SHA384 0xff83
  848. #define OP_PCL_TLS12_AES_128_CBC_SHA512 0xff85
  849. #define OP_PCL_TLS12_AES_192_CBC_SHA160 0xff20
  850. #define OP_PCL_TLS12_AES_192_CBC_SHA224 0xff24
  851. #define OP_PCL_TLS12_AES_192_CBC_SHA256 0xff26
  852. #define OP_PCL_TLS12_AES_192_CBC_SHA384 0xff23
  853. #define OP_PCL_TLS12_AES_192_CBC_SHA512 0xff25
  854. #define OP_PCL_TLS12_AES_256_CBC_SHA160 0xff60
  855. #define OP_PCL_TLS12_AES_256_CBC_SHA224 0xff64
  856. #define OP_PCL_TLS12_AES_256_CBC_SHA256 0xff66
  857. #define OP_PCL_TLS12_AES_256_CBC_SHA384 0xff63
  858. #define OP_PCL_TLS12_AES_256_CBC_SHA512 0xff65
  859. /* For DTLS - OP_PCLID_DTLS */
  860. #define OP_PCL_DTLS_AES_128_CBC_SHA 0x002f
  861. #define OP_PCL_DTLS_AES_128_CBC_SHA_2 0x0030
  862. #define OP_PCL_DTLS_AES_128_CBC_SHA_3 0x0031
  863. #define OP_PCL_DTLS_AES_128_CBC_SHA_4 0x0032
  864. #define OP_PCL_DTLS_AES_128_CBC_SHA_5 0x0033
  865. #define OP_PCL_DTLS_AES_128_CBC_SHA_6 0x0034
  866. #define OP_PCL_DTLS_AES_128_CBC_SHA_7 0x008c
  867. #define OP_PCL_DTLS_AES_128_CBC_SHA_8 0x0090
  868. #define OP_PCL_DTLS_AES_128_CBC_SHA_9 0x0094
  869. #define OP_PCL_DTLS_AES_128_CBC_SHA_10 0xc004
  870. #define OP_PCL_DTLS_AES_128_CBC_SHA_11 0xc009
  871. #define OP_PCL_DTLS_AES_128_CBC_SHA_12 0xc00e
  872. #define OP_PCL_DTLS_AES_128_CBC_SHA_13 0xc013
  873. #define OP_PCL_DTLS_AES_128_CBC_SHA_14 0xc018
  874. #define OP_PCL_DTLS_AES_128_CBC_SHA_15 0xc01d
  875. #define OP_PCL_DTLS_AES_128_CBC_SHA_16 0xc01e
  876. #define OP_PCL_DTLS_AES_128_CBC_SHA_17 0xc01f
  877. #define OP_PCL_DTLS_AES_256_CBC_SHA 0x0035
  878. #define OP_PCL_DTLS_AES_256_CBC_SHA_2 0x0036
  879. #define OP_PCL_DTLS_AES_256_CBC_SHA_3 0x0037
  880. #define OP_PCL_DTLS_AES_256_CBC_SHA_4 0x0038
  881. #define OP_PCL_DTLS_AES_256_CBC_SHA_5 0x0039
  882. #define OP_PCL_DTLS_AES_256_CBC_SHA_6 0x003a
  883. #define OP_PCL_DTLS_AES_256_CBC_SHA_7 0x008d
  884. #define OP_PCL_DTLS_AES_256_CBC_SHA_8 0x0091
  885. #define OP_PCL_DTLS_AES_256_CBC_SHA_9 0x0095
  886. #define OP_PCL_DTLS_AES_256_CBC_SHA_10 0xc005
  887. #define OP_PCL_DTLS_AES_256_CBC_SHA_11 0xc00a
  888. #define OP_PCL_DTLS_AES_256_CBC_SHA_12 0xc00f
  889. #define OP_PCL_DTLS_AES_256_CBC_SHA_13 0xc014
  890. #define OP_PCL_DTLS_AES_256_CBC_SHA_14 0xc019
  891. #define OP_PCL_DTLS_AES_256_CBC_SHA_15 0xc020
  892. #define OP_PCL_DTLS_AES_256_CBC_SHA_16 0xc021
  893. #define OP_PCL_DTLS_AES_256_CBC_SHA_17 0xc022
  894. /* #define OP_PCL_DTLS_3DES_EDE_CBC_MD5 0x0023 */
  895. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA 0x001f
  896. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_2 0x008b
  897. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_3 0x008f
  898. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_4 0x0093
  899. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_5 0x000a
  900. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_6 0x000d
  901. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_7 0x0010
  902. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_8 0x0013
  903. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_9 0x0016
  904. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_10 0x001b
  905. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_11 0xc003
  906. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_12 0xc008
  907. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_13 0xc00d
  908. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_14 0xc012
  909. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_15 0xc017
  910. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_16 0xc01a
  911. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_17 0xc01b
  912. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_18 0xc01c
  913. #define OP_PCL_DTLS_DES40_CBC_MD5 0x0029
  914. #define OP_PCL_DTLS_DES_CBC_MD5 0x0022
  915. #define OP_PCL_DTLS_DES40_CBC_SHA 0x0008
  916. #define OP_PCL_DTLS_DES40_CBC_SHA_2 0x000b
  917. #define OP_PCL_DTLS_DES40_CBC_SHA_3 0x000e
  918. #define OP_PCL_DTLS_DES40_CBC_SHA_4 0x0011
  919. #define OP_PCL_DTLS_DES40_CBC_SHA_5 0x0014
  920. #define OP_PCL_DTLS_DES40_CBC_SHA_6 0x0019
  921. #define OP_PCL_DTLS_DES40_CBC_SHA_7 0x0026
  922. #define OP_PCL_DTLS_DES_CBC_SHA 0x001e
  923. #define OP_PCL_DTLS_DES_CBC_SHA_2 0x0009
  924. #define OP_PCL_DTLS_DES_CBC_SHA_3 0x000c
  925. #define OP_PCL_DTLS_DES_CBC_SHA_4 0x000f
  926. #define OP_PCL_DTLS_DES_CBC_SHA_5 0x0012
  927. #define OP_PCL_DTLS_DES_CBC_SHA_6 0x0015
  928. #define OP_PCL_DTLS_DES_CBC_SHA_7 0x001a
  929. #define OP_PCL_DTLS_3DES_EDE_CBC_MD5 0xff23
  930. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA160 0xff30
  931. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA224 0xff34
  932. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA256 0xff36
  933. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA384 0xff33
  934. #define OP_PCL_DTLS_3DES_EDE_CBC_SHA512 0xff35
  935. #define OP_PCL_DTLS_AES_128_CBC_SHA160 0xff80
  936. #define OP_PCL_DTLS_AES_128_CBC_SHA224 0xff84
  937. #define OP_PCL_DTLS_AES_128_CBC_SHA256 0xff86
  938. #define OP_PCL_DTLS_AES_128_CBC_SHA384 0xff83
  939. #define OP_PCL_DTLS_AES_128_CBC_SHA512 0xff85
  940. #define OP_PCL_DTLS_AES_192_CBC_SHA160 0xff20
  941. #define OP_PCL_DTLS_AES_192_CBC_SHA224 0xff24
  942. #define OP_PCL_DTLS_AES_192_CBC_SHA256 0xff26
  943. #define OP_PCL_DTLS_AES_192_CBC_SHA384 0xff23
  944. #define OP_PCL_DTLS_AES_192_CBC_SHA512 0xff25
  945. #define OP_PCL_DTLS_AES_256_CBC_SHA160 0xff60
  946. #define OP_PCL_DTLS_AES_256_CBC_SHA224 0xff64
  947. #define OP_PCL_DTLS_AES_256_CBC_SHA256 0xff66
  948. #define OP_PCL_DTLS_AES_256_CBC_SHA384 0xff63
  949. #define OP_PCL_DTLS_AES_256_CBC_SHA512 0xff65
  950. /* 802.16 WiMAX protinfos */
  951. #define OP_PCL_WIMAX_OFDM 0x0201
  952. #define OP_PCL_WIMAX_OFDMA 0x0231
  953. /* 802.11 WiFi protinfos */
  954. #define OP_PCL_WIFI 0xac04
  955. /* MacSec protinfos */
  956. #define OP_PCL_MACSEC 0x0001
  957. /* Derived Key Protocol (DKP) Protinfo */
  958. #define OP_PCL_DKP_SRC_SHIFT 14
  959. #define OP_PCL_DKP_SRC_MASK (3 << OP_PCL_DKP_SRC_SHIFT)
  960. #define OP_PCL_DKP_SRC_IMM (0 << OP_PCL_DKP_SRC_SHIFT)
  961. #define OP_PCL_DKP_SRC_SEQ (1 << OP_PCL_DKP_SRC_SHIFT)
  962. #define OP_PCL_DKP_SRC_PTR (2 << OP_PCL_DKP_SRC_SHIFT)
  963. #define OP_PCL_DKP_SRC_SGF (3 << OP_PCL_DKP_SRC_SHIFT)
  964. #define OP_PCL_DKP_DST_SHIFT 12
  965. #define OP_PCL_DKP_DST_MASK (3 << OP_PCL_DKP_DST_SHIFT)
  966. #define OP_PCL_DKP_DST_IMM (0 << OP_PCL_DKP_DST_SHIFT)
  967. #define OP_PCL_DKP_DST_SEQ (1 << OP_PCL_DKP_DST_SHIFT)
  968. #define OP_PCL_DKP_DST_PTR (2 << OP_PCL_DKP_DST_SHIFT)
  969. #define OP_PCL_DKP_DST_SGF (3 << OP_PCL_DKP_DST_SHIFT)
  970. #define OP_PCL_DKP_KEY_SHIFT 0
  971. #define OP_PCL_DKP_KEY_MASK (0xfff << OP_PCL_DKP_KEY_SHIFT)
  972. /* PKI unidirectional protocol protinfo bits */
  973. #define OP_PCL_PKPROT_TEST 0x0008
  974. #define OP_PCL_PKPROT_DECRYPT 0x0004
  975. #define OP_PCL_PKPROT_ECC 0x0002
  976. #define OP_PCL_PKPROT_F2M 0x0001
  977. /* For non-protocol/alg-only op commands */
  978. #define OP_ALG_TYPE_SHIFT 24
  979. #define OP_ALG_TYPE_MASK (0x7 << OP_ALG_TYPE_SHIFT)
  980. #define OP_ALG_TYPE_CLASS1 (2 << OP_ALG_TYPE_SHIFT)
  981. #define OP_ALG_TYPE_CLASS2 (4 << OP_ALG_TYPE_SHIFT)
  982. #define OP_ALG_ALGSEL_SHIFT 16
  983. #define OP_ALG_ALGSEL_MASK (0xff << OP_ALG_ALGSEL_SHIFT)
  984. #define OP_ALG_ALGSEL_SUBMASK (0x0f << OP_ALG_ALGSEL_SHIFT)
  985. #define OP_ALG_ALGSEL_AES (0x10 << OP_ALG_ALGSEL_SHIFT)
  986. #define OP_ALG_ALGSEL_DES (0x20 << OP_ALG_ALGSEL_SHIFT)
  987. #define OP_ALG_ALGSEL_3DES (0x21 << OP_ALG_ALGSEL_SHIFT)
  988. #define OP_ALG_ALGSEL_ARC4 (0x30 << OP_ALG_ALGSEL_SHIFT)
  989. #define OP_ALG_ALGSEL_MD5 (0x40 << OP_ALG_ALGSEL_SHIFT)
  990. #define OP_ALG_ALGSEL_SHA1 (0x41 << OP_ALG_ALGSEL_SHIFT)
  991. #define OP_ALG_ALGSEL_SHA224 (0x42 << OP_ALG_ALGSEL_SHIFT)
  992. #define OP_ALG_ALGSEL_SHA256 (0x43 << OP_ALG_ALGSEL_SHIFT)
  993. #define OP_ALG_ALGSEL_SHA384 (0x44 << OP_ALG_ALGSEL_SHIFT)
  994. #define OP_ALG_ALGSEL_SHA512 (0x45 << OP_ALG_ALGSEL_SHIFT)
  995. #define OP_ALG_ALGSEL_RNG (0x50 << OP_ALG_ALGSEL_SHIFT)
  996. #define OP_ALG_ALGSEL_SNOW (0x60 << OP_ALG_ALGSEL_SHIFT)
  997. #define OP_ALG_ALGSEL_SNOW_F8 (0x60 << OP_ALG_ALGSEL_SHIFT)
  998. #define OP_ALG_ALGSEL_KASUMI (0x70 << OP_ALG_ALGSEL_SHIFT)
  999. #define OP_ALG_ALGSEL_CRC (0x90 << OP_ALG_ALGSEL_SHIFT)
  1000. #define OP_ALG_ALGSEL_SNOW_F9 (0xA0 << OP_ALG_ALGSEL_SHIFT)
  1001. #define OP_ALG_AAI_SHIFT 4
  1002. #define OP_ALG_AAI_MASK (0x1ff << OP_ALG_AAI_SHIFT)
  1003. /* blockcipher AAI set */
  1004. #define OP_ALG_AAI_CTR_MOD128 (0x00 << OP_ALG_AAI_SHIFT)
  1005. #define OP_ALG_AAI_CTR_MOD8 (0x01 << OP_ALG_AAI_SHIFT)
  1006. #define OP_ALG_AAI_CTR_MOD16 (0x02 << OP_ALG_AAI_SHIFT)
  1007. #define OP_ALG_AAI_CTR_MOD24 (0x03 << OP_ALG_AAI_SHIFT)
  1008. #define OP_ALG_AAI_CTR_MOD32 (0x04 << OP_ALG_AAI_SHIFT)
  1009. #define OP_ALG_AAI_CTR_MOD40 (0x05 << OP_ALG_AAI_SHIFT)
  1010. #define OP_ALG_AAI_CTR_MOD48 (0x06 << OP_ALG_AAI_SHIFT)
  1011. #define OP_ALG_AAI_CTR_MOD56 (0x07 << OP_ALG_AAI_SHIFT)
  1012. #define OP_ALG_AAI_CTR_MOD64 (0x08 << OP_ALG_AAI_SHIFT)
  1013. #define OP_ALG_AAI_CTR_MOD72 (0x09 << OP_ALG_AAI_SHIFT)
  1014. #define OP_ALG_AAI_CTR_MOD80 (0x0a << OP_ALG_AAI_SHIFT)
  1015. #define OP_ALG_AAI_CTR_MOD88 (0x0b << OP_ALG_AAI_SHIFT)
  1016. #define OP_ALG_AAI_CTR_MOD96 (0x0c << OP_ALG_AAI_SHIFT)
  1017. #define OP_ALG_AAI_CTR_MOD104 (0x0d << OP_ALG_AAI_SHIFT)
  1018. #define OP_ALG_AAI_CTR_MOD112 (0x0e << OP_ALG_AAI_SHIFT)
  1019. #define OP_ALG_AAI_CTR_MOD120 (0x0f << OP_ALG_AAI_SHIFT)
  1020. #define OP_ALG_AAI_CBC (0x10 << OP_ALG_AAI_SHIFT)
  1021. #define OP_ALG_AAI_ECB (0x20 << OP_ALG_AAI_SHIFT)
  1022. #define OP_ALG_AAI_CFB (0x30 << OP_ALG_AAI_SHIFT)
  1023. #define OP_ALG_AAI_OFB (0x40 << OP_ALG_AAI_SHIFT)
  1024. #define OP_ALG_AAI_XTS (0x50 << OP_ALG_AAI_SHIFT)
  1025. #define OP_ALG_AAI_CMAC (0x60 << OP_ALG_AAI_SHIFT)
  1026. #define OP_ALG_AAI_XCBC_MAC (0x70 << OP_ALG_AAI_SHIFT)
  1027. #define OP_ALG_AAI_CCM (0x80 << OP_ALG_AAI_SHIFT)
  1028. #define OP_ALG_AAI_GCM (0x90 << OP_ALG_AAI_SHIFT)
  1029. #define OP_ALG_AAI_CBC_XCBCMAC (0xa0 << OP_ALG_AAI_SHIFT)
  1030. #define OP_ALG_AAI_CTR_XCBCMAC (0xb0 << OP_ALG_AAI_SHIFT)
  1031. #define OP_ALG_AAI_CHECKODD (0x80 << OP_ALG_AAI_SHIFT)
  1032. #define OP_ALG_AAI_DK (0x100 << OP_ALG_AAI_SHIFT)
  1033. /* randomizer AAI set */
  1034. #define OP_ALG_AAI_RNG (0x00 << OP_ALG_AAI_SHIFT)
  1035. #define OP_ALG_AAI_RNG_NZB (0x10 << OP_ALG_AAI_SHIFT)
  1036. #define OP_ALG_AAI_RNG_OBP (0x20 << OP_ALG_AAI_SHIFT)
  1037. /* RNG4 AAI set */
  1038. #define OP_ALG_AAI_RNG4_SH_0 (0x00 << OP_ALG_AAI_SHIFT)
  1039. #define OP_ALG_AAI_RNG4_SH_1 (0x01 << OP_ALG_AAI_SHIFT)
  1040. #define OP_ALG_AAI_RNG4_PS (0x40 << OP_ALG_AAI_SHIFT)
  1041. #define OP_ALG_AAI_RNG4_AI (0x80 << OP_ALG_AAI_SHIFT)
  1042. #define OP_ALG_AAI_RNG4_SK (0x100 << OP_ALG_AAI_SHIFT)
  1043. /* hmac/smac AAI set */
  1044. #define OP_ALG_AAI_HASH (0x00 << OP_ALG_AAI_SHIFT)
  1045. #define OP_ALG_AAI_HMAC (0x01 << OP_ALG_AAI_SHIFT)
  1046. #define OP_ALG_AAI_SMAC (0x02 << OP_ALG_AAI_SHIFT)
  1047. #define OP_ALG_AAI_HMAC_PRECOMP (0x04 << OP_ALG_AAI_SHIFT)
  1048. /* CRC AAI set*/
  1049. #define OP_ALG_AAI_802 (0x01 << OP_ALG_AAI_SHIFT)
  1050. #define OP_ALG_AAI_3385 (0x02 << OP_ALG_AAI_SHIFT)
  1051. #define OP_ALG_AAI_CUST_POLY (0x04 << OP_ALG_AAI_SHIFT)
  1052. #define OP_ALG_AAI_DIS (0x10 << OP_ALG_AAI_SHIFT)
  1053. #define OP_ALG_AAI_DOS (0x20 << OP_ALG_AAI_SHIFT)
  1054. #define OP_ALG_AAI_DOC (0x40 << OP_ALG_AAI_SHIFT)
  1055. /* Kasumi/SNOW AAI set */
  1056. #define OP_ALG_AAI_F8 (0xc0 << OP_ALG_AAI_SHIFT)
  1057. #define OP_ALG_AAI_F9 (0xc8 << OP_ALG_AAI_SHIFT)
  1058. #define OP_ALG_AAI_GSM (0x10 << OP_ALG_AAI_SHIFT)
  1059. #define OP_ALG_AAI_EDGE (0x20 << OP_ALG_AAI_SHIFT)
  1060. #define OP_ALG_AS_SHIFT 2
  1061. #define OP_ALG_AS_MASK (0x3 << OP_ALG_AS_SHIFT)
  1062. #define OP_ALG_AS_UPDATE (0 << OP_ALG_AS_SHIFT)
  1063. #define OP_ALG_AS_INIT (1 << OP_ALG_AS_SHIFT)
  1064. #define OP_ALG_AS_FINALIZE (2 << OP_ALG_AS_SHIFT)
  1065. #define OP_ALG_AS_INITFINAL (3 << OP_ALG_AS_SHIFT)
  1066. #define OP_ALG_ICV_SHIFT 1
  1067. #define OP_ALG_ICV_MASK (1 << OP_ALG_ICV_SHIFT)
  1068. #define OP_ALG_ICV_OFF (0 << OP_ALG_ICV_SHIFT)
  1069. #define OP_ALG_ICV_ON (1 << OP_ALG_ICV_SHIFT)
  1070. #define OP_ALG_DIR_SHIFT 0
  1071. #define OP_ALG_DIR_MASK 1
  1072. #define OP_ALG_DECRYPT 0
  1073. #define OP_ALG_ENCRYPT 1
  1074. /* PKHA algorithm type set */
  1075. #define OP_ALG_PK 0x00800000
  1076. #define OP_ALG_PK_FUN_MASK 0x3f /* clrmem, modmath, or cpymem */
  1077. /* PKHA mode clear memory functions */
  1078. #define OP_ALG_PKMODE_A_RAM 0x80000
  1079. #define OP_ALG_PKMODE_B_RAM 0x40000
  1080. #define OP_ALG_PKMODE_E_RAM 0x20000
  1081. #define OP_ALG_PKMODE_N_RAM 0x10000
  1082. #define OP_ALG_PKMODE_CLEARMEM 0x00001
  1083. /* PKHA mode modular-arithmetic functions */
  1084. #define OP_ALG_PKMODE_MOD_IN_MONTY 0x80000
  1085. #define OP_ALG_PKMODE_MOD_OUT_MONTY 0x40000
  1086. #define OP_ALG_PKMODE_MOD_F2M 0x20000
  1087. #define OP_ALG_PKMODE_MOD_R2_IN 0x10000
  1088. #define OP_ALG_PKMODE_PRJECTV 0x00800
  1089. #define OP_ALG_PKMODE_TIME_EQ 0x400
  1090. #define OP_ALG_PKMODE_OUT_B 0x000
  1091. #define OP_ALG_PKMODE_OUT_A 0x100
  1092. #define OP_ALG_PKMODE_MOD_ADD 0x002
  1093. #define OP_ALG_PKMODE_MOD_SUB_AB 0x003
  1094. #define OP_ALG_PKMODE_MOD_SUB_BA 0x004
  1095. #define OP_ALG_PKMODE_MOD_MULT 0x005
  1096. #define OP_ALG_PKMODE_MOD_EXPO 0x006
  1097. #define OP_ALG_PKMODE_MOD_REDUCT 0x007
  1098. #define OP_ALG_PKMODE_MOD_INV 0x008
  1099. #define OP_ALG_PKMODE_MOD_ECC_ADD 0x009
  1100. #define OP_ALG_PKMODE_MOD_ECC_DBL 0x00a
  1101. #define OP_ALG_PKMODE_MOD_ECC_MULT 0x00b
  1102. #define OP_ALG_PKMODE_MOD_MONT_CNST 0x00c
  1103. #define OP_ALG_PKMODE_MOD_CRT_CNST 0x00d
  1104. #define OP_ALG_PKMODE_MOD_GCD 0x00e
  1105. #define OP_ALG_PKMODE_MOD_PRIMALITY 0x00f
  1106. /* PKHA mode copy-memory functions */
  1107. #define OP_ALG_PKMODE_SRC_REG_SHIFT 17
  1108. #define OP_ALG_PKMODE_SRC_REG_MASK (7 << OP_ALG_PKMODE_SRC_REG_SHIFT)
  1109. #define OP_ALG_PKMODE_DST_REG_SHIFT 10
  1110. #define OP_ALG_PKMODE_DST_REG_MASK (7 << OP_ALG_PKMODE_DST_REG_SHIFT)
  1111. #define OP_ALG_PKMODE_SRC_SEG_SHIFT 8
  1112. #define OP_ALG_PKMODE_SRC_SEG_MASK (3 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
  1113. #define OP_ALG_PKMODE_DST_SEG_SHIFT 6
  1114. #define OP_ALG_PKMODE_DST_SEG_MASK (3 << OP_ALG_PKMODE_DST_SEG_SHIFT)
  1115. #define OP_ALG_PKMODE_SRC_REG_A (0 << OP_ALG_PKMODE_SRC_REG_SHIFT)
  1116. #define OP_ALG_PKMODE_SRC_REG_B (1 << OP_ALG_PKMODE_SRC_REG_SHIFT)
  1117. #define OP_ALG_PKMODE_SRC_REG_N (3 << OP_ALG_PKMODE_SRC_REG_SHIFT)
  1118. #define OP_ALG_PKMODE_DST_REG_A (0 << OP_ALG_PKMODE_DST_REG_SHIFT)
  1119. #define OP_ALG_PKMODE_DST_REG_B (1 << OP_ALG_PKMODE_DST_REG_SHIFT)
  1120. #define OP_ALG_PKMODE_DST_REG_E (2 << OP_ALG_PKMODE_DST_REG_SHIFT)
  1121. #define OP_ALG_PKMODE_DST_REG_N (3 << OP_ALG_PKMODE_DST_REG_SHIFT)
  1122. #define OP_ALG_PKMODE_SRC_SEG_0 (0 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
  1123. #define OP_ALG_PKMODE_SRC_SEG_1 (1 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
  1124. #define OP_ALG_PKMODE_SRC_SEG_2 (2 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
  1125. #define OP_ALG_PKMODE_SRC_SEG_3 (3 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
  1126. #define OP_ALG_PKMODE_DST_SEG_0 (0 << OP_ALG_PKMODE_DST_SEG_SHIFT)
  1127. #define OP_ALG_PKMODE_DST_SEG_1 (1 << OP_ALG_PKMODE_DST_SEG_SHIFT)
  1128. #define OP_ALG_PKMODE_DST_SEG_2 (2 << OP_ALG_PKMODE_DST_SEG_SHIFT)
  1129. #define OP_ALG_PKMODE_DST_SEG_3 (3 << OP_ALG_PKMODE_DST_SEG_SHIFT)
  1130. #define OP_ALG_PKMODE_CPYMEM_N_SZ 0x80
  1131. #define OP_ALG_PKMODE_CPYMEM_SRC_SZ 0x81
  1132. /*
  1133. * SEQ_IN_PTR Command Constructs
  1134. */
  1135. /* Release Buffers */
  1136. #define SQIN_RBS 0x04000000
  1137. /* Sequence pointer is really a descriptor */
  1138. #define SQIN_INL 0x02000000
  1139. /* Sequence pointer is a scatter-gather table */
  1140. #define SQIN_SGF 0x01000000
  1141. /* Appends to a previous pointer */
  1142. #define SQIN_PRE 0x00800000
  1143. /* Use extended length following pointer */
  1144. #define SQIN_EXT 0x00400000
  1145. /* Restore sequence with pointer/length */
  1146. #define SQIN_RTO 0x00200000
  1147. /* Replace job descriptor */
  1148. #define SQIN_RJD 0x00100000
  1149. #define SQIN_LEN_SHIFT 0
  1150. #define SQIN_LEN_MASK (0xffff << SQIN_LEN_SHIFT)
  1151. /*
  1152. * SEQ_OUT_PTR Command Constructs
  1153. */
  1154. /* Sequence pointer is a scatter-gather table */
  1155. #define SQOUT_SGF 0x01000000
  1156. /* Appends to a previous pointer */
  1157. #define SQOUT_PRE SQIN_PRE
  1158. /* Restore sequence with pointer/length */
  1159. #define SQOUT_RTO SQIN_RTO
  1160. /* Use extended length following pointer */
  1161. #define SQOUT_EXT 0x00400000
  1162. #define SQOUT_LEN_SHIFT 0
  1163. #define SQOUT_LEN_MASK (0xffff << SQOUT_LEN_SHIFT)
  1164. /*
  1165. * SIGNATURE Command Constructs
  1166. */
  1167. /* TYPE field is all that's relevant */
  1168. #define SIGN_TYPE_SHIFT 16
  1169. #define SIGN_TYPE_MASK (0x0f << SIGN_TYPE_SHIFT)
  1170. #define SIGN_TYPE_FINAL (0x00 << SIGN_TYPE_SHIFT)
  1171. #define SIGN_TYPE_FINAL_RESTORE (0x01 << SIGN_TYPE_SHIFT)
  1172. #define SIGN_TYPE_FINAL_NONZERO (0x02 << SIGN_TYPE_SHIFT)
  1173. #define SIGN_TYPE_IMM_2 (0x0a << SIGN_TYPE_SHIFT)
  1174. #define SIGN_TYPE_IMM_3 (0x0b << SIGN_TYPE_SHIFT)
  1175. #define SIGN_TYPE_IMM_4 (0x0c << SIGN_TYPE_SHIFT)
  1176. /*
  1177. * MOVE Command Constructs
  1178. */
  1179. #define MOVE_AUX_SHIFT 25
  1180. #define MOVE_AUX_MASK (3 << MOVE_AUX_SHIFT)
  1181. #define MOVE_AUX_MS (2 << MOVE_AUX_SHIFT)
  1182. #define MOVE_AUX_LS (1 << MOVE_AUX_SHIFT)
  1183. #define MOVE_WAITCOMP_SHIFT 24
  1184. #define MOVE_WAITCOMP_MASK (1 << MOVE_WAITCOMP_SHIFT)
  1185. #define MOVE_WAITCOMP (1 << MOVE_WAITCOMP_SHIFT)
  1186. #define MOVE_SRC_SHIFT 20
  1187. #define MOVE_SRC_MASK (0x0f << MOVE_SRC_SHIFT)
  1188. #define MOVE_SRC_CLASS1CTX (0x00 << MOVE_SRC_SHIFT)
  1189. #define MOVE_SRC_CLASS2CTX (0x01 << MOVE_SRC_SHIFT)
  1190. #define MOVE_SRC_OUTFIFO (0x02 << MOVE_SRC_SHIFT)
  1191. #define MOVE_SRC_DESCBUF (0x03 << MOVE_SRC_SHIFT)
  1192. #define MOVE_SRC_MATH0 (0x04 << MOVE_SRC_SHIFT)
  1193. #define MOVE_SRC_MATH1 (0x05 << MOVE_SRC_SHIFT)
  1194. #define MOVE_SRC_MATH2 (0x06 << MOVE_SRC_SHIFT)
  1195. #define MOVE_SRC_MATH3 (0x07 << MOVE_SRC_SHIFT)
  1196. #define MOVE_SRC_INFIFO (0x08 << MOVE_SRC_SHIFT)
  1197. #define MOVE_SRC_INFIFO_CL (0x09 << MOVE_SRC_SHIFT)
  1198. #define MOVE_DEST_SHIFT 16
  1199. #define MOVE_DEST_MASK (0x0f << MOVE_DEST_SHIFT)
  1200. #define MOVE_DEST_CLASS1CTX (0x00 << MOVE_DEST_SHIFT)
  1201. #define MOVE_DEST_CLASS2CTX (0x01 << MOVE_DEST_SHIFT)
  1202. #define MOVE_DEST_OUTFIFO (0x02 << MOVE_DEST_SHIFT)
  1203. #define MOVE_DEST_DESCBUF (0x03 << MOVE_DEST_SHIFT)
  1204. #define MOVE_DEST_MATH0 (0x04 << MOVE_DEST_SHIFT)
  1205. #define MOVE_DEST_MATH1 (0x05 << MOVE_DEST_SHIFT)
  1206. #define MOVE_DEST_MATH2 (0x06 << MOVE_DEST_SHIFT)
  1207. #define MOVE_DEST_MATH3 (0x07 << MOVE_DEST_SHIFT)
  1208. #define MOVE_DEST_CLASS1INFIFO (0x08 << MOVE_DEST_SHIFT)
  1209. #define MOVE_DEST_CLASS2INFIFO (0x09 << MOVE_DEST_SHIFT)
  1210. #define MOVE_DEST_INFIFO_NOINFO (0x0a << MOVE_DEST_SHIFT)
  1211. #define MOVE_DEST_PK_A (0x0c << MOVE_DEST_SHIFT)
  1212. #define MOVE_DEST_CLASS1KEY (0x0d << MOVE_DEST_SHIFT)
  1213. #define MOVE_DEST_CLASS2KEY (0x0e << MOVE_DEST_SHIFT)
  1214. #define MOVE_OFFSET_SHIFT 8
  1215. #define MOVE_OFFSET_MASK (0xff << MOVE_OFFSET_SHIFT)
  1216. #define MOVE_LEN_SHIFT 0
  1217. #define MOVE_LEN_MASK (0xff << MOVE_LEN_SHIFT)
  1218. #define MOVELEN_MRSEL_SHIFT 0
  1219. #define MOVELEN_MRSEL_MASK (0x3 << MOVE_LEN_SHIFT)
  1220. /*
  1221. * MATH Command Constructs
  1222. */
  1223. #define MATH_IFB_SHIFT 26
  1224. #define MATH_IFB_MASK (1 << MATH_IFB_SHIFT)
  1225. #define MATH_IFB (1 << MATH_IFB_SHIFT)
  1226. #define MATH_NFU_SHIFT 25
  1227. #define MATH_NFU_MASK (1 << MATH_NFU_SHIFT)
  1228. #define MATH_NFU (1 << MATH_NFU_SHIFT)
  1229. #define MATH_STL_SHIFT 24
  1230. #define MATH_STL_MASK (1 << MATH_STL_SHIFT)
  1231. #define MATH_STL (1 << MATH_STL_SHIFT)
  1232. /* Function selectors */
  1233. #define MATH_FUN_SHIFT 20
  1234. #define MATH_FUN_MASK (0x0f << MATH_FUN_SHIFT)
  1235. #define MATH_FUN_ADD (0x00 << MATH_FUN_SHIFT)
  1236. #define MATH_FUN_ADDC (0x01 << MATH_FUN_SHIFT)
  1237. #define MATH_FUN_SUB (0x02 << MATH_FUN_SHIFT)
  1238. #define MATH_FUN_SUBB (0x03 << MATH_FUN_SHIFT)
  1239. #define MATH_FUN_OR (0x04 << MATH_FUN_SHIFT)
  1240. #define MATH_FUN_AND (0x05 << MATH_FUN_SHIFT)
  1241. #define MATH_FUN_XOR (0x06 << MATH_FUN_SHIFT)
  1242. #define MATH_FUN_LSHIFT (0x07 << MATH_FUN_SHIFT)
  1243. #define MATH_FUN_RSHIFT (0x08 << MATH_FUN_SHIFT)
  1244. #define MATH_FUN_SHLD (0x09 << MATH_FUN_SHIFT)
  1245. #define MATH_FUN_ZBYT (0x0a << MATH_FUN_SHIFT)
  1246. /* Source 0 selectors */
  1247. #define MATH_SRC0_SHIFT 16
  1248. #define MATH_SRC0_MASK (0x0f << MATH_SRC0_SHIFT)
  1249. #define MATH_SRC0_REG0 (0x00 << MATH_SRC0_SHIFT)
  1250. #define MATH_SRC0_REG1 (0x01 << MATH_SRC0_SHIFT)
  1251. #define MATH_SRC0_REG2 (0x02 << MATH_SRC0_SHIFT)
  1252. #define MATH_SRC0_REG3 (0x03 << MATH_SRC0_SHIFT)
  1253. #define MATH_SRC0_IMM (0x04 << MATH_SRC0_SHIFT)
  1254. #define MATH_SRC0_DPOVRD (0x07 << MATH_SRC0_SHIFT)
  1255. #define MATH_SRC0_SEQINLEN (0x08 << MATH_SRC0_SHIFT)
  1256. #define MATH_SRC0_SEQOUTLEN (0x09 << MATH_SRC0_SHIFT)
  1257. #define MATH_SRC0_VARSEQINLEN (0x0a << MATH_SRC0_SHIFT)
  1258. #define MATH_SRC0_VARSEQOUTLEN (0x0b << MATH_SRC0_SHIFT)
  1259. #define MATH_SRC0_ZERO (0x0c << MATH_SRC0_SHIFT)
  1260. /* Source 1 selectors */
  1261. #define MATH_SRC1_SHIFT 12
  1262. #define MATH_SRC1_MASK (0x0f << MATH_SRC1_SHIFT)
  1263. #define MATH_SRC1_REG0 (0x00 << MATH_SRC1_SHIFT)
  1264. #define MATH_SRC1_REG1 (0x01 << MATH_SRC1_SHIFT)
  1265. #define MATH_SRC1_REG2 (0x02 << MATH_SRC1_SHIFT)
  1266. #define MATH_SRC1_REG3 (0x03 << MATH_SRC1_SHIFT)
  1267. #define MATH_SRC1_IMM (0x04 << MATH_SRC1_SHIFT)
  1268. #define MATH_SRC1_DPOVRD (0x07 << MATH_SRC1_SHIFT)
  1269. #define MATH_SRC1_INFIFO (0x0a << MATH_SRC1_SHIFT)
  1270. #define MATH_SRC1_OUTFIFO (0x0b << MATH_SRC1_SHIFT)
  1271. #define MATH_SRC1_ONE (0x0c << MATH_SRC1_SHIFT)
  1272. /* Destination selectors */
  1273. #define MATH_DEST_SHIFT 8
  1274. #define MATH_DEST_MASK (0x0f << MATH_DEST_SHIFT)
  1275. #define MATH_DEST_REG0 (0x00 << MATH_DEST_SHIFT)
  1276. #define MATH_DEST_REG1 (0x01 << MATH_DEST_SHIFT)
  1277. #define MATH_DEST_REG2 (0x02 << MATH_DEST_SHIFT)
  1278. #define MATH_DEST_REG3 (0x03 << MATH_DEST_SHIFT)
  1279. #define MATH_DEST_DPOVRD (0x07 << MATH_DEST_SHIFT)
  1280. #define MATH_DEST_SEQINLEN (0x08 << MATH_DEST_SHIFT)
  1281. #define MATH_DEST_SEQOUTLEN (0x09 << MATH_DEST_SHIFT)
  1282. #define MATH_DEST_VARSEQINLEN (0x0a << MATH_DEST_SHIFT)
  1283. #define MATH_DEST_VARSEQOUTLEN (0x0b << MATH_DEST_SHIFT)
  1284. #define MATH_DEST_NONE (0x0f << MATH_DEST_SHIFT)
  1285. /* Length selectors */
  1286. #define MATH_LEN_SHIFT 0
  1287. #define MATH_LEN_MASK (0x0f << MATH_LEN_SHIFT)
  1288. #define MATH_LEN_1BYTE 0x01
  1289. #define MATH_LEN_2BYTE 0x02
  1290. #define MATH_LEN_4BYTE 0x04
  1291. #define MATH_LEN_8BYTE 0x08
  1292. /*
  1293. * JUMP Command Constructs
  1294. */
  1295. #define JUMP_CLASS_SHIFT 25
  1296. #define JUMP_CLASS_MASK (3 << JUMP_CLASS_SHIFT)
  1297. #define JUMP_CLASS_NONE 0
  1298. #define JUMP_CLASS_CLASS1 (1 << JUMP_CLASS_SHIFT)
  1299. #define JUMP_CLASS_CLASS2 (2 << JUMP_CLASS_SHIFT)
  1300. #define JUMP_CLASS_BOTH (3 << JUMP_CLASS_SHIFT)
  1301. #define JUMP_JSL_SHIFT 24
  1302. #define JUMP_JSL_MASK (1 << JUMP_JSL_SHIFT)
  1303. #define JUMP_JSL (1 << JUMP_JSL_SHIFT)
  1304. #define JUMP_TYPE_SHIFT 22
  1305. #define JUMP_TYPE_LOCAL (0x00 << JUMP_TYPE_SHIFT)
  1306. #define JUMP_TYPE_NONLOCAL (0x01 << JUMP_TYPE_SHIFT)
  1307. #define JUMP_TYPE_HALT (0x02 << JUMP_TYPE_SHIFT)
  1308. #define JUMP_TYPE_HALT_USER (0x03 << JUMP_TYPE_SHIFT)
  1309. #define JUMP_TEST_SHIFT 16
  1310. #define JUMP_TEST_MASK (0x03 << JUMP_TEST_SHIFT)
  1311. #define JUMP_TEST_ALL (0x00 << JUMP_TEST_SHIFT)
  1312. #define JUMP_TEST_INVALL (0x01 << JUMP_TEST_SHIFT)
  1313. #define JUMP_TEST_ANY (0x02 << JUMP_TEST_SHIFT)
  1314. #define JUMP_TEST_INVANY (0x03 << JUMP_TEST_SHIFT)
  1315. /* Condition codes. JSL bit is factored in */
  1316. #define JUMP_COND_SHIFT 8
  1317. #define JUMP_COND_MASK (0x100ff << JUMP_COND_SHIFT)
  1318. #define JUMP_COND_PK_0 (0x80 << JUMP_COND_SHIFT)
  1319. #define JUMP_COND_PK_GCD_1 (0x40 << JUMP_COND_SHIFT)
  1320. #define JUMP_COND_PK_PRIME (0x20 << JUMP_COND_SHIFT)
  1321. #define JUMP_COND_MATH_N (0x08 << JUMP_COND_SHIFT)
  1322. #define JUMP_COND_MATH_Z (0x04 << JUMP_COND_SHIFT)
  1323. #define JUMP_COND_MATH_C (0x02 << JUMP_COND_SHIFT)
  1324. #define JUMP_COND_MATH_NV (0x01 << JUMP_COND_SHIFT)
  1325. #define JUMP_COND_JRP ((0x80 << JUMP_COND_SHIFT) | JUMP_JSL)
  1326. #define JUMP_COND_SHRD ((0x40 << JUMP_COND_SHIFT) | JUMP_JSL)
  1327. #define JUMP_COND_SELF ((0x20 << JUMP_COND_SHIFT) | JUMP_JSL)
  1328. #define JUMP_COND_CALM ((0x10 << JUMP_COND_SHIFT) | JUMP_JSL)
  1329. #define JUMP_COND_NIP ((0x08 << JUMP_COND_SHIFT) | JUMP_JSL)
  1330. #define JUMP_COND_NIFP ((0x04 << JUMP_COND_SHIFT) | JUMP_JSL)
  1331. #define JUMP_COND_NOP ((0x02 << JUMP_COND_SHIFT) | JUMP_JSL)
  1332. #define JUMP_COND_NCP ((0x01 << JUMP_COND_SHIFT) | JUMP_JSL)
  1333. #define JUMP_OFFSET_SHIFT 0
  1334. #define JUMP_OFFSET_MASK (0xff << JUMP_OFFSET_SHIFT)
  1335. /*
  1336. * NFIFO ENTRY
  1337. * Data Constructs
  1338. *
  1339. */
  1340. #define NFIFOENTRY_DEST_SHIFT 30
  1341. #define NFIFOENTRY_DEST_MASK (3 << NFIFOENTRY_DEST_SHIFT)
  1342. #define NFIFOENTRY_DEST_DECO (0 << NFIFOENTRY_DEST_SHIFT)
  1343. #define NFIFOENTRY_DEST_CLASS1 (1 << NFIFOENTRY_DEST_SHIFT)
  1344. #define NFIFOENTRY_DEST_CLASS2 (2 << NFIFOENTRY_DEST_SHIFT)
  1345. #define NFIFOENTRY_DEST_BOTH (3 << NFIFOENTRY_DEST_SHIFT)
  1346. #define NFIFOENTRY_LC2_SHIFT 29
  1347. #define NFIFOENTRY_LC2_MASK (1 << NFIFOENTRY_LC2_SHIFT)
  1348. #define NFIFOENTRY_LC2 (1 << NFIFOENTRY_LC2_SHIFT)
  1349. #define NFIFOENTRY_LC1_SHIFT 28
  1350. #define NFIFOENTRY_LC1_MASK (1 << NFIFOENTRY_LC1_SHIFT)
  1351. #define NFIFOENTRY_LC1 (1 << NFIFOENTRY_LC1_SHIFT)
  1352. #define NFIFOENTRY_FC2_SHIFT 27
  1353. #define NFIFOENTRY_FC2_MASK (1 << NFIFOENTRY_FC2_SHIFT)
  1354. #define NFIFOENTRY_FC2 (1 << NFIFOENTRY_FC2_SHIFT)
  1355. #define NFIFOENTRY_FC1_SHIFT 26
  1356. #define NFIFOENTRY_FC1_MASK (1 << NFIFOENTRY_FC1_SHIFT)
  1357. #define NFIFOENTRY_FC1 (1 << NFIFOENTRY_FC1_SHIFT)
  1358. #define NFIFOENTRY_STYPE_SHIFT 24
  1359. #define NFIFOENTRY_STYPE_MASK (3 << NFIFOENTRY_STYPE_SHIFT)
  1360. #define NFIFOENTRY_STYPE_DFIFO (0 << NFIFOENTRY_STYPE_SHIFT)
  1361. #define NFIFOENTRY_STYPE_OFIFO (1 << NFIFOENTRY_STYPE_SHIFT)
  1362. #define NFIFOENTRY_STYPE_PAD (2 << NFIFOENTRY_STYPE_SHIFT)
  1363. #define NFIFOENTRY_STYPE_SNOOP (3 << NFIFOENTRY_STYPE_SHIFT)
  1364. #define NFIFOENTRY_DTYPE_SHIFT 20
  1365. #define NFIFOENTRY_DTYPE_MASK (0xF << NFIFOENTRY_DTYPE_SHIFT)
  1366. #define NFIFOENTRY_DTYPE_SBOX (0x0 << NFIFOENTRY_DTYPE_SHIFT)
  1367. #define NFIFOENTRY_DTYPE_AAD (0x1 << NFIFOENTRY_DTYPE_SHIFT)
  1368. #define NFIFOENTRY_DTYPE_IV (0x2 << NFIFOENTRY_DTYPE_SHIFT)
  1369. #define NFIFOENTRY_DTYPE_SAD (0x3 << NFIFOENTRY_DTYPE_SHIFT)
  1370. #define NFIFOENTRY_DTYPE_ICV (0xA << NFIFOENTRY_DTYPE_SHIFT)
  1371. #define NFIFOENTRY_DTYPE_SKIP (0xE << NFIFOENTRY_DTYPE_SHIFT)
  1372. #define NFIFOENTRY_DTYPE_MSG (0xF << NFIFOENTRY_DTYPE_SHIFT)
  1373. #define NFIFOENTRY_DTYPE_PK_A0 (0x0 << NFIFOENTRY_DTYPE_SHIFT)
  1374. #define NFIFOENTRY_DTYPE_PK_A1 (0x1 << NFIFOENTRY_DTYPE_SHIFT)
  1375. #define NFIFOENTRY_DTYPE_PK_A2 (0x2 << NFIFOENTRY_DTYPE_SHIFT)
  1376. #define NFIFOENTRY_DTYPE_PK_A3 (0x3 << NFIFOENTRY_DTYPE_SHIFT)
  1377. #define NFIFOENTRY_DTYPE_PK_B0 (0x4 << NFIFOENTRY_DTYPE_SHIFT)
  1378. #define NFIFOENTRY_DTYPE_PK_B1 (0x5 << NFIFOENTRY_DTYPE_SHIFT)
  1379. #define NFIFOENTRY_DTYPE_PK_B2 (0x6 << NFIFOENTRY_DTYPE_SHIFT)
  1380. #define NFIFOENTRY_DTYPE_PK_B3 (0x7 << NFIFOENTRY_DTYPE_SHIFT)
  1381. #define NFIFOENTRY_DTYPE_PK_N (0x8 << NFIFOENTRY_DTYPE_SHIFT)
  1382. #define NFIFOENTRY_DTYPE_PK_E (0x9 << NFIFOENTRY_DTYPE_SHIFT)
  1383. #define NFIFOENTRY_DTYPE_PK_A (0xC << NFIFOENTRY_DTYPE_SHIFT)
  1384. #define NFIFOENTRY_DTYPE_PK_B (0xD << NFIFOENTRY_DTYPE_SHIFT)
  1385. #define NFIFOENTRY_BND_SHIFT 19
  1386. #define NFIFOENTRY_BND_MASK (1 << NFIFOENTRY_BND_SHIFT)
  1387. #define NFIFOENTRY_BND (1 << NFIFOENTRY_BND_SHIFT)
  1388. #define NFIFOENTRY_PTYPE_SHIFT 16
  1389. #define NFIFOENTRY_PTYPE_MASK (0x7 << NFIFOENTRY_PTYPE_SHIFT)
  1390. #define NFIFOENTRY_PTYPE_ZEROS (0x0 << NFIFOENTRY_PTYPE_SHIFT)
  1391. #define NFIFOENTRY_PTYPE_RND_NOZEROS (0x1 << NFIFOENTRY_PTYPE_SHIFT)
  1392. #define NFIFOENTRY_PTYPE_INCREMENT (0x2 << NFIFOENTRY_PTYPE_SHIFT)
  1393. #define NFIFOENTRY_PTYPE_RND (0x3 << NFIFOENTRY_PTYPE_SHIFT)
  1394. #define NFIFOENTRY_PTYPE_ZEROS_NZ (0x4 << NFIFOENTRY_PTYPE_SHIFT)
  1395. #define NFIFOENTRY_PTYPE_RND_NZ_LZ (0x5 << NFIFOENTRY_PTYPE_SHIFT)
  1396. #define NFIFOENTRY_PTYPE_N (0x6 << NFIFOENTRY_PTYPE_SHIFT)
  1397. #define NFIFOENTRY_PTYPE_RND_NZ_N (0x7 << NFIFOENTRY_PTYPE_SHIFT)
  1398. #define NFIFOENTRY_OC_SHIFT 15
  1399. #define NFIFOENTRY_OC_MASK (1 << NFIFOENTRY_OC_SHIFT)
  1400. #define NFIFOENTRY_OC (1 << NFIFOENTRY_OC_SHIFT)
  1401. #define NFIFOENTRY_AST_SHIFT 14
  1402. #define NFIFOENTRY_AST_MASK (1 << NFIFOENTRY_OC_SHIFT)
  1403. #define NFIFOENTRY_AST (1 << NFIFOENTRY_OC_SHIFT)
  1404. #define NFIFOENTRY_BM_SHIFT 11
  1405. #define NFIFOENTRY_BM_MASK (1 << NFIFOENTRY_BM_SHIFT)
  1406. #define NFIFOENTRY_BM (1 << NFIFOENTRY_BM_SHIFT)
  1407. #define NFIFOENTRY_PS_SHIFT 10
  1408. #define NFIFOENTRY_PS_MASK (1 << NFIFOENTRY_PS_SHIFT)
  1409. #define NFIFOENTRY_PS (1 << NFIFOENTRY_PS_SHIFT)
  1410. #define NFIFOENTRY_DLEN_SHIFT 0
  1411. #define NFIFOENTRY_DLEN_MASK (0xFFF << NFIFOENTRY_DLEN_SHIFT)
  1412. #define NFIFOENTRY_PLEN_SHIFT 0
  1413. #define NFIFOENTRY_PLEN_MASK (0xFF << NFIFOENTRY_PLEN_SHIFT)
  1414. /* Append Load Immediate Command */
  1415. #define FD_CMD_APPEND_LOAD_IMMEDIATE 0x80000000
  1416. /* Set SEQ LIODN equal to the Non-SEQ LIODN for the job */
  1417. #define FD_CMD_SET_SEQ_LIODN_EQUAL_NONSEQ_LIODN 0x40000000
  1418. /* Frame Descriptor Command for Replacement Job Descriptor */
  1419. #define FD_CMD_REPLACE_JOB_DESC 0x20000000
  1420. #endif /* DESC_H */