Skip to content

Commit

Permalink
ARM: dts: vf610: assign oscillator to clock module
Browse files Browse the repository at this point in the history
The clock controller module (CCM) has several clock inputs, which
are connected to external crystal oscillators. To reflect this,
assign these fixed clocks to the CCM node directly.

This especially resolves initialization order dependencies we had
with the earlier initialization code: When resolving of the fixed
clocks failed in clk-vf610, the code created fixed clocks with a
rate of 0.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
  • Loading branch information
Stefan Agner authored and Shawn Guo committed Nov 23, 2014
1 parent 7e41a98 commit 3f3ebfb
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 31 deletions.
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/clock/vf610-clock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ Required properties:
- reg: Address and length of the register set
- #clock-cells: Should be <1>

Optional properties:
- clocks: list of clock identifiers which are external input clocks to the
given clock controller. Please refer the next section to find
the input clocks for a given controller.
- clock-names: list of names of clocks which are exteral input clocks to the
given clock controller.

Input clocks for top clock controller:
- sxosc (external crystal oscillator 32KHz, recommended)
- fxosc (external crystal oscillator 24MHz, recommended)
- audio_ext
- enet_ext

The clock consumer should specify the desired clock by having the clock
ID in its "clocks" phandle cell. See include/dt-bindings/clock/vf610-clock.h
for the full list of VF610 clock IDs.
Expand All @@ -15,6 +28,8 @@ clks: ccm@4006b000 {
compatible = "fsl,vf610-ccm";
reg = <0x4006b000 0x1000>;
#clock-cells = <1>;
clocks = <&sxosc>, <&fxosc>;
clock-names = "sxosc", "fxosc";
};

uart1: serial@40028000 {
Expand Down
14 changes: 8 additions & 6 deletions arch/arm/boot/dts/vf610-cosmic.dts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@
reg = <0x80000000 0x10000000>;
};

clocks {
enet_ext {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <50000000>;
};
enet_ext: enet_ext {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <50000000>;
};
};

&clks {
clocks = <&sxosc>, <&fxosc>, <&enet_ext>;
clock-names = "sxosc", "fxosc", "enet_ext";
};

&fec1 {
Expand Down
25 changes: 14 additions & 11 deletions arch/arm/boot/dts/vf610-twr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@
reg = <0x80000000 0x8000000>;
};

clocks {
audio_ext {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24576000>;
};
audio_ext: mclk_osc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24576000>;
};

enet_ext {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <50000000>;
};
enet_ext: eth_osc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <50000000>;
};

regulators {
Expand Down Expand Up @@ -95,6 +93,11 @@
status = "okay";
};

&clks {
clocks = <&sxosc>, <&fxosc>, <&enet_ext>, <&audio_ext>;
clock-names = "sxosc", "fxosc", "enet_ext", "audio_ext";
};

&dspi0 {
bus-num = <0>;
pinctrl-names = "default";
Expand Down
25 changes: 11 additions & 14 deletions arch/arm/boot/dts/vf610.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,16 @@
};
};

clocks {
#address-cells = <1>;
#size-cells = <0>;

sxosc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <32768>;
};
fxosc: fxosc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
};

fxosc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <24000000>;
};
sxosc: sxosc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <32768>;
};

soc {
Expand Down Expand Up @@ -358,6 +353,8 @@
clks: ccm@4006b000 {
compatible = "fsl,vf610-ccm";
reg = <0x4006b000 0x1000>;
clocks = <&sxosc>, <&fxosc>;
clock-names = "sxosc", "fxosc";
#clock-cells = <1>;
};

Expand Down

0 comments on commit 3f3ebfb

Please sign in to comment.