xref: /openbmc/linux/drivers/gpu/drm/etnaviv/etnaviv_dump.h (revision a8c21a5451d831e67b7a6fb910f9ca8bc7b43554)
1*a8c21a54SThe etnaviv authors /*
2*a8c21a54SThe etnaviv authors  * Copyright (C) 2015 Etnaviv Project
3*a8c21a54SThe etnaviv authors  *
4*a8c21a54SThe etnaviv authors  * This program is free software; you can redistribute it and/or modify it
5*a8c21a54SThe etnaviv authors  * under the terms of the GNU General Public License version 2 as published by
6*a8c21a54SThe etnaviv authors  * the Free Software Foundation.
7*a8c21a54SThe etnaviv authors  *
8*a8c21a54SThe etnaviv authors  * This program is distributed in the hope that it will be useful, but WITHOUT
9*a8c21a54SThe etnaviv authors  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10*a8c21a54SThe etnaviv authors  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11*a8c21a54SThe etnaviv authors  * more details.
12*a8c21a54SThe etnaviv authors  *
13*a8c21a54SThe etnaviv authors  * You should have received a copy of the GNU General Public License along with
14*a8c21a54SThe etnaviv authors  * this program.  If not, see <http://www.gnu.org/licenses/>.
15*a8c21a54SThe etnaviv authors  *
16*a8c21a54SThe etnaviv authors  * Etnaviv devcoredump file definitions
17*a8c21a54SThe etnaviv authors  */
18*a8c21a54SThe etnaviv authors #ifndef ETNAVIV_DUMP_H
19*a8c21a54SThe etnaviv authors #define ETNAVIV_DUMP_H
20*a8c21a54SThe etnaviv authors 
21*a8c21a54SThe etnaviv authors #include <linux/types.h>
22*a8c21a54SThe etnaviv authors 
23*a8c21a54SThe etnaviv authors enum {
24*a8c21a54SThe etnaviv authors 	ETDUMP_MAGIC = 0x414e5445,
25*a8c21a54SThe etnaviv authors 	ETDUMP_BUF_REG = 0,
26*a8c21a54SThe etnaviv authors 	ETDUMP_BUF_MMU,
27*a8c21a54SThe etnaviv authors 	ETDUMP_BUF_RING,
28*a8c21a54SThe etnaviv authors 	ETDUMP_BUF_CMD,
29*a8c21a54SThe etnaviv authors 	ETDUMP_BUF_BOMAP,
30*a8c21a54SThe etnaviv authors 	ETDUMP_BUF_BO,
31*a8c21a54SThe etnaviv authors 	ETDUMP_BUF_END,
32*a8c21a54SThe etnaviv authors };
33*a8c21a54SThe etnaviv authors 
34*a8c21a54SThe etnaviv authors struct etnaviv_dump_object_header {
35*a8c21a54SThe etnaviv authors 	__le32 magic;
36*a8c21a54SThe etnaviv authors 	__le32 type;
37*a8c21a54SThe etnaviv authors 	__le32 file_offset;
38*a8c21a54SThe etnaviv authors 	__le32 file_size;
39*a8c21a54SThe etnaviv authors 	__le64 iova;
40*a8c21a54SThe etnaviv authors 	__le32 data[2];
41*a8c21a54SThe etnaviv authors };
42*a8c21a54SThe etnaviv authors 
43*a8c21a54SThe etnaviv authors /* Registers object, an array of these */
44*a8c21a54SThe etnaviv authors struct etnaviv_dump_registers {
45*a8c21a54SThe etnaviv authors 	__le32 reg;
46*a8c21a54SThe etnaviv authors 	__le32 value;
47*a8c21a54SThe etnaviv authors };
48*a8c21a54SThe etnaviv authors 
49*a8c21a54SThe etnaviv authors #ifdef __KERNEL__
50*a8c21a54SThe etnaviv authors struct etnaviv_gpu;
51*a8c21a54SThe etnaviv authors void etnaviv_core_dump(struct etnaviv_gpu *gpu);
52*a8c21a54SThe etnaviv authors #endif
53*a8c21a54SThe etnaviv authors 
54*a8c21a54SThe etnaviv authors #endif
55