drivers: soc: Add devcoredump based ramdump APIs

Introduce elf/non-elf dump APIs using devcoredump. These APIs
can be utilized by kernel clients to dump their memory regions
independently.

Change-Id: If4f5bcc0d4954b6f47a6893668d6a2a857bb0057
Signed-off-by: Rishabh Bhatnagar <[email protected]>
This commit is contained in:
Rishabh Bhatnagar 2020-03-23 15:30:01 -07:00
commit 11af58274d
2 changed files with 177 additions and 2 deletions

View file

@ -1,10 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2011-2014, 2017-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2014, 2017-2020, The Linux Foundation. All rights reserved.
*/
#ifndef _RAMDUMP_HEADER
#define _RAMDUMP_HEADER
#include <linux/kernel.h>
#include <linux/firmware.h>
#include <linux/devcoredump.h>
#include <linux/soc/qcom/mdt_loader.h>
struct device;
@ -15,6 +19,17 @@ struct ramdump_segment {
unsigned long size;
};
struct qcom_dump_segment {
struct list_head node;
dma_addr_t da;
void *va;
size_t size;
};
extern int do_elf_dump(struct list_head *segs, struct device *dev);
extern int do_dump(struct list_head *head, struct device *dev);
extern int do_fw_elf_dump(struct firmware *fw, struct device *dev);
#if IS_ENABLED(CONFIG_MSM_SUBSYSTEM_RESTART)
extern void *create_ramdump_device(const char *dev_name, struct device *parent);
extern void destroy_ramdump_device(void *dev);