aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/cypress-touchkey-firmware.h
blob: cdfcea487ae13552621e60dd06215c702c2e17e6 (plain)
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
210
211
212
/*
 * Copyright 2010, Cypress Semiconductor Corporation.
 * Copyright (C) 2010-2011, Samsung Electronics Co. Ltd. All Rights Reserved.
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301, USA.
 *
 */

#include <linux/types.h>

#ifndef _CYPRESS_TOUCHKEY_FIRMWARE_H__
#define _CYPRESS_TOUCHKEY_FIRMWARE_H__

struct issp_vector {
	u16 num_bits;
	u8 data[];
};

static const struct issp_vector tsync_enable = {
	.data = {
		0xDE, 0xE2, 0x1F, 0x7F, 0x02, 0x7D, 0xC4, 0x09,
		0xF7, 0x00, 0x1F, 0xDE, 0xE0, 0x1C
	},
	.num_bits = 110,
};

static const struct issp_vector tsync_disable = {
	.data = {
		0xDE, 0xE2, 0x1F, 0x71, 0x00, 0x7D, 0xFC, 0x01,
		0xF7, 0x00, 0x1F, 0xDE, 0xE0, 0x1C
	},
	.num_bits = 110,
};

static const struct issp_vector id_setup_1 = {
	.data = {
		0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x0D, 0xEE, 0x21, 0xF7, 0xF0, 0x27, 0xDC, 0x40,
		0x9F, 0x70, 0x01, 0xFD, 0xEE, 0x01, 0xE7, 0xC1,
		0xD7, 0x9F, 0x20, 0x7E, 0x7D, 0x88, 0x7D, 0xEE,
		0x21, 0xF7, 0xF0, 0x07, 0xDC, 0x40, 0x1F, 0x70,
		0x01, 0xFD, 0xEE, 0x01, 0xF7, 0xA0, 0x1F, 0xDE,
		0xA0, 0x1F, 0x7B, 0x00, 0x7D, 0xE0, 0x13, 0xF7,
		0xC0, 0x07, 0xDF, 0x28, 0x1F, 0x7D, 0x18, 0x7D,
		0xFE, 0x25, 0xC0
	},
	.num_bits = 594,
};

static const struct issp_vector set_block_num = {
	.data = {
		0x9f, 0x40, 0x1c
	},
	.num_bits = 11,
};

static const struct issp_vector read_write_setup = {
	.data = {
		0xde, 0xf0, 0x1f, 0x78, 0x00, 0x7d, 0xa0, 0x03,
		0xc0
	},
	.num_bits = 66,
};

static const struct issp_vector erase = {
	.data = {
		0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09,
		0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x85,
		0xfd, 0xfc, 0x01, 0xf7, 0x10, 0x07, 0xdc, 0x00,
		0x7f, 0x7b, 0x80, 0x7d, 0xe0, 0x0b, 0xf7, 0xa0,
		0x1f, 0xd7, 0xa0, 0x1f, 0x7b, 0x04, 0x7d, 0xf0,
		0x01, 0xf7, 0xc9, 0x87, 0xdf, 0x48, 0x1f, 0x7f,
		0x89, 0x70
	},
	.num_bits = 396,
};

static const struct issp_vector secure = {
	.data = {
		0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09,
		0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x81,
		0xf9, 0xf7, 0x01, 0xf7, 0xf0, 0x07, 0xdc, 0x40,
		0x1f, 0x70, 0x01, 0xfd, 0xee, 0x01, 0xf6, 0xa0,
		0x0f, 0xde, 0x80, 0x7f, 0x7a, 0x80, 0x7d, 0xec,
		0x01, 0xf7, 0x80, 0x27, 0xdf, 0x00, 0x1f, 0x7c,
		0xa0, 0x7d, 0xf4, 0x61, 0xf7, 0xf8, 0x97
	},
	.num_bits = 440,
};

