Lines Matching defs:base

117 	uint8_t *xg;   /* Curve base point G coordinate x */
119 uint8_t *yg; /* Curve base point G coordinate y */
282 if ((info.base == 0) || (info.clock < 0) || (info.reset < 0)) {
286 pka_pdata.base = (uintptr_t)info.base;
293 static int pka_wait_bit(uintptr_t base, uint32_t bit)
297 while ((mmio_read_32(base + _PKA_SR) & bit) != bit) {
308 static void pka_disable(uintptr_t base)
310 mmio_clrbits_32(base + _PKA_CR, _PKA_CR_EN);
313 static int pka_enable(uintptr_t base, uint32_t mode)
316 mmio_clrsetbits_32(base + _PKA_CR, _PKA_IT_MASK | _PKA_CR_MODE_MASK,
319 mmio_setbits_32(base + _PKA_CR, _PKA_CR_EN);
321 return pka_wait_bit(base, _PKA_SR_INITOK);
329 static int stm32_pka_process(uintptr_t base)
331 mmio_setbits_32(base + _PKA_CR, _PKA_CR_START);
333 return pka_wait_bit(base, _PKA_IT_PROCEND);
396 static int stm32_pka_ecdsa_verif_configure_curve(uintptr_t base, enum stm32_pka_ecdsa_curve_id cid)
401 mmio_write_64(base + _PKA_RAM_N_LEN, curve_def[cid].n_len);
402 mmio_write_64(base + _PKA_RAM_P_LEN, curve_def[cid].p_len);
403 mmio_write_64(base + _PKA_RAM_A_SIGN, curve_def[cid].a_sign);
405 ret = write_eo_data(base + _PKA_RAM_A, curve_def[cid].a, curve_def[cid].a_size, eo_nbw);
410 ret = write_eo_data(base + _PKA_RAM_PRIME_N,
417 ret = write_eo_data(base + _PKA_RAM_P, curve_def[cid].p,
423 ret = write_eo_data(base + _PKA_RAM_XG, curve_def[cid].xg, curve_def[cid].xg_size, eo_nbw);
428 ret = write_eo_data(base + _PKA_RAM_YG, curve_def[cid].yg, curve_def[cid].yg_size, eo_nbw);
436 static int stm32_pka_ecdsa_verif_check_return(uintptr_t base)
441 sr = mmio_read_32(base + _PKA_SR);
450 value = mmio_read_64(base + _PKA_RAM_ECDSA_VERIFY);
599 id = mmio_read_32(pka_pdata.base + _PKA_IPIDR);
600 ver = mmio_read_32(pka_pdata.base + _PKA_VERR);
617 uintptr_t base = pka_pdata.base;
636 if ((mmio_read_32(base + _PKA_SR) & _PKA_SR_BUSY) == _PKA_SR_BUSY) {
644 ret = stm32_pka_ecdsa_verif_configure_curve(base, cid);
650 ret = write_eo_data(base + _PKA_RAM_XQ, pk_x_ptr, pk_x_size, eo_nbw);
655 ret = write_eo_data(base + _PKA_RAM_YQ, pk_y_ptr, pk_y_size, eo_nbw);
661 ret = write_eo_data(base + _PKA_RAM_HASH_Z, hash, hash_size, eo_nbw);
667 ret = write_eo_data(base + _PKA_RAM_SIGN_R, sig_r_ptr, sig_r_size, eo_nbw);
672 ret = write_eo_data(base + _PKA_RAM_SIGN_S, sig_s_ptr, sig_s_size, eo_nbw);
678 ret = pka_enable(base, _PKA_CR_MODE_ECDSA_VERIF);
685 ret = stm32_pka_process(base);
692 ret = stm32_pka_ecdsa_verif_check_return(base);
695 mmio_setbits_32(base + _PKA_CLRFR, _PKA_IT_PROCEND);
699 pka_disable(base);