Lines Matching refs:desc
22 uint32_t desc_length(uint32_t *desc) in desc_length() argument
24 return desc[0] & DESC_LEN_MASK; in desc_length()
28 void desc_update_start_index(uint32_t *desc, uint32_t index) in desc_update_start_index() argument
30 desc[0] |= (index << DESC_START_SHIFT); in desc_update_start_index()
34 void desc_init(uint32_t *desc) in desc_init() argument
36 *desc = 0; in desc_init()
40 void desc_add_word(uint32_t *desc, uint32_t word) in desc_add_word() argument
42 uint32_t len = desc_length(desc); in desc_add_word()
45 uint32_t *last = desc + len; in desc_add_word()
49 desc[0] += 1; in desc_add_word()
53 void desc_add_ptr(uint32_t *desc, phys_addr_t *ptr) in desc_add_ptr() argument
55 uint32_t len = desc_length(desc); in desc_add_ptr()
58 phys_addr_t *last = (phys_addr_t *) (desc + len); in desc_add_ptr()
70 desc[0] += (uint32_t) (sizeof(phys_addr_t) / sizeof(uint32_t)); in desc_add_ptr()
74 int cnstr_rng_jobdesc(uint32_t *desc, uint32_t state_handle, in cnstr_rng_jobdesc() argument
88 desc_init(desc); in cnstr_rng_jobdesc()
90 desc_add_word(desc, U(0xb0800000)); in cnstr_rng_jobdesc()
91 desc_add_word(desc, U(0x82500000) | (state_handle << ALG_AAI_SH_SHIFT)); in cnstr_rng_jobdesc()
92 desc_add_word(desc, U(0x60340000) | len); in cnstr_rng_jobdesc()
93 desc_add_ptr(desc, phys_addr_out); in cnstr_rng_jobdesc()
100 int cnstr_rng_instantiate_jobdesc(uint32_t *desc) in cnstr_rng_instantiate_jobdesc() argument
102 desc_init(desc); in cnstr_rng_instantiate_jobdesc()
103 desc_add_word(desc, U(0xb0800000)); in cnstr_rng_instantiate_jobdesc()
105 desc_add_word(desc, U(0x82500004)); in cnstr_rng_instantiate_jobdesc()
107 desc_add_word(desc, U(0xa2000001)); in cnstr_rng_instantiate_jobdesc()
109 desc_add_word(desc, U(0x10880004)); in cnstr_rng_instantiate_jobdesc()
111 desc_add_word(desc, U(0x00000001)); in cnstr_rng_instantiate_jobdesc()
113 desc_add_word(desc, U(0x82501000)); in cnstr_rng_instantiate_jobdesc()
119 int cnstr_hw_encap_blob_jobdesc(uint32_t *desc, in cnstr_hw_encap_blob_jobdesc() argument
132 desc_init(desc); in cnstr_hw_encap_blob_jobdesc()
134 desc_add_word(desc, U(0xb0800000)); in cnstr_hw_encap_blob_jobdesc()
137 desc_add_word(desc, (key_class | key_sz)); in cnstr_hw_encap_blob_jobdesc()
138 desc_add_ptr(desc, phys_key_idnfr); in cnstr_hw_encap_blob_jobdesc()
141 desc_add_word(desc, U(0xf0400000)); in cnstr_hw_encap_blob_jobdesc()
142 desc_add_ptr(desc, phys_addr_in); in cnstr_hw_encap_blob_jobdesc()
145 desc_add_word(desc, in_sz); in cnstr_hw_encap_blob_jobdesc()
148 desc_add_word(desc, U(0xf8400000)); in cnstr_hw_encap_blob_jobdesc()
149 desc_add_ptr(desc, phys_addr_out); in cnstr_hw_encap_blob_jobdesc()
152 desc_add_word(desc, out_sz); in cnstr_hw_encap_blob_jobdesc()
155 desc_add_word(desc, operation); in cnstr_hw_encap_blob_jobdesc()
158 VERBOSE("desc word %x\n", desc[i]); in cnstr_hw_encap_blob_jobdesc()
172 void cnstr_jobdesc_pkha_rsaexp(uint32_t *desc, in cnstr_jobdesc_pkha_rsaexp() argument
183 desc_init(desc); in cnstr_jobdesc_pkha_rsaexp()
184 desc_add_word(desc, U(0xb0800000)); in cnstr_jobdesc_pkha_rsaexp()
185 desc_add_word(desc, U(0x02010000) | pkin->e_siz); in cnstr_jobdesc_pkha_rsaexp()
186 desc_add_ptr(desc, ptr_addr_e); in cnstr_jobdesc_pkha_rsaexp()
187 desc_add_word(desc, U(0x220c0000) | pkin->a_siz); in cnstr_jobdesc_pkha_rsaexp()
188 desc_add_ptr(desc, ptr_addr_a); in cnstr_jobdesc_pkha_rsaexp()
189 desc_add_word(desc, U(0x22080000) | pkin->n_siz); in cnstr_jobdesc_pkha_rsaexp()
190 desc_add_ptr(desc, ptr_addr_n); in cnstr_jobdesc_pkha_rsaexp()
191 desc_add_word(desc, U(0x81800006)); in cnstr_jobdesc_pkha_rsaexp()
192 desc_add_word(desc, U(0x620d0000) | out_siz); in cnstr_jobdesc_pkha_rsaexp()
193 desc_add_ptr(desc, ptr_addr_out); in cnstr_jobdesc_pkha_rsaexp()
205 void cnstr_hash_jobdesc(uint32_t *desc, uint8_t *msg, uint32_t msgsz, in cnstr_hash_jobdesc() argument
214 desc_init(desc); in cnstr_hash_jobdesc()
215 desc_add_word(desc, U(0xb0800000)); in cnstr_hash_jobdesc()
221 desc_add_word(desc, U(0x8443000d)); in cnstr_hash_jobdesc()
224 desc_add_word(desc, U(0x25540000)); /* FIFO Load */ in cnstr_hash_jobdesc()
225 desc_add_ptr(desc, ptr_addr_in); /* Pointer to msg */ in cnstr_hash_jobdesc()
226 desc_add_word(desc, msgsz); /* Size */ in cnstr_hash_jobdesc()
227 desc_add_word(desc, U(0x54200020)); /* FIFO Store */ in cnstr_hash_jobdesc()
228 desc_add_ptr(desc, ptr_addr_out); /* Pointer to Result */ in cnstr_hash_jobdesc()
230 desc_add_word(desc, U(0x25140000) | msgsz); in cnstr_hash_jobdesc()
231 desc_add_ptr(desc, ptr_addr_in); in cnstr_hash_jobdesc()
232 desc_add_word(desc, U(0x54200020)); in cnstr_hash_jobdesc()
233 desc_add_ptr(desc, ptr_addr_out); in cnstr_hash_jobdesc()