Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: "http://devicetree.org/schemas/reserved-memory/ramoops.yaml#"
0005 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
0006 
0007 title: Ramoops oops/panic logger
0008 
0009 description: |
0010   ramoops provides persistent RAM storage for oops and panics, so they can be
0011   recovered after a reboot. This is a child-node of "/reserved-memory", and
0012   is named "ramoops" after the backend, rather than "pstore" which is the
0013   subsystem.
0014 
0015   Parts of this storage may be set aside for other persistent log buffers, such
0016   as kernel log messages, or for optional ECC error-correction data.  The total
0017   size of these optional buffers must fit in the reserved region.
0018 
0019   Any remaining space will be used for a circular buffer of oops and panic
0020   records.  These records have a configurable size, with a size of 0 indicating
0021   that they should be disabled.
0022 
0023   At least one of "record-size", "console-size", "ftrace-size", or "pmsg-size"
0024   must be set non-zero, but are otherwise optional as listed below.
0025 
0026 maintainers:
0027   - Kees Cook <keescook@chromium.org>
0028 
0029 allOf:
0030   - $ref: "reserved-memory.yaml"
0031 
0032 properties:
0033   compatible:
0034     const: ramoops
0035 
0036   reg:
0037     description: region of memory that is preserved between reboots
0038 
0039   ecc-size:
0040     $ref: /schemas/types.yaml#/definitions/uint32
0041     description: enables ECC support and specifies ECC buffer size in bytes
0042     default: 0 # no ECC
0043 
0044   record-size:
0045     $ref: /schemas/types.yaml#/definitions/uint32
0046     description: maximum size in bytes of each kmsg dump
0047     default: 0
0048 
0049   console-size:
0050     $ref: /schemas/types.yaml#/definitions/uint32
0051     description: size in bytes of log buffer reserved for kernel messages
0052     default: 0
0053 
0054   ftrace-size:
0055     $ref: /schemas/types.yaml#/definitions/uint32
0056     description: size in bytes of log buffer reserved for function tracing and profiling
0057     default: 0
0058 
0059   pmsg-size:
0060     $ref: /schemas/types.yaml#/definitions/uint32
0061     description: size in bytes of log buffer reserved for userspace messages
0062     default: 0
0063 
0064   mem-type:
0065     $ref: /schemas/types.yaml#/definitions/uint32
0066     description: if present, sets the type of mapping is to be used to map the reserved region.
0067     default: 0
0068     oneOf:
0069       - const: 0
0070         description: write-combined
0071       - const: 1
0072         description: unbuffered
0073       - const: 2
0074         description: cached
0075 
0076   max-reason:
0077     $ref: /schemas/types.yaml#/definitions/uint32
0078     default: 2 # log oopses and panics
0079     maximum: 0x7fffffff
0080     description: |
0081       If present, sets maximum type of kmsg dump reasons to store.
0082       This can be set to INT_MAX to store all kmsg dumps.
0083       See include/linux/kmsg_dump.h KMSG_DUMP_* for other kmsg dump reason values.
0084       Setting this to 0 (KMSG_DUMP_UNDEF), means the reason filtering will be
0085       controlled by the printk.always_kmsg_dump boot param.
0086       If unset, it will be 2 (KMSG_DUMP_OOPS), otherwise 5 (KMSG_DUMP_MAX).
0087 
0088   flags:
0089     $ref: /schemas/types.yaml#/definitions/uint32
0090     default: 0
0091     description: |
0092       If present, pass ramoops behavioral flags
0093       (see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values).
0094 
0095   no-dump-oops:
0096     deprecated: true
0097     type: boolean
0098     description: |
0099       Use max_reason instead. If present, and max_reason is not specified,
0100       it is equivalent to max_reason = 1 (KMSG_DUMP_PANIC).
0101 
0102   unbuffered:
0103     deprecated: true
0104     type: boolean
0105     description: |
0106       Use mem_type instead. If present, and mem_type is not specified,
0107       it is equivalent to mem_type = 1 and uses unbuffered mappings to map
0108       the reserved region (defaults to buffered mappings mem_type = 0).
0109       If both are specified -- "mem_type" overrides "unbuffered".
0110 
0111 unevaluatedProperties: false
0112 
0113 required:
0114   - compatible
0115   - reg
0116 
0117 anyOf:
0118   - required: [record-size]
0119   - required: [console-size]
0120   - required: [ftrace-size]
0121   - required: [pmsg-size]
0122 
0123 examples:
0124   - |
0125     / {
0126         compatible = "foo";
0127         model = "foo";
0128         #address-cells = <1>;
0129         #size-cells = <1>;
0130 
0131         reserved-memory {
0132             #address-cells = <1>;
0133             #size-cells = <1>;
0134             ranges;
0135 
0136             ramoops@bfdf0000 {
0137                 compatible = "ramoops";
0138                 reg = <0xbfdf0000 0x10000>; /* 64kB */
0139                 console-size = <0x8000>;    /* 32kB */
0140                 record-size = <0x400>;      /*  1kB */
0141                 ecc-size = <16>;
0142             };
0143         };
0144     };