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

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

 



On 11/12/18 8:15 AM, Pankaj Bansal wrote:
> 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>
> ---
>  .../bindings/net/can/fsl-flexcan.txt         | 29 ++++++++++++++++--
>  1 file changed, 27 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> index bfc0c433654f..3210e2891b84 100644
> --- a/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> +++ b/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
> @@ -12,10 +12,26 @@ 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
> +
> +- clock-frequency : The oscillator/peripheral clock frequency
> +  driving the flexcan device
> +
> +  or
> +
> +- 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

This sounds like it's equivalent which format you use. But it's strongly
preferred to specify the clock phandles. Only on platforms where you
don't have your clocks in the DT, use "clock-frequency" as a fallback. I
think it's only used on some old powerpc boards.

> -- 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.
> @@ -33,3 +49,12 @@ Example:
>  		interrupt-parent = <&mpic>;
>  		clock-frequency = <200000000>; // filled in by bootloader
>  	};
> +
> +	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>;
> +		clock-names = "ipg", "per";
> +		status = "disabled";
> +	};

Can you move this example in front of the other and add something like
"preferred" and "fallback if no clock phandles available" to it?

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature


[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