i2c-ocores.txt 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Device tree configuration for i2c-ocores
  2. Required properties:
  3. - compatible : "opencores,i2c-ocores" or "aeroflexgaisler,i2cmst"
  4. - reg : bus address start and address range size of device
  5. - interrupts : interrupt number
  6. - clocks : handle to the controller clock; see the note below.
  7. Mutually exclusive with opencores,ip-clock-frequency
  8. - opencores,ip-clock-frequency: frequency of the controller clock in Hz;
  9. see the note below. Mutually exclusive with clocks
  10. - #address-cells : should be <1>
  11. - #size-cells : should be <0>
  12. Optional properties:
  13. - clock-frequency : frequency of bus clock in Hz; see the note below.
  14. Defaults to 100 KHz when the property is not specified
  15. - reg-shift : device register offsets are shifted by this value
  16. - reg-io-width : io register width in bytes (1, 2 or 4)
  17. - regstep : deprecated, use reg-shift above
  18. Note
  19. clock-frequency property is meant to control the bus frequency for i2c bus
  20. drivers, but it was incorrectly used to specify i2c controller input clock
  21. frequency. So the following rules are set to fix this situation:
  22. - if clock-frequency is present and neither opencores,ip-clock-frequency nor
  23. clocks are, then clock-frequency specifies i2c controller clock frequency.
  24. This is to keep backwards compatibility with setups using old DTB. i2c bus
  25. frequency is fixed at 100 KHz.
  26. - if clocks is present it specifies i2c controller clock. clock-frequency
  27. property specifies i2c bus frequency.
  28. - if opencores,ip-clock-frequency is present it specifies i2c controller
  29. clock frequency. clock-frequency property specifies i2c bus frequency.
  30. Examples:
  31. i2c0: ocores@a0000000 {
  32. #address-cells = <1>;
  33. #size-cells = <0>;
  34. compatible = "opencores,i2c-ocores";
  35. reg = <0xa0000000 0x8>;
  36. interrupts = <10>;
  37. opencores,ip-clock-frequency = <20000000>;
  38. reg-shift = <0>; /* 8 bit registers */
  39. reg-io-width = <1>; /* 8 bit read/write */
  40. dummy@60 {
  41. compatible = "dummy";
  42. reg = <0x60>;
  43. };
  44. };
  45. or
  46. i2c0: ocores@a0000000 {
  47. #address-cells = <1>;
  48. #size-cells = <0>;
  49. compatible = "opencores,i2c-ocores";
  50. reg = <0xa0000000 0x8>;
  51. interrupts = <10>;
  52. clocks = <&osc>;
  53. clock-frequency = <400000>; /* i2c bus frequency 400 KHz */
  54. reg-shift = <0>; /* 8 bit registers */
  55. reg-io-width = <1>; /* 8 bit read/write */
  56. dummy@60 {
  57. compatible = "dummy";
  58. reg = <0x60>;
  59. };
  60. };