1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Firmware-Assisted Dump support on POWER platform (OPAL).
4  *
5  * Copyright 2019, Hari Bathini, IBM Corporation.
6  */
7 
8 #ifndef _POWERNV_OPAL_FADUMP_H
9 #define _POWERNV_OPAL_FADUMP_H
10 
11 /*
12  * OPAL FADump metadata structure format version
13  *
14  * OPAL FADump kernel metadata structure stores kernel metadata needed to
15  * register-for/process crash dump. Format version is used to keep a tab on
16  * the changes in the structure format. The changes, if any, to the format
17  * are expected to be minimal and backward compatible.
18  */
19 #define OPAL_FADUMP_VERSION			0x1
20 
21 /* Maximum number of memory regions kernel supports */
22 #define OPAL_FADUMP_MAX_MEM_REGS		128
23 
24 /*
25  * OPAL FADump kernel metadata
26  *
27  * The address of this structure will be registered with f/w for retrieving
28  * and processing during crash dump.
29  */
30 struct opal_fadump_mem_struct {
31 	u8	version;
32 	u8	reserved[3];
33 	u16	region_cnt;		/* number of regions */
34 	u16	registered_regions;	/* Regions registered for MPIPL */
35 	u64	fadumphdr_addr;
36 	struct opal_mpipl_region	rgn[OPAL_FADUMP_MAX_MEM_REGS];
37 } __packed;
38 
39 #endif /* _POWERNV_OPAL_FADUMP_H */
40