From c10e50e81c586c6fd662548ef31bd24d425a488c Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Thu, 19 Sep 2024 12:28:17 +0200 Subject: [PATCH 1/2] [nrf fromtree] dts: bindings: arm: nordic: Add TDDCONF sources For nrf54h20 a range of combinations exist to configure the test and debug domains data sources and sinks. Expose them in DTS to allow configuring them. Also drop the previous style which was too rigid to extend to cover all cases cleanly. The old style was only used in a single sample application so far. Signed-off-by: Karsten Koenig (cherry picked from commit 43f9488045435cf43e2c48a9856b380b1cfe270b) --- dts/bindings/arm/nordic,nrf-tddconf.yaml | 26 ++++++++++++++----- dts/common/nordic/nrf54h20.dtsi | 1 + .../zephyr/dt-bindings/misc/nordic-tddconf.h | 14 ++++++++++ .../boards/nrf54h20_cpuapp.overlay | 3 ++- .../boards/nrf54h20_cpurad.overlay | 9 +++++++ snippets/nordic-log-stm-dict/snippet.yml | 3 +++ .../boards/nrf54h20_cpuapp.overlay | 3 ++- .../boards/nrf54h20_cpurad.overlay | 9 +++++++ snippets/nordic-log-stm/snippet.yml | 3 +++ 9 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 include/zephyr/dt-bindings/misc/nordic-tddconf.h create mode 100644 snippets/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay create mode 100644 snippets/nordic-log-stm/boards/nrf54h20_cpurad.overlay diff --git a/dts/bindings/arm/nordic,nrf-tddconf.yaml b/dts/bindings/arm/nordic,nrf-tddconf.yaml index 8ef56b44c58..46f9a0e7b2d 100644 --- a/dts/bindings/arm/nordic,nrf-tddconf.yaml +++ b/dts/bindings/arm/nordic,nrf-tddconf.yaml @@ -11,15 +11,27 @@ compatible: "nordic,nrf-tddconf" include: base.yaml properties: - stmsink: - type: string - description: indicates the sink for STM data - enum: - - "etr" - - "tpiu" - # - "etb" - Not supported yet + etbsources: + type: int + description: | + Bitmask of enabled sources for the ETB sink. Valid values can be found in + dt-bindings/misc/nordic-tddconf.h + + tpiusources: + type: int + description: | + Bitmask of enabled sources for the TPIU sink. Valid values can be found in + dt-bindings/misc/nordic-tddconf.h + + etrsources: + type: int + description: | + Bitmask of enabled sources for the ETR sink. Valid values can be found in + dt-bindings/misc/nordic-tddconf.h + portconfig: type: int + default: 3 description: TPIU clock divider - TDD HSFLL / 2^(2 + portconfig) enum: - 0 diff --git a/dts/common/nordic/nrf54h20.dtsi b/dts/common/nordic/nrf54h20.dtsi index c87db0167fa..370b560bc0b 100644 --- a/dts/common/nordic/nrf54h20.dtsi +++ b/dts/common/nordic/nrf54h20.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include /delete-node/ &sw_pwm; diff --git a/include/zephyr/dt-bindings/misc/nordic-tddconf.h b/include/zephyr/dt-bindings/misc/nordic-tddconf.h new file mode 100644 index 00000000000..b1b45b99252 --- /dev/null +++ b/include/zephyr/dt-bindings/misc/nordic-tddconf.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_TDDCONF_H_ + +#define NRF_TDDCONF_SOURCE_STMMAINCORE BIT(0) +#define NRF_TDDCONF_SOURCE_ETMMAINCORE BIT(1) +#define NRF_TDDCONF_SOURCE_STMHWEVENTS BIT(2) +#define NRF_TDDCONF_SOURCE_STMPPR BIT(3) +#define NRF_TDDCONF_SOURCE_STMFLPR BIT(4) + +#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_MISC_NORDIC_TDDCONF_H_ */ diff --git a/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay b/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay index bedc93411c9..d620b83872f 100644 --- a/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay +++ b/snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay @@ -9,6 +9,7 @@ &tddconf { status = "okay"; - stmsink = "etr"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR | + NRF_TDDCONF_SOURCE_STMFLPR)>; portconfig = <0>; }; diff --git a/snippets/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay b/snippets/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay new file mode 100644 index 00000000000..5bdeddd3c07 --- /dev/null +++ b/snippets/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +&tddconf { + status = "okay"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>; +}; diff --git a/snippets/nordic-log-stm-dict/snippet.yml b/snippets/nordic-log-stm-dict/snippet.yml index 5bacbaf5af0..a482498d1e9 100644 --- a/snippets/nordic-log-stm-dict/snippet.yml +++ b/snippets/nordic-log-stm-dict/snippet.yml @@ -6,3 +6,6 @@ boards: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay EXTRA_CONF_FILE: boards/nrf54h20_cpuapp.conf + /.*/nrf54h20/cpurad/: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpurad.overlay diff --git a/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay b/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay index bedc93411c9..d620b83872f 100644 --- a/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay +++ b/snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay @@ -9,6 +9,7 @@ &tddconf { status = "okay"; - stmsink = "etr"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR | + NRF_TDDCONF_SOURCE_STMFLPR)>; portconfig = <0>; }; diff --git a/snippets/nordic-log-stm/boards/nrf54h20_cpurad.overlay b/snippets/nordic-log-stm/boards/nrf54h20_cpurad.overlay new file mode 100644 index 00000000000..5bdeddd3c07 --- /dev/null +++ b/snippets/nordic-log-stm/boards/nrf54h20_cpurad.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor + * SPDX-License-Identifier: Apache-2.0 + */ + +&tddconf { + status = "okay"; + etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>; +}; diff --git a/snippets/nordic-log-stm/snippet.yml b/snippets/nordic-log-stm/snippet.yml index 1cd65087bcc..e2ff7b6f8a1 100644 --- a/snippets/nordic-log-stm/snippet.yml +++ b/snippets/nordic-log-stm/snippet.yml @@ -6,3 +6,6 @@ boards: append: EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpuapp.overlay EXTRA_CONF_FILE: boards/nrf54h20_cpuapp.conf + /.*/nrf54h20/cpurad/: + append: + EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20_cpurad.overlay From 504140f0a6719bac8e4516763166d99f12756e41 Mon Sep 17 00:00:00 2001 From: Karsten Koenig Date: Tue, 24 Sep 2024 15:27:03 +0200 Subject: [PATCH 2/2] [nrf noup] modules: hal_nordic: Drop EXACT nrf-regtool check We don't want an exact version match, a minimum one is enough. This aligns it also with the upstream copy of this file. Signed-off-by: Karsten Koenig --- modules/hal_nordic/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hal_nordic/CMakeLists.txt b/modules/hal_nordic/CMakeLists.txt index 2ba8eea33a0..eb85fd58f5e 100644 --- a/modules/hal_nordic/CMakeLists.txt +++ b/modules/hal_nordic/CMakeLists.txt @@ -15,7 +15,7 @@ if(CONFIG_NRF_REGTOOL_GENERATE_BICR) list(APPEND nrf_regtool_components GENERATE:BICR) endif() if(DEFINED nrf_regtool_components) - find_package(nrf-regtool 5.6.0 EXACT REQUIRED + find_package(nrf-regtool 5.6.0 REQUIRED COMPONENTS ${nrf_regtool_components} PATHS ${CMAKE_CURRENT_LIST_DIR}/nrf-regtool NO_CMAKE_PATH