amu-bindings.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. Activity Monitor Unit (AMU) Bindings
  2. ====================================
  3. To support platform-defined Activity Monitor Unit (|AMU|) auxiliary counters
  4. through FCONF, the ``HW_CONFIG`` device tree accepts several |AMU|-specific
  5. nodes and properties.
  6. Bindings
  7. ^^^^^^^^
  8. .. contents::
  9. :local:
  10. ``/cpus/cpus/cpu*`` node properties
  11. """""""""""""""""""""""""""""""""""
  12. The ``cpu`` node has been augmented to support a handle to an associated |AMU|
  13. view, which should describe the counters offered by the core.
  14. +---------------+-------+---------------+-------------------------------------+
  15. | Property name | Usage | Value type | Description |
  16. +===============+=======+===============+=====================================+
  17. | ``amu`` | O | ``<phandle>`` | If present, indicates that an |AMU| |
  18. | | | | is available and its counters are |
  19. | | | | described by the node provided. |
  20. +---------------+-------+---------------+-------------------------------------+
  21. ``/cpus/amus`` node properties
  22. """"""""""""""""""""""""""""""
  23. The ``amus`` node describes the |AMUs| implemented by the cores in the system.
  24. This node does not have any properties.
  25. ``/cpus/amus/amu*`` node properties
  26. """""""""""""""""""""""""""""""""""
  27. An ``amu`` node describes the layout and meaning of the auxiliary counter
  28. registers of one or more |AMUs|, and may be shared by multiple cores.
  29. +--------------------+-------+------------+------------------------------------+
  30. | Property name | Usage | Value type | Description |
  31. +====================+=======+============+====================================+
  32. | ``#address-cells`` | R | ``<u32>`` | Value shall be 1. Specifies that |
  33. | | | | the ``reg`` property array of |
  34. | | | | children of this node uses a |
  35. | | | | single cell. |
  36. +--------------------+-------+------------+------------------------------------+
  37. | ``#size-cells`` | R | ``<u32>`` | Value shall be 0. Specifies that |
  38. | | | | no size is required in the ``reg`` |
  39. | | | | property in children of this node. |
  40. +--------------------+-------+------------+------------------------------------+
  41. ``/cpus/amus/amu*/counter*`` node properties
  42. """"""""""""""""""""""""""""""""""""""""""""
  43. A ``counter`` node describes an auxiliary counter belonging to the parent |AMU|
  44. view.
  45. +-------------------+-------+-------------+------------------------------------+
  46. | Property name | Usage | Value type | Description |
  47. +===================+=======+=============+====================================+
  48. | ``reg`` | R | array | Represents the counter register |
  49. | | | | index, and must be a single cell. |
  50. +-------------------+-------+-------------+------------------------------------+
  51. | ``enable-at-el3`` | O | ``<empty>`` | The presence of this property |
  52. | | | | indicates that this counter should |
  53. | | | | be enabled prior to EL3 exit. |
  54. +-------------------+-------+-------------+------------------------------------+
  55. Example
  56. ^^^^^^^
  57. An example system offering four cores made up of two clusters, where the cores
  58. of each cluster share different |AMUs|, may use something like the following:
  59. .. code-block::
  60. cpus {
  61. #address-cells = <2>;
  62. #size-cells = <0>;
  63. amus {
  64. amu0: amu-0 {
  65. #address-cells = <1>;
  66. #size-cells = <0>;
  67. counterX: counter@0 {
  68. reg = <0>;
  69. enable-at-el3;
  70. };
  71. counterY: counter@1 {
  72. reg = <1>;
  73. enable-at-el3;
  74. };
  75. };
  76. amu1: amu-1 {
  77. #address-cells = <1>;
  78. #size-cells = <0>;
  79. counterZ: counter@0 {
  80. reg = <0>;
  81. enable-at-el3;
  82. };
  83. };
  84. };
  85. cpu0@00000 {
  86. ...
  87. amu = <&amu0>;
  88. };
  89. cpu1@00100 {
  90. ...
  91. amu = <&amu0>;
  92. };
  93. cpu2@10000 {
  94. ...
  95. amu = <&amu1>;
  96. };
  97. cpu3@10100 {
  98. ...
  99. amu = <&amu1>;
  100. };
  101. }
  102. In this situation, ``cpu0`` and ``cpu1`` (the two cores in the first cluster),
  103. share the view of their AMUs defined by ``amu0``. Likewise, ``cpu2`` and
  104. ``cpu3`` (the two cores in the second cluster), share the view of their |AMUs|
  105. defined by ``amu1``. This will cause ``counterX`` and ``counterY`` to be enabled
  106. for both ``cpu0`` and ``cpu1``, and ``counterZ`` to be enabled for both ``cpu2``
  107. and ``cpu3``.