diff mbox

[v1,1/1] dts: bindings: add mpc5121 clocks binding document

Message ID 1385994034-2513-1-git-send-email-gsi@denx.de
State Superseded, archived
Headers show

Commit Message

Gerhard Sittig Dec. 2, 2013, 2:20 p.m. UTC
add a clock bindings documentation file for Freescale MPC5121

this binding implements and uses existing common clock bindings,
it does not introduce a new binding semantics but discusses the
specific use on Freescale MPC5121 and provides examples

Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: devicetree@vger.kernel.org
Signed-off-by: Gerhard Sittig <gsi@denx.de>
---

an accompanying doc update was suggested while the feature's
implementation currently is under review, i.e. this document does not
apply to the current status but "describes the future"

sending out this doc patch now is meant to neither have to re-spin the
whole series nor to further delay the doc update submission, but to
allow for immediate review of the doc update

 .../devicetree/bindings/clock/mpc5121-clock.txt    |   95 ++++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/mpc5121-clock.txt

Comments

Gerhard Sittig Dec. 2, 2013, 4:55 p.m. UTC | #1
On Mon, Dec 02, 2013 at 15:20 +0100, Gerhard Sittig wrote:
> 
> add a clock bindings documentation file for Freescale MPC5121
> 
> this binding implements and uses existing common clock bindings,
> it does not introduce a new binding semantics but discusses the
> specific use on Freescale MPC5121 and provides examples
> 
> [ ... ]
> 
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/mpc5121-clock.txt
> @@ -0,0 +1,95 @@
> +Device Tree Clock bindings for Freescale MPC5121
> +
> [ ... ]
> +
> +Required properties:
> +- compatible:	shall contain "fsl,mpc5121-clock"
> +- reg:		shall specify the start address and length of the
> +		clock module's set of control registers
> +- #clock-cells:	shall be 1; defines the number of integer cells
> +		required for a clock specifier which references
> +		this clock provider

In hindsight the wording is not good (especially 'reg'), will see
how I can improve this.  And the layout may improve some more.

> +
> +Optional properties:
> +- clocks:	list of phandle and clock specifier pairs for the
> +		node's input clocks, following the common clock
> +		consumers binding; should be empty, or one XTAL/OSC
> +		clock reference
> +- clock-names:	list of clock input name strings sorted in the same
> +		order as the 'clocks' property

Mark, I very much like your suggestion to state that 'clocks'
should match 'clock-names' (and not vice versa, found in another
thread, after having sent this patch).

And noticed that 'clock-names' still does not say that the
XTAL/OSC should go by the name "osc".  And should not say that at
most one clock is accepted or how their order is.


So I will wait for more feedback, but can tell already that v1
needs an update before becoming acceptable.  Thank you for your
patience. :)


virtually yours
Gerhard Sittig
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/clock/mpc5121-clock.txt b/Documentation/devicetree/bindings/clock/mpc5121-clock.txt
new file mode 100644
index 000000000000..8fbb489f6581
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/mpc5121-clock.txt
@@ -0,0 +1,95 @@ 
+Device Tree Clock bindings for Freescale MPC5121
+
+This binding uses the common clock binding[1] as well as the
+fixed-clock binding[2].
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+[2] Documentation/devicetree/bindings/clock/fixed-clock.txt
+
+== Clock provider ==
+
+The MPC5121 clock control module (CCM) implements a clock provider
+with several output clocks, which in turn are input clocks to
+peripherals.
+
+The MPC5121 CCM is another clock consumer with respect to the SoC's
+crystal or oscillator input (referred to both as XTAL or OSC in the
+chip's documentation).
+
+Required properties:
+- compatible:	shall contain "fsl,mpc5121-clock"
+- reg:		shall specify the start address and length of the
+		clock module's set of control registers
+- #clock-cells:	shall be 1; defines the number of integer cells
+		required for a clock specifier which references
+		this clock provider
+
+Optional properties:
+- clocks:	list of phandle and clock specifier pairs for the
+		node's input clocks, following the common clock
+		consumers binding; should be empty, or one XTAL/OSC
+		clock reference
+- clock-names:	list of clock input name strings sorted in the same
+		order as the 'clocks' property
+
+== Clock consumers ==
+
+Peripherals specify their input clocks by referencing clock providers
+according to the common clock consumer binding.  A clock gets identified
+by a phandle and clock specifiers pair.  The number of integer cells in
+the clock specifier is a property of the clock provider.
+
+The <dt-bindings/clock/mpc512x-clock.h> file provides symbolic names
+such that consumers need not encode magic numbers into their specs.
+
+== Examples ==
+
+The following example describes a fixed rate XTAL clock.
+
+osc: osc {
+	compatible = "fixed-clock";
+	#clock-cells = <0>;
+	clock-frequency = <33000000>;
+};
+
+The following example describes the clock control module (CCM),
+referencing the above XTAL as an input, providing output clocks.
+
+clks: clock@f00 {
+	compatible = "fsl,mpc5121-clock";
+	reg = <0xf00 0x100>;
+	#clock-cells = <1>;
+	clocks = <&osc>;
+	clock-names = "osc";
+};
+
+The following examples describe peripheral nodes which reference
+CCM output clocks as their input clocks.
+
+#include <dt-bindings/clock/mpc512x-clock.h>
+
+can@1300 {
+	compatible = "fsl,mpc5121-mscan";
+	...
+	clocks = <&clks MPC512x_CLK_BDLC>,
+		 <&clks MPC512x_CLK_IPS>,
+		 <&clks MPC512x_CLK_SYS>,
+		 <&clks MPC512x_CLK_REF>,
+		 <&clks MPC512x_CLK_MSCAN0_MCLK>;
+	clock-names = "ipg", "ips", "sys", "ref", "mclk";
+};
+
+i2c@1700 {
+	compatible = "fsl,mpc5121-i2c", "fsl-i2c";
+	...
+	clocks = <&clks MPC512x_CLK_I2C>;
+	clock-names = "ipg";
+};
+
+psc@11000 {
+	compatible = "fsl,mpc5121-psc";
+	...
+	clocks = <&clks MPC512x_CLK_PSC0>,
+		 <&clks MPC512x_CLK_PSC0_MCLK>;
+	clock-names = "ipg", "mclk";
+};