diff --git a/.github/test-spec.yml b/.github/test-spec.yml index 03dc8fd74be4..a06bf6289c4d 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -611,8 +611,5 @@ - "include/nfc/ndef/record.h" - "include/nfc/ndef/text_rec.h" - "include/dk_buttons_and_leds.h" - - "include/sdfw/sdfw_services/echo_service.h" - - "include/sdfw/sdfw_services/reset_evt_service.h" - - "include/sdfw/sdfw_services/sdfw_update_service.h" - "include/app_event_manager/app_event_manager.h" - "include/sdfw/sdfw_services/ssf_errno.h" diff --git a/CODEOWNERS b/CODEOWNERS index 92ed317d4245..537bd3642102 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -264,7 +264,6 @@ /doc/nrf/samples/other.rst @nrfconnect/ncs-doc-leads /doc/nrf/samples/peripheral.rst @nrfconnect/ncs-radio-sw-doc /doc/nrf/samples/pmic.rst @nrfconnect/ncs-pmic-doc -/doc/nrf/samples/sdfw.rst @nrfconnect/ncs-aurora-doc /doc/nrf/samples/sensor.rst @nrfconnect/ncs-cia-doc /doc/nrf/samples/serialization.rst @nrfconnect/ncs-si-muffin-doc /doc/nrf/samples/suit.rst @nrfconnect/ncs-charon-doc @@ -511,8 +510,6 @@ /samples/peripheral/lpuart/ @nordic-krch /samples/peripheral/radio_test/ @nrfconnect/ncs-si-muffin /samples/pmic/native/ @nordic-auko -/samples/sdfw/ @nrfconnect/ncs-aurora -/samples/sdfw/ssf_client/ @anhmolt /samples/sensor/bh1749/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia /samples/sensor/bme68x_iaq/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-cia /samples/suit/ @nrfconnect/ncs-charon @@ -635,7 +632,6 @@ /samples/peripheral/lpuart/*.rst @nrfconnect/ncs-doc-leads /samples/peripheral/radio_test/*.rst @nrfconnect/ncs-si-muffin-doc /samples/pmic/**/*.rst @nrfconnect/ncs-pmic-doc -/samples/sdfw/**/*.rst @nrfconnect/ncs-aurora-doc /samples/sensor/**/*.rst @nrfconnect/ncs-cia-doc /samples/suit/**/*.rst @nrfconnect/ncs-charon-doc /samples/tfm/**/*.rst @nrfconnect/ncs-aegir-doc diff --git a/doc/nrf/samples.rst b/doc/nrf/samples.rst index b12487559441..eb76b1f2799f 100644 --- a/doc/nrf/samples.rst +++ b/doc/nrf/samples.rst @@ -51,7 +51,6 @@ General information about samples in the |NCS| samples/nrf5340 samples/peripheral samples/pmic - samples/sdfw samples/sensor samples/serialization samples/suit diff --git a/doc/nrf/samples/sdfw.rst b/doc/nrf/samples/sdfw.rst deleted file mode 100644 index f884f1b64fd9..000000000000 --- a/doc/nrf/samples/sdfw.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. _sdfw_samples: - -SDFW samples -############ - -This section lists available |NCS| samples for :ref:`developing with Secure Domain firmware for nRF54H20 `. - -.. include:: ../samples.rst - :start-after: samples_general_info_start - :end-before: samples_general_info_end - -|filter_samples_by_board| - -.. toctree:: - :maxdepth: 1 - :caption: Subpages - :glob: - - ../../../samples/sdfw/*/README diff --git a/include/sdfw/sdfw_services/echo_service.h b/include/sdfw/sdfw_services/echo_service.h deleted file mode 100644 index 0fe6aafc5ec2..000000000000 --- a/include/sdfw/sdfw_services/echo_service.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef SSF_ECHO_SERVICE_H__ -#define SSF_ECHO_SERVICE_H__ - -#include - -#include - -/** .. include_startingpoint_echo_header_rst */ -/** - * @brief Echo back a c string. - * - * @param[in] str_in c string to be echoed back. - * @param[out] str_out Local buffer for copying the echoed c string into. - * @param[in] str_out_size Size of local buffer. - * - * @return 0 on success, otherwise a negative errno. - */ -int ssf_echo(char *str_in, char *str_out, size_t str_out_size); -/** .. include_endpoint_echo_header_rst */ - -#endif /* SSF_ECHO_SERVICE_H__ */ diff --git a/include/sdfw/sdfw_services/reset_evt_service.h b/include/sdfw/sdfw_services/reset_evt_service.h deleted file mode 100644 index cc002f76e6ba..000000000000 --- a/include/sdfw/sdfw_services/reset_evt_service.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef SSF_RESET_EVT_SERVICE_H__ -#define SSF_RESET_EVT_SERVICE_H__ - -#include - -#include -#include - -/** Error code in response from server if it failed to register or deregister - * the requested subscription. - */ -#define SSF_RESET_EVT_ERROR_SUB 1 - -/** - * @brief User callback invoked by client of reset event service for incoming notifications. - * - * @param[in] domains Bitfield of domains that will be reset. - * @param[in] delay_ms Delay in milliseconds until the reset occurs. - * @param[in] user_data Pointer to user data context - * - * @return 0 on success, otherwise a negative error code. Note that a non-0 value only results - * in an error being logged. - */ -typedef int (*ssf_reset_evt_callback)(uint32_t domains, uint32_t delay_ms, void *user_data); - -/** - * @brief Subscribe to reset event notifications. - * - * @param[in] callback Callback to be invoked for incoming notifications. - * @param[in] context User context given to the callback on incoming events. - * - * @return 0 on success - * -SSF_EINVAL if already subscribed to the service - * -SSF_EFAULT if response from server is not 0 - */ -int ssf_reset_evt_subscribe(ssf_reset_evt_callback callback, void *context); - -/** - * @brief Unsubscribe from all reset event service notifications. - * - * @return 0 on success - * -SSF_EINVAL if callback is NULL - * -SSF_EFAULT if response from server is not 0 - */ -int ssf_reset_evt_unsubscribe(void); - -/** - * @brief Notify all subscribed clients about an incoming reset. - * Note that this is a server side function. - * - * @param[in] domains Bitfield of domains that will be reset. - * @param[in] delay_ms Delay in milliseconds before the incoming reset. - * - * @return Value returned by `ssf_server_notif` - */ -int ssf_reset_evt_notify(uint32_t domains, uint32_t delay_ms); - -#endif /* SSF_RESET_EVT_SERVICE_H__ */ diff --git a/include/sdfw/sdfw_services/sdfw_update_service.h b/include/sdfw/sdfw_services/sdfw_update_service.h deleted file mode 100644 index e192addfb982..000000000000 --- a/include/sdfw/sdfw_services/sdfw_update_service.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#ifndef SSF_SDFW_UPDATE_SERVICE_H__ -#define SSF_SDFW_UPDATE_SERVICE_H__ - -#include - -#include - -/* Error code in response from server if an error occurred when performing the request. */ -#define SSF_SDFW_UPDATE_FAILED 0x3dfc0001 - -/** - * @brief Trigger an SDFW update request by pointing to an SDFW update blob. - * - * @param[in] blob_addr Start address of the SDFW update blob. - * - * @return Return value from `ssf_client_send_request`. - */ -int ssf_sdfw_update(uintptr_t blob_addr); - -#endif /* SSF_SDFW_UPDATE_SERVICE_H__ */ diff --git a/samples/sdfw/ssf_client/CMakeLists.txt b/samples/sdfw/ssf_client/CMakeLists.txt deleted file mode 100644 index 9b4520241a4a..000000000000 --- a/samples/sdfw/ssf_client/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -cmake_minimum_required(VERSION 3.13.1) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(ssf_client_sample) - -# NORDIC SDK APP START -target_sources(app PRIVATE src/main.c) -# NORDIC SDK APP END diff --git a/samples/sdfw/ssf_client/Kconfig b/samples/sdfw/ssf_client/Kconfig deleted file mode 100644 index 091beb20eb2f..000000000000 --- a/samples/sdfw/ssf_client/Kconfig +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -menuconfig SSF_CLIENT_SAMPLE - bool "SDFW Service Framework Client Sample" - help - "Enable sample-specific configurations." - -if SSF_CLIENT_SAMPLE - -config ENABLE_ECHO_REQUEST - bool "Enable SSF dummy request service(s)" - depends on SSF_ECHO_SERVICE_ENABLED - default y - -config ENABLE_RESET_EVT_SUBSCRIBE_REQUEST - bool "Enable the reset event subscription service" - depends on SSF_RESET_EVT_SERVICE_ENABLED - default y - -config ENABLE_SDFW_UPDATE_REQUEST - bool "Enable the SDFW update service" - depends on SSF_SDFW_UPDATE_SERVICE_ENABLED - help - Prompt a firmware update of SDFW based on downloaded update data. - This data can be "downloaded" in the sense that it was programmed into - MRAM manually for local testing. - -config UPDATE_REQUEST_CHECK_DATA - bool "Abort update if no data exists" - depends on ENABLE_SDFW_UPDATE_REQUEST - default y - help - Safety option to abort the update request if the download data is invalid - or not programmed at all. - -module = SSF_CLIENT_SAMPLE -module-str = SSF Client Sample -source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" - -endif # SSF_CLIENT_SAMPLE - -source "Kconfig.zephyr" diff --git a/samples/sdfw/ssf_client/README.rst b/samples/sdfw/ssf_client/README.rst deleted file mode 100644 index 70de017f1e0c..000000000000 --- a/samples/sdfw/ssf_client/README.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. _sdfw_ssf_client_sample: - -SDFW: Service Framework Client -############################## - -.. contents:: - :local: - :depth: 2 - -The sample demonstrates how Application and Radio core can request Secure Domain services. -It uses the SDFW Service Framework (SSF). - -Requirements -************ - -The sample supports the following development kits: - -.. table-from-rows:: /includes/sample_board_rows.txt - :header: heading - :rows: nrf54h20dk_nrf54h20_cpuapp, nrf54h20dk_nrf54h20_cpurad - -Overview -******** - -The sample shows how to use Secure Domain services by invoking some of the available services. -Available Secure Domain Services can be found in :file:`nrf/include/sdfw/sdfw_services`. -The service source files are located in :file:`nrf/subsys/sdfw_services/services`. - - - -Building and running -******************** - -.. |sample path| replace:: :file:`samples/sdfw/ssf_client` - -.. include:: /includes/build_and_run.txt - -.. note:: - |54H_engb_2_8| - -Testing -======= - -|test_sample| - -#. |connect_kit| -#. |connect_terminal| -#. In the terminal, observe the responses to the different requests. - -Dependencies -************ - -The sample uses the following `sdk-nrfxlib`_ library: - -* :ref:`nrfxlib:nrf_rpc` - -It uses the following Zephyr libraries: - -* :ref:`zephyr:ipc_service_backend_icmsg` -* :ref:`zephyr:logging_api` -* :ref:`zephyr:kernel_api` - -The sample also uses drivers from `nrfx`_. diff --git a/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpuapp.overlay deleted file mode 100644 index 1ca688cf9792..000000000000 --- a/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -&cpusec_cpuapp_ipc { - status = "okay"; -}; - -&cpuapp_ram0x_region { - status = "okay"; -}; - -&cpusec_bellboard { - status = "okay"; -}; - -&cpuapp_bellboard { - status = "okay"; -}; diff --git a/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpurad.overlay b/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpurad.overlay deleted file mode 100644 index 4a04725908a9..000000000000 --- a/samples/sdfw/ssf_client/boards/nrf54h20dk_nrf54h20_cpurad.overlay +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -&cpusec_cpurad_ipc { - status = "okay"; -}; - -&cpurad_ram0x_region { - status = "okay"; -}; - -&cpusec_bellboard { - status = "okay"; -}; - -&cpurad_bellboard { - status = "okay"; -}; diff --git a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpuapp.conf b/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpuapp.conf deleted file mode 100644 index 24be02d577c4..000000000000 --- a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpuapp.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DCACHE=n diff --git a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpuapp.overlay b/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpuapp.overlay deleted file mode 100644 index ee0bfcad083a..000000000000 --- a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpuapp.overlay +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -&cpusec_cpuapp_ipc { - status = "okay"; -}; - -&cpusec_bellboard { - status = "okay"; -}; diff --git a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpurad.conf b/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpurad.conf deleted file mode 100644 index 24be02d577c4..000000000000 --- a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DCACHE=n diff --git a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpurad.overlay b/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpurad.overlay deleted file mode 100644 index 789f8e84bea2..000000000000 --- a/samples/sdfw/ssf_client/boards/nrf9280pdk_nrf9280_cpurad.overlay +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -&cpusec_cpurad_ipc { - status = "okay"; -}; - -&cpurad_ram0x_region { - status = "okay"; -}; - -&cpusec_bellboard { - status = "okay"; -}; diff --git a/samples/sdfw/ssf_client/prj.conf b/samples/sdfw/ssf_client/prj.conf deleted file mode 100644 index e4dfd071ee42..000000000000 --- a/samples/sdfw/ssf_client/prj.conf +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SSF_CLIENT_SAMPLE=y diff --git a/samples/sdfw/ssf_client/sample.yaml b/samples/sdfw/ssf_client/sample.yaml deleted file mode 100644 index 9f6074ab16b0..000000000000 --- a/samples/sdfw/ssf_client/sample.yaml +++ /dev/null @@ -1,38 +0,0 @@ -sample: - name: SSF Client Sample - description: | - Sample demonstrating how to build application with sdfw service framework - enabled and how to request services from secure domain. - -common: - build_only: true - tags: ci_build ci_samples_sdfw - -tests: - samples.sdfw.ssf_client: - sysbuild: true - tags: sysbuild ci_samples_sdfw - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf9280pdk/nrf9280/cpuapp - - nrf9280pdk/nrf9280/cpurad - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf9280pdk/nrf9280/cpuapp - - nrf9280pdk/nrf9280/cpurad - samples.sdfw.ssf_client.logging.uart: - sysbuild: true - tags: sysbuild ci_samples_sdfw - platform_allow: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf9280pdk/nrf9280/cpuapp - - nrf9280pdk/nrf9280/cpurad - integration_platforms: - - nrf54h20dk/nrf54h20/cpuapp - - nrf54h20dk/nrf54h20/cpurad - - nrf9280pdk/nrf9280/cpuapp - - nrf9280pdk/nrf9280/cpurad - extra_args: EXTRA_CONF_FILE=uart_logging.conf diff --git a/samples/sdfw/ssf_client/src/main.c b/samples/sdfw/ssf_client/src/main.c deleted file mode 100644 index e6e14154b22a..000000000000 --- a/samples/sdfw/ssf_client/src/main.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA. - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include -#include - -#include -#include -LOG_MODULE_REGISTER(ssf_client_sample, CONFIG_SSF_CLIENT_SAMPLE_LOG_LEVEL); - -#if CONFIG_IMPRIMATUR_ENABLED -#define IMPRIMATUR_UPDATE_IMAGE_OFFSET CONFIG_IMPRIMATUR_UPDATE_IMAGE_OFFSET -#else -#define IMPRIMATUR_UPDATE_IMAGE_OFFSET (0xe155000) -#endif - -static void echo_request(void) -{ - int err; - char req_str[] = "Hello " CONFIG_BOARD; - char rsp_str[sizeof(req_str) + 1]; - - LOG_INF("Calling ssf_echo, str: \"%s\"", req_str); - - err = ssf_echo(req_str, rsp_str, sizeof(rsp_str)); - if (err != 0) { - LOG_ERR("ssf_echo failed"); - } else { - LOG_INF("ssf_echo response: %s", rsp_str); - } -} - -static int reset_evt_callback(uint32_t domains, uint32_t delay_ms, void *user_data) -{ - LOG_INF("reset_evt: domains 0x%x will reset in %d ms", domains, delay_ms); - - return 0; -} - -static void reset_evt_subscribe(void) -{ - int err; - - err = ssf_reset_evt_subscribe(reset_evt_callback, NULL); - if (err != 0) { - LOG_ERR("Unable to subscribe to reset_evt, err: %d", err); - return; - } -} - -static void sdfw_update(void) -{ - int err; - - uintptr_t *image_data = (uintptr_t *)IMPRIMATUR_UPDATE_IMAGE_OFFSET; - - if (IS_ENABLED(CONFIG_UPDATE_REQUEST_CHECK_DATA) && *image_data == 0xFFFFFFFF) { - LOG_WRN("No update download data."); - return; - } - - err = ssf_sdfw_update(IMPRIMATUR_UPDATE_IMAGE_OFFSET); - if (err != 0) { - LOG_ERR("Unable to perform sdfw update, err: %d", err); - return; - } -} - -int main(void) -{ - LOG_INF("ssf client sample (%s)", CONFIG_BOARD); - - if (IS_ENABLED(CONFIG_ENABLE_ECHO_REQUEST)) { - echo_request(); - } - - if (IS_ENABLED(CONFIG_ENABLE_RESET_EVT_SUBSCRIBE_REQUEST)) { - reset_evt_subscribe(); - } - - if (IS_ENABLED(CONFIG_ENABLE_SDFW_UPDATE_REQUEST)) { - sdfw_update(); - } - - return 0; -} diff --git a/samples/sdfw/ssf_client/uart_logging.conf b/samples/sdfw/ssf_client/uart_logging.conf deleted file mode 100644 index bdd802ffac2a..000000000000 --- a/samples/sdfw/ssf_client/uart_logging.conf +++ /dev/null @@ -1,14 +0,0 @@ -# Enable serial printing via UART -CONFIG_SERIAL=y -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -CONFIG_LOG=y -CONFIG_LOG_BACKEND_UART=y -CONFIG_LOG_PRINTK=y - -# Show function names for errors only -CONFIG_LOG_FUNC_NAME_PREFIX_ERR=y -CONFIG_LOG_FUNC_NAME_PREFIX_WRN=n -CONFIG_LOG_FUNC_NAME_PREFIX_INF=n -CONFIG_LOG_FUNC_NAME_PREFIX_DBG=n diff --git a/samples/suit/recovery/prj.conf b/samples/suit/recovery/prj.conf index 9ae6263e72db..7e13ec7f581b 100644 --- a/samples/suit/recovery/prj.conf +++ b/samples/suit/recovery/prj.conf @@ -113,6 +113,3 @@ CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n CONFIG_BT_CTLR_PRIVACY=n CONFIG_BT_CTLR_PHY_2M=n - -CONFIG_SSF_ECHO_SERVICE_ENABLED=n -CONFIG_SSF_RESET_EVT_SERVICE_ENABLED=n diff --git a/subsys/sdfw_services/services/CMakeLists.txt b/subsys/sdfw_services/services/CMakeLists.txt index 7c323f72f28e..ab2f6813b72a 100644 --- a/subsys/sdfw_services/services/CMakeLists.txt +++ b/subsys/sdfw_services/services/CMakeLists.txt @@ -5,10 +5,7 @@ # # Services -add_subdirectory_ifdef(CONFIG_SSF_ECHO_SERVICE_ENABLED echo) add_subdirectory_ifdef(CONFIG_SSF_ENC_FW_SERVICE_ENABLED enc_fw) add_subdirectory_ifdef(CONFIG_SSF_EXTMEM_SERVICE_ENABLED extmem) add_subdirectory_ifdef(CONFIG_SSF_PSA_CRYPTO_SERVICE_ENABLED psa_crypto) -add_subdirectory_ifdef(CONFIG_SSF_RESET_EVT_SERVICE_ENABLED reset_evt) -add_subdirectory_ifdef(CONFIG_SSF_SDFW_UPDATE_SERVICE_ENABLED sdfw_update) add_subdirectory_ifdef(CONFIG_SSF_SUIT_SERVICE_ENABLED suit_service) diff --git a/subsys/sdfw_services/services/Kconfig b/subsys/sdfw_services/services/Kconfig index a9ed5a5dd52a..ffd463ed79e5 100644 --- a/subsys/sdfw_services/services/Kconfig +++ b/subsys/sdfw_services/services/Kconfig @@ -5,10 +5,7 @@ # # Services -rsource "echo/Kconfig" rsource "enc_fw/Kconfig" rsource "extmem/Kconfig" rsource "psa_crypto/Kconfig" -rsource "reset_evt/Kconfig" -rsource "sdfw_update/Kconfig" rsource "suit_service/Kconfig" diff --git a/subsys/sdfw_services/services/echo/CMakeLists.txt b/subsys/sdfw_services/services/echo/CMakeLists.txt deleted file mode 100644 index f1c7fc92ec45..000000000000 --- a/subsys/sdfw_services/services/echo/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_sources(echo_service.c) - -generate_and_add_cbor_files(echo_service.cddl zcbor_generated - echo_service_req - echo_service_rsp -) diff --git a/subsys/sdfw_services/services/echo/Kconfig b/subsys/sdfw_services/services/echo/Kconfig deleted file mode 100644 index 9e95af0ac003..000000000000 --- a/subsys/sdfw_services/services/echo/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -service_name = ECHO -service_default_enabled = y -service_id = 0x64 -service_version = 1 -service_buffer_size = 128 -service_name_str = Echo -rsource "../Kconfig.template.service" diff --git a/subsys/sdfw_services/services/echo/echo_service.c b/subsys/sdfw_services/services/echo/echo_service.c deleted file mode 100644 index f74399cbf26a..000000000000 --- a/subsys/sdfw_services/services/echo/echo_service.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/** .. include_startingpoint_echo_source_rst */ -#include -#include -#include - -#include - -#include "echo_service_decode.h" -#include "echo_service_encode.h" -#include "echo_service_types.h" -#include -#include "ssf_client_os.h" - -SSF_CLIENT_SERVICE_DEFINE(echo_srvc, ECHO, cbor_encode_echo_service_req, - cbor_decode_echo_service_rsp); - -int ssf_echo(char *str_in, char *str_out, size_t str_out_size) -{ - int err; - int ret; - struct zcbor_string req_data; - struct echo_service_rsp rsp_data; - const uint8_t *rsp_pkt; /* For freeing response packet after copying rsp_str. */ - - const uint8_t *rsp_str; - size_t rsp_str_len; - - req_data.value = (uint8_t *)str_in; - req_data.len = strlen(str_in); - - err = ssf_client_send_request(&echo_srvc, &req_data, &rsp_data, &rsp_pkt); - if (err != 0) { - return err; - } - - ret = rsp_data.echo_service_rsp_ret; - if (ret != 0) { - ssf_client_decode_done(rsp_pkt); - return ret; - } - - rsp_str = rsp_data.echo_service_rsp_str_out.value; - rsp_str_len = rsp_data.echo_service_rsp_str_out.len; - memcpy(str_out, rsp_str, SSF_CLIENT_MIN(str_out_size, rsp_str_len)); - - ssf_client_decode_done(rsp_pkt); - return 0; -} -/** .. include_endpoint_echo_source_rst */ diff --git a/subsys/sdfw_services/services/echo/echo_service.cddl b/subsys/sdfw_services/services/echo/echo_service.cddl deleted file mode 100644 index 5103e140374c..000000000000 --- a/subsys/sdfw_services/services/echo/echo_service.cddl +++ /dev/null @@ -1,18 +0,0 @@ -; -; Copyright (c) 2024 Nordic Semiconductor ASA -; -; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -; - -; .. include_startingpoint_echo_cddl_rst -; Echo service request payload. -echo_service_req = [ - str_in: tstr, -] - -; Echo service response payload. -echo_service_rsp = [ - ret: int, - str_out: tstr, -] -; .. include_endpoint_echo_cddl_rst diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/echo/zcbor_generated/CMakeLists.txt deleted file mode 100644 index 6775bb9108f8..000000000000 --- a/subsys/sdfw_services/services/echo/zcbor_generated/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# -# Generated using cmake macro generate_and_add_cbor_files. -# - -zephyr_sources( - echo_service_decode.c - echo_service_encode.c -) - -zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c deleted file mode 100644 index 682fa3afb16c..000000000000 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#include -#include -#include -#include -#include "zcbor_decode.h" -#include "echo_service_decode.h" -#include "zcbor_print.h" - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result); -static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result); - -static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_decode(state) && - ((((zcbor_int32_decode(state, (&(*result).echo_service_rsp_ret)))) && - ((zcbor_tstr_decode(state, (&(*result).echo_service_rsp_str_out))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_tstr_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len, - struct zcbor_string *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_echo_service_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len, - struct echo_service_rsp *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_echo_service_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); -} diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h deleted file mode 100644 index 284b67ff2716..000000000000 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_decode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef ECHO_SERVICE_DECODE_H__ -#define ECHO_SERVICE_DECODE_H__ - -#include -#include -#include -#include -#include "echo_service_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len, - struct zcbor_string *result, size_t *payload_len_out); - -int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len, - struct echo_service_rsp *result, size_t *payload_len_out); - -#ifdef __cplusplus -} -#endif - -#endif /* ECHO_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c deleted file mode 100644 index a0cf04d2482e..000000000000 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#include -#include -#include -#include -#include "zcbor_encode.h" -#include "echo_service_encode.h" -#include "zcbor_print.h" - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input); -static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input); - -static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_encode(state, 2) && - ((((zcbor_int32_encode(state, (&(*input).echo_service_rsp_ret)))) && - ((zcbor_tstr_encode(state, (&(*input).echo_service_rsp_str_out))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 2)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_tstr_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len, - const struct zcbor_string *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_echo_service_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len, - const struct echo_service_rsp *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_echo_service_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); -} diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h deleted file mode 100644 index 08002595be0e..000000000000 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_encode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef ECHO_SERVICE_ENCODE_H__ -#define ECHO_SERVICE_ENCODE_H__ - -#include -#include -#include -#include -#include "echo_service_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len, - const struct zcbor_string *input, size_t *payload_len_out); - -int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len, - const struct echo_service_rsp *input, size_t *payload_len_out); - -#ifdef __cplusplus -} -#endif - -#endif /* ECHO_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h b/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h deleted file mode 100644 index 8b89ebb3c067..000000000000 --- a/subsys/sdfw_services/services/echo/zcbor_generated/echo_service_types.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef ECHO_SERVICE_TYPES_H__ -#define ECHO_SERVICE_TYPES_H__ - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Which value for --default-max-qty this file was created with. - * - * The define is used in the other generated file to do a build-time - * compatibility check. - * - * See `zcbor --help` for more information about --default-max-qty - */ -#define DEFAULT_MAX_QTY 3 - -struct echo_service_rsp { - int32_t echo_service_rsp_ret; - struct zcbor_string echo_service_rsp_str_out; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* ECHO_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/reset_evt/CMakeLists.txt b/subsys/sdfw_services/services/reset_evt/CMakeLists.txt deleted file mode 100644 index 75d0c7f7cff8..000000000000 --- a/subsys/sdfw_services/services/reset_evt/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_sources(reset_evt_service.c) - -generate_and_add_cbor_files(reset_evt_service.cddl zcbor_generated - reset_evt_sub_req - reset_evt_sub_rsp - reset_evt_notif -) diff --git a/subsys/sdfw_services/services/reset_evt/Kconfig b/subsys/sdfw_services/services/reset_evt/Kconfig deleted file mode 100644 index 36c5854e0cf8..000000000000 --- a/subsys/sdfw_services/services/reset_evt/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -service_name = RESET_EVT -service_default_enabled = y -service_id = 0x68 -service_version = 1 -service_buffer_size = 32 -service_name_str = Reset Event Notification -rsource "../Kconfig.template.service" diff --git a/subsys/sdfw_services/services/reset_evt/reset_evt_service.c b/subsys/sdfw_services/services/reset_evt/reset_evt_service.c deleted file mode 100644 index 303e74359ead..000000000000 --- a/subsys/sdfw_services/services/reset_evt/reset_evt_service.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include -#include - -#include - -#include "reset_evt_service_decode.h" -#include "reset_evt_service_encode.h" -#include "reset_evt_service_types.h" -#include -#include -#include -#include "ssf_client_os.h" - -SSF_CLIENT_LOG_REGISTER(reset_evt_service, CONFIG_SSF_RESET_EVT_SERVICE_LOG_LEVEL); - -SSF_CLIENT_SERVICE_DEFINE(reset_evt_srvc, RESET_EVT, cbor_encode_reset_evt_sub_req, - cbor_decode_reset_evt_sub_rsp); - -SSF_CLIENT_NOTIF_LISTENER_DEFINE(reset_evt_listener, RESET_EVT, cbor_decode_reset_evt_notif, - reset_evt_handler); - -static ssf_reset_evt_callback user_callback; - -static int reset_evt_handler(struct ssf_notification *notif, void *handler_user_data) -{ - int err; - struct reset_evt_notif notification; - - if (user_callback == NULL) { - SSF_CLIENT_LOG_WRN("No user callback set"); - return -SSF_EFAULT; - } - - err = ssf_client_notif_decode(notif, ¬ification); - ssf_client_notif_decode_done(notif); - if (err != 0) { - SSF_CLIENT_LOG_ERR("Decoding notification failed: %d", err); - return err; - } - - err = user_callback(notification.reset_evt_notif_domains, - notification.reset_evt_notif_delay_ms, handler_user_data); - - return err; -} - -int ssf_reset_evt_subscribe(ssf_reset_evt_callback callback, void *context) -{ - int err; - bool req_subscribe; - int32_t rsp_status; - - if (user_callback != NULL || callback == NULL) { - return -SSF_EINVAL; - } - - err = ssf_client_notif_register(&reset_evt_listener, context); - if (err != 0) { - SSF_CLIENT_LOG_ERR("Failed to register for notifications: %d", err); - return err; - } - - req_subscribe = true; - err = ssf_client_send_request(&reset_evt_srvc, &req_subscribe, &rsp_status, NULL); - if (err != 0) { - return err; - } - - if (rsp_status != 0) { - SSF_CLIENT_LOG_ERR("Failed to subscribe to server notifications: %d", err); - err = ssf_client_notif_deregister(&reset_evt_listener); - if (err != 0) { - SSF_CLIENT_LOG_ERR("Failed to deregister from notifications: %d", err); - } - - return -SSF_EFAULT; - } - - user_callback = callback; - - return err; -} - -int ssf_reset_evt_unsubscribe(void) -{ - int err; - bool req_subscribe; - int32_t rsp_status; - - req_subscribe = false; - - err = ssf_client_send_request(&reset_evt_srvc, &req_subscribe, &rsp_status, NULL); - if (err != 0) { - SSF_CLIENT_LOG_ERR("Failed to issue unsubscribe message to server: %d", err); - return err; - } - - if (rsp_status != 0) { - SSF_CLIENT_LOG_ERR("Server returned error when unsubscribing: %d", err); - return -SSF_EFAULT; - } - - err = ssf_client_notif_deregister(&reset_evt_listener); - if (err != 0) { - SSF_CLIENT_LOG_ERR("Failed to de-register from notifications: %d", err); - return err; - } - - user_callback = NULL; - - return err; -} diff --git a/subsys/sdfw_services/services/reset_evt/reset_evt_service.cddl b/subsys/sdfw_services/services/reset_evt/reset_evt_service.cddl deleted file mode 100644 index 56e27b984dc9..000000000000 --- a/subsys/sdfw_services/services/reset_evt/reset_evt_service.cddl +++ /dev/null @@ -1,21 +0,0 @@ -; -; Copyright (c) 2024 Nordic Semiconductor ASA -; -; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -; - -; Subscribe to reset events -reset_evt_sub_req = [ - subscribe: bool, ; True for subscribe, false for unsubscribe -] - -; Response from subscribing to reset event service. -reset_evt_sub_rsp = [ - status: int, -] - -; Reset event notification message. -reset_evt_notif = [ - domains: uint, ; Bitfield of domains that will be reset - delay_ms: uint, ; Delay in milliseconds before the incoming reset -] diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/reset_evt/zcbor_generated/CMakeLists.txt deleted file mode 100644 index ba5122c76dfb..000000000000 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# -# Generated using cmake macro generate_and_add_cbor_files. -# - -zephyr_sources( - reset_evt_service_decode.c - reset_evt_service_encode.c -) - -zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c deleted file mode 100644 index 0ec42dfada5e..000000000000 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#include -#include -#include -#include -#include "zcbor_decode.h" -#include "reset_evt_service_decode.h" -#include "zcbor_print.h" - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -static bool decode_reset_evt_notif(zcbor_state_t *state, struct reset_evt_notif *result); -static bool decode_reset_evt_sub_rsp(zcbor_state_t *state, int32_t *result); -static bool decode_reset_evt_sub_req(zcbor_state_t *state, bool *result); - -static bool decode_reset_evt_notif(zcbor_state_t *state, struct reset_evt_notif *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_decode(state) && - ((((zcbor_uint32_decode(state, (&(*result).reset_evt_notif_domains)))) && - ((zcbor_uint32_decode(state, (&(*result).reset_evt_notif_delay_ms))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_reset_evt_sub_rsp(zcbor_state_t *state, int32_t *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_int32_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_reset_evt_sub_req(zcbor_state_t *state, bool *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_bool_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, bool *result, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_reset_evt_sub_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_reset_evt_sub_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_decode_reset_evt_notif(const uint8_t *payload, size_t payload_len, - struct reset_evt_notif *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_reset_evt_notif, - sizeof(states) / sizeof(zcbor_state_t), 1); -} diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h deleted file mode 100644 index 73ebfb26e965..000000000000 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_decode.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef RESET_EVT_SERVICE_DECODE_H__ -#define RESET_EVT_SERVICE_DECODE_H__ - -#include -#include -#include -#include -#include "reset_evt_service_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -int cbor_decode_reset_evt_sub_req(const uint8_t *payload, size_t payload_len, bool *result, - size_t *payload_len_out); - -int cbor_decode_reset_evt_sub_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out); - -int cbor_decode_reset_evt_notif(const uint8_t *payload, size_t payload_len, - struct reset_evt_notif *result, size_t *payload_len_out); - -#ifdef __cplusplus -} -#endif - -#endif /* RESET_EVT_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c deleted file mode 100644 index f3d096c77f07..000000000000 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#include -#include -#include -#include -#include "zcbor_encode.h" -#include "reset_evt_service_encode.h" -#include "zcbor_print.h" - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -static bool encode_reset_evt_notif(zcbor_state_t *state, const struct reset_evt_notif *input); -static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, const int32_t *input); -static bool encode_reset_evt_sub_req(zcbor_state_t *state, const bool *input); - -static bool encode_reset_evt_notif(zcbor_state_t *state, const struct reset_evt_notif *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = - (((zcbor_list_start_encode(state, 2) && - ((((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_domains)))) && - ((zcbor_uint32_encode(state, (&(*input).reset_evt_notif_delay_ms))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 2)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_reset_evt_sub_rsp(zcbor_state_t *state, const int32_t *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_int32_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_reset_evt_sub_req(zcbor_state_t *state, const bool *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_bool_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, const bool *input, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_reset_evt_sub_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_reset_evt_sub_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_encode_reset_evt_notif(uint8_t *payload, size_t payload_len, - const struct reset_evt_notif *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_reset_evt_notif, - sizeof(states) / sizeof(zcbor_state_t), 1); -} diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h deleted file mode 100644 index 5892b17ea8f5..000000000000 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_encode.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef RESET_EVT_SERVICE_ENCODE_H__ -#define RESET_EVT_SERVICE_ENCODE_H__ - -#include -#include -#include -#include -#include "reset_evt_service_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -int cbor_encode_reset_evt_sub_req(uint8_t *payload, size_t payload_len, const bool *input, - size_t *payload_len_out); - -int cbor_encode_reset_evt_sub_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out); - -int cbor_encode_reset_evt_notif(uint8_t *payload, size_t payload_len, - const struct reset_evt_notif *input, size_t *payload_len_out); - -#ifdef __cplusplus -} -#endif - -#endif /* RESET_EVT_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h b/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h deleted file mode 100644 index e7b9b242189a..000000000000 --- a/subsys/sdfw_services/services/reset_evt/zcbor_generated/reset_evt_service_types.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef RESET_EVT_SERVICE_TYPES_H__ -#define RESET_EVT_SERVICE_TYPES_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Which value for --default-max-qty this file was created with. - * - * The define is used in the other generated file to do a build-time - * compatibility check. - * - * See `zcbor --help` for more information about --default-max-qty - */ -#define DEFAULT_MAX_QTY 3 - -struct reset_evt_notif { - uint32_t reset_evt_notif_domains; - uint32_t reset_evt_notif_delay_ms; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* RESET_EVT_SERVICE_TYPES_H__ */ diff --git a/subsys/sdfw_services/services/sdfw_update/CMakeLists.txt b/subsys/sdfw_services/services/sdfw_update/CMakeLists.txt deleted file mode 100644 index a0bc40fa1a30..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -zephyr_sources(sdfw_update_service.c) - -generate_and_add_cbor_files(sdfw_update_service.cddl zcbor_generated - sdfw_update_req - sdfw_update_rsp -) diff --git a/subsys/sdfw_services/services/sdfw_update/Kconfig b/subsys/sdfw_services/services/sdfw_update/Kconfig deleted file mode 100644 index 55e872a2df81..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/Kconfig +++ /dev/null @@ -1,47 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -service_name = SDFW_UPDATE -service_default_enabled = y -service_id = 0x69 -service_version = 1 -service_buffer_size = 64 -service_name_str = SDFW Update -rsource "../Kconfig.template.service" - -if SSF_SDFW_UPDATE_SERVICE_ENABLED - -config SSF_SDFW_UPDATE_TBS_OFFSET - hex - default 0x10 - help - Offset of TBS data inside the update blob. - -config SSF_SDFW_UPDATE_PUBLIC_KEY_OFFSET - hex - default 0x110 - help - Offset of public key inside the update blob. - -config SSF_SDFW_UPDATE_SIGNATURE_OFFSET - hex - default 0x130 - help - Offset of signature inside the update blob. - -config SSF_SDFW_UPDATE_FIRMWARE_OFFSET - hex - default 0x170 - help - Offset of firmware inside the update blob. - -config SSF_SDFW_UPDATE_DOWNLOAD_MAX - hex - default 0xf0000 - help - Max size of update. - -endif # SSF_SDFW_UPDATE_SERVICE_ENABLED diff --git a/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.c b/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.c deleted file mode 100644 index ee4075bb555f..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -#include -#include - -#include - -#include "sdfw_update_service_decode.h" -#include "sdfw_update_service_encode.h" -#include "sdfw_update_service_types.h" -#include -#include "ssf_client_os.h" - -SSF_CLIENT_LOG_REGISTER(sdfw_update_service, CONFIG_SSF_SDFW_UPDATE_SERVICE_LOG_LEVEL); - -SSF_CLIENT_SERVICE_DEFINE(sdfw_update_srvc, SDFW_UPDATE, cbor_encode_sdfw_update_req, - cbor_decode_sdfw_update_rsp); - -int ssf_sdfw_update(uintptr_t blob_addr) -{ - int err; - struct sdfw_update_req req_data; - int32_t rsp_status; - - req_data.sdfw_update_req_tbs_addr = blob_addr + CONFIG_SSF_SDFW_UPDATE_TBS_OFFSET; - req_data.sdfw_update_req_dl_max = CONFIG_SSF_SDFW_UPDATE_DOWNLOAD_MAX; - req_data.sdfw_update_req_dl_addr_fw = blob_addr + CONFIG_SSF_SDFW_UPDATE_FIRMWARE_OFFSET; - req_data.sdfw_update_req_dl_addr_pk = blob_addr + CONFIG_SSF_SDFW_UPDATE_PUBLIC_KEY_OFFSET; - req_data.sdfw_update_req_dl_addr_signature = - blob_addr + CONFIG_SSF_SDFW_UPDATE_SIGNATURE_OFFSET; - - err = ssf_client_send_request(&sdfw_update_srvc, &req_data, &rsp_status, NULL); - if (err != 0) { - SSF_CLIENT_LOG_ERR("Error while sending request: %d", err); - return err; - } - - if (rsp_status != 0) { - SSF_CLIENT_LOG_ERR("Error in response: %d", rsp_status); - } - - return err; -} diff --git a/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.cddl b/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.cddl deleted file mode 100644 index da6cd3c031aa..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/sdfw_update_service.cddl +++ /dev/null @@ -1,17 +0,0 @@ -; -; Copyright (c) 2024 Nordic Semiconductor ASA -; -; SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -; - -sdfw_update_req = [ - tbs_addr: uint, ; Address of data to be stored in SICR.UROT.UPDATE.SM.TBS - dl_max: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.MAX - dl_addr_fw: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.FIRMWARE - dl_addr_pk: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.PUBKEY - dl_addr_signature: uint, ; Value to write to SICR.UROT.UPDATE.DOWNLOAD.SIGNATURE -] - -sdfw_update_rsp = [ - status: int, -] diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/CMakeLists.txt b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/CMakeLists.txt deleted file mode 100644 index 0f96d2b36685..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# -# Generated using cmake macro generate_and_add_cbor_files. -# - -zephyr_sources( - sdfw_update_service_decode.c - sdfw_update_service_encode.c -) - -zephyr_include_directories(.) diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c deleted file mode 100644 index 25640e21ae7e..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#include -#include -#include -#include -#include "zcbor_decode.h" -#include "sdfw_update_service_decode.h" -#include "zcbor_print.h" - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result); -static bool decode_sdfw_update_req(zcbor_state_t *state, struct sdfw_update_req *result); - -static bool decode_sdfw_update_rsp(zcbor_state_t *state, int32_t *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_decode(state) && - ((((zcbor_int32_decode(state, (&(*result)))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool decode_sdfw_update_req(zcbor_state_t *state, struct sdfw_update_req *result) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = ((( - zcbor_list_start_decode(state) && - ((((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_tbs_addr)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_max)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_fw)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_pk)))) && - ((zcbor_uint32_decode(state, (&(*result).sdfw_update_req_dl_addr_signature))))) || - (zcbor_list_map_end_force_decode(state), false)) && - zcbor_list_end_decode(state)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -int cbor_decode_sdfw_update_req(const uint8_t *payload, size_t payload_len, - struct sdfw_update_req *result, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_sdfw_update_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states, - (zcbor_decoder_t *)decode_sdfw_update_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); -} diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h deleted file mode 100644 index a869f949d749..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_decode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef SDFW_UPDATE_SERVICE_DECODE_H__ -#define SDFW_UPDATE_SERVICE_DECODE_H__ - -#include -#include -#include -#include -#include "sdfw_update_service_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -int cbor_decode_sdfw_update_req(const uint8_t *payload, size_t payload_len, - struct sdfw_update_req *result, size_t *payload_len_out); - -int cbor_decode_sdfw_update_rsp(const uint8_t *payload, size_t payload_len, int32_t *result, - size_t *payload_len_out); - -#ifdef __cplusplus -} -#endif - -#endif /* SDFW_UPDATE_SERVICE_DECODE_H__ */ diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c deleted file mode 100644 index be58fb2e1a5c..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#include -#include -#include -#include -#include "zcbor_encode.h" -#include "sdfw_update_service_encode.h" -#include "zcbor_print.h" - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input); -static bool encode_sdfw_update_req(zcbor_state_t *state, const struct sdfw_update_req *input); - -static bool encode_sdfw_update_rsp(zcbor_state_t *state, const int32_t *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (((zcbor_list_start_encode(state, 1) && - ((((zcbor_int32_encode(state, (&(*input)))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 1)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -static bool encode_sdfw_update_req(zcbor_state_t *state, const struct sdfw_update_req *input) -{ - zcbor_log("%s\r\n", __func__); - - bool tmp_result = (( - (zcbor_list_start_encode(state, 5) && - ((((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_tbs_addr)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_max)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_fw)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_pk)))) && - ((zcbor_uint32_encode(state, (&(*input).sdfw_update_req_dl_addr_signature))))) || - (zcbor_list_map_end_force_encode(state), false)) && - zcbor_list_end_encode(state, 5)))); - - if (!tmp_result) { - zcbor_trace_file(state); - zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state))); - } else { - zcbor_log("%s success\r\n", __func__); - } - - return tmp_result; -} - -int cbor_encode_sdfw_update_req(uint8_t *payload, size_t payload_len, - const struct sdfw_update_req *input, size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_sdfw_update_req, - sizeof(states) / sizeof(zcbor_state_t), 1); -} - -int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out) -{ - zcbor_state_t states[3]; - - return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states, - (zcbor_decoder_t *)encode_sdfw_update_rsp, - sizeof(states) / sizeof(zcbor_state_t), 1); -} diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h deleted file mode 100644 index 94f0d7b477f5..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_encode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef SDFW_UPDATE_SERVICE_ENCODE_H__ -#define SDFW_UPDATE_SERVICE_ENCODE_H__ - -#include -#include -#include -#include -#include "sdfw_update_service_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if DEFAULT_MAX_QTY != 3 -#error "The type file was generated with a different default_max_qty than this file" -#endif - -int cbor_encode_sdfw_update_req(uint8_t *payload, size_t payload_len, - const struct sdfw_update_req *input, size_t *payload_len_out); - -int cbor_encode_sdfw_update_rsp(uint8_t *payload, size_t payload_len, const int32_t *input, - size_t *payload_len_out); - -#ifdef __cplusplus -} -#endif - -#endif /* SDFW_UPDATE_SERVICE_ENCODE_H__ */ diff --git a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h b/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h deleted file mode 100644 index ecf3d6c40239..000000000000 --- a/subsys/sdfw_services/services/sdfw_update/zcbor_generated/sdfw_update_service_types.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/* - * Generated using zcbor version 0.8.1 - * https://github.com/NordicSemiconductor/zcbor - * Generated with a --default-max-qty of 3 - */ - -#ifndef SDFW_UPDATE_SERVICE_TYPES_H__ -#define SDFW_UPDATE_SERVICE_TYPES_H__ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Which value for --default-max-qty this file was created with. - * - * The define is used in the other generated file to do a build-time - * compatibility check. - * - * See `zcbor --help` for more information about --default-max-qty - */ -#define DEFAULT_MAX_QTY 3 - -struct sdfw_update_req { - uint32_t sdfw_update_req_tbs_addr; - uint32_t sdfw_update_req_dl_max; - uint32_t sdfw_update_req_dl_addr_fw; - uint32_t sdfw_update_req_dl_addr_pk; - uint32_t sdfw_update_req_dl_addr_signature; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* SDFW_UPDATE_SERVICE_TYPES_H__ */