diff mbox

[2/2] spi: Add DT bindings documentation for Netlogic XLP SPI controller

Message ID 1439960957-4213-3-git-send-email-kamlakant.patel@broadcom.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kamlakant Patel Aug. 19, 2015, 5:09 a.m. UTC
From: Kamlakant Patel <kamlakant.patel@broadcom.com>

Add DT bindings documentation for SPI controller driver used by
Netlogic XLP MIPS64 SoCs.

Signed-off-by: Kamlakant Patel <kamlakant.patel@broadcom.com>
---
 Documentation/devicetree/bindings/spi/spi-xlp.txt |   40 +++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-xlp.txt

Comments

Mark Brown Aug. 19, 2015, 5:53 p.m. UTC | #1
On Wed, Aug 19, 2015 at 10:39:17AM +0530, kamlakant.patel@broadcom.com wrote:

> +- clock-frequency : [OPTIONAL] Input clock frequency to the SPI block in Hz.
> +		    Default is 133333333 Hz.

I would expect this to be specifying the input clock to the block via
the standard clock binding rather than just hard coding a number in
here.  This means the binding will continue to work for more complex
sysetems with programmable clocks and is generally more standard.  SoCs
can still specify hard coded fixed frequency clocks as fixed clocks in
the DT.
Mark Brown Aug. 26, 2015, 10:22 a.m. UTC | #2
On Wed, Aug 26, 2015 at 11:13:01AM +0530, Kamlakant Patel wrote:
> On Wed, Aug 19, 2015 at 10:53:04AM -0700, Mark Brown wrote:
> > On Wed, Aug 19, 2015 at 10:39:17AM +0530, kamlakant.patel@broadcom.com wrote:

> > > +- clock-frequency : [OPTIONAL] Input clock frequency to the SPI block in Hz.
> > > +		    Default is 133333333 Hz.

> > I would expect this to be specifying the input clock to the block via
> > the standard clock binding rather than just hard coding a number in
> > here.  This means the binding will continue to work for more complex
> > sysetems with programmable clocks and is generally more standard.  SoCs
> > can still specify hard coded fixed frequency clocks as fixed clocks in
> > the DT.

> We don't have our clock framework upstream yet, and don't have
> of_clk_init hook for Netlogic XLP platform to use fixed-clock. I will
> update the driver and dts to use standard clock framework but for now we
> will continue using "clock-frequency" and will update when clock framework
> is upstream.

No, you should leave it out - DT bindings are supposed to be permanent
so we don't want to have temporary bindings that are expected to be
removed quickly.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-xlp.txt b/Documentation/devicetree/bindings/spi/spi-xlp.txt
new file mode 100644
index 0000000..a8bbca3
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-xlp.txt
@@ -0,0 +1,40 @@ 
+SPI Master controller for Netlogic XLP MIPS64 SOCs
+==================================================
+
+Currently this SPI controller driver is supported for the following
+Netlogic XLP SoCs:
+	XLP832, XLP316, XLP208, XLP980, XLP532
+
+Required properties:
+- compatible	: Should be "netlogic,xlp832-spi".
+- #address-cell	: Number of cells required to define a chip select address
+		  on the SPI bus.
+- #size-cells	: Should be zero.
+- reg:		: Should contain register location and length.
+- interrupts	: Interrupt number used by this controller.
+- interrupt-parent: Phandle of the parent interrupt controller.
+- clock-frequency : [OPTIONAL] Input clock frequency to the SPI block in Hz.
+		    Default is 133333333 Hz.
+
+SPI slave nodes must be children of the SPI master node and can contain
+properties described in Documentation/devicetree/bindings/spi/spi-bus.txt.
+
+Example:
+
+	spi: xlp_spi@3a100 {
+		compatible = "netlogic,xlp832-spi";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0 0x3a100 0x100>;
+		clock-frequency = <133333333>;
+		interrupts = <34>;
+		interrupt-parent = <&pic>;
+
+		spi_nor@1 {
+			compatible = "spansion,s25sl12801";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <1>;	/* Chip Select */
+			spi-max-frequency = <40000000>;
+		};
+};