diff --git a/samples/bluetooth/hci_ipc/boards/nrf5340_audio_dk_nrf5340_cpunet_nrf21540_ek.overlay b/samples/bluetooth/hci_ipc/boards/nrf5340_audio_dk_nrf5340_cpunet_nrf21540_ek.overlay index cb056659aafaf8..82e6b8cf848564 100644 --- a/samples/bluetooth/hci_ipc/boards/nrf5340_audio_dk_nrf5340_cpunet_nrf21540_ek.overlay +++ b/samples/bluetooth/hci_ipc/boards/nrf5340_audio_dk_nrf5340_cpunet_nrf21540_ek.overlay @@ -6,23 +6,10 @@ pdn-gpios = <&arduino_header 15 GPIO_ACTIVE_HIGH>; /* D9 */ ant-sel-gpios = <&arduino_header 10 GPIO_ACTIVE_HIGH>; /* D4 */ mode-gpios = <&arduino_header 8 GPIO_ACTIVE_HIGH>; /* D2 */ - spi-if = <&nrf_radio_fem_spi>; supply-voltage-mv = <3000>; }; }; -&spi0 { - /* status = "okay"; */ - cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */ - - nrf_radio_fem_spi: nrf21540_fem_spi@0 { - compatible = "nordic,nrf21540-fem-spi"; - /* status = "okay"; */ - reg = <0>; - spi-max-frequency = <8000000>; - }; -}; - &radio { fem = <&nrf_radio_fem>; }; 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 8ec0e62fa50d5c..79954af8da295c 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 @@ -79,9 +79,6 @@ BUILD_ASSERT(NRF_DT_GPIOTE_INST(FEM_NODE, HAL_RADIO_GPIO_PA_PROP) == static const nrfx_gpiote_t gpiote_pdn = NRFX_GPIOTE_INSTANCE( NRF_DT_GPIOTE_INST(FEM_NODE, pdn_gpios)); static uint8_t gpiote_ch_pdn; -static const nrfx_gpiote_t gpiote_csn = NRFX_GPIOTE_INSTANCE( - NRF_DT_GPIOTE_INST(DT_BUS(FEM_SPI_DEV_NODE), cs_gpios)); -static uint8_t gpiote_ch_csn; #endif /* These headers require the above gpiote-related variables to be declared. */ @@ -134,20 +131,6 @@ BUILD_ASSERT(!BAD_FLAGS(NRF_GPIO_LNA_FLAGS), NRF_DT_CHECK_GPIO_CTLR_IS_SOC(FEM_NODE, pdn_gpios, "pdn-gpios"); #endif /* DT_NODE_HAS_PROP(FEM_NODE, pdn_gpios) */ -/* CSN is special because it comes from the spi-if property. */ -#if defined(HAL_RADIO_FEM_NRF21540_HAS_CSN) -#define NRF_GPIO_CSN_CTLR DT_SPI_DEV_CS_GPIOS_CTLR(FEM_SPI_DEV_NODE) -#define NRF_GPIO_CSN ((NRF_GPIO_Type *)DT_REG_ADDR(NRF_GPIO_CSN_CTLR)) -#define NRF_GPIO_CSN_PIN DT_SPI_DEV_CS_GPIOS_PIN(FEM_SPI_DEV_NODE) -#define NRF_GPIO_CSN_FLAGS DT_SPI_DEV_CS_GPIOS_FLAGS(FEM_SPI_DEV_NODE) -#define NRF_GPIO_CSN_PSEL (NRF_GPIO_CSN_PIN + \ - (DT_PROP(NRF_GPIO_CSN_CTLR, port) << 5)) -BUILD_ASSERT(DT_NODE_HAS_COMPAT(NRF_GPIO_CSN_CTLR, nordic_nrf_gpio), - "fem node " DT_NODE_PATH(FEM_NODE) " has a spi-if property, " - " but the chip select pin is not on the SoC. Check cs-gpios in " - DT_NODE_PATH(DT_BUS(FEM_SPI_DEV_NODE))); -#endif /* HAL_RADIO_FEM_NRF21540_HAS_CSN */ - #endif /* HAL_RADIO_FEM_IS_NRF21540 */ /* CTEINLINE S0_MASK for periodic advertising PUDs. It allows to accept all types of extended @@ -208,15 +191,6 @@ void radio_setup(void) } #endif /* NRF_GPIO_PDN_PIN */ -#if defined(NRF_GPIO_CSN_PIN) - NRF_GPIO_CSN->DIRSET = BIT(NRF_GPIO_CSN_PIN); - if (ACTIVE_LOW(NRF_GPIO_CSN_FLAGS)) { - NRF_GPIO_CSN->OUTSET = BIT(NRF_GPIO_CSN_PIN); - } else { - NRF_GPIO_CSN->OUTCLR = BIT(NRF_GPIO_CSN_PIN); - } -#endif /* NRF_GPIO_CSN_PIN */ - hal_radio_ram_prio_setup(); } @@ -1841,12 +1815,6 @@ int radio_gpio_pa_lna_init(void) } #endif -#if defined(NRF_GPIO_CSN_PIN) - if (nrfx_gpiote_channel_alloc(&gpiote_csn, &gpiote_ch_csn) != NRFX_SUCCESS) { - return -ENOMEM; - } -#endif - return 0; } @@ -1859,10 +1827,6 @@ void radio_gpio_pa_lna_deinit(void) #if defined(NRF_GPIO_PDN_PIN) (void)nrfx_gpiote_channel_free(&gpiote_pdn, gpiote_ch_pdn); #endif - -#if defined(NRF_GPIO_CSN_PIN) - (void)nrfx_gpiote_channel_free(&gpiote_csn, gpiote_ch_csn); -#endif } #if defined(HAL_RADIO_GPIO_HAVE_PA_PIN) @@ -1881,7 +1845,6 @@ void radio_gpio_pa_setup(void) #if defined(HAL_RADIO_FEM_IS_NRF21540) hal_pa_ppi_setup(); radio_gpio_pdn_setup(); - radio_gpio_csn_setup(); #endif } #endif /* HAL_RADIO_GPIO_HAVE_PA_PIN */ @@ -1902,7 +1865,6 @@ void radio_gpio_lna_setup(void) #if defined(HAL_RADIO_FEM_IS_NRF21540) hal_lna_ppi_setup(); radio_gpio_pdn_setup(); - radio_gpio_csn_setup(); #endif } @@ -1922,22 +1884,6 @@ void radio_gpio_pdn_setup(void) #endif /* NRF_GPIO_PDN_PIN */ } -void radio_gpio_csn_setup(void) -{ - /* Note: the spi-if property is optional. */ -#if defined(NRF_GPIO_CSN_PIN) - gpiote_csn.p_reg->CONFIG[gpiote_ch_csn] = - (GPIOTE_CONFIG_MODE_Task << - GPIOTE_CONFIG_MODE_Pos) | - (NRF_GPIO_CSN_PSEL << - GPIOTE_CONFIG_PSEL_Pos) | - (GPIOTE_CONFIG_POLARITY_Toggle << - GPIOTE_CONFIG_POLARITY_Pos) | - (OUTINIT_INACTIVE(NRF_GPIO_CSN_FLAGS) << - GPIOTE_CONFIG_OUTINIT_Pos); -#endif /* NRF_GPIO_CSN_PIN */ -} - void radio_gpio_lna_on(void) { if (ACTIVE_LOW(NRF_GPIO_LNA_FLAGS)) { @@ -1981,7 +1927,6 @@ void radio_gpio_pa_lna_disable(void) BIT(HAL_DISABLE_FEM_PPI)); gpiote_palna.p_reg->CONFIG[gpiote_ch_palna] = 0; gpiote_pdn.p_reg->CONFIG[gpiote_ch_pdn] = 0; - gpiote_csn.p_reg->CONFIG[gpiote_ch_csn] = 0; #else hal_radio_nrf_ppi_channels_disable(BIT(HAL_ENABLE_PALNA_PPI) | BIT(HAL_DISABLE_PALNA_PPI)); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h index 3d517121ec0414..eac3381c8824de 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.h @@ -163,7 +163,6 @@ void radio_gpio_pa_lna_deinit(void); void radio_gpio_pa_setup(void); void radio_gpio_lna_setup(void); void radio_gpio_pdn_setup(void); -void radio_gpio_csn_setup(void); void radio_gpio_lna_on(void); void radio_gpio_lna_off(void); void radio_gpio_pa_lna_enable(uint32_t trx_us); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h index 1403921ac22c50..428bcb869687b8 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_dppi_gpiote.h @@ -66,10 +66,6 @@ static inline void hal_fem_ppi_setup(void) hal_gpiote_tasks_setup(gpiote_pdn.p_reg, gpiote_ch_pdn, IS_ENABLED(HAL_RADIO_GPIO_NRF21540_PDN_POL_INV), HAL_ENABLE_FEM_PPI, HAL_DISABLE_FEM_PPI); - - hal_gpiote_tasks_setup(gpiote_csn.p_reg, gpiote_ch_csn, - IS_ENABLED(HAL_RADIO_GPIO_NRF21540_CSN_POL_INV), - HAL_ENABLE_FEM_PPI, HAL_DISABLE_FEM_PPI); } #endif /* HAL_RADIO_FEM_IS_NRF21540 */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_fem_nrf21540.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_fem_nrf21540.h index 6b473198ffaf48..3ecefdb422d0ca 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_fem_nrf21540.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_fem_nrf21540.h @@ -59,19 +59,3 @@ #define HAL_RADIO_GPIO_NRF21540_PDN_POL_INV 1 #endif /* DT_GPIO_FLAGS(FEM_NODE, pdn_gpios) & GPIO_ACTIVE_LOW */ #endif /* FEM_HAS_PROP(pdn_gpios) */ - -#if FEM_HAS_PROP(spi_if) -/* This is the "SPI device" node, i.e. the one with compatible - * nordic,nrf21540-fem-spi. - */ -#define FEM_SPI_DEV_NODE DT_PHANDLE(FEM_NODE, spi_if) -/* If the SPI device node has a chip select gpio... */ -#if DT_SPI_DEV_HAS_CS_GPIOS(FEM_SPI_DEV_NODE) -/* set a macro indicating that, and... */ -#define HAL_RADIO_FEM_NRF21540_HAS_CSN 1 -/* use it to get the CSN polarity. */ -#if DT_SPI_DEV_CS_GPIOS_FLAGS(FEM_SPI_DEV_NODE) & GPIO_ACTIVE_LOW -#define HAL_RADIO_GPIO_NRF21540_CSN_POL_INV 1 -#endif /* DT_SPI_DEV_CS_GPIOS_FLAGS(FEM_SPI_DEV_NODE) & GPIO_ACTIVE_LOW */ -#endif /* DT_SPI_DEV_HAS_CS_GPIOS(FEM_SPI_DEV_NODE) */ -#endif /* FEM_HAS_PROP(spi_if) */ diff --git a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h index ec3c11fea1b362..268bae5aef177f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h +++ b/subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio_nrf5_ppi_gpiote.h @@ -36,18 +36,16 @@ static inline void hal_lna_ppi_setup(void) static inline void hal_fem_ppi_setup(void) { - nrf_ppi_channel_and_fork_endpoint_setup( + nrf_ppi_channel_endpoint_setup( NRF_PPI, HAL_ENABLE_FEM_PPI, (uint32_t)&(EVENT_TIMER->EVENTS_COMPARE[3]), - (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn]), - (uint32_t)&(gpiote_csn.p_reg->TASKS_OUT[gpiote_ch_csn])); - nrf_ppi_channel_and_fork_endpoint_setup( + (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn])); + nrf_ppi_channel_endpoint_setup( NRF_PPI, HAL_DISABLE_FEM_PPI, (uint32_t)&(NRF_RADIO->EVENTS_DISABLED), - (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn]), - (uint32_t)&(gpiote_csn.p_reg->TASKS_OUT[gpiote_ch_csn])); + (uint32_t)&(gpiote_pdn.p_reg->TASKS_OUT[gpiote_ch_pdn])); } #endif /* HAL_RADIO_FEM_IS_NRF21540 */