dhd: rename 100.10.315.x to 100.10.545.x
[GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_dhd-driver.git] / bcmdhd.100.10.545.x / include / hnd_debug.h
1 /*
2 * HND Run Time Environment debug info area
3 *
4 * Copyright (C) 1999-2019, Broadcom.
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 *
25 * <<Broadcom-WL-IPTag/Open:>>
26 *
27 * $Id: hnd_debug.h 726313 2017-10-12 06:07:22Z $
28 */
29
30 #ifndef _HND_DEBUG_H
31 #define _HND_DEBUG_H
32
33 /* Magic number at a magic location to find HND_DEBUG pointers */
34 #define HND_DEBUG_PTR_PTR_MAGIC 0x50504244 /* DBPP */
35
36 /* Magic number at a magic location to find RAM size */
37 #define HND_RAMSIZE_PTR_MAGIC 0x534d4152 /* RAMS */
38
39 #ifndef _LANGUAGE_ASSEMBLY
40
41 /* Includes only when building dongle code */
42
43 /* We use explicit sizes here since this gets included from different
44 * systems. The sizes must be the size of the creating system
45 * (currently 32 bit ARM) since this is gleaned from dump.
46 */
47
48 #ifdef FWID
49 extern uint32 gFWID;
50 #endif // endif
51
52 /* Define pointers for use on other systems */
53 #define _HD_EVLOG_P uint32
54 #define _HD_CONS_P uint32
55 #define _HD_TRAP_P uint32
56
57 /* This struct is placed at a well-defined location, and contains a pointer to hnd_debug. */
58 typedef struct hnd_debug_ptr {
59 uint32 magic;
60
61 /* RAM address of 'hnd_debug'. For legacy versions of this struct, it is a 0-indexed
62 * offset instead.
63 */
64 uint32 hnd_debug_addr;
65
66 /* Base address of RAM. This field does not exist for legacy versions of this struct. */
67 uint32 ram_base_addr;
68
69 } hnd_debug_ptr_t;
70
71 /* This struct is placed at a well-defined location. */
72 typedef struct hnd_ramsize_ptr {
73 uint32 magic; /* 'RAMS' */
74
75 /* RAM size information. */
76 uint32 ram_size;
77 } hnd_ramsize_ptr_t;
78
79 #define HND_DEBUG_EPIVERS_MAX_STR_LEN 32
80 #define HND_DEBUG_BUILD_SIGNATURE_FWID_LEN 17
81 #define HND_DEBUG_BUILD_SIGNATURE_VER_LEN 22
82 typedef struct hnd_debug {
83 uint32 magic;
84 #define HND_DEBUG_MAGIC 0x47424544 /* 'DEBG' */
85
86 uint32 version; /* Debug struct version */
87 #define HND_DEBUG_VERSION 1
88
89 uint32 fwid; /* 4 bytes of fw info */
90 char epivers[HND_DEBUG_EPIVERS_MAX_STR_LEN];
91
92 _HD_TRAP_P trap_ptr; /* trap_t data struct */
93 _HD_CONS_P console; /* Console */
94
95 uint32 ram_base;
96 uint32 ram_size;
97
98 uint32 rom_base;
99 uint32 rom_size;
100
101 _HD_EVLOG_P event_log_top;
102
103 /* To populated fields below,
104 * INCLUDE_BUILD_SIGNATURE_IN_SOCRAM needs to be enabled
105 */
106 char fwid_signature[HND_DEBUG_BUILD_SIGNATURE_FWID_LEN]; /* fwid=<FWID> */
107 char ver_signature[HND_DEBUG_BUILD_SIGNATURE_VER_LEN]; /* ver=abc.abc.abc.abc */
108
109 } hnd_debug_t;
110
111 /*
112 * timeval_t and prstatus_t are copies of the Linux structures.
113 * Included here because we need the definitions for the target processor
114 * (32 bits) and not the definition on the host this is running on
115 * (which could be 64 bits).
116 */
117
118 typedef struct { /* Time value with microsecond resolution */
119 uint32 tv_sec; /* Seconds */
120 uint32 tv_usec; /* Microseconds */
121 } timeval_t;
122
123 /* Linux/ARM 32 prstatus for notes section */
124 typedef struct prstatus {
125 int32 si_signo; /* Signal number */
126 int32 si_code; /* Extra code */
127 int32 si_errno; /* Errno */
128 uint16 pr_cursig; /* Current signal. */
129 uint16 unused;
130 uint32 pr_sigpend; /* Set of pending signals. */
131 uint32 pr_sighold; /* Set of held signals. */
132 uint32 pr_pid;
133 uint32 pr_ppid;
134 uint32 pr_pgrp;
135 uint32 pr_sid;
136 timeval_t pr_utime; /* User time. */
137 timeval_t pr_stime; /* System time. */
138 timeval_t pr_cutime; /* Cumulative user time. */
139 timeval_t pr_cstime; /* Cumulative system time. */
140 uint32 uregs[18];
141 int32 pr_fpvalid; /* True if math copro being used. */
142 } prstatus_t;
143
144 /* for mkcore and other utilities use */
145 #define DUMP_INFO_PTR_PTR_0 0x74
146 #define DUMP_INFO_PTR_PTR_1 0x78
147 #define DUMP_INFO_PTR_PTR_2 0xf0
148 #define DUMP_INFO_PTR_PTR_3 0xf8
149 #define DUMP_INFO_PTR_PTR_4 0x874
150 #define DUMP_INFO_PTR_PTR_5 0x878
151 #define DUMP_INFO_PTR_PTR_END 0xffffffff
152 #define DUMP_INFO_PTR_PTR_LIST DUMP_INFO_PTR_PTR_0, \
153 DUMP_INFO_PTR_PTR_1, \
154 DUMP_INFO_PTR_PTR_2, \
155 DUMP_INFO_PTR_PTR_3, \
156 DUMP_INFO_PTR_PTR_4, \
157 DUMP_INFO_PTR_PTR_5, \
158 DUMP_INFO_PTR_PTR_END
159
160 /* for DHD driver to get dongle ram size info. */
161 #define RAMSIZE_PTR_PTR_0 0x6c
162 #define RAMSIZE_PTR_PTR_END 0xffffffff
163 #define RAMSIZE_PTR_PTR_LIST RAMSIZE_PTR_PTR_0, \
164 RAMSIZE_PTR_PTR_END
165
166 #endif /* !LANGUAGE_ASSEMBLY */
167
168 #endif /* _HND_DEBUG_H */