i2c.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. U-Boot I2C
  2. ----------
  3. U-Boot's I2C model has the concept of an offset within a chip (I2C target
  4. device). The offset can be up to 4 bytes long, but is normally 1 byte,
  5. meaning that offsets from 0 to 255 are supported by the chip. This often
  6. corresponds to register numbers.
  7. Apart from the controller-specific I2C bindings, U-Boot supports a special
  8. property which allows the chip offset length to be selected.
  9. Optional properties:
  10. - u-boot,i2c-offset-len - length of chip offset in bytes. If omitted the
  11. default value of 1 is used.
  12. - gpios = <sda ...>, <scl ...>;
  13. pinctrl-names = "default", "gpio";
  14. pinctrl-0 = <&i2c_xfer>;
  15. pinctrl-1 = <&i2c_gpio>;
  16. Pin description for I2C bus software deblocking.
  17. Example
  18. -------
  19. i2c4: i2c@12ca0000 {
  20. cros-ec@1e {
  21. reg = <0x1e>;
  22. compatible = "google,cros-ec";
  23. i2c-max-frequency = <100000>;
  24. u-boot,i2c-offset-len = <0>;
  25. ec-interrupt = <&gpx1 6 GPIO_ACTIVE_LOW>;
  26. };
  27. };
  28. &i2c1 {
  29. pinctrl-names = "default", "gpio";
  30. pinctrl-0 = <&i2c1_xfer>;
  31. pinctrl-1 = <&i2c1_gpio>;
  32. gpios = <&gpio1 26 GPIO_ACTIVE_LOW>, /* SDA */
  33. <&gpio1 27 GPIO_ACTIVE_LOW>; /* SCL */
  34. };