Documentation / devicetree / bindings / reserved-memory / ramoops.yaml


Based on kernel version 6.11. Page generated on 2024-09-24 08:21 EST.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/ramoops.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Ramoops oops/panic logger

description: |
  ramoops provides persistent RAM storage for oops and panics, so they can be
  recovered after a reboot. This is a child-node of "/reserved-memory", and
  is named "ramoops" after the backend, rather than "pstore" which is the
  subsystem.
 
  Parts of this storage may be set aside for other persistent log buffers, such
  as kernel log messages, or for optional ECC error-correction data.  The total
  size of these optional buffers must fit in the reserved region.
 
  Any remaining space will be used for a circular buffer of oops and panic
  records.  These records have a configurable size, with a size of 0 indicating
  that they should be disabled.
 
  At least one of "record-size", "console-size", "ftrace-size", or "pmsg-size"
  must be set non-zero, but are otherwise optional as listed below.

maintainers:
  - Kees Cook <keescook@chromium.org>

allOf:
  - $ref: reserved-memory.yaml

properties:
  compatible:
    const: ramoops

  reg:
    description: region of memory that is preserved between reboots

  ecc-size:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: enables ECC support and specifies ECC buffer size in bytes
    default: 0 # no ECC

  record-size:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum size in bytes of each kmsg dump
    default: 0

  console-size:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: size in bytes of log buffer reserved for kernel messages
    default: 0

  ftrace-size:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: size in bytes of log buffer reserved for function tracing and profiling
    default: 0

  pmsg-size:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: size in bytes of log buffer reserved for userspace messages
    default: 0

  mem-type:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: if present, sets the type of mapping is to be used to map the reserved region.
    default: 0
    oneOf:
      - const: 0
        description: write-combined
      - const: 1
        description: unbuffered
      - const: 2
        description: cached

  max-reason:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 2 # log oopses and panics
    maximum: 0x7fffffff
    description: |
      If present, sets maximum type of kmsg dump reasons to store.
      This can be set to INT_MAX to store all kmsg dumps.
      See include/linux/kmsg_dump.h KMSG_DUMP_* for other kmsg dump reason values.
      Setting this to 0 (KMSG_DUMP_UNDEF), means the reason filtering will be
      controlled by the printk.always_kmsg_dump boot param.
      If unset, it will be 2 (KMSG_DUMP_OOPS), otherwise 5 (KMSG_DUMP_MAX).

  flags:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0
    description: |
      If present, pass ramoops behavioral flags
      (see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values).

  no-dump-oops:
    deprecated: true
    type: boolean
    description: |
      Use max_reason instead. If present, and max_reason is not specified,
      it is equivalent to max_reason = 1 (KMSG_DUMP_PANIC).

  unbuffered:
    deprecated: true
    type: boolean
    description: |
      Use mem_type instead. If present, and mem_type is not specified,
      it is equivalent to mem_type = 1 and uses unbuffered mappings to map
      the reserved region (defaults to buffered mappings mem_type = 0).
      If both are specified -- "mem_type" overrides "unbuffered".

unevaluatedProperties: false

required:
  - compatible
  - reg

anyOf:
  - required: [record-size]
  - required: [console-size]
  - required: [ftrace-size]
  - required: [pmsg-size]

examples:
  - |
    / {
        compatible = "foo";
        model = "foo";
        #address-cells = <1>;
        #size-cells = <1>;
 
        reserved-memory {
            #address-cells = <1>;
            #size-cells = <1>;
            ranges;
 
            ramoops@bfdf0000 {
                compatible = "ramoops";
                reg = <0xbfdf0000 0x10000>; /* 64kB */
                console-size = <0x8000>;    /* 32kB */
                record-size = <0x400>;      /*  1kB */
                ecc-size = <16>;
            };
        };
    };