diff --git a/arch/arm/src/nrf53/nrf53_sdc.c b/arch/arm/src/nrf53/nrf53_sdc.c index 4051153c922..21a3c003534 100644 --- a/arch/arm/src/nrf53/nrf53_sdc.c +++ b/arch/arm/src/nrf53/nrf53_sdc.c @@ -41,6 +41,9 @@ #if defined(CONFIG_UART_BTH4) # include #endif +#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER +# include +#endif #include "arm_internal.h" #include "ram_vectors.h" @@ -60,6 +63,12 @@ # error Only for the NET core #endif +#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER +# if defined(CONFIG_UART_BTH4) || defined(CONFIG_NET_BLUETOOTH) +# error Invalid configuration +# endif +#endif + /* Connections configuration ************************************************/ /* If NET_BLUETOOTH not defined */ @@ -919,9 +928,41 @@ int nrf53_sdc_initialize(void) wlerr("bt_netdev_register error: %d\n", ret); return ret; } +#elif defined(CONFIG_BLUETOOTH_RPMSG_SERVER) + /* Do nothing here */ #else # error #endif return ret; } + +#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER +/**************************************************************************** + * Name: nrf53_rpmsghci_server_initialize + ****************************************************************************/ + +int nrf53_rpmsghci_server_initialize(const char *name) +{ + int ret = OK; + + /* Initialize SDC */ + + ret = nrf53_sdc_initialize(); + if (ret < 0) + { + wlerr("nrf53_sdc_initialize error: %d\n", ret); + return ret; + } + + /* Register rpmsg-HCI server */ + + ret = rpmshci_server_init(name, &g_bt_driver); + if (ret < 0) + { + wlerr("rpmshci_server_init error: %d\n", ret); + } + + return ret; +} +#endif diff --git a/arch/arm/src/nrf53/nrf53_sdc.h b/arch/arm/src/nrf53/nrf53_sdc.h index 4f54cc78ab6..ece8bae6150 100644 --- a/arch/arm/src/nrf53/nrf53_sdc.h +++ b/arch/arm/src/nrf53/nrf53_sdc.h @@ -56,6 +56,9 @@ extern "C" ****************************************************************************/ int nrf53_sdc_initialize(void); +#ifdef CONFIG_BLUETOOTH_RPMSG_SERVER +int nrf53_rpmsghci_server_initialize(const char *name); +#endif #undef EXTERN #ifdef __cplusplus