1# Copyright (c) 2020-2023 Gerson Fernando Budke <nandojve@gmail.com>
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5  Atmel SAM4L Family I2C (TWIM) node
6
7  The Atmel Two-wire Master Interface (TWIM) interconnects components on a
8  unique two-wire bus, made up of one clock line and one data line with speeds
9  of up to 3.4 Mbit/s, based on a byte-oriented transfer format.  The TWIM is
10  always a bus master and can transfer sequential or single bytes.  Multiple
11  master capability is supported.  Arbitration of the bus is performed
12  internally and relinquishes the bus automatically if the bus arbitration is
13  lost.
14
15  When using speeds above standard mode, user may need adjust clock and data
16  lines slew and strength parameters.  In general, slew 0 and minimal strength
17  is enough for short buses and light loads.  As a reference, the below
18  is the lowest power configuration:
19
20    std-clk-slew-lim = <0>;
21    std-clk-strength-low = "0.5";
22    std-data-slew-lim = <0>;
23    std-data-strength-low = "0.5";
24
25    hs-clk-slew-lim = <0>;
26    hs-clk-strength-high = "0.5";
27    hs-clk-strength-low = "0.5";
28    hs-data-slew-lim = <0>;
29    hs-data-strength-low = "0.5";
30
31  For best performances, user can tune the slope curves using an osciloscope.
32  The tuning should be performed by groups defined <mode>-<line>.  The prefix
33  std-<line> configures fast/fast-plus mode speeds and hs-<line> selects the
34  high speed mode.  The tune should be performed for both clock and data lines
35  on both speed modes.
36
37
38compatible: "atmel,sam-i2c-twim"
39
40include:
41  - name: i2c-controller.yaml
42  - name: pinctrl-device.yaml
43
44properties:
45  reg:
46    required: true
47
48  interrupts:
49    required: true
50
51  clocks:
52    required: true
53
54  std-clk-slew-lim:
55    type: int
56    required: true
57    description: |
58      Slew limit of the TWCK output buffer.  This should be adjusted with
59      std-clk-strength-low to fine tune the TWCK slope.
60    enum:
61      - 0
62      - 1
63      - 2
64      - 3
65
66  std-clk-strength-low:
67    type: string
68    required: true
69    description: |
70      Pull-down drive strength of the TWCK output buffer in fast/fast plus
71      mode.  This should be adjusted to provide proper TWCK line fall time.
72      The value represents the port output current in mA when signal on
73      low level.
74    enum:
75      - "0.5"
76      - "1.0"
77      - "1.6"
78      - "3.1"
79      - "6.2"
80      - "9.3"
81      - "15.5"
82      - "21.8"
83
84  std-data-slew-lim:
85    type: int
86    required: true
87    description: |
88      Slew limit of the TWD output buffer.  This should be adjusted with
89      std-data-strength-low to fine tune the TWD slope.
90    enum:
91      - 0
92      - 1
93      - 2
94      - 3
95
96  std-data-strength-low:
97    type: string
98    required: true
99    description: |
100      Pull-down drive strength of the TWD output buffer in fast/fast plus
101      mode.  This should be adjusted to provide proper TWD line fall time.
102      The value represents the port output current in mA when signal on
103      low level.
104    enum:
105      - "0.5"
106      - "1.0"
107      - "1.6"
108      - "3.1"
109      - "6.2"
110      - "9.3"
111      - "15.5"
112      - "21.8"
113
114  hs-clk-slew-lim:
115    type: int
116    required: true
117    description: |
118      Slew limit of the TWCK output buffer in high speed mode.  This
119      should be adjusted with both hs-clk-strength-high and
120      hs-clk-strength-low to fine tune the TWCK slope.
121    enum:
122      - 0
123      - 1
124      - 2
125      - 3
126
127  hs-clk-strength-high:
128    type: string
129    required: true
130    description: |
131      Pull-up drive strength of the TWCK output buffer in high speed
132      mode.  This should be adjusted to provide proper TWCK line rise time.
133      The value represents the port output current in mA when signal on
134      high level.
135    enum:
136      - "0.5"
137      - "1.0"
138      - "1.5"
139      - "3.0"
140
141  hs-clk-strength-low:
142    type: string
143    required: true
144    description: |
145      Pull-down drive strength of the TWCK output buffer in high speed
146      mode.  This should be adjusted to provide proper TWCK line fall time.
147      The value represents the port output current in mA when signal on
148      low level.
149    enum:
150      - "0.5"
151      - "1.0"
152      - "1.6"
153      - "3.1"
154      - "6.2"
155      - "9.3"
156      - "15.5"
157      - "21.8"
158
159  hs-data-slew-lim:
160    type: int
161    required: true
162    description: |
163      Slew limit of the TWD output buffer in high speed mode.  This
164      should be adjusted with hs-data-strength-low to fine tune the TWD
165      slope.
166    enum:
167      - 0
168      - 1
169      - 2
170      - 3
171
172  hs-data-strength-low:
173    type: string
174    description: |
175      Pull-down drive strength of the TWD output buffer in high speed
176      mode.  This should be adjusted to provide proper TWD line fall time.
177      The value represents the port output current in mA when signal on
178      low level.
179    enum:
180      - "0.5"
181      - "1.0"
182      - "1.6"
183      - "3.1"
184      - "6.2"
185      - "9.3"
186      - "15.5"
187      - "21.8"
188
189  hs-master-code:
190    type: int
191    required: true
192    description: |
193      3-bit code to be prefixed with 0b00001 to form a unique
194      8-bit HS-mode master code (0000 1XXX)
195    enum:
196      - 0   # 000
197      - 1   # 001
198      - 2   # 010
199      - 3   # 011
200      - 4   # 100
201      - 5   # 101
202      - 6   # 110
203      - 7   # 111
204