1 /* 2 * (C) Copyright 2020 Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #ifndef RK_MINIDUMP_H 8 #define RK_MINIDUMP_H 9 10 #include <elf.h> 11 12 #define MD_MAX_NAME_LENGTH 16 13 /* md_region - Minidump table entry 14 * @name: Entry name, Minidump will dump binary with this name. 15 * @id: Entry ID, used only for SDI dumps. 16 * @virt_addr: Address of the entry. 17 * @phys_addr: Physical address of the entry to dump. 18 * @size: Number of byte to dump from @address location 19 * it should be 4 byte aligned. 20 */ 21 struct md_region { 22 char name[MD_MAX_NAME_LENGTH]; 23 u32 id; 24 u64 virt_addr; 25 u64 phys_addr; 26 u64 size; 27 }; 28 29 void rk_minidump_init(void); 30 31 #ifdef CONFIG_ARM64 32 void rk_minidump_get_el64(void **ram_image_addr, Elf64_Xword *ram_image_size); 33 #else 34 void rk_minidump_get_el32(void **ram_image_addr, Elf32_Word *ram_image_size); 35 #endif 36 37 struct md_region *md_get_region(char *name); 38 u32 md_no_fault_handler(struct pt_regs *pt_regs, unsigned int esr); 39 #endif 40