-
Notifications
You must be signed in to change notification settings - Fork 0
/
nt36xxx_mem_map.h
209 lines (201 loc) · 7.42 KB
/
nt36xxx_mem_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
* Copyright (C) 2010 - 2017 Novatek, Inc.
* Copyright (C) 2018 XiaoMi, Inc.
*
* $Revision: 20544 $
* $Date: 2017-12-20 11:08:15 +0800 (週三, 20 十二月 2017) $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
struct nvt_ts_mem_map {
uint32_t EVENT_BUF_ADDR;
uint32_t RAW_PIPE0_ADDR;
uint32_t RAW_PIPE0_Q_ADDR;
uint32_t RAW_PIPE1_ADDR;
uint32_t RAW_PIPE1_Q_ADDR;
uint32_t BASELINE_ADDR;
uint32_t BASELINE_Q_ADDR;
uint32_t BASELINE_BTN_ADDR;
uint32_t BASELINE_BTN_Q_ADDR;
uint32_t DIFF_PIPE0_ADDR;
uint32_t DIFF_PIPE0_Q_ADDR;
uint32_t DIFF_PIPE1_ADDR;
uint32_t DIFF_PIPE1_Q_ADDR;
uint32_t RAW_BTN_PIPE0_ADDR;
uint32_t RAW_BTN_PIPE0_Q_ADDR;
uint32_t RAW_BTN_PIPE1_ADDR;
uint32_t RAW_BTN_PIPE1_Q_ADDR;
uint32_t DIFF_BTN_PIPE0_ADDR;
uint32_t DIFF_BTN_PIPE0_Q_ADDR;
uint32_t DIFF_BTN_PIPE1_ADDR;
uint32_t DIFF_BTN_PIPE1_Q_ADDR;
uint32_t READ_FLASH_CHECKSUM_ADDR;
uint32_t RW_FLASH_DATA_ADDR;
};
static const struct nvt_ts_mem_map NT36672A_memory_map = {
.EVENT_BUF_ADDR = 0x21C00,
.RAW_PIPE0_ADDR = 0x20000,
.RAW_PIPE0_Q_ADDR = 0,
.RAW_PIPE1_ADDR = 0x23000,
.RAW_PIPE1_Q_ADDR = 0,
.BASELINE_ADDR = 0x20BFC,
.BASELINE_Q_ADDR = 0,
.BASELINE_BTN_ADDR = 0x23BFC,
.BASELINE_BTN_Q_ADDR = 0,
.DIFF_PIPE0_ADDR = 0x206DC,
.DIFF_PIPE0_Q_ADDR = 0,
.DIFF_PIPE1_ADDR = 0x236DC,
.DIFF_PIPE1_Q_ADDR = 0,
.RAW_BTN_PIPE0_ADDR = 0x20510,
.RAW_BTN_PIPE0_Q_ADDR = 0,
.RAW_BTN_PIPE1_ADDR = 0x23510,
.RAW_BTN_PIPE1_Q_ADDR = 0,
.DIFF_BTN_PIPE0_ADDR = 0x20BF0,
.DIFF_BTN_PIPE0_Q_ADDR = 0,
.DIFF_BTN_PIPE1_ADDR = 0x23BF0,
.DIFF_BTN_PIPE1_Q_ADDR = 0,
.READ_FLASH_CHECKSUM_ADDR = 0x24000,
.RW_FLASH_DATA_ADDR = 0x24002,
};
static const struct nvt_ts_mem_map NT36772_memory_map = {
.EVENT_BUF_ADDR = 0x11E00,
.RAW_PIPE0_ADDR = 0x10000,
.RAW_PIPE0_Q_ADDR = 0,
.RAW_PIPE1_ADDR = 0x12000,
.RAW_PIPE1_Q_ADDR = 0,
.BASELINE_ADDR = 0x10E70,
.BASELINE_Q_ADDR = 0,
.BASELINE_BTN_ADDR = 0x12E70,
.BASELINE_BTN_Q_ADDR = 0,
.DIFF_PIPE0_ADDR = 0x10830,
.DIFF_PIPE0_Q_ADDR = 0,
.DIFF_PIPE1_ADDR = 0x12830,
.DIFF_PIPE1_Q_ADDR = 0,
.RAW_BTN_PIPE0_ADDR = 0x10E60,
.RAW_BTN_PIPE0_Q_ADDR = 0,
.RAW_BTN_PIPE1_ADDR = 0x12E60,
.RAW_BTN_PIPE1_Q_ADDR = 0,
.DIFF_BTN_PIPE0_ADDR = 0x10E68,
.DIFF_BTN_PIPE0_Q_ADDR = 0,
.DIFF_BTN_PIPE1_ADDR = 0x12E68,
.DIFF_BTN_PIPE1_Q_ADDR = 0,
.READ_FLASH_CHECKSUM_ADDR = 0x14000,
.RW_FLASH_DATA_ADDR = 0x14002,
};
static const struct nvt_ts_mem_map NT36525_memory_map = {
.EVENT_BUF_ADDR = 0x11A00,
.RAW_PIPE0_ADDR = 0x10000,
.RAW_PIPE0_Q_ADDR = 0,
.RAW_PIPE1_ADDR = 0x12000,
.RAW_PIPE1_Q_ADDR = 0,
.BASELINE_ADDR = 0x10B08,
.BASELINE_Q_ADDR = 0,
.BASELINE_BTN_ADDR = 0x12B08,
.BASELINE_BTN_Q_ADDR = 0,
.DIFF_PIPE0_ADDR = 0x1064C,
.DIFF_PIPE0_Q_ADDR = 0,
.DIFF_PIPE1_ADDR = 0x1264C,
.DIFF_PIPE1_Q_ADDR = 0,
.RAW_BTN_PIPE0_ADDR = 0x10634,
.RAW_BTN_PIPE0_Q_ADDR = 0,
.RAW_BTN_PIPE1_ADDR = 0x12634,
.RAW_BTN_PIPE1_Q_ADDR = 0,
.DIFF_BTN_PIPE0_ADDR = 0x10AFC,
.DIFF_BTN_PIPE0_Q_ADDR = 0,
.DIFF_BTN_PIPE1_ADDR = 0x12AFC,
.DIFF_BTN_PIPE1_Q_ADDR = 0,
.READ_FLASH_CHECKSUM_ADDR = 0x14000,
.RW_FLASH_DATA_ADDR = 0x14002,
};
static const struct nvt_ts_mem_map NT36870_memory_map = {
.EVENT_BUF_ADDR = 0x25000,
.RAW_PIPE0_ADDR = 0x20000,
.RAW_PIPE0_Q_ADDR = 0x204C8,
.RAW_PIPE1_ADDR = 0x23000,
.RAW_PIPE1_Q_ADDR = 0x234C8,
.BASELINE_ADDR = 0x21350,
.BASELINE_Q_ADDR = 0x21818,
.BASELINE_BTN_ADDR = 0x24350,
.BASELINE_BTN_Q_ADDR = 0x24358,
.DIFF_PIPE0_ADDR = 0x209B0,
.DIFF_PIPE0_Q_ADDR = 0x20E78,
.DIFF_PIPE1_ADDR = 0x239B0,
.DIFF_PIPE1_Q_ADDR = 0x23E78,
.RAW_BTN_PIPE0_ADDR = 0x20990,
.RAW_BTN_PIPE0_Q_ADDR = 0x20998,
.RAW_BTN_PIPE1_ADDR = 0x23990,
.RAW_BTN_PIPE1_Q_ADDR = 0x23998,
.DIFF_BTN_PIPE0_ADDR = 0x21340,
.DIFF_BTN_PIPE0_Q_ADDR = 0x21348,
.DIFF_BTN_PIPE1_ADDR = 0x24340,
.DIFF_BTN_PIPE1_Q_ADDR = 0x24348,
.READ_FLASH_CHECKSUM_ADDR = 0x24000,
.RW_FLASH_DATA_ADDR = 0x24002,
};
static const struct nvt_ts_mem_map NT36676F_memory_map = {
.EVENT_BUF_ADDR = 0x11A00,
.RAW_PIPE0_ADDR = 0x10000,
.RAW_PIPE0_Q_ADDR = 0,
.RAW_PIPE1_ADDR = 0x12000,
.RAW_PIPE1_Q_ADDR = 0,
.BASELINE_ADDR = 0x10B08,
.BASELINE_Q_ADDR = 0,
.BASELINE_BTN_ADDR = 0x12B08,
.BASELINE_BTN_Q_ADDR = 0,
.DIFF_PIPE0_ADDR = 0x1064C,
.DIFF_PIPE0_Q_ADDR = 0,
.DIFF_PIPE1_ADDR = 0x1264C,
.DIFF_PIPE1_Q_ADDR = 0,
.RAW_BTN_PIPE0_ADDR = 0x10634,
.RAW_BTN_PIPE0_Q_ADDR = 0,
.RAW_BTN_PIPE1_ADDR = 0x12634,
.RAW_BTN_PIPE1_Q_ADDR = 0,
.DIFF_BTN_PIPE0_ADDR = 0x10AFC,
.DIFF_BTN_PIPE0_Q_ADDR = 0,
.DIFF_BTN_PIPE1_ADDR = 0x12AFC,
.DIFF_BTN_PIPE1_Q_ADDR = 0,
.READ_FLASH_CHECKSUM_ADDR = 0x14000,
.RW_FLASH_DATA_ADDR = 0x14002,
};
#define NVT_ID_BYTE_MAX 6
struct nvt_ts_trim_id_table {
uint8_t id[NVT_ID_BYTE_MAX];
uint8_t mask[NVT_ID_BYTE_MAX];
const struct nvt_ts_mem_map *mmap;
uint8_t carrier_system;
};
static const struct nvt_ts_trim_id_table trim_id_table[] = {
{.id = {0x0A, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {1, 0, 0, 1, 1, 1},
.mmap = &NT36672A_memory_map, .carrier_system = 0},
{.id = {0x55, 0x00, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0x55, 0x72, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xAA, 0x00, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xAA, 0x72, 0xFF, 0x00, 0x00, 0x00}, .mask = {1, 1, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x72, 0x67, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x70, 0x66, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x70, 0x67, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36772_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x25, 0x65, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36525_memory_map, .carrier_system = 0},
{.id = {0xFF, 0xFF, 0xFF, 0x70, 0x68, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36870_memory_map, .carrier_system = 1},
{.id = {0xFF, 0xFF, 0xFF, 0x76, 0x66, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
.mmap = &NT36676F_memory_map, .carrier_system = 0}
};