summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/archosg9/feature_list.h
blob: 0b726cd1a3903bd63d8c73ab8bc73800bfda5b5f (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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#ifndef _FEATURE_LIST_H
#define _FEATURE_LIST_H

/*
 This file comes from:
 http://gitorious.org/archos/archos-gpl-gen9-kernel-ics/blobs/raw/master/
 arch/arm/include/asm/feature_list.h
*/

#define FEATURE_LIST_MAGIC		0xFEA01234

#define FEATURE_LIST_REV		0x00000001

struct feature_tag_header {
	u32 size;
	u32 tag;
};

struct feature_tag_generic {
	u32 vendor;
	u32 product;
	u32 type;
	u32 revision;
	u32 flags;
};

#define FTAG_NONE			0x00000000

#define FTAG_CORE			0x00000001
struct feature_tag_core {
	u32 magic;
	u32 list_revision;
	u32 flags;
};

/* product specific */
#define FTAG_PRODUCT_NAME		0x00000002
struct feature_tag_product_name {
	char name[64];
	u32 id;
};
#define FTAG_PRODUCT_SERIAL_NUMBER	0x00000003
struct feature_tag_product_serial {
	u32 serial[4];
};

#define FTAG_PRODUCT_MAC_ADDRESS	0x00000004
struct feature_tag_product_mac_address {
	u8 addr[6];
	u8 reserved1;
	u8 reserved2;
};

#define FTAG_PRODUCT_OEM		0x00000005
struct feature_tag_product_oem {
	char name[16];
	u32 id;
};

#define FTAG_PRODUCT_ZONE		0x00000006
struct feature_tag_product_zone {
	char name[16];
	u32 id;
};

/* board pcb specific */
#define FTAG_BOARD_PCB_REVISION		0x00000010
struct feature_tag_board_revision {
	u32 revision;
};

/* clock and ram setup */
#define FTAG_CLOCK			0x00000011
struct feature_tag_clock {
	u32 clock;
};

#define FTAG_SDRAM			0x00000012
struct feature_tag_sdram {
	char vendor[16];
	char product[32];
	u32 type;
	u32 revision;
	u32 flags;
	u32 clock;
	/* custom params */
	u32 param_0;
	u32 param_1;
	u32 param_2;
	u32 param_3;
	u32 param_4;
	u32 param_5;
	u32 param_6;
	u32 param_7;
};

/* PMIC */
#define FTAG_PMIC			0x00000013
#define FTAG_PMIC_TPS62361		0x00000001
struct feature_tag_pmic {
	u32 flags;
};

/* serial port */
#define FTAG_SERIAL_PORT		0x00000020
struct feature_tag_serial_port {
	u32 uart_id;
	u32 speed;
};

/* turbo bit */
#define FTAG_TURBO			0x00000014
struct feature_tag_turbo {
	u32 flag;
};

/*** features ****/
#define FTAG_HAS_GPIO_VOLUME_KEYS	0x00010001
struct feature_tag_gpio_volume_keys {
	u32 gpio_vol_up;
	u32 gpio_vol_down;
	u32 flags;
};

#define FTAG_HAS_ELECTRICAL_SHORTCUT	0x00010002
#define FTAG_HAS_DCIN			0x00010003
struct feature_tag_dcin {
	u32 autodetect;
};

/* external screen support */
#define FTAG_HAS_EXT_SCREEN		0x00010004

#define EXT_SCREEN_TYPE_TVOUT	0x00000001
#define EXT_SCREEN_TYPE_HDMI	0x00000002
#define EXT_SCREEN_TYPE_VGA	0x00000004
struct feature_tag_ext_screen {
	u32 type;
	u32 revision;
};

/* wireless lan */
#define FTAG_HAS_WIFI			0x00010005

#define WIFI_TYPE_TIWLAN	0x00000001
struct feature_tag_wifi {
	u32 vendor;
	u32 product;
	u32 type;
	u32 revision;
	u32 flags;
};

/* bluetooth */
#define FTAG_HAS_BLUETOOTH		0x00010006

#define BLUETOOTH_TYPE_TIWLAN	0x00000001
struct feature_tag_bluetooth {
	u32 vendor;
	u32 product;
	u32 type;
	u32 revision;
	u32 flags;
};

/* accelerometer */
#define FTAG_HAS_ACCELEROMETER		0x00010007
struct feature_tag_accelerometer {
	u32 vendor;
	u32 product;
	u32 type;
	u32 revision;
	u32 flags;
};

/* gyroscope */
#define FTAG_HAS_GYROSCOPE		0x00010008

/* compass */
#define FTAG_HAS_COMPASS		0x00010009

/* gps */
#define FTAG_HAS_GPS			0x0001000a
#define GPS_FLAG_DISABLED		0x00000001
struct feature_tag_gps {
	u32 vendor;
	u32 product;
	u32 revision;
	u32 flags;
};

/* camera */
#define FTAG_HAS_CAMERA			0x0001000b

/* harddisk controller */
#define FTAG_HAS_HARDDISK_CONTROLLER	0x0001000c
#define HDCONTROLLER_TYPE_SATA	0x00000001
struct feature_tag_harddisk_controller {
	u32 vendor;
	u32 product;
	u32 type;
	u32 revision;
	u32 flags;
};

/* harddisk */
#define FTAG_HAS_HARDDISK		0x0001000d

#define HARDDISK_TYPE_SATA	0x00000001
#define HARDDISK_TYPE_PATA	0x00000002
struct feature_tag_harddisk {
	u32 vendor;
	u32 product;
	u32 type;
	u32 revision;
	u32 flags;
};

/* touchscreen */
#define FTAG_HAS_TOUCHSCREEN		0x0001000e

#define TOUCHSCREEN_TYPE_CAPACITIVE 0x00000001
#define TOUCHSCREEN_TYPE_RESISTIVE  0x00000002

#define TOUCHSCREEN_FLAG_MULTITOUCH 0x00000001
struct feature_tag_touchscreen {
	u32 vendor;
	u32 product;
	u32 type;
	u32 revision;
	u32 flags;
};

/* microphone */
#define FTAG_HAS_MICROPHONE		0x0001000f

/* external SDMMC slot */
#define FTAG_HAS_EXT_MMCSD_SLOT		0x00010010
#define MMCSD_FLAG_CARDDETECT    0x00000001
#define MMCSD_FLAG_CARDPREDETECT 0x00000002

struct feature_tag_mmcsd {
	u32 width;
	u32 voltagemask;
	u32 revision;
	u32 flags;
};

/* ambient light sensor */
#define FTAG_HAS_AMBIENT_LIGHT_SENSOR	0x00010011

/* proximity sensor */
#define FTAG_HAS_PROXIMITY_SENSOR	0x00010012

/* gps */
#define FTAG_HAS_GSM			0x00010013

/* dect */
#define FTAG_HAS_DECT			0x00010014

/* hsdpa data modem */
#define FTAG_HAS_HSDPA			0x00010015

/* near field communication */
#define FTAG_HAS_NFC			0x00010016

#define FTAG_GPIO_KEYS			0x00010017
struct feature_tag_gpio_keys {
#define GPIO_KEYS_LONG_PRESS		0x00010000
	u32 vol_up;
	u32 vol_down;
	u32 ok;
	u32 reserved[5];
};

#define FTAG_SCREEN			0x00010018
struct feature_tag_screen {
	char vendor[16];
	u32 type;
	u32 revision;
	u32 vcom;
	u32 backlight;
	u32 reserved[5];
};

#define FTAG_WIFI_PA			0x00010019
struct feature_tag_wifi_pa {
	char vendor[16];
	u32 type;
};

/* loudspeaker */
#define FTAG_HAS_SPEAKER		0x0001001a

#define SPEAKER_FLAG_STEREO	 0x00000001
#define SPEAKER_FLAG_OWN_VOLCTRL 0x00000002
struct feature_tag_speaker {
	u32 flags;
};

#define FTAG_BATTERY			0x0001001b
struct feature_tag_battery {
	u32 type;
};
#define BATTERY_TYPE_HIGHRS	 0x00000000
#define BATTERY_TYPE_LOWRS	 0x00000001


#define feature_tag_next(t) \
	((struct feature_tag *)((u32 *)(t) + (t)->hdr.size))
#define feature_tag_size(type) \
	((sizeof(struct feature_tag_header) + sizeof(struct type)) >> 2)
#define for_each_feature_tag(t, base) \
	for (t = base; t->hdr.size; t = feature_tag_next(t))


struct feature_tag {
	struct feature_tag_header hdr;
	union {
		struct feature_tag_core			core;
		struct feature_tag_generic		generic;
		struct feature_tag_product_name		product_name;
		struct feature_tag_product_serial	product_serial;
		struct feature_tag_product_oem		product_oem;
		struct feature_tag_product_zone		product_zone;
		struct feature_tag_product_mac_address	mac_address;
		struct feature_tag_board_revision	board_revision;
		struct feature_tag_clock		clock;
		struct feature_tag_sdram		sdram;
		struct feature_tag_pmic			pmic;
		struct feature_tag_turbo		turbo;
		struct feature_tag_serial_port		serial_port;
		struct feature_tag_gpio_volume_keys	gpio_volume_keys;
		struct feature_tag_dcin			dcin;
		struct feature_tag_ext_screen		ext_screen;
		struct feature_tag_wifi			wifi;
		struct feature_tag_bluetooth		bluetooth;
		struct feature_tag_accelerometer	accelerometer;
		struct feature_tag_harddisk_controller	harddisk_controller;
		struct feature_tag_harddisk		harddisk;
		struct feature_tag_touchscreen		touchscreen;
		struct feature_tag_gps			gps;
		struct feature_tag_speaker		speaker;
		struct feature_tag_mmcsd		mmcsd;
		struct feature_tag_gpio_keys		gpio_keys;
		struct feature_tag_screen		screen;
		struct feature_tag_wifi_pa		wifi_pa;
		struct feature_tag_battery		battery;
	} u;
};

#endif /* _FEATURE_LIST_H */