Path: blob/master/drivers/crypto/ccree/cc_hw_queue_defs.h
26282 views
/* SPDX-License-Identifier: GPL-2.0 */1/* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */23#ifndef __CC_HW_QUEUE_DEFS_H__4#define __CC_HW_QUEUE_DEFS_H__56#include <linux/types.h>78#include "cc_kernel_regs.h"9#include <linux/bitfield.h>1011/******************************************************************************12* DEFINITIONS13******************************************************************************/1415#define HW_DESC_SIZE_WORDS 616/* Define max. available slots in HW queue */17#define HW_QUEUE_SLOTS_MAX 151819#define CC_REG_LOW(name) (name ## _BIT_SHIFT)20#define CC_REG_HIGH(name) (CC_REG_LOW(name) + name ## _BIT_SIZE - 1)21#define CC_GENMASK(name) GENMASK(CC_REG_HIGH(name), CC_REG_LOW(name))2223#define CC_HWQ_GENMASK(word, field) \24CC_GENMASK(CC_DSCRPTR_QUEUE_WORD ## word ## _ ## field)2526#define WORD0_VALUE CC_HWQ_GENMASK(0, VALUE)27#define WORD0_CPP_CIPHER_MODE CC_HWQ_GENMASK(0, CPP_CIPHER_MODE)28#define WORD1_DIN_CONST_VALUE CC_HWQ_GENMASK(1, DIN_CONST_VALUE)29#define WORD1_DIN_DMA_MODE CC_HWQ_GENMASK(1, DIN_DMA_MODE)30#define WORD1_DIN_SIZE CC_HWQ_GENMASK(1, DIN_SIZE)31#define WORD1_NOT_LAST CC_HWQ_GENMASK(1, NOT_LAST)32#define WORD1_NS_BIT CC_HWQ_GENMASK(1, NS_BIT)33#define WORD1_LOCK_QUEUE CC_HWQ_GENMASK(1, LOCK_QUEUE)34#define WORD2_VALUE CC_HWQ_GENMASK(2, VALUE)35#define WORD3_DOUT_DMA_MODE CC_HWQ_GENMASK(3, DOUT_DMA_MODE)36#define WORD3_DOUT_LAST_IND CC_HWQ_GENMASK(3, DOUT_LAST_IND)37#define WORD3_DOUT_SIZE CC_HWQ_GENMASK(3, DOUT_SIZE)38#define WORD3_HASH_XOR_BIT CC_HWQ_GENMASK(3, HASH_XOR_BIT)39#define WORD3_NS_BIT CC_HWQ_GENMASK(3, NS_BIT)40#define WORD3_QUEUE_LAST_IND CC_HWQ_GENMASK(3, QUEUE_LAST_IND)41#define WORD4_ACK_NEEDED CC_HWQ_GENMASK(4, ACK_NEEDED)42#define WORD4_AES_SEL_N_HASH CC_HWQ_GENMASK(4, AES_SEL_N_HASH)43#define WORD4_AES_XOR_CRYPTO_KEY CC_HWQ_GENMASK(4, AES_XOR_CRYPTO_KEY)44#define WORD4_BYTES_SWAP CC_HWQ_GENMASK(4, BYTES_SWAP)45#define WORD4_CIPHER_CONF0 CC_HWQ_GENMASK(4, CIPHER_CONF0)46#define WORD4_CIPHER_CONF1 CC_HWQ_GENMASK(4, CIPHER_CONF1)47#define WORD4_CIPHER_CONF2 CC_HWQ_GENMASK(4, CIPHER_CONF2)48#define WORD4_CIPHER_DO CC_HWQ_GENMASK(4, CIPHER_DO)49#define WORD4_CIPHER_MODE CC_HWQ_GENMASK(4, CIPHER_MODE)50#define WORD4_CMAC_SIZE0 CC_HWQ_GENMASK(4, CMAC_SIZE0)51#define WORD4_DATA_FLOW_MODE CC_HWQ_GENMASK(4, DATA_FLOW_MODE)52#define WORD4_KEY_SIZE CC_HWQ_GENMASK(4, KEY_SIZE)53#define WORD4_SETUP_OPERATION CC_HWQ_GENMASK(4, SETUP_OPERATION)54#define WORD5_DIN_ADDR_HIGH CC_HWQ_GENMASK(5, DIN_ADDR_HIGH)55#define WORD5_DOUT_ADDR_HIGH CC_HWQ_GENMASK(5, DOUT_ADDR_HIGH)5657/******************************************************************************58* TYPE DEFINITIONS59******************************************************************************/6061struct cc_hw_desc {62union {63u32 word[HW_DESC_SIZE_WORDS];64u16 hword[HW_DESC_SIZE_WORDS * 2];65};66};6768enum cc_axi_sec {69AXI_SECURE = 0,70AXI_NOT_SECURE = 171};7273enum cc_desc_direction {74DESC_DIRECTION_ILLEGAL = -1,75DESC_DIRECTION_ENCRYPT_ENCRYPT = 0,76DESC_DIRECTION_DECRYPT_DECRYPT = 1,77DESC_DIRECTION_DECRYPT_ENCRYPT = 3,78DESC_DIRECTION_END = S32_MAX,79};8081enum cc_dma_mode {82DMA_MODE_NULL = -1,83NO_DMA = 0,84DMA_SRAM = 1,85DMA_DLLI = 2,86DMA_MLLI = 3,87DMA_MODE_END = S32_MAX,88};8990enum cc_flow_mode {91FLOW_MODE_NULL = -1,92/* data flows */93BYPASS = 0,94DIN_AES_DOUT = 1,95AES_to_HASH = 2,96AES_and_HASH = 3,97DIN_DES_DOUT = 4,98DES_to_HASH = 5,99DES_and_HASH = 6,100DIN_HASH = 7,101DIN_HASH_and_BYPASS = 8,102AESMAC_and_BYPASS = 9,103AES_to_HASH_and_DOUT = 10,104DIN_RC4_DOUT = 11,105DES_to_HASH_and_DOUT = 12,106AES_to_AES_to_HASH_and_DOUT = 13,107AES_to_AES_to_HASH = 14,108AES_to_HASH_and_AES = 15,109DIN_SM4_DOUT = 16,110DIN_AES_AESMAC = 17,111HASH_to_DOUT = 18,112/* setup flows */113S_DIN_to_AES = 32,114S_DIN_to_AES2 = 33,115S_DIN_to_DES = 34,116S_DIN_to_RC4 = 35,117S_DIN_to_SM4 = 36,118S_DIN_to_HASH = 37,119S_AES_to_DOUT = 38,120S_AES2_to_DOUT = 39,121S_SM4_to_DOUT = 40,122S_RC4_to_DOUT = 41,123S_DES_to_DOUT = 42,124S_HASH_to_DOUT = 43,125SET_FLOW_ID = 44,126FLOW_MODE_END = S32_MAX,127};128129enum cc_setup_op {130SETUP_LOAD_NOP = 0,131SETUP_LOAD_STATE0 = 1,132SETUP_LOAD_STATE1 = 2,133SETUP_LOAD_STATE2 = 3,134SETUP_LOAD_KEY0 = 4,135SETUP_LOAD_XEX_KEY = 5,136SETUP_WRITE_STATE0 = 8,137SETUP_WRITE_STATE1 = 9,138SETUP_WRITE_STATE2 = 10,139SETUP_WRITE_STATE3 = 11,140SETUP_OP_END = S32_MAX,141};142143enum cc_hash_conf_pad {144HASH_PADDING_DISABLED = 0,145HASH_PADDING_ENABLED = 1,146HASH_DIGEST_RESULT_LITTLE_ENDIAN = 2,147HASH_CONFIG1_PADDING_RESERVE32 = S32_MAX,148};149150enum cc_aes_mac_selector {151AES_SK = 1,152AES_CMAC_INIT = 2,153AES_CMAC_SIZE0 = 3,154AES_MAC_END = S32_MAX,155};156157#define HW_KEY_MASK_CIPHER_DO 0x3158#define HW_KEY_SHIFT_CIPHER_CFG2 2159160/* HwCryptoKey[1:0] is mapped to cipher_do[1:0] */161/* HwCryptoKey[2:3] is mapped to cipher_config2[1:0] */162enum cc_hw_crypto_key {163USER_KEY = 0, /* 0x0000 */164ROOT_KEY = 1, /* 0x0001 */165PROVISIONING_KEY = 2, /* 0x0010 */ /* ==KCP */166SESSION_KEY = 3, /* 0x0011 */167RESERVED_KEY = 4, /* NA */168PLATFORM_KEY = 5, /* 0x0101 */169CUSTOMER_KEY = 6, /* 0x0110 */170KFDE0_KEY = 7, /* 0x0111 */171KFDE1_KEY = 9, /* 0x1001 */172KFDE2_KEY = 10, /* 0x1010 */173KFDE3_KEY = 11, /* 0x1011 */174END_OF_KEYS = S32_MAX,175};176177#define CC_NUM_HW_KEY_SLOTS 4178#define CC_FIRST_HW_KEY_SLOT 0179#define CC_LAST_HW_KEY_SLOT (CC_FIRST_HW_KEY_SLOT + CC_NUM_HW_KEY_SLOTS - 1)180181#define CC_NUM_CPP_KEY_SLOTS 8182#define CC_FIRST_CPP_KEY_SLOT 16183#define CC_LAST_CPP_KEY_SLOT (CC_FIRST_CPP_KEY_SLOT + \184CC_NUM_CPP_KEY_SLOTS - 1)185186enum cc_hw_aes_key_size {187AES_128_KEY = 0,188AES_192_KEY = 1,189AES_256_KEY = 2,190END_OF_AES_KEYS = S32_MAX,191};192193enum cc_hash_cipher_pad {194DO_NOT_PAD = 0,195DO_PAD = 1,196HASH_CIPHER_DO_PADDING_RESERVE32 = S32_MAX,197};198199#define CC_CPP_DIN_ADDR 0xFF00FF00UL200#define CC_CPP_DIN_SIZE 0xFF00FFUL201202/*****************************/203/* Descriptor packing macros */204/*****************************/205206/**207* hw_desc_init() - Init a HW descriptor struct208* @pdesc: pointer to HW descriptor struct209*/210static inline void hw_desc_init(struct cc_hw_desc *pdesc)211{212memset(pdesc, 0, sizeof(struct cc_hw_desc));213}214215/**216* set_queue_last_ind_bit() - Indicate the end of current HW descriptors flow217* and release the HW engines.218*219* @pdesc: Pointer to HW descriptor struct220*/221static inline void set_queue_last_ind_bit(struct cc_hw_desc *pdesc)222{223pdesc->word[3] |= FIELD_PREP(WORD3_QUEUE_LAST_IND, 1);224}225226/**227* set_din_type() - Set the DIN field of a HW descriptor228*229* @pdesc: Pointer to HW descriptor struct230* @dma_mode: The DMA mode: NO_DMA, SRAM, DLLI, MLLI, CONSTANT231* @addr: DIN address232* @size: Data size in bytes233* @axi_sec: AXI secure bit234*/235static inline void set_din_type(struct cc_hw_desc *pdesc,236enum cc_dma_mode dma_mode, dma_addr_t addr,237u32 size, enum cc_axi_sec axi_sec)238{239pdesc->word[0] = lower_32_bits(addr);240#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT241pdesc->word[5] |= FIELD_PREP(WORD5_DIN_ADDR_HIGH, upper_32_bits(addr));242#endif243pdesc->word[1] |= FIELD_PREP(WORD1_DIN_DMA_MODE, dma_mode) |244FIELD_PREP(WORD1_DIN_SIZE, size) |245FIELD_PREP(WORD1_NS_BIT, axi_sec);246}247248/**249* set_din_no_dma() - Set the DIN field of a HW descriptor to NO DMA mode.250* Used for NOP descriptor, register patches and other special modes.251*252* @pdesc: Pointer to HW descriptor struct253* @addr: DIN address254* @size: Data size in bytes255*/256static inline void set_din_no_dma(struct cc_hw_desc *pdesc, u32 addr, u32 size)257{258pdesc->word[0] = addr;259pdesc->word[1] |= FIELD_PREP(WORD1_DIN_SIZE, size);260}261262/**263* set_cpp_crypto_key() - Setup the special CPP descriptor264*265* @pdesc: Pointer to HW descriptor struct266* @slot: Slot number267*/268static inline void set_cpp_crypto_key(struct cc_hw_desc *pdesc, u8 slot)269{270pdesc->word[0] |= CC_CPP_DIN_ADDR;271272pdesc->word[1] |= FIELD_PREP(WORD1_DIN_SIZE, CC_CPP_DIN_SIZE);273pdesc->word[1] |= FIELD_PREP(WORD1_LOCK_QUEUE, 1);274275pdesc->word[4] |= FIELD_PREP(WORD4_SETUP_OPERATION, slot);276}277278/**279* set_din_sram() - Set the DIN field of a HW descriptor to SRAM mode.280* Note: No need to check SRAM alignment since host requests do not use SRAM and281* the adaptor will enforce alignment checks.282*283* @pdesc: Pointer to HW descriptor struct284* @addr: DIN address285* @size: Data size in bytes286*/287static inline void set_din_sram(struct cc_hw_desc *pdesc, u32 addr, u32 size)288{289pdesc->word[0] = addr;290pdesc->word[1] |= FIELD_PREP(WORD1_DIN_SIZE, size) |291FIELD_PREP(WORD1_DIN_DMA_MODE, DMA_SRAM);292}293294/**295* set_din_const() - Set the DIN field of a HW descriptor to CONST mode296*297* @pdesc: Pointer to HW descriptor struct298* @val: DIN const value299* @size: Data size in bytes300*/301static inline void set_din_const(struct cc_hw_desc *pdesc, u32 val, u32 size)302{303pdesc->word[0] = val;304pdesc->word[1] |= FIELD_PREP(WORD1_DIN_CONST_VALUE, 1) |305FIELD_PREP(WORD1_DIN_DMA_MODE, DMA_SRAM) |306FIELD_PREP(WORD1_DIN_SIZE, size);307}308309/**310* set_din_not_last_indication() - Set the DIN not last input data indicator311*312* @pdesc: Pointer to HW descriptor struct313*/314static inline void set_din_not_last_indication(struct cc_hw_desc *pdesc)315{316pdesc->word[1] |= FIELD_PREP(WORD1_NOT_LAST, 1);317}318319/**320* set_dout_type() - Set the DOUT field of a HW descriptor321*322* @pdesc: Pointer to HW descriptor struct323* @dma_mode: The DMA mode: NO_DMA, SRAM, DLLI, MLLI, CONSTANT324* @addr: DOUT address325* @size: Data size in bytes326* @axi_sec: AXI secure bit327*/328static inline void set_dout_type(struct cc_hw_desc *pdesc,329enum cc_dma_mode dma_mode, dma_addr_t addr,330u32 size, enum cc_axi_sec axi_sec)331{332pdesc->word[2] = lower_32_bits(addr);333#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT334pdesc->word[5] |= FIELD_PREP(WORD5_DOUT_ADDR_HIGH, upper_32_bits(addr));335#endif336pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_DMA_MODE, dma_mode) |337FIELD_PREP(WORD3_DOUT_SIZE, size) |338FIELD_PREP(WORD3_NS_BIT, axi_sec);339}340341/**342* set_dout_dlli() - Set the DOUT field of a HW descriptor to DLLI type343* The LAST INDICATION is provided by the user344*345* @pdesc: Pointer to HW descriptor struct346* @addr: DOUT address347* @size: Data size in bytes348* @axi_sec: AXI secure bit349* @last_ind: The last indication bit350*/351static inline void set_dout_dlli(struct cc_hw_desc *pdesc, dma_addr_t addr,352u32 size, enum cc_axi_sec axi_sec,353u32 last_ind)354{355set_dout_type(pdesc, DMA_DLLI, addr, size, axi_sec);356pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_LAST_IND, last_ind);357}358359/**360* set_dout_mlli() - Set the DOUT field of a HW descriptor to MLLI type361* The LAST INDICATION is provided by the user362*363* @pdesc: Pointer to HW descriptor struct364* @addr: DOUT address365* @size: Data size in bytes366* @axi_sec: AXI secure bit367* @last_ind: The last indication bit368*/369static inline void set_dout_mlli(struct cc_hw_desc *pdesc, u32 addr, u32 size,370enum cc_axi_sec axi_sec, bool last_ind)371{372set_dout_type(pdesc, DMA_MLLI, addr, size, axi_sec);373pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_LAST_IND, last_ind);374}375376/**377* set_dout_no_dma() - Set the DOUT field of a HW descriptor to NO DMA mode.378* Used for NOP descriptor, register patches and other special modes.379*380* @pdesc: pointer to HW descriptor struct381* @addr: DOUT address382* @size: Data size in bytes383* @write_enable: Enables a write operation to a register384*/385static inline void set_dout_no_dma(struct cc_hw_desc *pdesc, u32 addr,386u32 size, bool write_enable)387{388pdesc->word[2] = addr;389pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_SIZE, size) |390FIELD_PREP(WORD3_DOUT_LAST_IND, write_enable);391}392393/**394* set_xor_val() - Set the word for the XOR operation.395*396* @pdesc: Pointer to HW descriptor struct397* @val: XOR data value398*/399static inline void set_xor_val(struct cc_hw_desc *pdesc, u32 val)400{401pdesc->word[2] = val;402}403404/**405* set_xor_active() - Set the XOR indicator bit in the descriptor406*407* @pdesc: Pointer to HW descriptor struct408*/409static inline void set_xor_active(struct cc_hw_desc *pdesc)410{411pdesc->word[3] |= FIELD_PREP(WORD3_HASH_XOR_BIT, 1);412}413414/**415* set_aes_not_hash_mode() - Select the AES engine instead of HASH engine when416* setting up combined mode with AES XCBC MAC417*418* @pdesc: Pointer to HW descriptor struct419*/420static inline void set_aes_not_hash_mode(struct cc_hw_desc *pdesc)421{422pdesc->word[4] |= FIELD_PREP(WORD4_AES_SEL_N_HASH, 1);423}424425/**426* set_aes_xor_crypto_key() - Set aes xor crypto key, which in some scenarios427* selects the SM3 engine428*429* @pdesc: Pointer to HW descriptor struct430*/431static inline void set_aes_xor_crypto_key(struct cc_hw_desc *pdesc)432{433pdesc->word[4] |= FIELD_PREP(WORD4_AES_XOR_CRYPTO_KEY, 1);434}435436/**437* set_dout_sram() - Set the DOUT field of a HW descriptor to SRAM mode438* Note: No need to check SRAM alignment since host requests do not use SRAM and439* the adaptor will enforce alignment checks.440*441* @pdesc: Pointer to HW descriptor struct442* @addr: DOUT address443* @size: Data size in bytes444*/445static inline void set_dout_sram(struct cc_hw_desc *pdesc, u32 addr, u32 size)446{447pdesc->word[2] = addr;448pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_DMA_MODE, DMA_SRAM) |449FIELD_PREP(WORD3_DOUT_SIZE, size);450}451452/**453* set_xex_data_unit_size() - Set the data unit size for XEX mode in454* data_out_addr[15:0]455*456* @pdesc: Pointer to HW descriptor struct457* @size: Data unit size for XEX mode458*/459static inline void set_xex_data_unit_size(struct cc_hw_desc *pdesc, u32 size)460{461pdesc->word[2] = size;462}463464/**465* set_multi2_num_rounds() - Set the number of rounds for Multi2 in466* data_out_addr[15:0]467*468* @pdesc: Pointer to HW descriptor struct469* @num: Number of rounds for Multi2470*/471static inline void set_multi2_num_rounds(struct cc_hw_desc *pdesc, u32 num)472{473pdesc->word[2] = num;474}475476/**477* set_flow_mode() - Set the flow mode.478*479* @pdesc: Pointer to HW descriptor struct480* @mode: Any one of the modes defined in [CC7x-DESC]481*/482static inline void set_flow_mode(struct cc_hw_desc *pdesc,483enum cc_flow_mode mode)484{485pdesc->word[4] |= FIELD_PREP(WORD4_DATA_FLOW_MODE, mode);486}487488/**489* set_cipher_mode() - Set the cipher mode.490*491* @pdesc: Pointer to HW descriptor struct492* @mode: Any one of the modes defined in [CC7x-DESC]493*/494static inline void set_cipher_mode(struct cc_hw_desc *pdesc, int mode)495{496pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_MODE, mode);497}498499/**500* set_hash_cipher_mode() - Set the cipher mode for hash algorithms.501*502* @pdesc: Pointer to HW descriptor struct503* @cipher_mode: Any one of the modes defined in [CC7x-DESC]504* @hash_mode: specifies which hash is being handled505*/506static inline void set_hash_cipher_mode(struct cc_hw_desc *pdesc,507enum drv_cipher_mode cipher_mode,508enum drv_hash_mode hash_mode)509{510set_cipher_mode(pdesc, cipher_mode);511if (hash_mode == DRV_HASH_SM3)512set_aes_xor_crypto_key(pdesc);513}514515/**516* set_cipher_config0() - Set the cipher configuration fields.517*518* @pdesc: Pointer to HW descriptor struct519* @mode: Any one of the modes defined in [CC7x-DESC]520*/521static inline void set_cipher_config0(struct cc_hw_desc *pdesc, int mode)522{523pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_CONF0, mode);524}525526/**527* set_cipher_config1() - Set the cipher configuration fields.528*529* @pdesc: Pointer to HW descriptor struct530* @config: Padding mode531*/532static inline void set_cipher_config1(struct cc_hw_desc *pdesc,533enum cc_hash_conf_pad config)534{535pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_CONF1, config);536}537538/**539* set_hw_crypto_key() - Set HW key configuration fields.540*541* @pdesc: Pointer to HW descriptor struct542* @hw_key: The HW key slot asdefined in enum cc_hw_crypto_key543*/544static inline void set_hw_crypto_key(struct cc_hw_desc *pdesc,545enum cc_hw_crypto_key hw_key)546{547pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_DO,548(hw_key & HW_KEY_MASK_CIPHER_DO)) |549FIELD_PREP(WORD4_CIPHER_CONF2,550(hw_key >> HW_KEY_SHIFT_CIPHER_CFG2));551}552553/**554* set_bytes_swap() - Set byte order of all setup-finalize descriptors.555*556* @pdesc: Pointer to HW descriptor struct557* @config: True to enable byte swapping558*/559static inline void set_bytes_swap(struct cc_hw_desc *pdesc, bool config)560{561pdesc->word[4] |= FIELD_PREP(WORD4_BYTES_SWAP, config);562}563564/**565* set_cmac_size0_mode() - Set CMAC_SIZE0 mode.566*567* @pdesc: Pointer to HW descriptor struct568*/569static inline void set_cmac_size0_mode(struct cc_hw_desc *pdesc)570{571pdesc->word[4] |= FIELD_PREP(WORD4_CMAC_SIZE0, 1);572}573574/**575* set_key_size() - Set key size descriptor field.576*577* @pdesc: Pointer to HW descriptor struct578* @size: Key size in bytes (NOT size code)579*/580static inline void set_key_size(struct cc_hw_desc *pdesc, u32 size)581{582pdesc->word[4] |= FIELD_PREP(WORD4_KEY_SIZE, size);583}584585/**586* set_key_size_aes() - Set AES key size.587*588* @pdesc: Pointer to HW descriptor struct589* @size: Key size in bytes (NOT size code)590*/591static inline void set_key_size_aes(struct cc_hw_desc *pdesc, u32 size)592{593set_key_size(pdesc, ((size >> 3) - 2));594}595596/**597* set_key_size_des() - Set DES key size.598*599* @pdesc: Pointer to HW descriptor struct600* @size: Key size in bytes (NOT size code)601*/602static inline void set_key_size_des(struct cc_hw_desc *pdesc, u32 size)603{604set_key_size(pdesc, ((size >> 3) - 1));605}606607/**608* set_setup_mode() - Set the descriptor setup mode609*610* @pdesc: Pointer to HW descriptor struct611* @mode: Any one of the setup modes defined in [CC7x-DESC]612*/613static inline void set_setup_mode(struct cc_hw_desc *pdesc,614enum cc_setup_op mode)615{616pdesc->word[4] |= FIELD_PREP(WORD4_SETUP_OPERATION, mode);617}618619/**620* set_cipher_do() - Set the descriptor cipher DO621*622* @pdesc: Pointer to HW descriptor struct623* @config: Any one of the cipher do defined in [CC7x-DESC]624*/625static inline void set_cipher_do(struct cc_hw_desc *pdesc,626enum cc_hash_cipher_pad config)627{628pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_DO,629(config & HW_KEY_MASK_CIPHER_DO));630}631632#endif /*__CC_HW_QUEUE_DEFS_H__*/633634635