1# Copyright (c) 2020 Abram Early
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5  Microchip MCP251XFD SPI CAN-FD controller
6
7  The MCP251XFD node is defined on an SPI bus. An example
8  configuration is:
9
10  &mikrobus_spi {
11      cs-gpios = <&mikrobus_header 2 GPIO_ACTIVE_LOW>;
12
13      mcp2518fd_mikroe_mcp2518fd_click: mcp2518fd@0 {
14          compatible = "microchip,mcp251xfd";
15          status = "okay";
16
17          spi-max-frequency = <18000000>;
18          int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>;
19          reg = <0x0>;
20          osc-freq = <40000000>;
21
22          bus-speed = <125000>;
23          sample-point = <875>;
24          bus-speed-data = <1000000>;
25          sample-point-data = <875>;
26      };
27  };
28
29compatible: "microchip,mcp251xfd"
30
31include: [spi-device.yaml, can-fd-controller.yaml]
32
33properties:
34  osc-freq:
35    type: int
36    required: true
37    description: Frequency of the external oscillator in Hz.
38
39  int-gpios:
40    type: phandle-array
41    required: true
42    description: |
43      The interrupt signal from the controller is active low in push-pull mode.
44      The property value should ensure the flags properly describe the signal
45      that is presented to the driver.
46
47  pll-enable:
48    type: boolean
49    description: |
50      Enables controller PLL, which multiples input clock frequency x10.
51      This parameter also implicity sets whether the clock is from the PLL
52      output or directly from the oscillator.
53      If this option is enabled the clock source is the PLL, otherwise its
54      the oscillator.
55
56  timestamp-prescaler:
57    type: int
58    default: 1
59    description: |
60      Prescaler value for computing the timestamps of received messages.
61      The timestamp counter is derived from the internal clock divided by this value.
62      Valid range is [1, 1024].
63
64  sof-on-clko:
65    type: boolean
66    description: |
67      Output start-of-frame (SOF) signal on the CLKO pin every time
68      a Start bit of a CAN message is transmitted or received. If this option
69      is not set, then an internal clock (typically 40MHz or 20MHz) will be
70      output on CLKO pin instead.
71
72  clko-div:
73    type: int
74    description: The factor to divide the system clock for CLKO pin.
75    default: 10
76    enum:
77      - 1
78      - 2
79      - 4
80      - 10
81