Skip to content

Commit 28f0adb

Browse files
committed
drivers: firmware: nrf_ironside: Add TDD
Added support for the IRONside TDD service which allows configuring and powering the TraceAndDebug Domain. Signed-off-by: Karsten Koenig <[email protected]>
1 parent c3d57ee commit 28f0adb

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

drivers/firmware/nrf_ironside/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CALL call.c)
77

88
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_BOOT_REPORT boot_report.c)
99
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_CPUCONF_SERVICE cpuconf.c)
10+
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_TDD_SERVICE tdd.c)
1011
zephyr_library_sources_ifdef(CONFIG_NRF_IRONSIDE_UPDATE_SERVICE update.c)

drivers/firmware/nrf_ironside/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ config NRF_IRONSIDE_CPUCONF_SERVICE
3737
help
3838
Service used to boot local domain cores.
3939

40+
config NRF_IRONSIDE_TDD_SERVICE
41+
bool "IRONside tdd service"
42+
select NRF_IRONSIDE_CALL
43+
help
44+
Service used to control the trace and debug domain.
45+
4046
config NRF_IRONSIDE_UPDATE_SERVICE
4147
bool "IRONside update service"
4248
select NRF_IRONSIDE_CALL
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/drivers/firmware/nrf_ironside/tdd.h>
7+
#include <zephyr/drivers/firmware/nrf_ironside/call.h>
8+
9+
int ironside_tdd(const enum ironside_tdd_config config)
10+
{
11+
int err;
12+
struct ironside_call_buf *const buf = ironside_call_alloc();
13+
14+
buf->id = IRONSIDE_CALL_ID_TDD_V0;
15+
buf->args[IRONSIDE_TDD_SERVICE_REQ_CONFIG_IDX] = (uint32_t) config;
16+
17+
ironside_call_dispatch(buf);
18+
19+
if (buf->status == IRONSIDE_CALL_STATUS_RSP_SUCCESS) {
20+
err = buf->args[IRONSIDE_TDD_SERVICE_RSP_RETCODE_IDX];
21+
} else {
22+
err = buf->status;
23+
}
24+
25+
ironside_call_release(buf);
26+
27+
return err;
28+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_TDD_H_
7+
#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_TDD_H_
8+
9+
#include <zephyr/drivers/firmware/nrf_ironside/call.h>
10+
11+
#include <nrfx.h>
12+
13+
#define IRONSIDE_TDD_ERROR_EINVAL (22) /* Invalid argument */
14+
15+
16+
#define IRONSIDE_CALL_ID_TDD_V0 3
17+
18+
#define IRONSIDE_TDD_SERVICE_REQ_CONFIG_IDX 0
19+
#define IRONSIDE_TDD_SERVICE_RSP_RETCODE_IDX 0
20+
21+
enum ironside_tdd_config {
22+
/** Don't touch the configuration */
23+
IRONSIDE_TDD_CONFIG_NO_CHANGE = 0, /* This allows future extensions to the TDD service */
24+
/** Turn off the TDD */
25+
IRONSIDE_TDD_CONFIG_OFF = 1,
26+
/** Turn on the TDD with default configuration */
27+
IRONSIDE_TDD_CONFIG_ON_DEFAULT = 2,
28+
/** Turn on the TDD with default configuration, but skip TPIU pin configuration */
29+
IRONSIDE_TDD_CONFIG_ON_DEFAULT_NO_PINS = 3,
30+
};
31+
32+
/**
33+
* @brief Control the Trace and Debug Domain (TDD).
34+
*
35+
* @param config The configuration to be applied.
36+
*
37+
* @retval 0 on success.
38+
* @retval -IRONSIDE_TDD_ERROR_EINVAL on invalid argument.
39+
*/
40+
int ironside_tdd(const enum ironside_tdd_config config);
41+
42+
#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_TDD_H_ */

0 commit comments

Comments
 (0)