Skip to content

Commit

Permalink
[nrf fromtree] dts: bindings: arm: nordic: Add TDDCONF sources
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit 43f9488)
  • Loading branch information
karstenkoenig authored and nordicjm committed Sep 25, 2024
1 parent f869e11 commit d4ba08b
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 9 deletions.
26 changes: 19 additions & 7 deletions dts/bindings/arm/nordic,nrf-tddconf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dts/common/nordic/nrf54h20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <zephyr/dt-bindings/misc/nordic-nrf-ficr-nrf54h20.h>
#include <zephyr/dt-bindings/misc/nordic-domain-id-nrf54h20.h>
#include <zephyr/dt-bindings/misc/nordic-owner-id-nrf54h20.h>
#include <zephyr/dt-bindings/misc/nordic-tddconf.h>

/delete-node/ &sw_pwm;

Expand Down
14 changes: 14 additions & 0 deletions include/zephyr/dt-bindings/misc/nordic-tddconf.h
Original file line number Diff line number Diff line change
@@ -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_ */
3 changes: 2 additions & 1 deletion snippets/nordic-log-stm-dict/boards/nrf54h20_cpuapp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

&tddconf {
status = "okay";
stmsink = "etr";
etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR |
NRF_TDDCONF_SOURCE_STMFLPR)>;
portconfig = <0>;
};
9 changes: 9 additions & 0 deletions snippets/nordic-log-stm-dict/boards/nrf54h20_cpurad.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/

&tddconf {
status = "okay";
etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>;
};
3 changes: 3 additions & 0 deletions snippets/nordic-log-stm-dict/snippet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion snippets/nordic-log-stm/boards/nrf54h20_cpuapp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

&tddconf {
status = "okay";
stmsink = "etr";
etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE | NRF_TDDCONF_SOURCE_STMPPR |
NRF_TDDCONF_SOURCE_STMFLPR)>;
portconfig = <0>;
};
9 changes: 9 additions & 0 deletions snippets/nordic-log-stm/boards/nrf54h20_cpurad.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/

&tddconf {
status = "okay";
etrsources = <(NRF_TDDCONF_SOURCE_STMMAINCORE)>;
};
3 changes: 3 additions & 0 deletions snippets/nordic-log-stm/snippet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d4ba08b

Please sign in to comment.