From cac32a7a0db79ee90a117dc414c554adccc012a8 Mon Sep 17 00:00:00 2001 From: Jake Carter Date: Wed, 7 Aug 2024 18:02:55 -0600 Subject: [PATCH] fix(PeriphDrivers): Fix MAA Operator Setter for TPU Drivers (#1104) --- Libraries/PeriphDrivers/Source/TPU/tpu_reva.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/PeriphDrivers/Source/TPU/tpu_reva.c b/Libraries/PeriphDrivers/Source/TPU/tpu_reva.c index 3c570c31ed7..6607bde0ceb 100644 --- a/Libraries/PeriphDrivers/Source/TPU/tpu_reva.c +++ b/Libraries/PeriphDrivers/Source/TPU/tpu_reva.c @@ -262,6 +262,7 @@ int MXC_TPU_RevA_Cipher_Config(mxc_tpu_reva_regs_t *tpu, mxc_tpu_reva_modesel_t int MXC_TPU_RevA_Cipher_KeySelect(mxc_tpu_reva_regs_t *tpu, mxc_tpu_reva_keysrc_t key_src) { MXC_SETFIELD(tpu->cipher_ctrl, MXC_F_TPU_REVA_CIPHER_CTRL_SRC, key_src); + // Note: "key_src" enum is set with "S" definitions instead of "V" definitions, so shifting is not necessary return E_SUCCESS; } @@ -716,7 +717,8 @@ int MXC_TPU_RevA_MAA_Compute(mxc_tpu_reva_regs_t *tpu, mxc_tpu_maa_clcsel_t clc, memcpy((void *)MAA_M, (uint32_t *)mod, len); // Start MAA - MXC_SETFIELD(tpu->maa_ctrl, MXC_F_TPU_REVA_MAA_CTRL_CLC, clc); + MXC_SETFIELD(tpu->maa_ctrl, MXC_F_TPU_REVA_MAA_CTRL_CLC, + clc << MXC_F_TPU_REVA_MAA_CTRL_CLC_POS); tpu->maa_ctrl |= MXC_F_TPU_REVA_MAA_CTRL_STC; // Check if MAA Error occurs