Skip to content

Commit a3a7564

Browse files
committed
dts: clock: SAM D5x/E5x: add more functionality
Add more functionality in clock control driver. Add bindings for dfll, fdpll, gclk generator, mclk cpu, osc32k, rtc clock and xosc. Signed-off-by: Sunil Abraham <[email protected]>
1 parent 9d10d67 commit a3a7564

13 files changed

+906
-35
lines changed

dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,43 @@
4242
<0x40001400 0x20>, <0x40001c00 0x140>;
4343
reg-names = "mclk", "oscctrl",
4444
"osc32kctrl", "gclk";
45+
interrupts = <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>;
46+
47+
xosc: xosc {
48+
compatible = "microchip,sam-d5x-e5x-xosc";
49+
};
50+
51+
dfll: dfll {
52+
compatible = "microchip,sam-d5x-e5x-dfll";
53+
};
54+
55+
fdpll: fdpll {
56+
compatible = "microchip,sam-d5x-e5x-fdpll";
57+
};
58+
59+
rtcclock: rtcclock {
60+
compatible = "microchip,sam-d5x-e5x-rtc";
61+
#clock-cells = <1>;
62+
};
63+
64+
xosc32k: xosc32k {
65+
compatible = "microchip,sam-d5x-e5x-xosc32k";
66+
};
67+
68+
gclkgen: gclkgen {
69+
compatible = "microchip,sam-d5x-e5x-gclkgen";
70+
};
4571

4672
gclkperiph: gclkperiph {
4773
compatible = "microchip,sam-d5x-e5x-gclkperiph";
4874
#clock-cells = <1>;
4975
};
5076

77+
mclkcpu: mclkcpu {
78+
compatible = "microchip,sam-d5x-e5x-mclkcpu";
79+
mclk-cpu-div = <1>;
80+
};
81+
5182
mclkperiph: mclkperiph {
5283
compatible = "microchip,sam-d5x-e5x-mclkperiph";
5384
#clock-cells = <1>;

dts/bindings/clock/microchip,sam-d5x-e5x-gclkperiph.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

dts/bindings/clock/microchip,sam-d5x-e5x-clock.yaml renamed to dts/bindings/clock/microchip/sam_d5x_e5x/microchip,sam-d5x-e5x-clock.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ properties:
2121
2222
Driver waits in clock on API to check if the clock is actually on,
2323
so that the waiting time is not indefinite.
24+
25+
# flash wait states need not be changed for this device, since automatic wait state generation
26+
# is enabled by default.
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
title: SAM_D5x_E5x Internal Oscillator (OSC48M)
5+
6+
description: |
7+
Digital Frequency-Locked Loop (DFLL48M) configuration.
8+
9+
include: [base.yaml]
10+
11+
compatible: "microchip,sam-d5x-e5x-dfll"
12+
13+
properties:
14+
dfll-on-demand-en:
15+
type: int
16+
enum:
17+
- 0
18+
- 1
19+
default: 0
20+
description: |
21+
0: The oscillator is always on
22+
1: The oscillator is running when a peripheral is requesting the oscillator to be used as a
23+
clock source. The oscillator is not running if no peripheral is requesting the clock source.
24+
Important: Initializing it with 1, along with clock enabled, can lead to indefinite wait for
25+
the clock to be on, if there is no peripheral request for the clock in the sequence of clock
26+
Initialization. If required, better to turn on the clock using API, instead of enabling both
27+
during startup.
28+
29+
dfll-run-in-standby-en:
30+
type: int
31+
enum:
32+
- 0
33+
- 1
34+
default: 0
35+
description: |
36+
0: The DFLL is not running in standby sleep mode if no peripheral requests the clock.
37+
1: The DFLL is running in standby sleep mode.
38+
If ONDEMAND is one, the DFLL will be running when a peripheral is requesting the clock. If
39+
ONDEMAND is false, the clock source will always be running in standby sleep mode.
40+
41+
dfll-en:
42+
type: int
43+
enum:
44+
- 0
45+
- 1
46+
default: 1
47+
description: |
48+
Oscillator Enable
49+
0: to disable, 1: to enable
50+
51+
dfll-wait-lock-en:
52+
type: int
53+
enum:
54+
- 0
55+
- 1
56+
default: 0
57+
description: |
58+
If enabled, clock available only after DFLL is locked (Fine lock)
59+
0: to disable, 1: to enable
60+
61+
dfll-bypass-coarse-lock-en:
62+
type: int
63+
enum:
64+
- 0
65+
- 1
66+
default: 0
67+
description: |
68+
To bypass coarse lock procedure
69+
0: to disable, 1: to enable
70+
71+
dfll-quick-lock-dis:
72+
type: int
73+
enum:
74+
- 0
75+
- 1
76+
default: 0
77+
description: |
78+
Disable quick lock
79+
1: to disable, 0: to enable
80+
81+
dfll-chill-cycle-dis:
82+
type: int
83+
enum:
84+
- 0
85+
- 1
86+
default: 0
87+
description: |
88+
Disable chill cycle
89+
1: to disable, 0: to enable
90+
91+
dfll-usb-recovery-en:
92+
type: int
93+
enum:
94+
- 0
95+
- 1
96+
default: 0
97+
description: |
98+
Enable USB Clock Recovery Mode
99+
0: to disable, 1: to enable
100+
101+
dfll-lose-lock-en:
102+
type: int
103+
enum:
104+
- 0
105+
- 1
106+
default: 0
107+
description: |
108+
If enabled, locks will be lost after waking up from sleep modes,
109+
if the DFLL clock has been stopped
110+
0: Locks will not be lost after waking up from sleep modes
111+
1: Locks will be lost after waking up from sleep modes
112+
113+
dfll-stable-freq-en:
114+
type: int
115+
enum:
116+
- 0
117+
- 1
118+
default: 0
119+
description: |
120+
0: FINE calibration tracks changes in output frequency.
121+
1: FINE calibration register value will be fixed after a fine lock.
122+
123+
dfll-closed-loop-en:
124+
type: int
125+
enum:
126+
- 0
127+
- 1
128+
default: 0
129+
description: |
130+
0: The DFLL operates in open-loop operation.
131+
1: The DFLL operates in closed-loop operation.
132+
133+
dfll-coarse-max-step:
134+
type: int
135+
default: 0
136+
description: |
137+
Indicates the maximum step size allowed during coarse adjustment in closed-loop mode (0 - 31)
138+
139+
dfll-fine-max-step:
140+
type: int
141+
default: 0
142+
description: |
143+
Indicates the maximum step size allowed during fine adjustment in closed-loop mode (0 - 255)
144+
145+
dfll-multiply-factor:
146+
type: int
147+
default: 0
148+
description: |
149+
Determines the ratio of the CLK_DFLL output frequency to the CLK_DFLL_REF input frequency (0
150+
- 65535)
151+
152+
dfll-src-gclk:
153+
type: string
154+
enum:
155+
- "gclk0"
156+
- "gclk1"
157+
- "gclk2"
158+
- "gclk3"
159+
- "gclk4"
160+
- "gclk5"
161+
- "gclk6"
162+
- "gclk7"
163+
- "gclk8"
164+
- "gclk9"
165+
- "gclk10"
166+
- "gclk11"
167+
default: "gclk0"
168+
description: |
169+
Reference source clock selection from gclk generator

0 commit comments

Comments
 (0)