Bluetooth: controller: Make worker and job priority configurable
Add Controller advanced Kconfig options to select IRQ priorities of the Radio, Ticker's Worker and JOB IRQs. This will provide an opportunity to have peripheral IRQ's of higher level than Bluetooth Controller. Change-id: Iaa128c1cd64a309a77d42d485fdefe68f31e4895 Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
parent
1277eea15e
commit
7c22073195
7 changed files with 53 additions and 13 deletions
|
@ -114,6 +114,26 @@ config BLUETOOTH_CONTROLLER_ADVANCED_FEATURES
|
|||
menu "Advanced features"
|
||||
visible if BLUETOOTH_CONTROLLER_ADVANCED_FEATURES
|
||||
|
||||
config BLUETOOTH_CONTROLLER_WORKER_PRIO
|
||||
prompt "Radio and Ticker's Worker IRQ priority"
|
||||
int
|
||||
range 0 3 if SOC_SERIES_NRF51X
|
||||
range 0 6 if SOC_SERIES_NRF52X
|
||||
default 0
|
||||
help
|
||||
The interrupt priority for event preparation and radio IRQ. This value
|
||||
shall be less than or equal to the Ticker's Job priority value.
|
||||
|
||||
config BLUETOOTH_CONTROLLER_JOB_PRIO
|
||||
prompt "Ticker's JOB IRQ priority"
|
||||
int
|
||||
range BLUETOOTH_CONTROLLER_WORKER_PRIO 3 if SOC_SERIES_NRF51X
|
||||
range BLUETOOTH_CONTROLLER_WORKER_PRIO 6 if SOC_SERIES_NRF52X
|
||||
default 0
|
||||
help
|
||||
The interrupt priority for Ticker's Job (SWI4) IRQ. This value shall
|
||||
be greater than or equal to the Ticker's Worker IRQ priority value.
|
||||
|
||||
config BLUETOOTH_CONTROLLER_XTAL_ADVANCED
|
||||
bool "Advanced event preparation"
|
||||
default y
|
||||
|
|
|
@ -4192,9 +4192,9 @@ static void event_adv(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
} else
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_XTAL_ADVANCED */
|
||||
|
||||
{
|
||||
/* Ticker Job Silence */
|
||||
#if (RADIO_TICKER_USER_ID_WORKER_PRIO == RADIO_TICKER_USER_ID_JOB_PRIO)
|
||||
{
|
||||
uint32_t ticker_status;
|
||||
|
||||
ticker_status =
|
||||
|
@ -4203,8 +4203,8 @@ static void event_adv(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
ticker_job_disable, NULL);
|
||||
LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
|
||||
(ticker_status == TICKER_STATUS_BUSY));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
DEBUG_RADIO_START_A(0);
|
||||
}
|
||||
|
@ -5696,9 +5696,9 @@ static void event_slave(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
} else
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_XTAL_ADVANCED */
|
||||
|
||||
{
|
||||
/* Ticker Job Silence */
|
||||
#if (RADIO_TICKER_USER_ID_WORKER_PRIO == RADIO_TICKER_USER_ID_JOB_PRIO)
|
||||
{
|
||||
uint32_t ticker_status;
|
||||
|
||||
ticker_status =
|
||||
|
@ -5707,8 +5707,8 @@ static void event_slave(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
ticker_job_disable, NULL);
|
||||
LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
|
||||
(ticker_status == TICKER_STATUS_BUSY));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Route the tx packet to respective connections */
|
||||
packet_tx_enqueue(2);
|
||||
|
@ -5833,9 +5833,9 @@ static void event_master(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
} else
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_XTAL_ADVANCED */
|
||||
|
||||
{
|
||||
/* Ticker Job Silence */
|
||||
#if (RADIO_TICKER_USER_ID_WORKER_PRIO == RADIO_TICKER_USER_ID_JOB_PRIO)
|
||||
{
|
||||
uint32_t ticker_status;
|
||||
|
||||
ticker_status =
|
||||
|
@ -5844,8 +5844,8 @@ static void event_master(uint32_t ticks_at_expire, uint32_t remainder,
|
|||
ticker_job_disable, NULL);
|
||||
LL_ASSERT((ticker_status == TICKER_STATUS_SUCCESS) ||
|
||||
(ticker_status == TICKER_STATUS_BUSY));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
DEBUG_RADIO_START_M(0);
|
||||
}
|
||||
|
|
|
@ -68,9 +68,6 @@
|
|||
#define RADIO_TICKER_USER_ID_JOB MAYFLY_CALL_ID_1
|
||||
#define RADIO_TICKER_USER_ID_APP MAYFLY_CALL_ID_PROGRAM
|
||||
|
||||
#define RADIO_TICKER_USER_ID_WORKER_PRIO TICKER_MAYFLY_CALL_ID_WORKER0_PRIO
|
||||
#define RADIO_TICKER_USER_ID_JOB_PRIO TICKER_MAYFLY_CALL_ID_JOB0_PRIO
|
||||
|
||||
#define RADIO_TICKER_USER_WORKER_OPS (7 + 1)
|
||||
#define RADIO_TICKER_USER_JOB_OPS (2 + 1)
|
||||
#define RADIO_TICKER_USER_APP_OPS (1 + 1)
|
||||
|
@ -106,6 +103,18 @@
|
|||
RADIO_BLE_FEATURES_BIT_PING | \
|
||||
RADIO_BLE_FEATURES_BIT_DLE)
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONTROLLER_WORKER_PRIO)
|
||||
#define RADIO_TICKER_USER_ID_WORKER_PRIO CONFIG_BLUETOOTH_CONTROLLER_WORKER_PRIO
|
||||
#else
|
||||
#define RADIO_TICKER_USER_ID_WORKER_PRIO 0
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONTROLLER_JOB_PRIO)
|
||||
#define RADIO_TICKER_USER_ID_JOB_PRIO CONFIG_BLUETOOTH_CONTROLLER_JOB_PRIO
|
||||
#else
|
||||
#define RADIO_TICKER_USER_ID_JOB_PRIO 0
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Controller Reference Defines (compile time override-able)
|
||||
****************************************************************************/
|
||||
|
|
|
@ -229,14 +229,19 @@ int ll_init(struct k_sem *sem_rx)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
IRQ_DIRECT_CONNECT(NRF5_IRQ_RADIO_IRQn, 0, radio_nrf5_isr, 0);
|
||||
IRQ_CONNECT(NRF5_IRQ_RTC0_IRQn, 0, rtc0_nrf5_isr, NULL, 0);
|
||||
IRQ_DIRECT_CONNECT(NRF5_IRQ_RADIO_IRQn,
|
||||
CONFIG_BLUETOOTH_CONTROLLER_WORKER_PRIO,
|
||||
radio_nrf5_isr, 0);
|
||||
IRQ_CONNECT(NRF5_IRQ_RTC0_IRQn, CONFIG_BLUETOOTH_CONTROLLER_WORKER_PRIO,
|
||||
rtc0_nrf5_isr, NULL, 0);
|
||||
IRQ_CONNECT(NRF5_IRQ_SWI4_IRQn, CONFIG_BLUETOOTH_CONTROLLER_JOB_PRIO,
|
||||
swi4_nrf5_isr, NULL, 0);
|
||||
IRQ_CONNECT(NRF5_IRQ_RNG_IRQn, 1, rng_nrf5_isr, NULL, 0);
|
||||
IRQ_CONNECT(NRF5_IRQ_SWI4_IRQn, 0, swi4_nrf5_isr, NULL, 0);
|
||||
|
||||
irq_enable(NRF5_IRQ_RADIO_IRQn);
|
||||
irq_enable(NRF5_IRQ_RTC0_IRQn);
|
||||
irq_enable(NRF5_IRQ_RNG_IRQn);
|
||||
irq_enable(NRF5_IRQ_SWI4_IRQn);
|
||||
irq_enable(NRF5_IRQ_RNG_IRQn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
CONFIG_BLUETOOTH=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER_WORKER_PRIO=0
|
||||
CONFIG_BLUETOOTH_CONTROLLER_JOB_PRIO=0
|
||||
CONFIG_BLUETOOTH_CONTROLLER_XTAL_ADVANCED=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER_SCHED_ADVANCED=y
|
||||
CONFIG_BLUETOOTH_PERIPHERAL=y
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
CONFIG_BLUETOOTH=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER_WORKER_PRIO=0
|
||||
CONFIG_BLUETOOTH_CONTROLLER_JOB_PRIO=0
|
||||
CONFIG_BLUETOOTH_CONTROLLER_XTAL_ADVANCED=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER_SCHED_ADVANCED=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER_LE_PING=n
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
CONFIG_BLUETOOTH=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER=y
|
||||
CONFIG_BLUETOOTH_CONTROLLER_WORKER_PRIO=0
|
||||
CONFIG_BLUETOOTH_CONTROLLER_JOB_PRIO=1
|
||||
CONFIG_BLUETOOTH_CONTROLLER_XTAL_ADVANCED=n
|
||||
CONFIG_BLUETOOTH_CONTROLLER_SCHED_ADVANCED=n
|
||||
CONFIG_BLUETOOTH_CONTROLLER_CONN_RSSI=y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue