fsi.txt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. FSI bus & engine generic device tree bindings
  2. =============================================
  3. The FSI bus is probe-able, so the OS is able to enumerate FSI slaves, and
  4. engines within those slaves. However, we have a facility to match devicetree
  5. nodes to probed engines. This allows for fsi engines to expose non-probeable
  6. busses, which are then exposed by the device tree. For example, an FSI engine
  7. that is an I2C master - the I2C bus can be described by the device tree under
  8. the engine's device tree node.
  9. FSI masters may require their own DT nodes (to describe the master HW itself);
  10. that requirement is defined by the master's implementation, and is described by
  11. the fsi-master-* binding specifications.
  12. Under the masters' nodes, we can describe the bus topology using nodes to
  13. represent the FSI slaves and their slave engines. As a basic outline:
  14. fsi-master {
  15. /* top-level of FSI bus topology, bound to an FSI master driver and
  16. * exposes an FSI bus */
  17. fsi-slave@<link,id> {
  18. /* this node defines the FSI slave device, and is handled
  19. * entirely with FSI core code */
  20. fsi-slave-engine@<addr> {
  21. /* this node defines the engine endpoint & address range, which
  22. * is bound to the relevant fsi device driver */
  23. ...
  24. };
  25. fsi-slave-engine@<addr> {
  26. ...
  27. };
  28. };
  29. };
  30. Note that since the bus is probe-able, some (or all) of the topology may
  31. not be described; this binding only provides an optional facility for
  32. adding subordinate device tree nodes as children of FSI engines.
  33. FSI masters
  34. -----------
  35. FSI master nodes declare themselves as such with the "fsi-master" compatible
  36. value. It's likely that an implementation-specific compatible value will
  37. be needed as well, for example:
  38. compatible = "fsi-master-gpio", "fsi-master";
  39. Since the master nodes describe the top-level of the FSI topology, they also
  40. need to declare the FSI-standard addressing scheme. This requires two cells for
  41. addresses (link index and slave ID), and no size:
  42. #address-cells = <2>;
  43. #size-cells = <0>;
  44. An optional boolean property can be added to indicate that a particular master
  45. should not scan for connected devices at initialization time. This is
  46. necessary in cases where a scan could cause arbitration issues with other
  47. masters that may be present on the bus.
  48. no-scan-on-init;
  49. FSI slaves
  50. ----------
  51. Slaves are identified by a (link-index, slave-id) pair, so require two cells
  52. for an address identifier. Since these are not a range, no size cells are
  53. required. For an example, a slave on link 1, with ID 2, could be represented
  54. as:
  55. cfam@1,2 {
  56. reg = <1 2>;
  57. [...];
  58. }
  59. Each slave provides an address-space, under which the engines are accessible.
  60. That address space has a maximum of 23 bits, so we use one cell to represent
  61. addresses and sizes in the slave address space:
  62. #address-cells = <1>;
  63. #size-cells = <1>;
  64. Optionally, a slave can provide a global unique chip ID which is used to
  65. identify the physical location of the chip in a system specific way
  66. chip-id = <0>;
  67. FSI engines (devices)
  68. ---------------------
  69. Engines are identified by their address under the slaves' address spaces. We
  70. use a single cell for address and size. Engine nodes represent the endpoint
  71. FSI device, and are passed to those FSI device drivers' ->probe() functions.
  72. For example, for a slave using a single 0x400-byte page starting at address
  73. 0xc00:
  74. engine@c00 {
  75. reg = <0xc00 0x400>;
  76. };
  77. Full example
  78. ------------
  79. Here's an example that illustrates:
  80. - an FSI master
  81. - connected to an FSI slave
  82. - that contains an engine that is an I2C master
  83. - connected to an I2C EEPROM
  84. The FSI master may be connected to additional slaves, and slaves may have
  85. additional engines, but they don't necessarily need to be describe in the
  86. device tree if no extra platform information is required.
  87. /* The GPIO-based FSI master node, describing the top level of the
  88. * FSI bus
  89. */
  90. gpio-fsi {
  91. compatible = "fsi-master-gpio", "fsi-master";
  92. #address-cells = <2>;
  93. #size-cells = <0>;
  94. /* A FSI slave (aka. CFAM) at link 0, ID 0. */
  95. cfam@0,0 {
  96. reg = <0 0>;
  97. #address-cells = <1>;
  98. #size-cells = <1>;
  99. chip-id = <0>;
  100. /* FSI engine at 0xc00, using a single page. In this example,
  101. * it's an I2C master controller, so subnodes describe the
  102. * I2C bus.
  103. */
  104. i2c-controller@c00 {
  105. reg = <0xc00 0x400>;
  106. /* Engine-specific data. In this case, we're describing an
  107. * I2C bus, so we're conforming to the generic I2C binding
  108. */
  109. compatible = "some-vendor,fsi-i2c-controller";
  110. #address-cells = <1>;
  111. #size-cells = <1>;
  112. /* I2C endpoint device: an Atmel EEPROM */
  113. eeprom@50 {
  114. compatible = "atmel,24c256";
  115. reg = <0x50>;
  116. pagesize = <64>;
  117. };
  118. };
  119. };
  120. };