blob: de818d4713f0c6f77f6a63ed0eb315ec5e66e746 [file] [log] [blame]
Simon Glassf5428412015-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.
Alexander Kochetkov84fe2912018-03-27 17:52:26 +030015- gpios = <sda ...>, <scl ...>;
16 pinctrl-names = "default", "gpio";
17 pinctrl-0 = <&i2c_xfer>;
18 pinctrl-1 = <&i2c_gpio>;
19 Pin description for I2C bus software deblocking.
Simon Glassf5428412015-01-26 20:29:37 -070020
21
22Example
23-------
24
25i2c4: i2c@12ca0000 {
26 cros-ec@1e {
27 reg = <0x1e>;
28 compatible = "google,cros-ec";
29 i2c-max-frequency = <100000>;
30 u-boot,i2c-offset-len = <0>;
31 ec-interrupt = <&gpx1 6 GPIO_ACTIVE_LOW>;
32 };
33};
Alexander Kochetkov84fe2912018-03-27 17:52:26 +030034
35&i2c1 {
36 pinctrl-names = "default", "gpio";
37 pinctrl-0 = <&i2c1_xfer>;
38 pinctrl-1 = <&i2c1_gpio>;
39 gpios = <&gpio1 26 GPIO_ACTIVE_LOW>, /* SDA */
40 <&gpio1 27 GPIO_ACTIVE_LOW>; /* SCL */
41};