PageRenderTime 30ms CodeModel.GetById 15ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/i386/kernel/cpu/cpufreq/longhaul.h

https://bitbucket.org/evzijst/gittest
C Header | 466 lines | 412 code | 20 blank | 34 comment | 0 complexity | 39f5b7bc1bad5c12141eee5b0ebecfb8 MD5 | raw file
  1/*
  2 *  longhaul.h
  3 *  (C) 2003 Dave Jones.
  4 *
  5 *  Licensed under the terms of the GNU GPL License version 2.
  6 *
  7 *  VIA-specific information
  8 */
  9
 10union msr_bcr2 {
 11	struct {
 12		unsigned Reseved:19,	// 18:0
 13		ESOFTBF:1,		// 19
 14		Reserved2:3,		// 22:20
 15		CLOCKMUL:4,		// 26:23
 16		Reserved3:5;		// 31:27
 17	} bits;
 18	unsigned long val;
 19};
 20
 21union msr_longhaul {
 22	struct {
 23		unsigned RevisionID:4,	// 3:0
 24		RevisionKey:4,		// 7:4
 25		EnableSoftBusRatio:1,	// 8
 26		EnableSoftVID:1,	// 9
 27		EnableSoftBSEL:1,	// 10
 28		Reserved:3,		// 11:13
 29		SoftBusRatio4:1,	// 14
 30		VRMRev:1,		// 15
 31		SoftBusRatio:4,		// 19:16
 32		SoftVID:5,		// 24:20
 33		Reserved2:3,		// 27:25
 34		SoftBSEL:2,		// 29:28
 35		Reserved3:2,		// 31:30
 36		MaxMHzBR:4,		// 35:32
 37		MaximumVID:5,		// 40:36
 38		MaxMHzFSB:2,		// 42:41
 39		MaxMHzBR4:1,		// 43
 40		Reserved4:4,		// 47:44
 41		MinMHzBR:4,		// 51:48
 42		MinimumVID:5,		// 56:52
 43		MinMHzFSB:2,		// 58:57
 44		MinMHzBR4:1,		// 59
 45		Reserved5:4;		// 63:60
 46	} bits;
 47	unsigned long long val;
 48};
 49
 50/*
 51 * Clock ratio tables. Div/Mod by 10 to get ratio.
 52 * The eblcr ones specify the ratio read from the CPU.
 53 * The clock_ratio ones specify what to write to the CPU.
 54 */
 55
 56/*
 57 * VIA C3 Samuel 1  & Samuel 2 (stepping 0)
 58 */
 59static int __initdata samuel1_clock_ratio[16] = {
 60	-1, /* 0000 -> RESERVED */
 61	30, /* 0001 ->  3.0x */
 62	40, /* 0010 ->  4.0x */
 63	-1, /* 0011 -> RESERVED */
 64	-1, /* 0100 -> RESERVED */
 65	35, /* 0101 ->  3.5x */
 66	45, /* 0110 ->  4.5x */
 67	55, /* 0111 ->  5.5x */
 68	60, /* 1000 ->  6.0x */
 69	70, /* 1001 ->  7.0x */
 70	80, /* 1010 ->  8.0x */
 71	50, /* 1011 ->  5.0x */
 72	65, /* 1100 ->  6.5x */
 73	75, /* 1101 ->  7.5x */
 74	-1, /* 1110 -> RESERVED */
 75	-1, /* 1111 -> RESERVED */
 76};
 77
 78static int __initdata samuel1_eblcr[16] = {
 79	50, /* 0000 -> RESERVED */
 80	30, /* 0001 ->  3.0x */
 81	40, /* 0010 ->  4.0x */
 82	-1, /* 0011 -> RESERVED */
 83	55, /* 0100 ->  5.5x */
 84	35, /* 0101 ->  3.5x */
 85	45, /* 0110 ->  4.5x */
 86	-1, /* 0111 -> RESERVED */
 87	-1, /* 1000 -> RESERVED */
 88	70, /* 1001 ->  7.0x */
 89	80, /* 1010 ->  8.0x */
 90	60, /* 1011 ->  6.0x */
 91	-1, /* 1100 -> RESERVED */
 92	75, /* 1101 ->  7.5x */
 93	-1, /* 1110 -> RESERVED */
 94	65, /* 1111 ->  6.5x */
 95};
 96
 97/*
 98 * VIA C3 Samuel2 Stepping 1->15
 99 */
