From d3833a7010817f82bff373e26d146e6401c695f4 Mon Sep 17 00:00:00 2001 From: Hari Bathini Date: Wed, 11 Sep 2019 20:18:40 +0530 Subject: powerpc/fadump: introduce callbacks for platform specific operations Introduce callback functions for platform specific operations like register, unregister, invalidate & such. Also, define place-holders for the same on pSeries platform. Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/156821330286.5656.15538934400074110770.stgit@hbathini.in.ibm.com --- arch/powerpc/include/asm/fadump-internal.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'arch/powerpc/include/asm/fadump-internal.h') diff --git a/arch/powerpc/include/asm/fadump-internal.h b/arch/powerpc/include/asm/fadump-internal.h index f8097510e03f..8ecd23421b6c 100644 --- a/arch/powerpc/include/asm/fadump-internal.h +++ b/arch/powerpc/include/asm/fadump-internal.h @@ -77,6 +77,9 @@ struct fad_crash_memory_ranges { unsigned long long size; }; +/* Platform specific callback functions */ +struct fadump_ops; + /* Firmware-assisted dump configuration details. */ struct fw_dump { unsigned long reserve_dump_area_start; @@ -99,6 +102,20 @@ struct fw_dump { unsigned long dump_active:1; unsigned long dump_registered:1; unsigned long nocma:1; + + struct fadump_ops *ops; +}; + +struct fadump_ops { + u64 (*fadump_init_mem_struct)(struct fw_dump *fadump_conf); + int (*fadump_register)(struct fw_dump *fadump_conf); + int (*fadump_unregister)(struct fw_dump *fadump_conf); + int (*fadump_invalidate)(struct fw_dump *fadump_conf); + int (*fadump_process)(struct fw_dump *fadump_conf); + void (*fadump_region_show)(struct fw_dump *fadump_conf, + struct seq_file *m); + void (*fadump_trigger)(struct fadump_crash_info_header *fdh, + const char *msg); }; /* Helper functions */ @@ -109,4 +126,11 @@ void fadump_update_elfcore_header(char *bufp); bool is_fadump_boot_mem_contiguous(void); bool is_fadump_reserved_mem_contiguous(void); +#ifdef CONFIG_PPC_PSERIES +extern void rtas_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node); +#else +static inline void +rtas_fadump_dt_scan(struct fw_dump *fadump_conf, u64 node) { } +#endif + #endif /* _ASM_POWERPC_FADUMP_INTERNAL_H */ -- cgit v1.2.3