utzig commented on a change in pull request #2327:
URL: https://github.com/apache/mynewt-core/pull/2327#discussion_r452550252



##########
File path: hw/drivers/crypto/crypto_da1469x/src/crypto_da1469x.c
##########
@@ -161,6 +162,17 @@ da1469x_crypto_op(struct crypto_dev *crypto, uint8_t op, 
uint16_t algo,
         *keyreg++ = os_bswap_32(*keyp32); keyp32++;
     }
 
+    /*
+     * REAMP_ADR0 when 2, 0 mapped to QSPI Flash. See SYS_CTRL_REG in 
datasheet.
+     * If inbuf is in QSPI Flash, the addresses need to be translated to
+     * to 0x36000000 range for the DMA engine access.
+     */
+    remap_addr0 = (CRG_TOP->SYS_CTRL_REG & 
CRG_TOP_SYS_CTRL_REG_REMAP_ADR0_Msk) >> CRG_TOP_SYS_CTRL_REG_REMAP_ADR0_Pos;
+
+    if (MCU_MEM_QSPIF_M_RANGE_ADDRESS(inbuf) && remap_addr0 == 2) {

Review comment:
       is there some meaning to `== 2`?

##########
File path: hw/drivers/crypto/crypto_da1469x/src/crypto_da1469x.c
##########
@@ -161,6 +162,17 @@ da1469x_crypto_op(struct crypto_dev *crypto, uint8_t op, 
uint16_t algo,
         *keyreg++ = os_bswap_32(*keyp32); keyp32++;
     }
 
+    /*
+     * REAMP_ADR0 when 2, 0 mapped to QSPI Flash. See SYS_CTRL_REG in 
datasheet.

Review comment:
       `REAMP` might be a typo?

##########
File path: hw/mcu/dialog/da14699/include/mcu/mcu.h
##########
@@ -150,6 +150,8 @@ void mcu_gpio_exit_sleep(void);
 #define MCU_MEM_QSPIF_M_END_ADDRESS     (0x18000000)
 #define MCU_MEM_SYSRAM_START_ADDRESS    (0x20000000)
 #define MCU_MEM_SYSRAM_END_ADDRESS      (0x20080000)
+#define MCU_MEM_QSPIF_M_RANGE_ADDRESS(x) \
+    ((uint32_t)x >= (uint32_t)MCU_MEM_QSPIF_M_START_ADDRESS && (uint32_t)x <= 
(uint32_t)MCU_MEM_QSPIF_M_END_ADDRESS)

Review comment:
       Might be better to add parenthesis around `x`




----------------------------------------------------------------
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