Skip to content

Commit 4de6953

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 4de6953

13 files changed

+875
-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: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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+
50+
dfll-wait-lock-en:
51+
type: int
52+
enum:
53+
- 0
54+
- 1
55+
default: 0
56+
description: |
57+
If enabled, clock available only after DFLL is locked (Fine lock)
58+
59+
dfll-bypass-coarse-lock-en:
60+
type: int
61+
enum:
62+
- 0
63+
- 1
64+
default: 0
65+
description: |
66+
To bypass coarse lock procedure
67+
68+
dfll-quick-lock-dis:
69+
type: int
70+
enum:
71+
- 0
72+
- 1
73+
default: 0
74+
description: |
75+
Disable quick lock
76+
77+
dfll-chill-cycle-dis:
78+
type: int
79+
enum:
80+
- 0
81+
- 1
82+
default: 0
83+
description: |
84+
Disable chill cycle
85+
86+
dfll-usb-recovery-en:
87+
type: int
88+
enum:
89+
- 0
90+
- 1
91+
default: 0
92+
description: |
93+
Enable USB Clock Recovery Mode
94+
95+
dfll-lose-lock-en:
96+
type: int
97+
enum:
98+
- 0
99+
- 1
100+
default: 0
101+
description: |
102+
If enabled, locks will be lost after waking up from sleep modes,
103+
if the DFLL clock has been stopped
104+
105+
dfll-stable-freq-en:
106+
type: int
107+
enum:
108+
- 0
109+
- 1
110+
default: 0
111+
description: |
112+
0: FINE calibration tracks changes in output frequency.
113+
1: FINE calibration register value will be fixed after a fine lock.
114+
115+
dfll-closed-loop-en:
116+
type: int
117+
enum:
118+
- 0
119+
- 1
120+
default: 0
121+
description: |
122+
0: The DFLL operates in open-loop operation.
123+
1: The DFLL operates in closed-loop operation.
124+
125+
dfll-coarse-max-step:
126+
type: int
127+
default: 0
128+
description: |
129+
Indicates the maximum step size allowed during coarse adjustment in closed-loop mode (0 - 31)
130+
131+
dfll-fine-max-step:
132+
type: int
133+
default: 0
134+
description: |
135+
Indicates the maximum step size allowed during fine adjustment in closed-loop mode (0 - 255)
136+
137+
dfll-multiply-factor:
138+
type: int
139+
default: 0
140+
description: |
141+
Determines the ratio of the CLK_DFLL output frequency to the CLK_DFLL_REF input frequency (0
142+
- 65535)
143+
144+
dfll-src-gclk:
145+
type: string
146+
enum:
147+
- "gclk0"
148+
- "gclk1"
149+
- "gclk2"
150+
- "gclk3"
151+
- "gclk4"
152+
- "gclk5"
153+
- "gclk6"
154+
- "gclk7"
155+
- "gclk8"
156+
- "gclk9"
157+
- "gclk10"
158+
- "gclk11"
159+
default: "gclk0"
160+
description: |
161+
Reference source clock selection from gclk generator

0 commit comments

Comments
 (0)