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