18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 28cc087a1SEmmanuel Vadot%YAML 1.2 38cc087a1SEmmanuel Vadot--- 4*fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/reserved-memory/ramoops.yaml# 5*fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 68cc087a1SEmmanuel Vadot 78cc087a1SEmmanuel Vadottitle: Ramoops oops/panic logger 88cc087a1SEmmanuel Vadot 98cc087a1SEmmanuel Vadotdescription: | 108cc087a1SEmmanuel Vadot ramoops provides persistent RAM storage for oops and panics, so they can be 118cc087a1SEmmanuel Vadot recovered after a reboot. This is a child-node of "/reserved-memory", and 128cc087a1SEmmanuel Vadot is named "ramoops" after the backend, rather than "pstore" which is the 138cc087a1SEmmanuel Vadot subsystem. 148cc087a1SEmmanuel Vadot 158cc087a1SEmmanuel Vadot Parts of this storage may be set aside for other persistent log buffers, such 168cc087a1SEmmanuel Vadot as kernel log messages, or for optional ECC error-correction data. The total 178cc087a1SEmmanuel Vadot size of these optional buffers must fit in the reserved region. 188cc087a1SEmmanuel Vadot 198cc087a1SEmmanuel Vadot Any remaining space will be used for a circular buffer of oops and panic 208cc087a1SEmmanuel Vadot records. These records have a configurable size, with a size of 0 indicating 218cc087a1SEmmanuel Vadot that they should be disabled. 228cc087a1SEmmanuel Vadot 238cc087a1SEmmanuel Vadot At least one of "record-size", "console-size", "ftrace-size", or "pmsg-size" 248cc087a1SEmmanuel Vadot must be set non-zero, but are otherwise optional as listed below. 258cc087a1SEmmanuel Vadot 268cc087a1SEmmanuel Vadotmaintainers: 278cc087a1SEmmanuel Vadot - Kees Cook <keescook@chromium.org> 288cc087a1SEmmanuel Vadot 298cc087a1SEmmanuel VadotallOf: 30*fac71e4eSEmmanuel Vadot - $ref: reserved-memory.yaml 318cc087a1SEmmanuel Vadot 328cc087a1SEmmanuel Vadotproperties: 338cc087a1SEmmanuel Vadot compatible: 348cc087a1SEmmanuel Vadot const: ramoops 358cc087a1SEmmanuel Vadot 368cc087a1SEmmanuel Vadot reg: 378cc087a1SEmmanuel Vadot description: region of memory that is preserved between reboots 388cc087a1SEmmanuel Vadot 398cc087a1SEmmanuel Vadot ecc-size: 408cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 418cc087a1SEmmanuel Vadot description: enables ECC support and specifies ECC buffer size in bytes 428cc087a1SEmmanuel Vadot default: 0 # no ECC 438cc087a1SEmmanuel Vadot 448cc087a1SEmmanuel Vadot record-size: 458cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 468cc087a1SEmmanuel Vadot description: maximum size in bytes of each kmsg dump 478cc087a1SEmmanuel Vadot default: 0 488cc087a1SEmmanuel Vadot 498cc087a1SEmmanuel Vadot console-size: 508cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 518cc087a1SEmmanuel Vadot description: size in bytes of log buffer reserved for kernel messages 528cc087a1SEmmanuel Vadot default: 0 538cc087a1SEmmanuel Vadot 548cc087a1SEmmanuel Vadot ftrace-size: 558cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 568cc087a1SEmmanuel Vadot description: size in bytes of log buffer reserved for function tracing and profiling 578cc087a1SEmmanuel Vadot default: 0 588cc087a1SEmmanuel Vadot 598cc087a1SEmmanuel Vadot pmsg-size: 608cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 618cc087a1SEmmanuel Vadot description: size in bytes of log buffer reserved for userspace messages 628cc087a1SEmmanuel Vadot default: 0 638cc087a1SEmmanuel Vadot 648cc087a1SEmmanuel Vadot mem-type: 658cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 668cc087a1SEmmanuel Vadot description: if present, sets the type of mapping is to be used to map the reserved region. 678cc087a1SEmmanuel Vadot default: 0 688cc087a1SEmmanuel Vadot oneOf: 698cc087a1SEmmanuel Vadot - const: 0 708cc087a1SEmmanuel Vadot description: write-combined 718cc087a1SEmmanuel Vadot - const: 1 728cc087a1SEmmanuel Vadot description: unbuffered 738cc087a1SEmmanuel Vadot - const: 2 748cc087a1SEmmanuel Vadot description: cached 758cc087a1SEmmanuel Vadot 768cc087a1SEmmanuel Vadot max-reason: 778cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 788cc087a1SEmmanuel Vadot default: 2 # log oopses and panics 798cc087a1SEmmanuel Vadot maximum: 0x7fffffff 808cc087a1SEmmanuel Vadot description: | 818cc087a1SEmmanuel Vadot If present, sets maximum type of kmsg dump reasons to store. 828cc087a1SEmmanuel Vadot This can be set to INT_MAX to store all kmsg dumps. 838cc087a1SEmmanuel Vadot See include/linux/kmsg_dump.h KMSG_DUMP_* for other kmsg dump reason values. 848cc087a1SEmmanuel Vadot Setting this to 0 (KMSG_DUMP_UNDEF), means the reason filtering will be 858cc087a1SEmmanuel Vadot controlled by the printk.always_kmsg_dump boot param. 868cc087a1SEmmanuel Vadot If unset, it will be 2 (KMSG_DUMP_OOPS), otherwise 5 (KMSG_DUMP_MAX). 878cc087a1SEmmanuel Vadot 888cc087a1SEmmanuel Vadot flags: 898cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 908cc087a1SEmmanuel Vadot default: 0 918cc087a1SEmmanuel Vadot description: | 928cc087a1SEmmanuel Vadot If present, pass ramoops behavioral flags 938cc087a1SEmmanuel Vadot (see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values). 948cc087a1SEmmanuel Vadot 958cc087a1SEmmanuel Vadot no-dump-oops: 968cc087a1SEmmanuel Vadot deprecated: true 978cc087a1SEmmanuel Vadot type: boolean 988cc087a1SEmmanuel Vadot description: | 998cc087a1SEmmanuel Vadot Use max_reason instead. If present, and max_reason is not specified, 1008cc087a1SEmmanuel Vadot it is equivalent to max_reason = 1 (KMSG_DUMP_PANIC). 1018cc087a1SEmmanuel Vadot 1028cc087a1SEmmanuel Vadot unbuffered: 1038cc087a1SEmmanuel Vadot deprecated: true 1048cc087a1SEmmanuel Vadot type: boolean 1058cc087a1SEmmanuel Vadot description: | 1068cc087a1SEmmanuel Vadot Use mem_type instead. If present, and mem_type is not specified, 1078cc087a1SEmmanuel Vadot it is equivalent to mem_type = 1 and uses unbuffered mappings to map 1088cc087a1SEmmanuel Vadot the reserved region (defaults to buffered mappings mem_type = 0). 1098cc087a1SEmmanuel Vadot If both are specified -- "mem_type" overrides "unbuffered". 1108cc087a1SEmmanuel Vadot 1118cc087a1SEmmanuel VadotunevaluatedProperties: false 1128cc087a1SEmmanuel Vadot 1138cc087a1SEmmanuel Vadotrequired: 1148cc087a1SEmmanuel Vadot - compatible 1158cc087a1SEmmanuel Vadot - reg 1168cc087a1SEmmanuel Vadot 1178cc087a1SEmmanuel VadotanyOf: 1188cc087a1SEmmanuel Vadot - required: [record-size] 1198cc087a1SEmmanuel Vadot - required: [console-size] 1208cc087a1SEmmanuel Vadot - required: [ftrace-size] 1218cc087a1SEmmanuel Vadot - required: [pmsg-size] 1228cc087a1SEmmanuel Vadot 1238cc087a1SEmmanuel Vadotexamples: 1248cc087a1SEmmanuel Vadot - | 1258cc087a1SEmmanuel Vadot / { 1268cc087a1SEmmanuel Vadot compatible = "foo"; 1278cc087a1SEmmanuel Vadot model = "foo"; 1288cc087a1SEmmanuel Vadot #address-cells = <1>; 1298cc087a1SEmmanuel Vadot #size-cells = <1>; 1308cc087a1SEmmanuel Vadot 1318cc087a1SEmmanuel Vadot reserved-memory { 1328cc087a1SEmmanuel Vadot #address-cells = <1>; 1338cc087a1SEmmanuel Vadot #size-cells = <1>; 1348cc087a1SEmmanuel Vadot ranges; 1358cc087a1SEmmanuel Vadot 1368cc087a1SEmmanuel Vadot ramoops@bfdf0000 { 1378cc087a1SEmmanuel Vadot compatible = "ramoops"; 1388cc087a1SEmmanuel Vadot reg = <0xbfdf0000 0x10000>; /* 64kB */ 1398cc087a1SEmmanuel Vadot console-size = <0x8000>; /* 32kB */ 1408cc087a1SEmmanuel Vadot record-size = <0x400>; /* 1kB */ 1418cc087a1SEmmanuel Vadot ecc-size = <16>; 1428cc087a1SEmmanuel Vadot }; 1438cc087a1SEmmanuel Vadot }; 1448cc087a1SEmmanuel Vadot }; 145