1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright 2020-2021 NXP 4 * 5 * CAAM driver data type definition. 6 */ 7 8 #ifndef __CAAM_TYPES_H__ 9 #define __CAAM_TYPES_H__ 10 11 #include <types_ext.h> 12 13 /* 14 * Definition of a CAAM buffer type 15 */ 16 struct caambuf { 17 uint8_t *data; /* Data buffer */ 18 paddr_t paddr; /* Physical address of the buffer */ 19 size_t length; /* Number of bytes in the data buffer */ 20 uint8_t nocache; /* =1 if buffer is not cacheable, 0 otherwise */ 21 }; 22 23 /* 24 * Definition of a CAAM Block buffer. Buffer used to store 25 * user source data to build a full algorithm block buffer 26 */ 27 struct caamblock { 28 struct caambuf buf; /* Data buffer */ 29 size_t filled; /* Current length filled in the buffer */ 30 size_t max; /* Maximum size of the block */ 31 }; 32 33 /* 34 * Definition of key size 35 */ 36 struct caamdefkey { 37 uint8_t min; /* Minimum size */ 38 uint8_t max; /* Maximum size */ 39 uint8_t mod; /* Key modulus */ 40 }; 41 42 #endif /* __CAAM_TYPES_H__ */ 43