aboutsummaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/can/fsl-flexcan.txt
blob: 61eb95b237324c49fa13da1cf09397100f1fb2ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Flexcan CAN controller on Freescale's ARM and PowerPC system-on-a-chip (SOC).

Required properties:

- compatible : Should be "fsl,<processor>-flexcan"

  An implementation should also claim any of the following compatibles
  that it is fully backwards compatible with:

  - fsl,p1010-flexcan

- reg : Offset and length of the register set for this device
- interrupts : Interrupt tuple for this device

Clocking information is must for flexcan. please refer below info for
understanding clocking in flexcan:

• The FLEXCAN module is divided into two blocks. Controller host interface
  ("CHI") and Protocol Engine ("PE")
• Both these blocks require clock.
• CHI is responsible for registers read write including MB read/write.
  While PE is responsible for Transfer/receive data on CAN bus.
• The clocks feeding to these two blocks can be synchronous (i.e. same clock)
  or asynchronous (i.e. separate clocks).
• Selection is made in the CLK_SRC bit (bit 13) of Control 1 Register.
  - CLK_SRC = 0, asynchronous i.e. separate clocks for CHI and PE
  - CLK_SRC = 1, synchronous i.e. CHI clock is used for PE and PE
                 clock is not used.
• If this bit is not implemented in SOC, then SOC only supports asynchronous
  clocks.
• Either of the clock can be generated by any of the clock source.
• When the two clocks are asynchronous, then following restrictions apply to
  PE clock.
  - PE clock must be less than CHI clock.
• If low jitter is required on CAN bus, dedicated oscillator can be used to
  provide PE clock, but it must be less than CHI clock.

Base on above information clocking info in flexcan can be defined in two ways:

Method 1(Preferred):
  - clocks: phandle to the clocks feeding the flexcan. Two can be given:
    - "ipg": Protocol Engine clock
    - "per": Controller host interface clock
  - clock-names: Must contain the clock names described just above.

Method 2(Not Preferred):
  - clock-frequency : The synchronous clock frequency supplied to both
  Controller host interface and Protocol Engine

Optional properties:

- xceiver-supply: Regulator that powers the CAN transceiver

- big-endian: This means the registers of FlexCAN controller are big endian.
              This is optional property.i.e. if this property is not present in
              device tree node then controller is assumed to be little endian.
              if this property is present then controller is assumed to be big
              endian.

Example:

	can@1c000 {
		compatible = "fsl,p1010-flexcan";
		reg = <0x1c000 0x1000>;
		interrupts = <48 0x2>;
		interrupt-parent = <&mpic>;
		clock-frequency = <200000000>; // filled in by bootloader
	};

	can@2180000 {
		compatible = "fsl,lx2160ar1-flexcan";
		reg = <0x0 0x2180000 0x0 0x10000>;
		interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&sysclk>, <&clockgen 4 7>;
		clock-names = "ipg", "per";
		status = "disabled";
	};