[v5,09/18] fadump: Define FADUMP structure

Message ID 20180816085721.11703-10-hegdevasant@linux.vnet.ibm.com
State New
Headers show
Series
  • MPIPL support
Related show

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Vasant Hegde Aug. 16, 2018, 8:57 a.m.
This structure is shared between OPAL and payload. During fadump registration
payload will use this structure to pass kernel memory reservation details to
OPAL. OPAL will use this structure to fill MDST, MDDT table. After fadump,
OPAL uses MDRT table to fill this structure and passes this to payload via
device tree.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 include/opal-api.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Patch

diff --git a/include/opal-api.h b/include/opal-api.h
index 5f397c8e6..91c787ce9 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -1314,6 +1314,36 @@  enum {
 	OPAL_PCI_P2P_TARGET	= 1,
 };
 
+/*
+ * FADUMP memory region ID usable by kernel
+ * 0x80 - 0xff -> Payload
+ */
+#define FADUMP_REGION_HOST_START	0x80
+#define FADUMP_REGION_HOST_END		0xff
+
+/*
+ * fadump section details. This structure is shared between OPAL and payload.
+ * During fadump registration payload will use this structure to pass kernel
+ * memory reservation details to OPAL. OPAL will use this structure to fill
+ * MDST, MDDT table. After fadump, OPAL uses MDRT table to fill this structure.
+ * And passes this to payload via device tree.
+ */
+struct fadump_section {
+	u8	source_type;	/* FADUMP_REGION_* */
+	u8	reserved[7];
+	u64	source_addr;
+	u64	source_size;
+	u64	dest_addr;
+	u64	dest_size;
+} __packed;
+
+struct fadump {
+	u16	fadump_section_size;	/* sizeof(struct fadump_section) */
+	u16	section_count;
+	u32	reserved;
+	struct	fadump_section section[];
+};
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __OPAL_API_H */