Skip to content

Commit 865b245

Browse files
adamkondraciukkartben
authored andcommitted
dts: nordic: Add support for clock outputs
Add support for GRTC clock output pins. Signed-off-by: Adam Kondraciuk <[email protected]>
1 parent 86dca04 commit 865b245

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
@@ -68,6 +68,8 @@
6868
/* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */
6969
child-owned-channels = <3 4 7 8 9 10 11>;
7070
status = "okay";
71+
/delete-property/ clocks;
72+
/delete-property/ clock-names;
7173
};
7274

7375
&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-hz = <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-hz:
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
@@ -944,11 +944,8 @@
944944
reg = <0x99c000 0x1000>;
945945
status = "disabled";
946946
cc-num = <16>;
947-
/* GRTC uses both LFCLK and FLL16M, but its accuracy and
948-
* precision are inherited from LFCLK. that's why this
949-
* one is linked here.
950-
*/
951-
clocks = <&lfclk>;
947+
clocks = <&lfclk>, <&fll16m>;
948+
clock-names = "lfclock", "hfclock";
952949
power-domains = <&gpd NRF_GPD_SLOW_ACTIVE>;
953950
};
954951

dts/common/nordic/nrf54l20.dtsi

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

3838
clocks {
39+
pclk: pclk {
40+
compatible = "fixed-clock";
41+
#clock-cells = <0>;
42+
clock-frequency = <DT_FREQ_M(16)>;
43+
};
44+
3945
lfxo: lfxo {
4046
compatible = "nordic,nrf-lfxo";
4147
#clock-cells = <0>;
@@ -506,6 +512,8 @@
506512
compatible = "nordic,nrf-grtc";
507513
reg = <0xe2000 0x1000>;
508514
cc-num = <12>;
515+
clocks = <&lfxo>, <&pclk>;
516+
clock-names = "lfclock", "hfclock";
509517
status = "disabled";
510518
};
511519

dts/common/nordic/nrf54l_05_10_15.dtsi

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

5151
clocks {
52+
pclk: pclk {
53+
compatible = "fixed-clock";
54+
#clock-cells = <0>;
55+
clock-frequency = <DT_FREQ_M(16)>;
56+
};
57+
5258
lfxo: lfxo {
5359
compatible = "nordic,nrf-lfxo";
5460
#clock-cells = <0>;
@@ -555,6 +561,8 @@
555561
compatible = "nordic,nrf-grtc";
556562
reg = <0xe2000 0x1000>;
557563
cc-num = <12>;
564+
clocks = <&lfxo>, <&pclk>;
565+
clock-names = "lfclock", "hfclock";
558566
status = "disabled";
559567
};
560568

0 commit comments

Comments
 (0)