Skip to content

Commit d877e1d

Browse files
Emil Obalskimbolivar-nordic
authored andcommitted
ipc_service: Automatically include source files for backends
The purpose of this change is to allow to enable more than one backend at once by removing choice from ipc-service backend Kconfig and depending backend Kconfig option on existing of correct compatible. Overwriting IPC_SERVICE_BACKEND option in some places is removes as no longer needed. Signed-off-by: Emil Obalski <[email protected]>
1 parent 5d18f93 commit d877e1d

File tree

5 files changed

+19
-34
lines changed

5 files changed

+19
-34
lines changed

drivers/bluetooth/hci/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ config BT_RPMSG
3939
Bluetooth HCI driver for communication with another CPU
4040
using RPMsg framework.
4141

42-
if BT_RPMSG
43-
44-
choice IPC_SERVICE_BACKEND
45-
default IPC_SERVICE_BACKEND_RPMSG
46-
endchoice
47-
48-
endif # BT_RPMSG
49-
5042
config BT_SPI
5143
bool "SPI HCI"
5244
depends on SPI

include/ipc/ipc_rpmsg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern "C" {
2222
*/
2323

2424
/** Number of endpoints. */
25-
#define NUM_ENDPOINTS CONFIG_IPC_SERVICE_NUM_ENDPOINTS_PER_INSTANCE
25+
#define NUM_ENDPOINTS CONFIG_IPC_SERVICE_BACKEND_RPMSG_NUM_ENDPOINTS_PER_INSTANCE
2626

2727
struct ipc_rpmsg_ept;
2828

modules/hal_nordic/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ endif
179179
menu "nRF 802.15.4 serialization"
180180
depends on NRF_802154_SER_HOST || NRF_802154_SER_RADIO
181181

182-
choice IPC_SERVICE_BACKEND
183-
default IPC_SERVICE_BACKEND_RPMSG
184-
endchoice
185-
186182
config NRF_802154_SER_LOG
187183
bool "802.15.4 serialization logs"
188184
default n

subsys/ipc/ipc_service/backends/Kconfig

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
11
# Copyright (c) 2021 Nordic Semiconductor (ASA)
22
# SPDX-License-Identifier: Apache-2.0
33

4-
choice IPC_SERVICE_BACKEND
5-
prompt "IPC service backend"
4+
DT_COMPAT_ZEPHYR_IPC_OPENAMP_STATIC_VRINGS := zephyr,ipc-openamp-static-vrings
5+
DT_COMPAT_ZEPHYR_IPC_ICMSG := zephyr,ipc-icmsg
6+
7+
config IPC_SERVICE_REG_BACKEND_PRIORITY
8+
int "Initialization priority of modules registering IPC backend"
9+
default 46
10+
help
11+
The backend must be registered before the endpoint register.
612

713
config IPC_SERVICE_BACKEND_RPMSG
814
bool "OpenAMP RPMSG backend with static VRINGs"
915
depends on MBOX
16+
default $(dt_compat_enabled,$(DT_COMPAT_ZEPHYR_IPC_OPENAMP_STATIC_VRINGS))
1017
select IPC_SERVICE_RPMSG
1118
select IPC_SERVICE_STATIC_VRINGS
1219
select OPENAMP
1320

1421
config IPC_SERVICE_BACKEND_ICMSG
1522
bool "ICMSG backend with ICMsg buffer"
1623
depends on MBOX
24+
default $(dt_compat_enabled,$(DT_COMPAT_ZEPHYR_IPC_ICMSG))
1725
select IPC_SERVICE_ICMSG_BUF
1826
help
1927
Chosing this backend results in single endpoint implementation based
2028
on ringbuf.
2129

22-
config IPC_SERVICE_BACKEND_ZTEST
23-
depends on ZTEST
24-
bool "IPC service backend test"
25-
26-
endchoice
27-
28-
config IPC_SERVICE_NUM_ENDPOINTS_PER_INSTANCE
29-
int "Max number of registered endpoints per instance"
30-
default 2
31-
help
32-
Maximal number of endpoints that can be registered for one instance.
33-
34-
config IPC_SERVICE_REG_BACKEND_PRIORITY
35-
int "Initialization priority of modules registering IPC backend"
36-
default 46
37-
help
38-
The backend must be registered before the endpoint register.
39-
4030
config IPC_SERVICE_RPMSG
4131
bool "RPMsg support library"
4232
help

subsys/ipc/ipc_service/backends/Kconfig.rpmsg

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,11 @@ config IPC_SERVICE_BACKEND_RPMSG_SHMEM_RESET
2121
When this parameter is set to 'y' the status region of the shared
2222
memory is reset on kernel initialization.
2323

24-
endif # IP_SERVICE_BACKEND_RPMSG
24+
config IPC_SERVICE_BACKEND_RPMSG_NUM_ENDPOINTS_PER_INSTANCE
25+
int "Max number of registered endpoints per instance"
26+
default 2
27+
help
28+
Maximal number of endpoints that can be registered for one instance
29+
for RPMSG backend.
30+
31+
endif # IPC_SERVICE_BACKEND_RPMSG

0 commit comments

Comments
 (0)