Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
/include/nrf_compress/ @nordicjm
/include/nrf_rpc/ @nrfconnect/ncs-co-drivers @nrfconnect/ncs-si-muffin @nrfconnect/ncs-protocols-serialization
/include/power/ @nrfconnect/ncs-co-drivers
/include/ironside/ @nrfconnect/ncs-aurora
/include/sdfw/ @nrfconnect/ncs-aurora
/include/sdfw/sdfw_services/extmem_remote.h @nrfconnect/ncs-charon
/include/sdfw/sdfw_services/suit_service.h @nrfconnect/ncs-charon
Expand All @@ -389,6 +390,7 @@
/lib/bin/lwm2m_carrier/ @nrfconnect/ncs-carrier
/lib/boot_banner/ @nordicjm
/lib/contin_array/ @nrfconnect/ncs-audio
/lib/cpuconf/ @nrfconnect/ncs-aurora
/lib/data_fifo/ @nrfconnect/ncs-audio
/lib/date_time/ @nrfconnect/ncs-modem-tre
/lib/dk_buttons_and_leds/ @nrfconnect/ncs-si-muffin
Expand Down
51 changes: 51 additions & 0 deletions include/ironside/se/cpuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#ifndef __CPUCONF_H__
#define __CPUCONF_H__

#include <zephyr/drivers/firmware/nrf_ironside/call.h>

#define IRONSIDE_SE_CPUCONF_SERVICE_WRONG_CPU 0x5eb2
#define IRONSIDE_SE_CPUCONF_SERVICE_STARTING_CPU_FAILED 0x5eb0
#define IRONSIDE_SE_CPUCONF_SERVICE_MEM_ACCESS_NOT_PERMITTED 0x5eb1

#define IRONSIDE_CALL_ID_CPUCONF_V0 2

enum {
IRONSIDE_SE_CPUCONF_INDEX_CPU,
IRONSIDE_SE_CPUCONF_INDEX_VECTOR_TABLE,
IRONSIDE_SE_CPUCONF_INDEX_CPU_WAIT,
IRONSIDE_SE_CPUCONF_INDEX_MSG,
IRONSIDE_SE_CPUCONF_INDEX_MSG_SIZE,
IRONSIDE_SE_CPUCONF_INDEX_ERR,
/* The last enum value is reserved for the number of arguments */
IRONSIDE_SE_CPUCONF_NUM_ARGS
};

BUILD_ASSERT(IRONSIDE_SE_CPUCONF_NUM_ARGS <= NRF_IRONSIDE_CALL_NUM_ARGS);

/**
* @brief Boot a local domain CPU
*
* @param cpu The CPU to be booted
* @param vector_table Pointer to the vector table used to boot the CPU.
* @param cpu_wait When this is true, the CPU will WAIT even if the CPU has clock.
* @param msg A message that can be placed in radiocore's boot report.
* @param msg_size Size of the message in bytes.
*
* @note cpu_wait is only intended to be enabled for debug purposes
* and it is only supported that a debugger resumes the CPU.
*
* @retval 0 on success or if the CPU has already booted.
* @retval -IRONSIDE_SE_CPUCONF_SERVICE_WRONG_CPU if cpu is unrecognized
* @retval -IRONSIDE_SE_CPUCONF_SERVICE_STARTING_CPU_FAILED if starting the CPU failed
* @retval -IRONSIDE_SE_CPUCONF_SERVICE_MEM_ACCESS_NOT_PERMITTED
* if the CPU does not have read access configured for the vector_table address
*/
int ironside_se_cpuconf_boot_core(NRF_PROCESSORID_Type cpu, void *vector_table, bool cpu_wait, uint8_t *msg, size_t msg_size);

Check warning on line 49 in include/ironside/se/cpuconf.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

include/ironside/se/cpuconf.h:49 line length of 126 exceeds 100 columns

#endif /* __CPUCONF_SERVICE_H__ */
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ add_subdirectory_ifdef(CONFIG_HW_UNIQUE_KEY_SRC hw_unique_key)
add_subdirectory_ifdef(CONFIG_APP_JWT app_jwt)
add_subdirectory_ifdef(CONFIG_MODEM_JWT modem_jwt)
add_subdirectory_ifdef(CONFIG_MODEM_SLM modem_slm)
add_subdirectory_ifdef(CONFIG_IRONSIDE_SE_CPUCONF cpuconf)
add_subdirectory_ifdef(CONFIG_MODEM_ATTEST_TOKEN modem_attest_token)
add_subdirectory_ifdef(CONFIG_LOCATION location)
add_subdirectory_ifdef(CONFIG_AT_SHELL at_shell)
Expand Down
1 change: 1 addition & 0 deletions lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rsource "hw_unique_key/Kconfig"
rsource "modem_jwt/Kconfig"
rsource "modem_slm/Kconfig"
rsource "modem_attest_token/Kconfig"
rsource "cpuconf/Kconfig"
rsource "location/Kconfig"
rsource "at_shell/Kconfig"
rsource "modem_antenna/Kconfig"
Expand Down
8 changes: 8 additions & 0 deletions lib/cpuconf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

zephyr_library()
zephyr_library_sources(cpuconf.c)
10 changes: 10 additions & 0 deletions lib/cpuconf/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config IRONSIDE_SE_CPUCONF
bool "CPUCONF"
depends on SOC_NRF54H20_CPUAPP
select NRF_IRONSIDE_CALL
45 changes: 45 additions & 0 deletions lib/cpuconf/cpuconf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <stdint.h>
#include <stdbool.h>

#include <zephyr/sys/util.h>

#include <nrfx.h>
#include <ironside/se/cpuconf.h> // Will be moved to Zephyr

Check failure on line 13 in lib/cpuconf/cpuconf.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

lib/cpuconf/cpuconf.c:13 do not use C99 // comments

#include <zephyr/drivers/firmware/nrf_ironside/call.h>

int ironside_se_cpuconf_boot_core(NRF_PROCESSORID_Type cpu, void *vector_table, bool cpu_wait, uint8_t *msg, size_t msg_size)

Check warning on line 17 in lib/cpuconf/cpuconf.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

lib/cpuconf/cpuconf.c:17 line length of 125 exceeds 100 columns
{
ARG_UNUSED(msg);
ARG_UNUSED(msg_size);

/* NCSDK-32393: msg is unused until the boot report is available */

struct ironside_call_buf *const buf = ironside_call_alloc();

buf->id = IRONSIDE_CALL_ID_CPUCONF_V0;

buf->args[IRONSIDE_SE_CPUCONF_INDEX_CPU] = cpu;
buf->args[IRONSIDE_SE_CPUCONF_INDEX_VECTOR_TABLE] = (uint32_t)vector_table;
buf->args[IRONSIDE_SE_CPUCONF_INDEX_CPU_WAIT] = cpu_wait;
buf->args[IRONSIDE_SE_CPUCONF_INDEX_MSG] = (uint32_t)msg;
buf->args[IRONSIDE_SE_CPUCONF_INDEX_MSG_SIZE] = msg_size;

ironside_call_dispatch(buf);

int err = -1; // TODO COMM_FAILURE

Check failure on line 36 in lib/cpuconf/cpuconf.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

lib/cpuconf/cpuconf.c:36 do not use C99 // comments

if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) {
err = buf->args[IRONSIDE_SE_CPUCONF_INDEX_ERR];
}

ironside_call_release(buf);

return err;
}
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: ca2af2f1469802d7e48b18a6e8bce6436d57223c
revision: pull/2815/head
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down
Loading