forked from robherring/dt-schema
/
i2c-controller.yaml
203 lines (168 loc) · 5.94 KB
/
i2c-controller.yaml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# SPDX-License-Identifier: BSD-2-Clause
# Copyright 2018 Linaro Ltd.
# Copyright 2015,2020 Wolfram Sang <wsa@sang-engineering.com>
# Copyright 2022 Arm Ltd.
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/i2c-controller.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Common i2c-controller class
maintainers:
- Rob Herring <robh@kernel.org>
properties:
$nodename:
pattern: "^i2c(@.*)?"
i2c-bus:
type: object
$ref: "#"
"#address-cells":
const: 1
"#size-cells":
const: 0
clock-frequency:
minimum: 1
maximum: 5000000
i2c-scl-falling-time-ns:
description:
Number of nanoseconds the SCL signal takes to fall; t(f) in the I2C
specification.
i2c-scl-internal-delay-ns:
description:
Number of nanoseconds the IP core additionally needs to setup SCL.
i2c-scl-rising-time-ns:
description:
Number of nanoseconds the SCL signal takes to rise; t(r) in the I2C
specification.
i2c-scl-clk-low-timeout-us:
description:
Number of microseconds the clock line needs to be pulled down in order
to force a waiting state.
i2c-transfer-timeout-us:
description:
Number of microseconds to wait before considering an I2C transfer has
failed.
i2c-scl-has-clk-low-timeout:
type: boolean
description:
Indicates whether the controller implements the feature of wait
induction through SCL low, with the timeout being implemented
internally by the controller.
i2c-sda-falling-time-ns:
description:
Number of nanoseconds the SDA signal takes to fall; t(f) in the I2C
specification.
i2c-analog-filter:
type: boolean
description:
Enable analog filter for i2c lines.
i2c-digital-filter:
type: boolean
description:
Enable digital filter for i2c lines.
i2c-digital-filter-width-ns:
description:
Width of spikes which can be filtered by digital filter
(i2c-digital-filter). This width is specified in nanoseconds.
i2c-analog-filter-cutoff-frequency:
$ref: /schemas/types.yaml#/definitions/uint32
description:
Frequency that the analog filter (i2c-analog-filter) uses to distinguish
which signal to filter. Signal with higher frequency than specified will
be filtered out. Only lower frequency will pass (this is applicable to a
low-pass analog filter). Typical value should be above the normal i2c bus
clock frequency (clock-frequency). Specified in Hz.
mctp-controller:
type: boolean
description:
Indicates that the system is accessible via this bus as an endpoint for
MCTP over I2C transport.
multi-master:
type: boolean
description:
States that there is another master active on this bus. The OS can use
this information to adapt power management to keep the arbitration awake
all the time, for example. Can not be combined with 'single-master'.
scl-gpios:
maxItems: 1
description:
Specifies the GPIO related to SCL pin. Used for GPIO bus recovery.
sda-gpios:
maxItems: 1
description:
Specifies the GPIO related to SDA pin. Optional for GPIO bus recovery.
single-master:
type: boolean
description:
States that there is no other master active on this bus. The OS can use
this information to detect a stalled bus more reliably, for example. Can
not be combined with 'multi-master'.
smbus:
type: boolean
description:
States that additional SMBus restrictions and features apply to this bus.
An example of feature is SMBusHostNotify. Examples of restrictions are
more reserved addresses and timeout definitions.
smbus-alert:
type: boolean
description:
states that the optional SMBus-Alert feature apply to this bus.
allOf:
- not:
required:
- i2c-scl-clk-low-timeout-us
- i2c-scl-has-clk-low-timeout
patternProperties:
'@[0-9a-f]+$':
type: object
properties:
reg:
items:
items:
- oneOf:
- maximum: 0x7f
- minimum: 0x40000000
maximum: 0x4000007f
- minimum: 0x80000000
maximum: 0x800003ff
- minimum: 0xc0000000
maximum: 0xc00003ff
description: |
One or many I2C slave addresses. These are usually a 7 bit addresses.
However, flags can be attached to an address. I2C_TEN_BIT_ADDRESS is
used to mark a 10 bit address. It is needed to avoid the ambiguity
between e.g. a 7 bit address of 0x50 and a 10 bit address of 0x050
which, in theory, can be on the same bus.
Another flag is I2C_OWN_SLAVE_ADDRESS to mark addresses on which we
listen to be devices ourselves.
host-notify:
type: boolean
description:
Device uses SMBus host notify protocol instead of interrupt line.
Requires being connected to an adapter that supports this feature.
interrupts:
description:
I2C core will treat "irq" interrupt (or the very first interrupt if
not using interrupt names) as primary interrupt for the slave.
interrupt-names:
anyOf:
- {} # Any name is allowed.
- items:
enum:
- irq
- wakeup
- smbus_alert
description:
Names which are recognized by I2C core, other names are left to
individual bindings.
wakeup-source:
description:
Device can be used as a wakeup source. The device should also have
"wakeup" interrupt for the device. If "wakeup" interrupt name is not
present in the binding, then primary interrupt will be used as wakeup
interrupt.
required:
- reg
dependentRequired:
i2c-analog-filter-cutoff-frequency: [ i2c-analog-filter ]
i2c-digital-filter-width-ns: [ i2c-digital-filter ]
additionalProperties: true