static const struct issp_vector read_security_setup = {
	.data = {
		0xde, 0xe2, 0x1f, 0x60, 0x88, 0x7d, 0x84, 0x21,
		0xf7, 0xb8, 0x07
	},
	.num_bits = 88,
};

static const struct issp_vector read_security_pt1 = {
	.data = {
		0xde, 0xe2, 0x1f, 0x72, 0x87, 0x7d, 0xca, 0x01,
		0xf7, 0x28
	},
	.num_bits = 78,
};

static const struct issp_vector read_security_pt1_end = {
	.data = {
		0xfb, 0x94, 0x03, 0x80
	},
	.num_bits = 25,
};

static const struct issp_vector read_security_pt2 = {
	.data = {
		0xde, 0xe0, 0x1f, 0x7a, 0x01, 0xfd, 0xea, 0x01,
		0xf7, 0xb0, 0x07, 0xdf, 0x0b, 0xbf, 0x7c, 0xf2,
		0xfd, 0xf4, 0x61, 0xf7, 0xb8, 0x87, 0xdf, 0xe2,
		0x5c
	},
	.num_bits = 198,
};

static const struct issp_vector read_security_pt3 = {
	.data = {
		0xde, 0xe0, 0x1f, 0x7a, 0x01, 0xfd, 0xea, 0x01,
		0xf7, 0xb0, 0x07, 0xdf, 0x0a, 0x7f, 0x7c, 0xc0
	},
	.num_bits = 122,
};

static const struct issp_vector read_security_pt3_end = {
	.data = {
		0xfb, 0xe8, 0xc3, 0xef, 0xf1, 0x2e
	},
	.num_bits = 47,
};

static const struct issp_vector checksum_setup = {
	.data = {
		0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09,
		0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x81,
		0xf9, 0xf4, 0x01, 0xf7, 0xf0, 0x07, 0xdc, 0x40,
		0x1f, 0x70, 0x01, 0xfd, 0xee, 0x01, 0xf7, 0xa0,
		0x1f, 0xde, 0xa0, 0x1f, 0x7b, 0x00, 0x7d, 0xe0,
		0x0f, 0xf7, 0xc0, 0x07, 0xdf, 0x28, 0x1f, 0x7d,
		0x18, 0x7d, 0xfe, 0x25, 0xc0
	},
	.num_bits = 418,
};

static const struct issp_vector program_and_verify = {
	.data = {
		0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09,
		0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x81,
		0xf9, 0xf7, 0x01, 0xf7, 0xf0, 0x07, 0xdc, 0x40,
		0x1f, 0x70, 0x01, 0xfd, 0xee, 0x01, 0xf6, 0xa0,
		0x0f, 0xde, 0x80, 0x7f, 0x7a, 0x80, 0x7d, 0xec,
		0x01, 0xf7, 0x80, 0x57, 0xdf, 0x00, 0x1f, 0x7c,
		0xa0, 0x7d, 0xf4, 0x61, 0xf7, 0xf8, 0x97
	},
	.num_bits = 440,
};

static const struct issp_vector read_id_v1 = {
	.data = {
		0xBF, 0x00
	},
	.num_bits = 11,
};

static const struct issp_vector wait_and_poll_end = {
	.data = {
		0x00, 0x00, 0x00, 0x00
	},
	.num_bits = 30,
};

static const struct issp_vector read_checksum_v1 = {
	.data = {
		0xBF, 0x20
	},
	.num_bits = 11,
};

static const struct issp_vector read_checksum_v2 = {
	.data = {
		0xDF, 0x80
	},
	.num_bits = 12,
};

#define BLOCK_SIZE		128
#define BLOCKS_PER_BANK		64
#define SECURITY_BYTES_PER_BANK	64
#define TRANSITION_TIMEOUT	0x100000

#endif /* _CYPRESS_TOUCHKEY_FIRMWARE_H__ */