-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth: controller: Refactor use of SWI
Refactor to abstract the use of software interrupts in nRF5 Series. Also, reduce the number of SWI used when interrupt priority level configured is same for ULL High and ULL Low contexts. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
- Loading branch information
1 parent
ee85f24
commit 78b461a
Showing
7 changed files
with
92 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "hal/swi_vendor_hal.h" |
7 changes: 0 additions & 7 deletions
7
subsys/bluetooth/controller/ll_sw/nordic/hal/irq_vendor_hal.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrf5_sw_irqs.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X) | ||
|
||
static inline void hal_swi_init(void) | ||
{ | ||
/* No platform-specific initialization required. */ | ||
} | ||
|
||
/* SW IRQs required for the nRF5 BLE Controller. */ | ||
#if defined(CONFIG_BT_LL_SW_SPLIT) | ||
/* Split architecture uses max. two SWI */ | ||
#define HAL_SWI_RADIO_IRQ NRF5_IRQ_SWI4_IRQn | ||
#define HAL_SWI_WORKER_IRQ NRF5_IRQ_RTC0_IRQn | ||
|
||
#if (CONFIG_BT_CTLR_ULL_HIGH_PRIO == CONFIG_BT_CTLR_ULL_LOW_PRIO) | ||
#define HAL_SWI_JOB_IRQ HAL_SWI_WORKER_IRQ | ||
#else | ||
#define HAL_SWI_JOB_IRQ NRF5_IRQ_SWI5_IRQn | ||
#endif | ||
|
||
static inline void hal_swi_lll_pend(void) | ||
{ | ||
NVIC_SetPendingIRQ(HAL_SWI_RADIO_IRQ); | ||
} | ||
|
||
#elif defined(CONFIG_BT_LL_SW_LEGACY) | ||
/* Legacy controller uses max. one SWI */ | ||
#define HAL_SWI_WORKER_IRQ NRF5_IRQ_RTC0_IRQn | ||
#define HAL_SWI_JOB_IRQ NRF5_IRQ_SWI5_IRQn | ||
|
||
#else | ||
#error "CTRL architecture not defined" | ||
#endif | ||
|
||
static inline void hal_swi_worker_pend(void) | ||
{ | ||
NVIC_SetPendingIRQ(HAL_SWI_WORKER_IRQ); | ||
} | ||
|
||
static inline void hal_swi_job_pend(void) | ||
{ | ||
NVIC_SetPendingIRQ(HAL_SWI_JOB_IRQ); | ||
} | ||
|
||
#endif /* CONFIG_SOC_SERIES_NRF51X || CONFIG_SOC_COMPATIBLE_NRF52X */ |
7 changes: 7 additions & 0 deletions
7
subsys/bluetooth/controller/ll_sw/nordic/hal/swi_vendor_hal.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright (c) 2019 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "hal/nrf5/swi.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters