Lines Matching +full:addr +full:- +full:mode

1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
21 #define CC_REG_HIGH(name) (CC_REG_LOW(name) + name ## _BIT_SIZE - 1)
75 DESC_DIRECTION_ILLEGAL = -1,
83 DMA_MODE_NULL = -1,
92 FLOW_MODE_NULL = -1,
180 #define CC_LAST_HW_KEY_SLOT (CC_FIRST_HW_KEY_SLOT + CC_NUM_HW_KEY_SLOTS - 1)
185 CC_NUM_CPP_KEY_SLOTS - 1)
208 * hw_desc_init() - Init a HW descriptor struct
217 * set_queue_last_ind_bit() - Indicate the end of current HW descriptors flow
224 pdesc->word[3] |= FIELD_PREP(WORD3_QUEUE_LAST_IND, 1); in set_queue_last_ind_bit()
228 * set_din_type() - Set the DIN field of a HW descriptor
231 * @dma_mode: The DMA mode: NO_DMA, SRAM, DLLI, MLLI, CONSTANT
232 * @addr: DIN address
237 enum cc_dma_mode dma_mode, dma_addr_t addr, in set_din_type() argument
240 pdesc->word[0] = lower_32_bits(addr); in set_din_type()
242 pdesc->word[5] |= FIELD_PREP(WORD5_DIN_ADDR_HIGH, upper_32_bits(addr)); in set_din_type()
244 pdesc->word[1] |= FIELD_PREP(WORD1_DIN_DMA_MODE, dma_mode) | in set_din_type()
250 * set_din_no_dma() - Set the DIN field of a HW descriptor to NO DMA mode.
254 * @addr: DIN address
257 static inline void set_din_no_dma(struct cc_hw_desc *pdesc, u32 addr, u32 size) in set_din_no_dma() argument
259 pdesc->word[0] = addr; in set_din_no_dma()
260 pdesc->word[1] |= FIELD_PREP(WORD1_DIN_SIZE, size); in set_din_no_dma()
264 * set_cpp_crypto_key() - Setup the special CPP descriptor
271 pdesc->word[0] |= CC_CPP_DIN_ADDR; in set_cpp_crypto_key()
273 pdesc->word[1] |= FIELD_PREP(WORD1_DIN_SIZE, CC_CPP_DIN_SIZE); in set_cpp_crypto_key()
274 pdesc->word[1] |= FIELD_PREP(WORD1_LOCK_QUEUE, 1); in set_cpp_crypto_key()
276 pdesc->word[4] |= FIELD_PREP(WORD4_SETUP_OPERATION, slot); in set_cpp_crypto_key()
280 * set_din_sram() - Set the DIN field of a HW descriptor to SRAM mode.
285 * @addr: DIN address
288 static inline void set_din_sram(struct cc_hw_desc *pdesc, u32 addr, u32 size) in set_din_sram() argument
290 pdesc->word[0] = addr; in set_din_sram()
291 pdesc->word[1] |= FIELD_PREP(WORD1_DIN_SIZE, size) | in set_din_sram()
296 * set_din_const() - Set the DIN field of a HW descriptor to CONST mode
304 pdesc->word[0] = val; in set_din_const()
305 pdesc->word[1] |= FIELD_PREP(WORD1_DIN_CONST_VALUE, 1) | in set_din_const()
311 * set_din_not_last_indication() - Set the DIN not last input data indicator
317 pdesc->word[1] |= FIELD_PREP(WORD1_NOT_LAST, 1); in set_din_not_last_indication()
321 * set_dout_type() - Set the DOUT field of a HW descriptor
324 * @dma_mode: The DMA mode: NO_DMA, SRAM, DLLI, MLLI, CONSTANT
325 * @addr: DOUT address
330 enum cc_dma_mode dma_mode, dma_addr_t addr, in set_dout_type() argument
333 pdesc->word[2] = lower_32_bits(addr); in set_dout_type()
335 pdesc->word[5] |= FIELD_PREP(WORD5_DOUT_ADDR_HIGH, upper_32_bits(addr)); in set_dout_type()
337 pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_DMA_MODE, dma_mode) | in set_dout_type()
343 * set_dout_dlli() - Set the DOUT field of a HW descriptor to DLLI type
347 * @addr: DOUT address
352 static inline void set_dout_dlli(struct cc_hw_desc *pdesc, dma_addr_t addr, in set_dout_dlli() argument
356 set_dout_type(pdesc, DMA_DLLI, addr, size, axi_sec); in set_dout_dlli()
357 pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_LAST_IND, last_ind); in set_dout_dlli()
361 * set_dout_mlli() - Set the DOUT field of a HW descriptor to MLLI type
365 * @addr: DOUT address
370 static inline void set_dout_mlli(struct cc_hw_desc *pdesc, u32 addr, u32 size, in set_dout_mlli() argument
373 set_dout_type(pdesc, DMA_MLLI, addr, size, axi_sec); in set_dout_mlli()
374 pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_LAST_IND, last_ind); in set_dout_mlli()
378 * set_dout_no_dma() - Set the DOUT field of a HW descriptor to NO DMA mode.
382 * @addr: DOUT address
386 static inline void set_dout_no_dma(struct cc_hw_desc *pdesc, u32 addr, in set_dout_no_dma() argument
389 pdesc->word[2] = addr; in set_dout_no_dma()
390 pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_SIZE, size) | in set_dout_no_dma()
395 * set_xor_val() - Set the word for the XOR operation.
402 pdesc->word[2] = val; in set_xor_val()
406 * set_xor_active() - Set the XOR indicator bit in the descriptor
412 pdesc->word[3] |= FIELD_PREP(WORD3_HASH_XOR_BIT, 1); in set_xor_active()
416 * set_aes_not_hash_mode() - Select the AES engine instead of HASH engine when
417 * setting up combined mode with AES XCBC MAC
423 pdesc->word[4] |= FIELD_PREP(WORD4_AES_SEL_N_HASH, 1); in set_aes_not_hash_mode()
427 * set_aes_xor_crypto_key() - Set aes xor crypto key, which in some scenarios
434 pdesc->word[4] |= FIELD_PREP(WORD4_AES_XOR_CRYPTO_KEY, 1); in set_aes_xor_crypto_key()
438 * set_dout_sram() - Set the DOUT field of a HW descriptor to SRAM mode
443 * @addr: DOUT address
446 static inline void set_dout_sram(struct cc_hw_desc *pdesc, u32 addr, u32 size) in set_dout_sram() argument
448 pdesc->word[2] = addr; in set_dout_sram()
449 pdesc->word[3] |= FIELD_PREP(WORD3_DOUT_DMA_MODE, DMA_SRAM) | in set_dout_sram()
454 * set_xex_data_unit_size() - Set the data unit size for XEX mode in
458 * @size: Data unit size for XEX mode
462 pdesc->word[2] = size; in set_xex_data_unit_size()
466 * set_multi2_num_rounds() - Set the number of rounds for Multi2 in
474 pdesc->word[2] = num; in set_multi2_num_rounds()
478 * set_flow_mode() - Set the flow mode.
481 * @mode: Any one of the modes defined in [CC7x-DESC]
484 enum cc_flow_mode mode) in set_flow_mode() argument
486 pdesc->word[4] |= FIELD_PREP(WORD4_DATA_FLOW_MODE, mode); in set_flow_mode()
490 * set_cipher_mode() - Set the cipher mode.
493 * @mode: Any one of the modes defined in [CC7x-DESC]
495 static inline void set_cipher_mode(struct cc_hw_desc *pdesc, int mode) in set_cipher_mode() argument
497 pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_MODE, mode); in set_cipher_mode()
501 * set_hash_cipher_mode() - Set the cipher mode for hash algorithms.
504 * @cipher_mode: Any one of the modes defined in [CC7x-DESC]
517 * set_cipher_config0() - Set the cipher configuration fields.
520 * @mode: Any one of the modes defined in [CC7x-DESC]
522 static inline void set_cipher_config0(struct cc_hw_desc *pdesc, int mode) in set_cipher_config0() argument
524 pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_CONF0, mode); in set_cipher_config0()
528 * set_cipher_config1() - Set the cipher configuration fields.
531 * @config: Padding mode
536 pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_CONF1, config); in set_cipher_config1()
540 * set_hw_crypto_key() - Set HW key configuration fields.
548 pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_DO, in set_hw_crypto_key()
555 * set_bytes_swap() - Set byte order of all setup-finalize descriptors.
562 pdesc->word[4] |= FIELD_PREP(WORD4_BYTES_SWAP, config); in set_bytes_swap()
566 * set_cmac_size0_mode() - Set CMAC_SIZE0 mode.
572 pdesc->word[4] |= FIELD_PREP(WORD4_CMAC_SIZE0, 1); in set_cmac_size0_mode()
576 * set_key_size() - Set key size descriptor field.
583 pdesc->word[4] |= FIELD_PREP(WORD4_KEY_SIZE, size); in set_key_size()
587 * set_key_size_aes() - Set AES key size.
594 set_key_size(pdesc, ((size >> 3) - 2)); in set_key_size_aes()
598 * set_key_size_des() - Set DES key size.
605 set_key_size(pdesc, ((size >> 3) - 1)); in set_key_size_des()
609 * set_setup_mode() - Set the descriptor setup mode
612 * @mode: Any one of the setup modes defined in [CC7x-DESC]
615 enum cc_setup_op mode) in set_setup_mode() argument
617 pdesc->word[4] |= FIELD_PREP(WORD4_SETUP_OPERATION, mode); in set_setup_mode()
621 * set_cipher_do() - Set the descriptor cipher DO
624 * @config: Any one of the cipher do defined in [CC7x-DESC]
629 pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_DO, in set_cipher_do()