ramoops.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/reserved-memory/ramoops.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Ramoops oops/panic logger
  7. description: |
  8. ramoops provides persistent RAM storage for oops and panics, so they can be
  9. recovered after a reboot. This is a child-node of "/reserved-memory", and
  10. is named "ramoops" after the backend, rather than "pstore" which is the
  11. subsystem.
  12. Parts of this storage may be set aside for other persistent log buffers, such
  13. as kernel log messages, or for optional ECC error-correction data. The total
  14. size of these optional buffers must fit in the reserved region.
  15. Any remaining space will be used for a circular buffer of oops and panic
  16. records. These records have a configurable size, with a size of 0 indicating
  17. that they should be disabled.
  18. At least one of "record-size", "console-size", "ftrace-size", or "pmsg-size"
  19. must be set non-zero, but are otherwise optional as listed below.
  20. maintainers:
  21. - Kees Cook <keescook@chromium.org>
  22. allOf:
  23. - $ref: reserved-memory.yaml
  24. properties:
  25. compatible:
  26. const: ramoops
  27. reg:
  28. description: region of memory that is preserved between reboots
  29. ecc-size:
  30. $ref: /schemas/types.yaml#/definitions/uint32
  31. description: enables ECC support and specifies ECC buffer size in bytes
  32. default: 0 # no ECC
  33. record-size:
  34. $ref: /schemas/types.yaml#/definitions/uint32
  35. description: maximum size in bytes of each kmsg dump
  36. default: 0
  37. console-size:
  38. $ref: /schemas/types.yaml#/definitions/uint32
  39. description: size in bytes of log buffer reserved for kernel messages
  40. default: 0
  41. ftrace-size:
  42. $ref: /schemas/types.yaml#/definitions/uint32
  43. description: size in bytes of log buffer reserved for function tracing and profiling
  44. default: 0
  45. pmsg-size:
  46. $ref: /schemas/types.yaml#/definitions/uint32
  47. description: size in bytes of log buffer reserved for userspace messages
  48. default: 0
  49. mem-type:
  50. $ref: /schemas/types.yaml#/definitions/uint32
  51. description: if present, sets the type of mapping is to be used to map the reserved region.
  52. default: 0
  53. oneOf:
  54. - const: 0
  55. description: write-combined
  56. - const: 1
  57. description: unbuffered
  58. - const: 2
  59. description: cached
  60. max-reason:
  61. $ref: /schemas/types.yaml#/definitions/uint32
  62. default: 2 # log oopses and panics
  63. maximum: 0x7fffffff
  64. description: |
  65. If present, sets maximum type of kmsg dump reasons to store.
  66. This can be set to INT_MAX to store all kmsg dumps.
  67. See include/linux/kmsg_dump.h KMSG_DUMP_* for other kmsg dump reason values.
  68. Setting this to 0 (KMSG_DUMP_UNDEF), means the reason filtering will be
  69. controlled by the printk.always_kmsg_dump boot param.
  70. If unset, it will be 2 (KMSG_DUMP_OOPS), otherwise 5 (KMSG_DUMP_MAX).
  71. flags:
  72. $ref: /schemas/types.yaml#/definitions/uint32
  73. default: 0
  74. description: |
  75. If present, pass ramoops behavioral flags
  76. (see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values).
  77. no-dump-oops:
  78. deprecated: true
  79. type: boolean
  80. description: |
  81. Use max_reason instead. If present, and max_reason is not specified,
  82. it is equivalent to max_reason = 1 (KMSG_DUMP_PANIC).
  83. unbuffered:
  84. deprecated: true
  85. type: boolean
  86. description: |
  87. Use mem_type instead. If present, and mem_type is not specified,
  88. it is equivalent to mem_type = 1 and uses unbuffered mappings to map
  89. the reserved region (defaults to buffered mappings mem_type = 0).
  90. If both are specified -- "mem_type" overrides "unbuffered".
  91. unevaluatedProperties: false
  92. required:
  93. - compatible
  94. - reg
  95. anyOf:
  96. - required: [record-size]
  97. - required: [console-size]
  98. - required: [ftrace-size]
  99. - required: [pmsg-size]
  100. examples:
  101. - |
  102. / {
  103. compatible = "foo";
  104. model = "foo";
  105. #address-cells = <1>;
  106. #size-cells = <1>;
  107. reserved-memory {
  108. #address-cells = <1>;
  109. #size-cells = <1>;
  110. ranges;
  111. ramoops@bfdf0000 {
  112. compatible = "ramoops";
  113. reg = <0xbfdf0000 0x10000>; /* 64kB */
  114. console-size = <0x8000>; /* 32kB */
  115. record-size = <0x400>; /* 1kB */
  116. ecc-size = <16>;
  117. };
  118. };
  119. };