blob: 9698e4899b54c8135a863e78ef1cdca74a2bb9b5 [file] [log] [blame]
Simon Glass7132b9f2015-01-26 20:29:37 -07001U-Boot I2C
2----------
3
4U-Boot's I2C model has the concept of an offset within a chip (I2C target
5device). The offset can be up to 4 bytes long, but is normally 1 byte,
6meaning that offsets from 0 to 255 are supported by the chip. This often
7corresponds to register numbers.
8
9Apart from the controller-specific I2C bindings, U-Boot supports a special
10property which allows the chip offset length to be selected.
11
12Optional properties:
13- u-boot,i2c-offset-len - length of chip offset in bytes. If omitted the
14 default value of 1 is used.
Lukasz Majewskia40fe212019-04-04 12:35:34 +020015- u-boot,i2c-transaction-bytes - the length of single I2C transaction on
16 the bus. Some devices require more than single byte transmission
17 (e.g. mc34708 mfd). This information is necessary to correctly
18 initialize (put into idle state) I2C bus after soft reset.
Alexander Kochetkovdf8dcac2018-03-27 17:52:26 +030019- gpios = <sda ...>, <scl ...>;
20 pinctrl-names = "default", "gpio";
21 pinctrl-0 = <&i2c_xfer>;
22 pinctrl-1 = <&i2c_gpio>;
23 Pin description for I2C bus software deblocking.
Simon Glass7132b9f2015-01-26 20:29:37 -070024
25
26Example
27-------
28
29i2c4: i2c@12ca0000 {
30 cros-ec@1e {
31 reg = <0x1e>;
32 compatible = "google,cros-ec";
33 i2c-max-frequency = <100000>;
34 u-boot,i2c-offset-len = <0>;
Lukasz Majewskia40fe212019-04-04 12:35:34 +020035 u-boot,i2c-transaction-bytes = <3>;
Simon Glass7132b9f2015-01-26 20:29:37 -070036 ec-interrupt = <&gpx1 6 GPIO_ACTIVE_LOW>;
37 };
38};
Alexander Kochetkovdf8dcac2018-03-27 17:52:26 +030039
40&i2c1 {
41 pinctrl-names = "default", "gpio";
42 pinctrl-0 = <&i2c1_xfer>;
43 pinctrl-1 = <&i2c1_gpio>;
44 gpios = <&gpio1 26 GPIO_ACTIVE_LOW>, /* SDA */
45 <&gpio1 27 GPIO_ACTIVE_LOW>; /* SCL */
46};