[PATCH v2] Documentation: can: flexcan: Add flexcan clocks' information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The property clock-frequency is optional for device tree probe.  When
it's absent, the flexcan driver will try to get the frequency from clk
system by calling clk_get_rate.

But, the clk_get_rate requires that clocks and clock-names properties
to be present in the flexcan node.
Document the usage of these properties.

Signed-off-by: Pankaj Bansal <pankaj.bansal@xxxxxxx>
---

Notes:
    V2:
     - Added notes that mentioning clocks' phandles is preferred method
       over mentioning clock-frequency

 .../bindings/net/can/fsl-flexcan.txt         | 37 ++++++++++++++++--
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
index bfc0c433654f..e1f9cc17d818 100644
--- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
+++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
@@ -12,10 +12,29 @@ Required properties:
 - reg : Offset and length of the register set for this device
 - interrupts : Interrupt tuple for this device
 
-Optional properties:
+The input clock is the one fed to the prescaler to generate the serial clock
+(Sclock). Serial Clock (Sclock), whose period defines the 'time quantum'
+used to compose the CAN waveform. The input clock information can be given
+in two formats
+
+- clocks: phandle to the clocks feeding the SPI controller. Two can be given:
+  - "ipg": Oscillator Clock
+  - "per": Peripheral Clock
+- clock-names: Must contain the clock names described just above
+Note : This method is preferred method.
+
+ or
+
+- clock-frequency : The oscillator/peripheral clock frequency
+  driving the flexcan device.
+Note : Only on platforms where you don't have your clocks in the Device Tree,
+       use "clock-frequency" (as a fallback).
 
-- clock-frequency : The oscillator frequency driving the flexcan device
+The oscillator clock should be selected whenever a tight tolerance (up to 0.1%)
+is required in the CAN bus timing. The crystal oscillator clock has better
+jitter performance than the peripheral clock.
 
+Optional properties:
 - xceiver-supply: Regulator that powers the CAN transceiver
 
 - big-endian: This means the registers of FlexCAN controller are big endian.
@@ -25,11 +44,23 @@ Optional properties:
               endian.
 
 Example:
+	can0: can@2180000 {
+		compatible = "fsl,lx2160ar1-flexcan";
+		reg = <0x0 0x2180000 0x0 0x10000>;
+		interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&clockgen 4 7>, <&clockgen 4 7>; // preferred method
+		clock-names = "ipg", "per";
+		status = "disabled";
+	};
 
 	can@1c000 {
 		compatible = "fsl,p1010-flexcan";
 		reg = <0x1c000 0x1000>;
 		interrupts = <48 0x2>;
 		interrupt-parent = <&mpic>;
-		clock-frequency = <200000000>; // filled in by bootloader
+		clock-frequency = <200000000>; // fallback method if no clocks
+					       // in device tree. can be filled
+					       // by bootloader
+		big-endian;
 	};
+
-- 
2.17.1





[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux