Skip to content

Commit bd9b718

Browse files
[nrf fromlist] dts: nordic: Add support for clock outputs
Add support for GRTC clock output pins. Upstream PR #: 82788 Signed-off-by: Adam Kondraciuk <[email protected]>
1 parent 430d26e commit bd9b718

File tree

7 files changed

+73
-6
lines changed

7 files changed

+73
-6
lines changed

boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
/* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */
7878
child-owned-channels = <3 4 7 8 9 10 11>;
7979
status = "okay";
80+
/delete-property/ clocks;
81+
/delete-property/ clock-names;
8082
};
8183

8284
&cpuapp_rram {

boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,19 @@
9898
low-power-enable;
9999
};
100100
};
101+
102+
/omit-if-no-ref/ grtc_default: grtc_default {
103+
group1 {
104+
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
105+
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 1)>;
106+
};
107+
};
108+
109+
/omit-if-no-ref/ grtc_sleep: grtc_sleep {
110+
group1 {
111+
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
112+
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 1)>;
113+
low-power-enable;
114+
};
115+
};
101116
};

boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,19 @@
7777
low-power-enable;
7878
};
7979
};
80+
81+
/omit-if-no-ref/ grtc_default: grtc_default {
82+
group1 {
83+
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
84+
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 4)>;
85+
};
86+
};
87+
88+
/omit-if-no-ref/ grtc_sleep: grtc_sleep {
89+
group1 {
90+
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
91+
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 4)>;
92+
low-power-enable;
93+
};
94+
};
8095
};

dts/bindings/timer/nordic,nrf-grtc.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,40 @@
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

7-
description: Nordic GRTC (Global RTC)
7+
description: |
8+
Nordic GRTC (Global RTC)
9+
10+
Example of using clock outputs:
11+
&grtc {
12+
pinctrl-0 = <&grtc_default>;
13+
pinctrl-1 = <&grtc_sleep>;
14+
pinctrl-names = "default", "sleep";
15+
clkout-fast-frequency = <8000000>;
16+
clkout-32k;
17+
/* In case of nRF54H20 devices: */
18+
nordic,clockpin-enable = <NRF_FUN_GRTC_CLKOUT_FAST>;
19+
};
820
921
compatible: "nordic,nrf-grtc"
1022

1123
include:
1224
- "base.yaml"
1325
- "nordic,split-channels.yaml"
26+
- "pinctrl-device.yaml"
27+
- "nordic-clockpin.yaml"
1428

1529
properties:
1630
reg:
1731
required: true
1832

33+
clkout-fast-frequency:
34+
type: int
35+
description: Fast output clock frequency.
36+
37+
clkout-32k:
38+
type: boolean
39+
description: 32768 Hz output clock frequency enable.
40+
1941
interrupts:
2042
required: true
2143

dts/common/nordic/nrf54h20.dtsi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -939,11 +939,8 @@
939939
reg = <0x99c000 0x1000>;
940940
status = "disabled";
941941
cc-num = <16>;
942-
/* GRTC uses both LFCLK and FLL16M, but its accuracy and
943-
* precision are inherited from LFCLK. that's why this
944-
* one is linked here.
945-
*/
946-
clocks = <&lfclk>;
942+
clocks = <&lfclk>, <&fll16m>;
943+
clock-names = "lfclock", "hfclock";
947944
power-domains = <&gpd NRF_GPD_SLOW_ACTIVE>;
948945
};
949946

dts/common/nordic/nrf54l20.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
};
3636

3737
clocks {
38+
pclk: pclk {
39+
compatible = "fixed-clock";
40+
#clock-cells = <0>;
41+
clock-frequency = <DT_FREQ_M(16)>;
42+
};
43+
3844
lfxo: lfxo {
3945
compatible = "nordic,nrf-lfxo";
4046
#clock-cells = <0>;
@@ -498,6 +504,8 @@
498504
compatible = "nordic,nrf-grtc";
499505
reg = <0xe2000 0x1000>;
500506
cc-num = <12>;
507+
clocks = <&lfxo>, <&pclk>;
508+
clock-names = "lfclock", "hfclock";
501509
status = "disabled";
502510
};
503511

dts/common/nordic/nrf54l_05_10_15.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
};
4949

5050
clocks {
51+
pclk: pclk {
52+
compatible = "fixed-clock";
53+
#clock-cells = <0>;
54+
clock-frequency = <DT_FREQ_M(16)>;
55+
};
56+
5157
lfxo: lfxo {
5258
compatible = "nordic,nrf-lfxo";
5359
#clock-cells = <0>;
@@ -548,6 +554,8 @@
548554
compatible = "nordic,nrf-grtc";
549555
reg = <0xe2000 0x1000>;
550556
cc-num = <12>;
557+
clocks = <&lfxo>, <&pclk>;
558+
clock-names = "lfclock", "hfclock";
551559
status = "disabled";
552560
};
553561

0 commit comments

Comments
 (0)