agross-korg commented on a change in pull request #2392:
URL: https://github.com/apache/mynewt-core/pull/2392#discussion_r509360840



##########
File path: hw/drivers/crypto/crypto_da1469x/src/crypto_da1469x.c
##########
@@ -64,26 +64,27 @@ da1469x_has_support(struct crypto_dev *crypto, uint8_t op, 
uint16_t algo,
 static void
 do_dma_key_tx(const void *key, uint16_t keylen)
 {
-    DMA_Type *dma_regs = DMA;
+    struct da1469x_dma_regs *dma_regs;
     /* DMA len: keylen in bits, bus width is 4 */
     keylen >>= 5;
 
     /* enable OTP clock and set in read mode */
     da1469x_clock_amba_enable(CRG_TOP_CLK_AMBA_REG_OTP_ENABLE_Msk);
     da1469x_otp_set_mode(OTPC_MODE_READ);
 
-    /* securely DMA hardware key from secret storage to QSPI decrypt engine */
-    dma_regs->DMA_REQ_MUX_REG |= 0xf000;
-    dma_regs->DMA7_LEN_REG = keylen;
+    /* securely DMA hardware key using channel #7 from secret storage to QSPI 
decrypt engine */
+    dma_regs = da1469x_dma_acquire_single(7);

Review comment:
       acquire single can return NULL.  




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to