Skip to content

Commit c105948

Browse files
nomo-nordicmasz-nordic
authored andcommitted
[nrf fromlist] nrfx: align errata checks to nrfx 4.0
Signed-off-by: Norbert Morawski <[email protected]>
1 parent 10809bd commit c105948

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

drivers/flash/nrf_qspi_nor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ BUILD_ASSERT(INST_0_SCK_FREQUENCY >= (NRF_QSPI_BASE_CLOCK_FREQ / 16),
111111
#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1
112112
#define INST_0_SCK_CFG NRF_QSPI_FREQ_DIV1
113113
/* If anomaly 159 is to be prevented, only /1 divider can be used. */
114-
#elif NRF53_ERRATA_159_ENABLE_WORKAROUND
114+
#elif NRF_ERRATA_STATIC_CHECK(53, 159)
115115
#define BASE_CLOCK_DIV NRF_CLOCK_HFCLK_DIV_1
116116
#define INST_0_SCK_CFG (DIV_ROUND_UP(NRF_QSPI_BASE_CLOCK_FREQ, \
117117
INST_0_SCK_FREQUENCY) - 1)
@@ -251,7 +251,7 @@ static inline int qspi_get_zephyr_ret_code(nrfx_err_t res)
251251
return -EINVAL;
252252
case NRFX_ERROR_INVALID_STATE:
253253
return -ECANCELED;
254-
#if NRF53_ERRATA_159_ENABLE_WORKAROUND
254+
#if NRF_ERRATA_STATIC_CHECK(53, 159)
255255
case NRFX_ERROR_FORBIDDEN:
256256
LOG_ERR("nRF5340 anomaly 159 conditions detected");
257257
LOG_ERR("Set the CPU clock to 64 MHz before starting QSPI operation");

drivers/flash/soc_flash_nrf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static inline bool is_uicr_addr_valid(off_t addr, size_t len)
121121
#endif /* CONFIG_SOC_FLASH_NRF_UICR */
122122
}
123123

124-
#if CONFIG_SOC_FLASH_NRF_UICR && IS_ENABLED(NRF91_ERRATA_7_ENABLE_WORKAROUND)
124+
#if CONFIG_SOC_FLASH_NRF_UICR && NRF_ERRATA_STATIC_CHECK(91, 7)
125125
static inline void nrf91_errata_7_enter(void)
126126
{
127127
__disable_irq();
@@ -164,7 +164,7 @@ static int flash_nrf_read(const struct device *dev, off_t addr,
164164
return 0;
165165
}
166166

167-
#if CONFIG_SOC_FLASH_NRF_UICR && IS_ENABLED(NRF91_ERRATA_7_ENABLE_WORKAROUND)
167+
#if CONFIG_SOC_FLASH_NRF_UICR && NRF_ERRATA_STATIC_CHECK(91, 7)
168168
if (within_uicr) {
169169
nrf_buffer_read_91_uicr(data, (uint32_t)addr, len);
170170
return 0;

drivers/pwm/pwm_nrfx.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919

2020
LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL);
2121

22-
/* NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED can be undefined or defined
23-
* to 0 or 1, hence the use of #if IS_ENABLED().
24-
*/
25-
#if IS_ENABLED(NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED)
22+
#if NRF_ERRATA_STATIC_CHECK(52, 109)
2623
#define ANOMALY_109_EGU_IRQ_CONNECT(idx) _EGU_IRQ_CONNECT(idx)
2724
#define _EGU_IRQ_CONNECT(idx) \
2825
extern void nrfx_egu_##idx##_irq_handler(void); \

0 commit comments

Comments
 (0)