Skip to content

Commit ad3f49a

Browse files
committed
soc: silabs: s2: Move RAIL interrupts installer
Move the RAIL interrupts installer from the Bluetooth HCI driver to the SoC layer so that it can be used by other subsystems as well. Signed-off-by: David Boullie <[email protected]>
1 parent dddd738 commit ad3f49a

File tree

4 files changed

+66
-30
lines changed

4 files changed

+66
-30
lines changed

drivers/bluetooth/hci/hci_silabs_efr32.c

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <sl_hci_common_transport.h>
1212
#include <pa_conversions_efr32.h>
1313
#include <rail.h>
14+
#include <soc_radio.h>
1415

1516
#define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL
1617
#include <zephyr/logging/log.h>
@@ -55,36 +56,6 @@ void BTLE_LL_Process(uint32_t events);
5556
int16_t BTLE_LL_SetMaxPower(int16_t power);
5657
bool sli_pending_btctrl_events(void);
5758

58-
#define RADIO_IRQN(name) DT_IRQ_BY_NAME(DT_NODELABEL(radio), name, irq)
59-
#define RADIO_IRQ_PRIO(name) DT_IRQ_BY_NAME(DT_NODELABEL(radio), name, priority)
60-
61-
void rail_isr_installer(void)
62-
{
63-
IRQ_CONNECT(RADIO_IRQN(agc), RADIO_IRQ_PRIO(agc), AGC_IRQHandler, NULL, 0);
64-
IRQ_CONNECT(RADIO_IRQN(bufc), RADIO_IRQ_PRIO(bufc), BUFC_IRQHandler, NULL, 0);
65-
IRQ_CONNECT(RADIO_IRQN(frc_pri), RADIO_IRQ_PRIO(frc_pri), FRC_PRI_IRQHandler, NULL, 0);
66-
IRQ_CONNECT(RADIO_IRQN(frc), RADIO_IRQ_PRIO(frc), FRC_IRQHandler, NULL, 0);
67-
IRQ_CONNECT(RADIO_IRQN(modem), RADIO_IRQ_PRIO(modem), MODEM_IRQHandler, NULL, 0);
68-
IRQ_CONNECT(RADIO_IRQN(protimer), RADIO_IRQ_PRIO(protimer), PROTIMER_IRQHandler, NULL, 0);
69-
IRQ_CONNECT(RADIO_IRQN(rac_rsm), RADIO_IRQ_PRIO(rac_rsm), RAC_RSM_IRQHandler, NULL, 0);
70-
IRQ_CONNECT(RADIO_IRQN(rac_seq), RADIO_IRQ_PRIO(rac_seq), RAC_SEQ_IRQHandler, NULL, 0);
71-
IRQ_CONNECT(RADIO_IRQN(synth), RADIO_IRQ_PRIO(synth), SYNTH_IRQHandler, NULL, 0);
72-
73-
/* Depending on the chip family, either HOSTMAILBOX, RDMAILBOX or neither is present */
74-
IF_ENABLED(DT_IRQ_HAS_NAME(DT_NODELABEL(radio), hostmailbox), ({
75-
IRQ_CONNECT(RADIO_IRQN(hostmailbox),
76-
RADIO_IRQ_PRIO(hostmailbox),
77-
HOSTMAILBOX_IRQHandler,
78-
NULL, 0);
79-
}));
80-
IF_ENABLED(DT_IRQ_HAS_NAME(DT_NODELABEL(radio), rdmailbox), ({
81-
IRQ_CONNECT(RADIO_IRQN(rdmailbox),
82-
RADIO_IRQ_PRIO(rdmailbox),
83-
RDMAILBOX_IRQHandler,
84-
NULL, 0);
85-
}));
86-
}
87-
8859
static bool slz_is_evt_discardable(const struct bt_hci_evt_hdr *hdr, const uint8_t *params,
8960
int16_t params_len)
9061
{

soc/silabs/silabs_s2/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
zephyr_sources(soc.c)
5+
zephyr_sources_ifdef(CONFIG_SOC_GECKO_HAS_RADIO soc_radio.c)
56
zephyr_sources_ifdef(CONFIG_SOC_SILABS_IMAGE_PROPERTIES soc_image_properties.c)
67
zephyr_linker_sources_ifdef(CONFIG_SOC_SILABS_IMAGE_PROPERTIES RODATA soc_image_properties.ld)

soc/silabs/silabs_s2/soc_radio.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2025 Silicon Laboratories Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief Radio initialization for Silicon Labs Series 2 products
10+
*/
11+
12+
#include <soc_radio.h>
13+
14+
#define RADIO_IRQN(name) DT_IRQ_BY_NAME(DT_NODELABEL(radio), name, irq)
15+
#define RADIO_IRQ_PRIO(name) DT_IRQ_BY_NAME(DT_NODELABEL(radio), name, priority)
16+
17+
void rail_isr_installer(void)
18+
{
19+
IRQ_CONNECT(RADIO_IRQN(agc), RADIO_IRQ_PRIO(agc), AGC_IRQHandler, NULL, 0);
20+
IRQ_CONNECT(RADIO_IRQN(bufc), RADIO_IRQ_PRIO(bufc), BUFC_IRQHandler, NULL, 0);
21+
IRQ_CONNECT(RADIO_IRQN(frc_pri), RADIO_IRQ_PRIO(frc_pri), FRC_PRI_IRQHandler, NULL, 0);
22+
IRQ_CONNECT(RADIO_IRQN(frc), RADIO_IRQ_PRIO(frc), FRC_IRQHandler, NULL, 0);
23+
IRQ_CONNECT(RADIO_IRQN(modem), RADIO_IRQ_PRIO(modem), MODEM_IRQHandler, NULL, 0);
24+
IRQ_CONNECT(RADIO_IRQN(protimer), RADIO_IRQ_PRIO(protimer), PROTIMER_IRQHandler, NULL, 0);
25+
IRQ_CONNECT(RADIO_IRQN(rac_rsm), RADIO_IRQ_PRIO(rac_rsm), RAC_RSM_IRQHandler, NULL, 0);
26+
IRQ_CONNECT(RADIO_IRQN(rac_seq), RADIO_IRQ_PRIO(rac_seq), RAC_SEQ_IRQHandler, NULL, 0);
27+
IRQ_CONNECT(RADIO_IRQN(synth), RADIO_IRQ_PRIO(synth), SYNTH_IRQHandler, NULL, 0);
28+
29+
/* Depending on the chip family, either HOSTMAILBOX, RDMAILBOX or neither is present */
30+
IF_ENABLED(DT_IRQ_HAS_NAME(DT_NODELABEL(radio), hostmailbox), ({
31+
IRQ_CONNECT(RADIO_IRQN(hostmailbox),
32+
RADIO_IRQ_PRIO(hostmailbox),
33+
HOSTMAILBOX_IRQHandler,
34+
NULL, 0);
35+
}));
36+
IF_ENABLED(DT_IRQ_HAS_NAME(DT_NODELABEL(radio), rdmailbox), ({
37+
IRQ_CONNECT(RADIO_IRQN(rdmailbox),
38+
RADIO_IRQ_PRIO(rdmailbox),
39+
RDMAILBOX_IRQHandler,
40+
NULL, 0);
41+
}));
42+
}

soc/silabs/silabs_s2/soc_radio.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025 Silicon Laboratories Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief Declare radio functions for Silicon Labs Series 2 products
10+
*
11+
*/
12+
13+
#include <zephyr/kernel.h>
14+
#include <rail.h>
15+
16+
/**
17+
* @brief Register RAIL IRQ handlers
18+
*
19+
* This function registers the RAIL IRQ handlers for the radio.
20+
*
21+
*/
22+
void rail_isr_installer(void);

0 commit comments

Comments
 (0)