dt-bindings: can: nxp,sja1000: Document RZ/N1 power-domains support
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / net / can / nxp,sja1000.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/net/can/nxp,sja1000.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Memory mapped SJA1000 CAN controller from NXP (formerly Philips)
8
9 maintainers:
10   - Wolfgang Grandegger <wg@grandegger.com>
11
12 properties:
13   compatible:
14     oneOf:
15       - enum:
16           - nxp,sja1000
17           - technologic,sja1000
18       - items:
19           - enum:
20               - renesas,r9a06g032-sja1000 # RZ/N1D
21               - renesas,r9a06g033-sja1000 # RZ/N1S
22           - const: renesas,rzn1-sja1000 # RZ/N1
23
24   reg:
25     maxItems: 1
26
27   interrupts:
28     maxItems: 1
29
30   clocks:
31     maxItems: 1
32
33   power-domains:
34     maxItems: 1
35
36   reg-io-width:
37     $ref: /schemas/types.yaml#/definitions/uint32
38     description: I/O register width (in bytes) implemented by this device
39     default: 1
40     enum: [ 1, 2, 4 ]
41
42   nxp,external-clock-frequency:
43     $ref: /schemas/types.yaml#/definitions/uint32
44     default: 16000000
45     description: |
46       Frequency of the external oscillator clock in Hz.
47       The internal clock frequency used by the SJA1000 is half of that value.
48
49   nxp,tx-output-mode:
50     $ref: /schemas/types.yaml#/definitions/uint32
51     enum: [ 0, 1, 2, 3 ]
52     default: 1
53     description: |
54       operation mode of the TX output control logic. Valid values are:
55         <0> : bi-phase output mode
56         <1> : normal output mode (default)
57         <2> : test output mode
58         <3> : clock output mode
59
60   nxp,tx-output-config:
61     $ref: /schemas/types.yaml#/definitions/uint32
62     default: 0x02
63     description: |
64       TX output pin configuration. Valid values are any one of the below
65       or combination of TX0 and TX1:
66         <0x01> : TX0 invert
67         <0x02> : TX0 pull-down (default)
68         <0x04> : TX0 pull-up
69         <0x06> : TX0 push-pull
70         <0x08> : TX1 invert
71         <0x10> : TX1 pull-down
72         <0x20> : TX1 pull-up
73         <0x30> : TX1 push-pull
74
75   nxp,clock-out-frequency:
76     $ref: /schemas/types.yaml#/definitions/uint32
77     description: |
78       clock frequency in Hz on the CLKOUT pin.
79       If not specified or if the specified value is 0, the CLKOUT pin
80       will be disabled.
81
82   nxp,no-comparator-bypass:
83     type: boolean
84     description: Allows to disable the CAN input comparator.
85
86 required:
87   - compatible
88   - reg
89   - interrupts
90
91 allOf:
92   - $ref: can-controller.yaml#
93   - if:
94       properties:
95         compatible:
96           contains:
97             enum:
98               - technologic,sja1000
99               - renesas,rzn1-sja1000
100     then:
101       required:
102         - reg-io-width
103   - if:
104       properties:
105         compatible:
106           contains:
107             const: renesas,rzn1-sja1000
108     then:
109       required:
110         - clocks
111         - power-domains
112
113 unevaluatedProperties: false
114
115 examples:
116   - |
117     can@1a000 {
118         compatible = "technologic,sja1000";
119         reg = <0x1a000 0x100>;
120         interrupts = <1>;
121         reg-io-width = <2>;
122         nxp,tx-output-config = <0x06>;
123         nxp,external-clock-frequency = <24000000>;
124     };
125
126   - |
127     #include <dt-bindings/interrupt-controller/arm-gic.h>
128     #include <dt-bindings/clock/r9a06g032-sysctrl.h>
129
130     can@52104000 {
131         compatible = "renesas,r9a06g032-sja1000", "renesas,rzn1-sja1000";
132         reg = <0x52104000 0x800>;
133         reg-io-width = <4>;
134         interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
135         clocks = <&sysctrl R9A06G032_HCLK_CAN0>;
136         power-domains = <&sysctrl>;
137     };