| 1 |
# SPDX-License-Identifier: BSD-2-Clause |
| 2 |
# Copyright 2018 Linaro Ltd. |
| 3 |
# Copyright 2015,2020 Wolfram Sang <[email protected]> |
| 4 |
# Copyright 2022 Arm Ltd. |
| 5 |
%YAML 1.2 |
| 6 |
--- |
| 7 |
$id: http://devicetree.org/schemas/i2c/i2c-controller.yaml# |
| 8 |
$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 9 |
|
| 10 |
title: Common i2c-controller class |
| 11 |
|
| 12 |
maintainers: |
| 13 |
- Rob Herring <[email protected]> |
| 14 |
|
| 15 |
properties: |
| 16 |
$nodename: |
| 17 |
pattern: "^i2c(@.+|-[a-z0-9]+)?$" |
| 18 |
|
| 19 |
i2c-bus: |
| 20 |
type: object |
| 21 |
$ref: "#" |
| 22 |
|
| 23 |
"#address-cells": |
| 24 |
const: 1 |
| 25 |
|
| 26 |
"#size-cells": |
| 27 |
const: 0 |
| 28 |
|
| 29 |
clock-frequency: |
| 30 |
minimum: 1 |
| 31 |
maximum: 5000000 |
| 32 |
|
| 33 |
i2c-scl-falling-time-ns: |
| 34 |
description: |
| 35 |
Number of nanoseconds the SCL signal takes to fall; t(f) in the I2C |
| 36 |
specification. |
| 37 |
|
| 38 |
i2c-scl-internal-delay-ns: |
| 39 |
description: |
| 40 |
Number of nanoseconds the IP core additionally needs to setup SCL. |
| 41 |
|
| 42 |
i2c-scl-rising-time-ns: |
| 43 |
description: |
| 44 |
Number of nanoseconds the SCL signal takes to rise; t(r) in the I2C |
| 45 |
specification. |
| 46 |
|
| 47 |
i2c-scl-clk-low-timeout-us: |
| 48 |
description: |
| 49 |
Number of microseconds the clock line needs to be pulled down in order |
| 50 |
to force a waiting state. |
| 51 |
|
| 52 |
i2c-transfer-timeout-us: |
| 53 |
description: |
| 54 |
Number of microseconds to wait before considering an I2C transfer has |
| 55 |
failed. |
| 56 |
|
| 57 |
i2c-scl-has-clk-low-timeout: |
| 58 |
type: boolean |
| 59 |
description: |
| 60 |
Indicates whether the controller implements the feature of wait |
| 61 |
induction through SCL low, with the timeout being implemented |
| 62 |
internally by the controller. |
| 63 |
|
| 64 |
i2c-sda-falling-time-ns: |
| 65 |
description: |
| 66 |
Number of nanoseconds the SDA signal takes to fall; t(f) in the I2C |
| 67 |
specification. |
| 68 |
|
| 69 |
i2c-analog-filter: |
| 70 |
type: boolean |
| 71 |
description: |
| 72 |
Enable analog filter for i2c lines. |
| 73 |
|
| 74 |
i2c-digital-filter: |
| 75 |
type: boolean |
| 76 |
description: |
| 77 |
Enable digital filter for i2c lines. |
| 78 |
|
| 79 |
i2c-digital-filter-width-ns: |
| 80 |
description: |
| 81 |
Width of spikes which can be filtered by digital filter |
| 82 |
(i2c-digital-filter). This width is specified in nanoseconds. |
| 83 |
|
| 84 |
i2c-analog-filter-cutoff-frequency: |
| 85 |
$ref: /schemas/types.yaml#/definitions/uint32 |
| 86 |
description: |
| 87 |
Frequency that the analog filter (i2c-analog-filter) uses to distinguish |
| 88 |
which signal to filter. Signal with higher frequency than specified will |
| 89 |
be filtered out. Only lower frequency will pass (this is applicable to a |
| 90 |
low-pass analog filter). Typical value should be above the normal i2c bus |
| 91 |
clock frequency (clock-frequency). Specified in Hz. |
| 92 |
|
| 93 |
interrupts: |
| 94 |
description: |
| 95 |
If not using interrupt-names, the first interrupt will be treated as the |
| 96 |
primary interrupt for the controller. |
| 97 |
|
| 98 |
interrupt-names: |
| 99 |
anyOf: |
| 100 |
- {} # Any name is allowed. |
| 101 |
- contains: |
| 102 |
enum: |
| 103 |
- smbus_alert |
| 104 |
description: |
| 105 |
Generic name is "smbus_alert" for the SMBusAlert signal. Other names |
| 106 |
are left to individual bindings. |
| 107 |
|
| 108 |
mctp-controller: |
| 109 |
type: boolean |
| 110 |
description: |
| 111 |
Indicates that the system is accessible via this bus as an endpoint for |
| 112 |
MCTP over I2C transport. |
| 113 |
|
| 114 |
multi-master: |
| 115 |
type: boolean |
| 116 |
description: |
| 117 |
States that there is another controller active on this bus. The OS can use |
| 118 |
this information to adapt power management to keep the arbitration awake |
| 119 |
all the time, for example. Can not be combined with 'single-master'. |
| 120 |
|
| 121 |
scl-gpios: |
| 122 |
maxItems: 1 |
| 123 |
description: |
| 124 |
Specifies the GPIO related to SCL pin. Used for GPIO bus recovery. |
| 125 |
|
| 126 |
sda-gpios: |
| 127 |
maxItems: 1 |
| 128 |
description: |
| 129 |
Specifies the GPIO related to SDA pin. Optional for GPIO bus recovery. |
| 130 |
|
| 131 |
single-master: |
| 132 |
type: boolean |
| 133 |
description: |
| 134 |
States that there is no other controller active on this bus. The OS can |
| 135 |
use this information to detect a stalled bus more reliably, for example. |
| 136 |
Can not be combined with 'multi-master'. |
| 137 |
|
| 138 |
smbalert-gpios: |
| 139 |
maxItems: 1 |
| 140 |
description: |
| 141 |
Specifies the GPIO used for the SMBALERT# line. Optional. |
| 142 |
|
| 143 |
smbus: |
| 144 |
type: boolean |
| 145 |
description: |
| 146 |
States that additional SMBus restrictions and features apply to this bus. |
| 147 |
An example of feature is SMBusHostNotify. Examples of restrictions are |
| 148 |
more reserved addresses and timeout definitions. |
| 149 |
|
| 150 |
smbus-alert: |
| 151 |
type: boolean |
| 152 |
description: |
| 153 |
states that the optional SMBus-Alert feature apply to this bus. |
| 154 |
|
| 155 |
allOf: |
| 156 |
- not: |
| 157 |
required: |
| 158 |
- i2c-scl-clk-low-timeout-us |
| 159 |
- i2c-scl-has-clk-low-timeout |
| 160 |
|
| 161 |
patternProperties: |
| 162 |
'@[0-9a-f]+$': |
| 163 |
type: object |
| 164 |
|
| 165 |
properties: |
| 166 |
reg: |
| 167 |
items: |
| 168 |
items: |
| 169 |
- oneOf: |
| 170 |
- maximum: 0x7f |
| 171 |
- minimum: 0x40000000 |
| 172 |
maximum: 0x4000007f |
| 173 |
- minimum: 0x80000000 |
| 174 |
maximum: 0x800003ff |
| 175 |
- minimum: 0xc0000000 |
| 176 |
maximum: 0xc00003ff |
| 177 |
description: | |
| 178 |
One or many I2C target addresses. These are usually 7 bit addresses. |
| 179 |
However, flags can be attached to an address. I2C_TEN_BIT_ADDRESS is |
| 180 |
used to mark a 10 bit address. It is needed to avoid the ambiguity |
| 181 |
between e.g. a 7 bit address of 0x50 and a 10 bit address of 0x050 |
| 182 |
which, in theory, can be on the same bus. |
| 183 |
Another flag is I2C_OWN_SLAVE_ADDRESS to mark addresses on which we |
| 184 |
listen to be devices ourselves. |
| 185 |
|
| 186 |
host-notify: |
| 187 |
type: boolean |
| 188 |
description: |
| 189 |
Device uses SMBus host notify protocol instead of interrupt line. |
| 190 |
Requires being connected to an adapter that supports this feature. |
| 191 |
|
| 192 |
interrupts: |
| 193 |
description: |
| 194 |
If not using interrupt-names, the first interrupt will be treated as |
| 195 |
the primary interrupt for the target. |
| 196 |
|
| 197 |
interrupt-names: |
| 198 |
anyOf: |
| 199 |
- {} # Any name is allowed. |
| 200 |
- contains: |
| 201 |
enum: |
| 202 |
- irq |
| 203 |
- wakeup |
| 204 |
description: |
| 205 |
Generic names are "irq" for the primary interrupt and "wakeup" |
| 206 |
for the wakeup interrupt. Other names are left to individual |
| 207 |
bindings. |
| 208 |
|
| 209 |
wakeup-source: |
| 210 |
description: |
| 211 |
Device can be used as a wakeup source. The device should also have |
| 212 |
"wakeup" interrupt for the device. If "wakeup" interrupt name is not |
| 213 |
present in the binding, then primary interrupt will be used as wakeup |
| 214 |
interrupt. |
| 215 |
|
| 216 |
required: |
| 217 |
- reg |
| 218 |
|
| 219 |
dependentRequired: |
| 220 |
i2c-analog-filter-cutoff-frequency: [ i2c-analog-filter ] |
| 221 |
i2c-digital-filter-width-ns: [ i2c-digital-filter ] |
| 222 |
|
| 223 |
additionalProperties: true |