arch_timer.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. * ARM architected timer
  2. ARM cores may have a per-core architected timer, which provides per-cpu timers,
  3. or a memory mapped architected timer, which provides up to 8 frames with a
  4. physical and optional virtual timer per frame.
  5. The per-core architected timer is attached to a GIC to deliver its
  6. per-processor interrupts via PPIs. The memory mapped timer is attached to a GIC
  7. to deliver its interrupts via SPIs.
  8. ** CP15 Timer node properties:
  9. - compatible : Should at least contain one of
  10. "arm,armv7-timer"
  11. "arm,armv8-timer"
  12. - interrupts : Interrupt list for secure, non-secure, virtual and
  13. hypervisor timers, in that order.
  14. - clock-frequency : The frequency of the main counter, in Hz. Should be present
  15. only where necessary to work around broken firmware which does not configure
  16. CNTFRQ on all CPUs to a uniform correct value. Use of this property is
  17. strongly discouraged; fix your firmware unless absolutely impossible.
  18. - always-on : a boolean property. If present, the timer is powered through an
  19. always-on power domain, therefore it never loses context.
  20. - fsl,erratum-a008585 : A boolean property. Indicates the presence of
  21. QorIQ erratum A-008585, which says that reading the counter is
  22. unreliable unless the same value is returned by back-to-back reads.
  23. This also affects writes to the tval register, due to the implicit
  24. counter read.
  25. - hisilicon,erratum-161010101 : A boolean property. Indicates the
  26. presence of Hisilicon erratum 161010101, which says that reading the
  27. counters is unreliable in some cases, and reads may return a value 32
  28. beyond the correct value. This also affects writes to the tval
  29. registers, due to the implicit counter read.
  30. ** Optional properties:
  31. - arm,cpu-registers-not-fw-configured : Firmware does not initialize
  32. any of the generic timer CPU registers, which contain their
  33. architecturally-defined reset values. Only supported for 32-bit
  34. systems which follow the ARMv7 architected reset values.
  35. - arm,no-tick-in-suspend : The main counter does not tick when the system is in
  36. low-power system suspend on some SoCs. This behavior does not match the
  37. Architecture Reference Manual's specification that the system counter "must
  38. be implemented in an always-on power domain."
  39. Example:
  40. timer {
  41. compatible = "arm,cortex-a15-timer",
  42. "arm,armv7-timer";
  43. interrupts = <1 13 0xf08>,
  44. <1 14 0xf08>,
  45. <1 11 0xf08>,
  46. <1 10 0xf08>;
  47. clock-frequency = <100000000>;
  48. };
  49. ** Memory mapped timer node properties:
  50. - compatible : Should at least contain "arm,armv7-timer-mem".
  51. - clock-frequency : The frequency of the main counter, in Hz. Should be present
  52. only when firmware has not configured the MMIO CNTFRQ registers.
  53. - reg : The control frame base address.
  54. Note that #address-cells, #size-cells, and ranges shall be present to ensure
  55. the CPU can address a frame's registers.
  56. A timer node has up to 8 frame sub-nodes, each with the following properties:
  57. - frame-number: 0 to 7.
  58. - interrupts : Interrupt list for physical and virtual timers in that order.
  59. The virtual timer interrupt is optional.
  60. - reg : The first and second view base addresses in that order. The second view
  61. base address is optional.
  62. - status : "disabled" indicates the frame is not available for use. Optional.
  63. Example:
  64. timer@f0000000 {
  65. compatible = "arm,armv7-timer-mem";
  66. #address-cells = <1>;
  67. #size-cells = <1>;
  68. ranges;
  69. reg = <0xf0000000 0x1000>;
  70. clock-frequency = <50000000>;
  71. frame@f0001000 {
  72. frame-number = <0>
  73. interrupts = <0 13 0x8>,
  74. <0 14 0x8>;
  75. reg = <0xf0001000 0x1000>,
  76. <0xf0002000 0x1000>;
  77. };
  78. frame@f0003000 {
  79. frame-number = <1>
  80. interrupts = <0 15 0x8>;
  81. reg = <0xf0003000 0x1000>;
  82. status = "disabled";
  83. };
  84. };