[RAMEN9610-20413][9610] wlbt: SCSC Driver version 10.6.1.0
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / drivers / misc / samsung / scsc / mxconf.h
1 /****************************************************************************
2 *
3 * Copyright (c) 2014 - 2016 Samsung Electronics Co., Ltd. All rights reserved
4 *
5 ****************************************************************************/
6
7 /**
8 * mx140 Infrastructure Configuration Structure.
9 *
10 * Used to pass configuration data from AP to R4 infrastructure
11 * on Maxwell Subsystem startup.
12 *
13 * Notes:
14 *
15 * - All multi-octet integers shall be stored LittleEndian.
16 *
17 * - All location fields ("*_loc") are 32 bit octet offsets w.r.t. the R4
18 * address map. They can therefore refer to DRAM memory or Mailbox registers.
19 *
20 * - "typedefs" are avoided to allow inclusion in linux source code.
21 */
22 #ifndef MXCONF_H__
23 #define MXCONF_H__
24
25 /* Uses */
26
27 /* It appears that due to the previous syntax "__packed struct foo" used in this
28 * header, the structures here don't actually get packed. Clang warns that
29 * that syntax is ignored. But correcting it causes a misalignment with FW.
30 * The __MXPACKED macro is used to stop packing the structures in this
31 * header until we've investigated further.
32 */
33 #define __MXPACKED /* TODO: HACK - don't actually pack! */
34
35 /* Definitions */
36
37 /**
38 * Config structure magic number.
39 *
40 * The AP writes this value and the R4 checks it to trap endian mismatches.
41 */
42 #define MXCONF_MAGIC 0x79828486
43
44 /**
45 * Config structure version
46 *
47 * The AP writes these values and the R4 checks them to trap config structure
48 * mismatches.
49 */
50 #define MXCONF_VERSION_MAJOR 0
51 #define MXCONF_VERSION_MINOR 5 /* For fleximac moredump */
52
53 /* Types */
54
55 /**
56 * Maxwell Circular Packet Buffer Configuration.
57 */
58 struct mxcbufconf {
59 scsc_mifram_ref buffer_loc; /**< Location of allocated buffer in DRAM */
60 uint32_t num_packets; /**< Total number of packets that can be stored in the buffer */
61 uint32_t packet_size; /**< Size of each individual packet within the buffer */
62 scsc_mifram_ref read_index_loc; /**< Location of 32bit read index in DRAM or Mailbox */
63 scsc_mifram_ref write_index_loc; /**< Location of 32bit write index */
64 } __MXPACKED;
65
66 /**
67 * Maxwell Management Simplex Stream Configuration
68 *
69 * A circular buffer plus a pair of R/W signaling bits.
70 */
71 struct mxstreamconf {
72 /** Circular Packet Buffer configuration */
73 struct mxcbufconf buf_conf;
74
75 /** Allocated MIF Interrupt Read Bit Index */
76 uint8_t read_bit_idx;
77
78 /** Allocated MIF Interrupt Write Bit Index */
79 uint8_t write_bit_idx;
80 } __MXPACKED;
81
82 /**
83 * Maxwell Management Transport Configuration
84 *
85 * A pair of simplex streams.
86 */
87 struct mxtransconf {
88 struct mxstreamconf to_ap_stream_conf;
89 struct mxstreamconf from_ap_stream_conf;
90 } __MXPACKED;
91
92 /**
93 * Maxwell Infrastructure Configuration Version
94 */
95 struct mxconfversion {
96 uint16_t major;
97 uint16_t minor;
98 } __MXPACKED;
99
100 /**
101 * Mxlog Event Buffer Configuration.
102 *
103 * A circular buffer. Size must be a multiple of 2.
104 */
105 struct mxlogconf
106 {
107 struct mxstreamconf stream_conf;
108 } __MXPACKED;
109
110
111 /**
112 * Maxwell Infrastructure Configuration Override (HCF block)
113 */
114 struct mxmibref {
115 uint32_t offset;
116 uint32_t size;
117 } __MXPACKED;
118
119
120 /**
121 * Maxwell Infrastructure Configuration
122 */
123 struct mxconf {
124 /**
125 * Config Magic Number
126 *
127 * Always 1st field in config.
128 */
129 uint32_t magic;
130
131 /**
132 * Config Version.
133 *
134 * Always second field in config.
135 */
136 struct mxconfversion version;
137
138 /**
139 * MX Management Message Transport Configuration.
140 */
141 struct mxtransconf mx_trans_conf;
142
143 /**
144 * MX Management GDB Message Transport Configuration.
145 */
146 /* Cortex-R4 channel */
147 struct mxtransconf mx_trans_conf_gdb_r4;
148 /* Cortex-M4 channel */
149 struct mxtransconf mx_trans_conf_gdb_m4;
150
151 /**
152 * Mxlog Event Buffer Configuration.
153 */
154 struct mxlogconf mxlogconf;
155
156 /* FROM MINOR_2 */
157
158 /**
159 * SOC HW revision override from host
160 */
161 uint32_t soc_revision;
162
163 /* FROM MINOR_3 */
164
165 /**
166 * Setup flags
167 */
168 #define MXCONF_FLAGS_FM_ON (BIT(0)) /* FM already on */
169 uint32_t flags;
170
171 /* FROM MINOR_4 */
172
173 /**
174 * Common HCF offset
175 */
176 struct mxmibref fwconfig;
177
178 /* FROM MINOR_5 */
179
180 /* Fleximac Cortex-M3_1 piggy back as M4 channel.
181 * (Driver must initialise from-ap buffer address to 0
182 * if channel is not in use).
183 */
184 struct mxtransconf mx_trans_conf_gdb_m4_1;
185
186 } __MXPACKED;
187
188 #endif /* MXCONF_H__ */