Skip to content

Commit

Permalink
dts: nordic: Add support for clock outputs
Browse files Browse the repository at this point in the history
Add support for GRTC clock output pins.

Signed-off-by: Adam Kondraciuk <[email protected]>
  • Loading branch information
adamkondraciuk committed Jan 20, 2025
1 parent 37d51f9 commit 9b75bf0
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 6 deletions.
2 changes: 2 additions & 0 deletions boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
/* Channels 7-11 reserved for Zero Latency IRQs, 3-4 for FLPR */
child-owned-channels = <3 4 7 8 9 10 11>;
status = "okay";
/delete-property/ clocks;
/delete-property/ clock-names;
};

&cpuapp_rram {
Expand Down
15 changes: 15 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,19 @@
low-power-enable;
};
};

/omit-if-no-ref/ grtc_default: grtc_default {
group1 {
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 1)>;
};
};

/omit-if-no-ref/ grtc_sleep: grtc_sleep {
group1 {
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 1)>;
low-power-enable;
};
};
};
15 changes: 15 additions & 0 deletions boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l_05_10_15-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,19 @@
low-power-enable;
};
};

/omit-if-no-ref/ grtc_default: grtc_default {
group1 {
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 4)>;
};
};

/omit-if-no-ref/ grtc_sleep: grtc_sleep {
group1 {
psels = <NRF_PSEL(GRTC_CLKOUT_FAST, 1, 8)>,
<NRF_PSEL(GRTC_CLKOUT_32K, 0, 4)>;
low-power-enable;
};
};
};
24 changes: 23 additions & 1 deletion dts/bindings/timer/nordic,nrf-grtc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,40 @@
# SPDX-License-Identifier: Apache-2.0
#

description: Nordic GRTC (Global RTC)
description: |
Nordic GRTC (Global RTC)
Example of using clock outputs:
&grtc {
pinctrl-0 = <&grtc_default>;
pinctrl-1 = <&grtc_sleep>;
pinctrl-names = "default", "sleep";
clkout-fast-frequency = <8000000>;
clkout-32k;
/* In case of nRF54H20 devices: */
nordic,clockpin-enable = <NRF_FUN_GRTC_CLKOUT_FAST>;
};
compatible: "nordic,nrf-grtc"

include:
- "base.yaml"
- "nordic,split-channels.yaml"
- "pinctrl-device.yaml"
- "nordic-clockpin.yaml"

properties:
reg:
required: true

clkout-fast-frequency:
type: int
description: Fast output clock frequency.

clkout-32k:
type: boolean
description: 32768 Hz output clock frequency enable.

interrupts:
required: true

Expand Down
7 changes: 2 additions & 5 deletions dts/common/nordic/nrf54h20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -943,11 +943,8 @@
reg = <0x99c000 0x1000>;
status = "disabled";
cc-num = <16>;
/* GRTC uses both LFCLK and FLL16M, but its accuracy and
* precision are inherited from LFCLK. that's why this
* one is linked here.
*/
clocks = <&lfclk>;
clocks = <&lfclk>, <&fll16m>;
clock-names = "lfclock", "hfclock";
power-domains = <&gpd NRF_GPD_SLOW_ACTIVE>;
};

Expand Down
8 changes: 8 additions & 0 deletions dts/common/nordic/nrf54l20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
};

clocks {
pclk: pclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <DT_FREQ_M(16)>;
};

lfxo: lfxo {
compatible = "nordic,nrf-lfxo";
#clock-cells = <0>;
Expand Down Expand Up @@ -504,6 +510,8 @@
compatible = "nordic,nrf-grtc";
reg = <0xe2000 0x1000>;
cc-num = <12>;
clocks = <&lfxo>, <&pclk>;
clock-names = "lfclock", "hfclock";
status = "disabled";
};

Expand Down
8 changes: 8 additions & 0 deletions dts/common/nordic/nrf54l_05_10_15.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
};

clocks {
pclk: pclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <DT_FREQ_M(16)>;
};

lfxo: lfxo {
compatible = "nordic,nrf-lfxo";
#clock-cells = <0>;
Expand Down Expand Up @@ -553,6 +559,8 @@
compatible = "nordic,nrf-grtc";
reg = <0xe2000 0x1000>;
cc-num = <12>;
clocks = <&lfxo>, <&pclk>;
clock-names = "lfclock", "hfclock";
status = "disabled";
};

Expand Down

0 comments on commit 9b75bf0

Please sign in to comment.