[RAMEN9610-20413][9610] wlbt: SCSC Driver version 10.6.1.0
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / drivers / misc / samsung / scsc / mx_dbg_sampler.h
1 /****************************************************************************
2 *
3 * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd. All rights reserved
4 *
5 ****************************************************************************/
6
7 #ifndef __MX_DBG_SAMPLER_H__
8 #define __MX_DBG_SAMPLER_H__
9
10
11 /**
12 * Debug Sampler DRAM Buffer descriptor.
13 *
14 * Initialised by Debug Sampler Driver on AP and passed by
15 * reference to Debug Sampler (Proxy) on R4 (by reference in
16 * WLAN config).
17 *
18 * Integer fields are LittleEndian.
19 */
20 struct debug_sampler_buffer_info {
21 /**
22 * Offset of circular octet buffer w.r.t. shared dram start
23 */
24 uint32_t buf_offset;
25
26 /**
27 * Circular buffer length (octets, 2^n)
28 *
29 * Default = 32KiB default
30 */
31 uint32_t buf_len;
32
33 /**
34 * Offset of 32bit write index (not wrapped, counts octets) w.r.t. shared dram start
35 */
36 uint32_t write_index_offset;
37
38 /**
39 * To AP interrupt number (0 – 15)
40 */
41 uint32_t intr_num;
42 };
43
44 struct debug_sampler_sample_spec {
45 /**
46 * -relative address of Location to sample (usually a register)
47 *
48 * Default = 0x00000000
49 */
50 uint32_t source_addr;
51
52 /**
53 * Number of significant octets (1,2 or 4) to log (lsbytes from source)
54 *
55 * Default = 4
56 */
57 uint32_t num_bytes;
58
59 /**
60 * Sampling period.
61 *
62 * 0 means as fast as possible (powers of 2 only)
63 *
64 * Default = 0
65 */
66 uint32_t period_usecs;
67 };
68
69
70 /**
71 * Debug Sampler Config Structure.
72 *
73 * This structure is allocated and initialised by the Debug Sampler driver
74 * on the AP and passed via the service_start message.
75 */
76 struct debug_sampler_config {
77 /**
78 * Config Structure Version (= DBGSAMPLER_CONFIG_VERSION)
79 *
80 * Set by driver, checked by service.
81 */
82 uint32_t version;
83
84 /**
85 * To-host circular buffer desciptor.
86 */
87 struct debug_sampler_buffer_info buffer_info;
88
89 /**
90 * Init/default sampling specification.
91 *
92 * (There is also an API on R4 to allow dynamic specification
93 * change - e.g. by WLAN service)
94 */
95 struct debug_sampler_sample_spec sample_spec;
96
97 /**
98 * Start/stop sampling when service is started/stopped?
99 *
100 * (There is also an API on R4 to allow dynamic start/stop
101 * - e.g. by WLAN service)
102 *
103 * Default = 0
104 */
105 uint32_t auto_start;
106 };
107
108 struct debug_sampler_align {
109
110 struct debug_sampler_config config __aligned(4);
111
112 u32 index;
113
114 void *mem __aligned(64);
115
116 };
117
118
119 #endif /* __MX_DBG_SAMPLER_H__ */
120
121