You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/10/26 17:04:15 UTC
[mynewt-core] 04/10: mcu/nfr5340: Disable QSPI errata in non-secure
code
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit b15e22ceaf03280336e89f3e220f8eb1e50b6cf2
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Wed Oct 20 10:44:22 2021 +0200
mcu/nfr5340: Disable QSPI errata in non-secure code
Errata 121 have to be executed in secure state.
In non-secure state executing nrf53_errata12() result in
access violation exception.
When QSPI is to be used in non-secure application,
bootloader must enable QSPI for correct errata usage.
---
hw/mcu/nordic/nrf5340/src/hal_qspi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/mcu/nordic/nrf5340/src/hal_qspi.c b/hw/mcu/nordic/nrf5340/src/hal_qspi.c
index c554bb1..d3142e6 100644
--- a/hw/mcu/nordic/nrf5340/src/hal_qspi.c
+++ b/hw/mcu/nordic/nrf5340/src/hal_qspi.c
@@ -375,6 +375,7 @@ nrf5340_qspi_init(const struct hal_flash *dev)
NRF_QSPI->XIPOFFSET = MYNEWT_VAL(QSPI_XIP_OFFSET);
+#if !defined(NRF_TRUSTZONE_NONSECURE)
/* Workaround for Errata 121: QSPI: Configuration of peripheral requires additional steps */
if (nrf53_errata_121()) {
NRF_QSPI->IFTIMING = (NRF_QSPI->IFTIMING & ~(7 << 8)) | (6 << 8);
@@ -385,6 +386,7 @@ nrf5340_qspi_init(const struct hal_flash *dev)
NRF_QSPI->IFCONFIG0 |= (1 << 16);
}
}
+#endif
#if (MYNEWT_VAL(QSPI_READOC) > 2) || (MYNEWT_VAL(QSPI_WRITEOC) > 1)
NRF_QSPI->PSEL.IO2 = MYNEWT_VAL(QSPI_PIN_DIO2);