From e998593c2efea1572555df0512edc7db3ed57a87 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 28 Aug 2024 10:38:55 +0200 Subject: [PATCH] Bluetooth: Controller: nRF54Lx: Port for data whitening register use nRF54Lx have updated Data Whitening register settings, add implementation to correctly set them up. Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/hal/nrf5/radio/radio.c | 8 ++++++++ .../ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h | 1 + 2 files changed, 9 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c index 2da45e72a0d..e349826afe4 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c @@ -401,7 +401,15 @@ void radio_freq_chan_set(uint32_t chan) void radio_whiten_iv_set(uint32_t iv) { +#if defined(CONFIG_SOC_COMPATIBLE_NRF54LX) +#if defined(RADIO_DATAWHITEIV_DATAWHITEIV_Msk) + NRF_RADIO->DATAWHITEIV = HAL_RADIO_RESET_VALUE_DATAWHITE | iv; +#else /* !RADIO_DATAWHITEIV_DATAWHITEIV_Msk */ + NRF_RADIO->DATAWHITE = HAL_RADIO_RESET_VALUE_DATAWHITE | iv; +#endif /* !RADIO_DATAWHITEIV_DATAWHITEIV_Msk */ +#else /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ nrf_radio_datawhiteiv_set(NRF_RADIO, iv); +#endif /* !CONFIG_SOC_COMPATIBLE_NRF54LX */ NRF_RADIO->PCNF1 &= ~RADIO_PCNF1_WHITEEN_Msk; NRF_RADIO->PCNF1 |= ((1UL) << RADIO_PCNF1_WHITEEN_Pos) & diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h index 3e08842214f..aef11bd7bc4 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf54lx.h @@ -368,6 +368,7 @@ */ #define HAL_RADIO_RESET_VALUE_DFEMODE 0x00000000UL #define HAL_RADIO_RESET_VALUE_CTEINLINECONF 0x00002800UL +#define HAL_RADIO_RESET_VALUE_DATAWHITE 0x00890040UL static inline void hal_radio_reset(void) {