100static int __initdata samuel2_eblcr[16] = {
101	50,  /* 0000 ->  5.0x */
102	30,  /* 0001 ->  3.0x */
103	40,  /* 0010 ->  4.0x */
104	100, /* 0011 -> 10.0x */
105	55,  /* 0100 ->  5.5x */
106	35,  /* 0101 ->  3.5x */
107	45,  /* 0110 ->  4.5x */
108	110, /* 0111 -> 11.0x */
109	90,  /* 1000 ->  9.0x */
110	70,  /* 1001 ->  7.0x */
111	80,  /* 1010 ->  8.0x */
112	60,  /* 1011 ->  6.0x */
113	120, /* 1100 -> 12.0x */
114	75,  /* 1101 ->  7.5x */
115	130, /* 1110 -> 13.0x */
116	65,  /* 1111 ->  6.5x */
117};
118
119/*
120 * VIA C3 Ezra
121 */
122static int __initdata ezra_clock_ratio[16] = {
123	100, /* 0000 -> 10.0x */
124	30,  /* 0001 ->  3.0x */
125	40,  /* 0010 ->  4.0x */
126	90,  /* 0011 ->  9.0x */
127	95,  /* 0100 ->  9.5x */
128	35,  /* 0101 ->  3.5x */
129	45,  /* 0110 ->  4.5x */
130	55,  /* 0111 ->  5.5x */
131	60,  /* 1000 ->  6.0x */
132	70,  /* 1001 ->  7.0x */
133	80,  /* 1010 ->  8.0x */
134	50,  /* 1011 ->  5.0x */
135	65,  /* 1100 ->  6.5x */
136	75,  /* 1101 ->  7.5x */
137	85,  /* 1110 ->  8.5x */
138	120, /* 1111 -> 12.0x */
139};
140
141static int __initdata ezra_eblcr[16] = {
142	50,  /* 0000 ->  5.0x */
143	30,  /* 0001 ->  3.0x */
144	40,  /* 0010 ->  4.0x */
145	100, /* 0011 -> 10.0x */
146	55,  /* 0100 ->  5.5x */
147	35,  /* 0101 ->  3.5x */
148	45,  /* 0110 ->  4.5x */
149	95,  /* 0111 ->  9.5x */
150	90,  /* 1000 ->  9.0x */
151	70,  /* 1001 ->  7.0x */
152	80,  /* 1010 ->  8.0x */
153	60,  /* 1011 ->  6.0x */
154	120, /* 1100 -> 12.0x */
155	75,  /* 1101 ->  7.5x */
156	85,  /* 1110 ->  8.5x */
157	65,  /* 1111 ->  6.5x */
158};
159
160/*
161 * VIA C3 (Ezra-T) [C5M].
162 */
163static int __initdata ezrat_clock_ratio[32] = {
164	100, /* 0000 -> 10.0x */
165	30,  /* 0001 ->  3.0x */
166	40,  /* 0010 ->  4.0x */
167	90,  /* 0011 ->  9.0x */
168	95,  /* 0100 ->  9.5x */
169	35,  /* 0101 ->  3.5x */
170	45,  /* 0110 ->  4.5x */
171	55,  /* 0111 ->  5.5x */
172	60,  /* 1000 ->  6.0x */
173	70,  /* 1001 ->  7.0x */
174	80,  /* 1010 ->  8.0x */
175	50,  /* 1011 ->  5.0x */
176	65,  /* 1100 ->  6.5x */
177	75,  /* 1101 ->  7.5x */
178	85,  /* 1110 ->  8.5x */
179	120, /* 1111 ->  12.0x */
180
181	-1,  /* 0000 -> RESERVED (10.0x) */
182	110, /* 0001 -> 11.0x */
183	120, /* 0010 -> 12.0x */
184	-1,  /* 0011 -> RESERVED (9.0x)*/
185	105, /* 0100 -> 10.5x */
186	115, /* 0101 -> 11.5x */
187	125, /* 0110 -> 12.5x */
188	135, /* 0111 -> 13.5x */
189	140, /* 1000 -> 14.0x */
190	150, /* 1001 -> 15.0x */
191	160, /* 1010 -> 16.0x */
192	130, /* 1011 -> 13.0x */
193	145, /* 1100 -> 14.5x */
194	155, /* 1101 -> 15.5x */
195	-1,  /* 1110 -> RESERVED (13.0x) */
196	-1,  /* 1111 -> RESERVED (12.0x) */
197};
198
199static int __initdata ezrat_eblcr[32] = {
200	50,  /* 0000 ->  5.0x */
201	30,  /* 0001 ->  3.0x */
202	40,  /* 0010 ->  4.0x */
203	100, /* 0011 -> 10.0x */
204	55,  /* 0100 ->  5.5x */
205	35,  /* 0101 ->  3.5x */
206	45,  /* 0110 ->  4.5x */
207	95,  /* 0111 ->  9.5x */
208	90,  /* 1000 ->  9.0x */
209	70,  /* 1001 ->  7.0x */
210	80,  /* 1010 ->  8.0x */
211	60,  /* 1011 ->  6.0x */
212	120, /* 1100 -> 12.0x */
213	75,  /* 1101 ->  7.5x */
214	85,  /* 1110 ->  8.5x */
215	65,  /* 1111 ->  6.5x */
216
217	-1,  /* 0000 -> RESERVED (9.0x) */
218	110, /* 0001 -> 11.0x */
219	120, /* 0010 -> 12.0x */
220	-1,  /* 0011 -> RESERVED (10.0x)*/
221	135, /* 0100 -> 13.5x */
222	115, /* 0101 -> 11.5x */
223	125, /* 0110 -> 12.5x */
224	105, /* 0111 -> 10.5x */
225	130, /* 1000 -> 13.0x */
226	150, /* 1001 -> 15.0x */
227	160, /* 1010 -> 16.0x */
228	140, /* 1011 -> 14.0x */
229	-1,  /* 1100 -> RESERVED (12.0x) */
230	155, /* 1101 -> 15.5x */
231	-1,  /* 1110 -> RESERVED (13.0x) */
232	145, /* 1111 -> 14.5x */
233};
234
235/*
236 * VIA C3 Nehemiah */
237 
238static int __initdata nehemiah_a_clock_ratio[32] = {
239	100, /* 0000 -> 10.0x */
240	160, /* 0001 -> 16.0x */
241	-1,  /* 0010 ->  RESERVED */
242	90,  /* 0011 ->  9.0x */
243	95,  /* 0100 ->  9.5x */
244	-1,  /* 0101 ->  RESERVED */
245	-1,  /* 0110 ->  RESERVED */
246	55,  /* 0111 ->  5.5x */
247	60,  /* 1000 ->  6.0x */
248	70,  /* 1001 ->  7.0x */
249	80,  /* 1010 ->  8.0x */
250	50,  /* 1011 ->  5.0x */
251	65,  /* 1100 ->  6.5x */
252	75,  /* 1101 ->  7.5x */
253	85,  /* 1110 ->  8.5x */
254	120, /* 1111 -> 12.0x */
255	100, /* 0000 -> 10.0x */
256	-1,  /* 0001 -> RESERVED */
257	120, /* 0010 -> 12.0x */
258	90,  /* 0011 ->  9.0x */
259	105, /* 0100 -> 10.5x */
260	115, /* 0101 -> 11.5x */
261	125, /* 0110 -> 12.5x */
262	135, /* 0111 -> 13.5x */
263	140, /* 1000 -> 14.0x */
264	150, /* 1001 -> 15.0x */
265	160, /* 1010 -> 16.0x */
266	130, /* 1011 -> 13.0x */
267	145, /* 1100 -> 14.5x */
268	155, /* 1101 -> 15.5x */
269	-1,  /* 1110 -> RESERVED (13.0x) */
270	120, /* 1111 -> 12.0x */
271};
272
273static int __initdata  nehemiah_b_clock_ratio[32] = {
274	100, /* 0000 -> 10.0x */
275	160, /* 0001 -> 16.0x */
276	-1,  /* 0010 ->  RESERVED */
277	90,  /* 0011 ->  9.0x */
278	95,  /* 0100 ->  9.5x */
279	-1,  /* 0101 ->  RESERVED */
280	-1,  /* 0110 ->  RESERVED */
281	55,  /* 0111 ->  5.5x */
282	60,  /* 1000 ->  6.0x */
283	70,  /* 1001 ->  7.0x */
284	80,  /* 1010 ->  8.0x */
285	50,  /* 1011 ->  5.0x */
286	65,  /* 1100 ->  6.5x */
287	75,  /* 1101 ->  7.5x */
288	85,  /* 1110 ->  8.5x */
289	120, /* 1111 -> 12.0x */
290	100, /* 0000 -> 10.0x */
291	110, /* 0001 -> 11.0x */
292	120, /* 0010 -> 12.0x */
293	90,  /* 0011 ->  9.0x */
294	105, /* 0100 -> 10.5x */
295	115, /* 0101 -> 11.5x */
296	125, /* 0110 -> 12.5x */
297	135, /* 0111 -> 13.5x */
298	140, /* 1000 -> 14.0x */
299	150, /* 1001 -> 15.0x */
300	160, /* 1010 -> 16.0x */
301	130, /* 1011 -> 13.0x */
302	145, /* 1100 -> 14.5x */
303	155, /* 1101 -> 15.5x */
304	-1,  /* 1110 -> RESERVED (13.0x) */
305	120, /* 1111 -> 12.0x */
306};
307
308static int __initdata  nehemiah_c_clock_ratio[32] = {
309	100, /* 0000 -> 10.0x */
310	160, /* 0001 -> 16.0x */
311	40,  /* 0010 ->  RESERVED */
312	90,  /* 0011 ->  9.0x */
313	95,  /* 0100 ->  9.5x */
314	-1,  /* 0101 ->  RESERVED */
315	45,  /* 0110 ->  RESERVED */
316	55,  /* 0111 ->  5.5x */
317	60,  /* 1000 ->  6.0x */
318	70,  /* 1001 ->  7.0x */
319	80,  /* 1010 ->  8.0x */
320	50,  /* 1011 ->  5.0x */
321	65,  /* 1100 ->  6.5x */
322	75,  /* 1101 ->  7.5x */
323	85,  /* 1110 ->  8.5x */
324	120, /* 1111 -> 12.0x */
325	100, /* 0000 -> 10.0x */
326	110, /* 0001 -> 11.0x */
327	120, /* 0010 -> 12.0x */
328	90,  /* 0011 ->  9.0x */
329	105, /* 0100 -> 10.5x */
330	115, /* 0101 -> 11.5x */
331	125, /* 0110 -> 12.5x */
332	135, /* 0111 -> 13.5x */
333	140, /* 1000 -> 14.0x */
334	150, /* 1001 -> 15.0x */
335	160, /* 1010 -> 16.0x */
336	130, /* 1011 -> 13.0x */
337	145, /* 1100 -> 14.5x */
338	155, /* 1101 -> 15.5x */
339	-1,  /* 1110 -> RESERVED (13.0x) */
340	120, /* 1111 -> 12.0x */
341};
342
343static int __initdata nehemiah_a_eblcr[32] = {
344	50,  /* 0000 ->  5.0x */
345	160, /* 0001 -> 16.0x */
346	-1,  /* 0010 ->  RESERVED */
347	100, /* 0011 -> 10.0x */
348	55,  /* 0100 ->  5.5x */
349	-1,  /* 0101 ->  RESERVED */
350	-1,  /* 0110 ->  RESERVED */
351	95,  /* 0111 ->  9.5x */
352	90,  /* 1000 ->  9.0x */
353	70,  /* 1001 ->  7.0x */
354	80,  /* 1010 ->  8.0x */
355	60,  /* 1011 ->  6.0x */
356	120, /* 1100 -> 12.0x */
357	75,  /* 1101 ->  7.5x */
358	85,  /* 1110 ->  8.5x */
359	65,  /* 1111 ->  6.5x */
360	90,  /* 0000 ->  9.0x */
361	-1,  /* 0001 -> RESERVED */
362	120, /* 0010 -> 12.0x */
363	100, /* 0011 -> 10.0x */
364	135, /* 0100 -> 13.5x */
365	115, /* 0101 -> 11.5x */
366	125, /* 0110 -> 12.5x */
367	105, /* 0111 -> 10.5x */
368	130, /* 1000 -> 13.0x */
369	150, /* 1001 -> 15.0x */
370	160, /* 1010 -> 16.0x */
371	140, /* 1011 -> 14.0x */
372	120, /* 1100 -> 12.0x */
373	155, /* 1101 -> 15.5x */
374	-1,  /* 1110 -> RESERVED (13.0x) */
375	145 /* 1111 -> 14.5x */
376   /* end of table  */
377};
378static int __initdata nehemiah_b_eblcr[32] = {
379	50,  /* 0000 ->  5.0x */
380	160, /* 0001 -> 16.0x */
381	-1,  /* 0010 ->  RESERVED */
382	100, /* 0011 -> 10.0x */
383	55,  /* 0100 ->  5.5x */
384	-1,  /* 0101 ->  RESERVED */
385	-1,  /* 0110 ->  RESERVED */
386	95,  /* 0111 ->  9.5x */
387	90,  /* 1000 ->  9.0x */
388	70,  /* 1001 ->  7.0x */
389	80,  /* 1010 ->  8.0x */
390	60,  /* 1011 ->  6.0x */
391	120, /* 1100 -> 12.0x */
392	75,  /* 1101 ->  7.5x */
393	85,  /* 1110 ->  8.5x */
394	65,  /* 1111 ->  6.5x */
395	90,  /* 0000 ->  9.0x */
396	110, /* 0001 -> 11.0x */
397	120, /* 0010 -> 12.0x */
398	100, /* 0011 -> 10.0x */
399	135, /* 0100 -> 13.5x */
400	115, /* 0101 -> 11.5x */
401	125, /* 0110 -> 12.5x */
402	105, /* 0111 -> 10.5x */
403	130, /* 1000 -> 13.0x */
404	150, /* 1001 -> 15.0x */
405	160, /* 1010 -> 16.0x */
406	140, /* 1011 -> 14.0x */
407	120, /* 1100 -> 12.0x */
408	155, /* 1101 -> 15.5x */
409	-1,  /* 1110 -> RESERVED (13.0x) */
410	145 /* 1111 -> 14.5x */
411	   /* end of table  */
412};
413static int __initdata nehemiah_c_eblcr[32] = {
414	50,  /* 0000 ->  5.0x */
415	160, /* 0001 -> 16.0x */
416	40,  /* 0010 ->  RESERVED */
417	100, /* 0011 -> 10.0x */
418	55,  /* 0100 ->  5.5x */
419	-1,  /* 0101 ->  RESERVED */
420	45,  /* 0110 ->  RESERVED */
421	95,  /* 0111 ->  9.5x */
422	90,  /* 1000 ->  9.0x */
423	70,  /* 1001 ->  7.0x */
424	80,  /* 1010 ->  8.0x */
425	60,  /* 1011 ->  6.0x */
426	120, /* 1100 -> 12.0x */
427	75,  /* 1101 ->  7.5x */
428	85,  /* 1110 ->  8.5x */
429	65,  /* 1111 ->  6.5x */
430	90,  /* 0000 ->  9.0x */
431	110, /* 0001 -> 11.0x */
432	120, /* 0010 -> 12.0x */
433	100, /* 0011 -> 10.0x */
434	135, /* 0100 -> 13.5x */
435	115, /* 0101 -> 11.5x */
436	125, /* 0110 -> 12.5x */
437	105, /* 0111 -> 10.5x */
438	130, /* 1000 -> 13.0x */
439	150, /* 1001 -> 15.0x */
440	160, /* 1010 -> 16.0x */
441	140, /* 1011 -> 14.0x */
442	120, /* 1100 -> 12.0x */
443	155, /* 1101 -> 15.5x */
444	-1,  /* 1110 -> RESERVED (13.0x) */
445	145 /* 1111 -> 14.5x */
446	  /* end of table  */
447};
448
449/* 
450 * Voltage scales. Div/Mod by 1000 to get actual voltage.
451 * Which scale to use depends on the VRM type in use.
452 */
453static int __initdata vrm85scales[32] = {
454	1250, 1200, 1150, 1100, 1050, 1800, 1750, 1700,
455	1650, 1600, 1550, 1500, 1450, 1400, 1350, 1300,
456	1275, 1225, 1175, 1125, 1075, 1825, 1775, 1725,
457	1675, 1625, 1575, 1525, 1475, 1425, 1375, 1325,
458};
459
460static int __initdata mobilevrmscales[32] = {
461	2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650,
462	1600, 1550, 1500, 1450, 1500, 1350, 1300, -1,
463	1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100,
464	1075, 1050, 1025, 1000, 975, 950, 925, -1,
465};
466