diff --git a/nrf_modem/CMakeLists.txt b/nrf_modem/CMakeLists.txt index 23057e1f43..56d1477e1c 100644 --- a/nrf_modem/CMakeLists.txt +++ b/nrf_modem/CMakeLists.txt @@ -21,6 +21,8 @@ if(CONFIG_NRF_MODEM_LINK_BINARY) cmake_path(APPEND lib_path nrf9160) elseif(CONFIG_SOC_NRF9120) cmake_path(APPEND lib_path nrf9120) + elseif(CONFIG_SOC_NRF9230_ENGB_CPUAPP) + cmake_path(APPEND lib_path nrf9230) else() assert(0 "Unsupported SOC. Got '${CONFIG_SOC}'") endif() @@ -54,6 +56,8 @@ if(CONFIG_NRF_MODEM_LINK_BINARY) zephyr_include_directories(include) - target_sources(app PRIVATE shmem.c) + if(CONFIG_SOC_NRF9160 OR CONFIG_SOC_NRF9120) + target_sources(app PRIVATE shmem.c) + endif() endif() diff --git a/nrf_modem/Kconfig b/nrf_modem/Kconfig index b736dc0875..0d69ac09f7 100644 --- a/nrf_modem/Kconfig +++ b/nrf_modem/Kconfig @@ -8,7 +8,7 @@ menu "nrf_modem (Modem library)" # Selected by NRF_MODEM_LIB in sdk-nrf config NRF_MODEM bool - select NRFX_IPC if (SOC_SERIES_NRF91X || ZTEST) + select NRFX_IPC if SOC_SERIES_NRF91X select REQUIRES_FULL_LIBC if NRF_MODEM @@ -45,7 +45,8 @@ endif # NRF_MODEM config NRF_MODEM_SHMEM_CTRL_SIZE hex - default 0x728 if NRF_MODEM_LINK_BINARY_DECT_PHY + default 0xCE0 if (SOC_SERIES_NRF92X && NRF_MODEM_LINK_BINARY_CELLULAR) + default 0x728 if (SOC_SERIES_NRF91X && NRF_MODEM_LINK_BINARY_DECT_PHY) default 0x4e8 endmenu # nrf_modem diff --git a/nrf_modem/doc/CHANGELOG.rst b/nrf_modem/doc/CHANGELOG.rst index bac1317a22..a5491a932c 100644 --- a/nrf_modem/doc/CHANGELOG.rst +++ b/nrf_modem/doc/CHANGELOG.rst @@ -9,6 +9,13 @@ Changelog All notable changes to this project are documented in this file. +nrf_modem +********* + +* Added: + + * Binaries for nRF9230 SoC internal development. + nrf_modem 2.7.0 *************** diff --git a/nrf_modem/include/nrf_modem_os_rpc.h b/nrf_modem/include/nrf_modem_os_rpc.h new file mode 100644 index 0000000000..8c645d8690 --- /dev/null +++ b/nrf_modem/include/nrf_modem_os_rpc.h @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** + * @file nrf_modem_os_rpc.h + * + * @brief RPC transport glue. + * + * @defgroup nrf_modem_os_rpc Modem Library RPC transport glue + * @{ + */ +#ifndef NRF_MODEM_OS_RPC_H__ +#define NRF_MODEM_OS_RPC_H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*nrf_modem_os_rpc_signal_cb_t)(uint32_t ch, void *priv); + +/** + * @brief Parameters for configuring an nrf_modem rpc instance. + * + * Passed when invoking @c nrf_modem_os_rpc_open. + */ +struct nrf_modem_os_rpc_config { + struct { + /** Remote signal device. */ + uintptr_t sigdev; + /** TX channel number. */ + uint32_t ch; + /** TX shared memory start address. */ + uintptr_t addr; + /** TX shared memory size. */ + size_t size; + } tx; + struct { + /** Local signal device. */ + uintptr_t sigdev; + /** RX channel number. */ + uint32_t ch; + /** RX shared memory start address. */ + uintptr_t addr; + /** RX shared memory size. */ + size_t size; + } rx; + struct { + /** Pointer to private context passed as an argument to callbacks. */ + void *priv; + /** + * @brief Bind was successful. + * + * Invoked when the local and remote rpc instances + * have bound successfully. + * + * @param priv Private user data. + */ + void (*bound)(void *priv); + /** + * @brief New message has arrived. + * + * Invoked when new data is received. + * + * @param data Pointer to data buffer. + * @param len Length of @a data. + * @param priv Private user data. + */ + void (*received)(const void *data, size_t len, void *priv); + } cb; +}; + +/** + * @brief Parameters for configuring an nrf_modem signaling instance. + * + * Passed when invoking @c nrf_modem_os_rpc_signal_init. + */ +struct nrf_modem_os_rpc_signal_config { + /** Signal device. */ + uintptr_t sigdev; + /** Channel number. */ + uint32_t ch; + /** Pointer to private context passed as an argument to callbacks. */ + void *priv; + /** Invoked when signal with channel num @a ch is raised. + * See @c nrf_modem_os_rpc_signal_cb_t. + */ + nrf_modem_os_rpc_signal_cb_t recv; +}; + +/** + * @brief RPC instance declaration used internally in nrf_modem. + * + * This structure must be defined in the glue. + */ +struct nrf_modem_os_rpc; + +/** + * @brief Signaling instance declaration used internally in nrf_modem. + * + * This structure must be defined in the glue. + */ +struct nrf_modem_os_rpc_signal; + +/** + * @brief RPC instances used by nrf_modem and defined externally. + */ +extern struct nrf_modem_os_rpc inst_ctrl; +extern struct nrf_modem_os_rpc inst_data; + +/** + * @brief Signaling instances used by nrf_modem and defined externally. + */ +extern struct nrf_modem_os_rpc_signal inst_app_fault; +extern struct nrf_modem_os_rpc_signal inst_modem_fault; +extern struct nrf_modem_os_rpc_signal inst_modem_sysoff; + +/** + * @brief Get address of the application signal device. + * + * @return Address of application signal device. + */ +uintptr_t nrf_modem_os_rpc_sigdev_app_get(void); + +/** + * @brief Get address of the modem signal device. + * + * @return Address of modem signal device. + */ +uintptr_t nrf_modem_os_rpc_sigdev_modem_get(void); + +/** + * @brief Open an RPC instance. + * + * @param instance Pointer to RPC instance. + * @param conf Parameters for configuring the instance before it is opened. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_open(struct nrf_modem_os_rpc *instance, + const struct nrf_modem_os_rpc_config *conf); + +/** + * @brief Send a message from the local RPC instance to the remote instance. + * + * @param instance Pointer to RPC instance. + * @param msg Pointer to a buffer containing data to send. + * @param len Size of data in the @p msg buffer. + * + * @retval 0 on success. + * @retval -NRF_EBUSY when the instance is closed or handshaking. + * @retval -NRF_ENOMEM when there are not enough memory in circular buffer. + * @retval other errno codes from dependent modules. + */ +int nrf_modem_os_rpc_send(struct nrf_modem_os_rpc *instance, const void *msg, size_t len); + +/** + * @brief Close an RPC instance. + * + * @param instance pointer to RPC instance. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_close(struct nrf_modem_os_rpc *instance); + +/** + * @brief Suspend processing of incoming messages on the RPC instance. + * + * @param instance Pointer to RPC instance. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_rx_suspend(struct nrf_modem_os_rpc *instance); + +/** + * @brief Resume processing of incoming messages on the RPC instance. + * + * @param instance Pointer to RPC instance. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_rx_resume(struct nrf_modem_os_rpc *instance); + +/** + * @brief Configure and enable the signaling instance. + * + * @param instance Signaling instance. + * @param conf Parameters for configuring the instance before it is enabled. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_signal_init(struct nrf_modem_os_rpc_signal *instance, + struct nrf_modem_os_rpc_signal_config *conf); + +/** + * @brief Signal with the signaling instance. + * + * @param instance Signaling instance. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_signal_send(struct nrf_modem_os_rpc_signal *instance); + +/** + * @brief Disable the signaling instance. + * + * @param instance Signaling instance. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_signal_deinit(struct nrf_modem_os_rpc_signal *instance); + +/** + * @brief Flush address range in cache. + * + * @param addr Starting address to flush. + * @param size Range size. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_cache_data_flush(void *addr, size_t size); + +/** + * @brief Invalidate address range in cache. + * + * @param addr Starting address to invalidate. + * @param size Range size. + * + * @return 0 on success, a negative errno otherwise. + */ +int nrf_modem_os_rpc_cache_data_invalidate(void *addr, size_t size); + + + +#ifdef __cplusplus +} +#endif + +#endif /* NRF_MODEM_OS_RPC_H__ */ +/** @} */ diff --git a/nrf_modem/lib/cellular/nrf9230/hard-float/libmodem.a b/nrf_modem/lib/cellular/nrf9230/hard-float/libmodem.a new file mode 100644 index 0000000000..ed586f1acd Binary files /dev/null and b/nrf_modem/lib/cellular/nrf9230/hard-float/libmodem.a differ diff --git a/nrf_modem/lib/cellular/nrf9230/hard-float/libmodem_log.a b/nrf_modem/lib/cellular/nrf9230/hard-float/libmodem_log.a new file mode 100644 index 0000000000..4f8c0fd74b Binary files /dev/null and b/nrf_modem/lib/cellular/nrf9230/hard-float/libmodem_log.a differ diff --git a/nrf_modem/lib/cellular/nrf9230/soft-float/libmodem.a b/nrf_modem/lib/cellular/nrf9230/soft-float/libmodem.a new file mode 100644 index 0000000000..5b99b137b8 Binary files /dev/null and b/nrf_modem/lib/cellular/nrf9230/soft-float/libmodem.a differ diff --git a/nrf_modem/lib/cellular/nrf9230/soft-float/libmodem_log.a b/nrf_modem/lib/cellular/nrf9230/soft-float/libmodem_log.a new file mode 100644 index 0000000000..02b25e8d0d Binary files /dev/null and b/nrf_modem/lib/cellular/nrf9230/soft-float/libmodem_log.a differ