Update K8 FID/VID setup. Add support for 100MHz FIDs (revG).
[coreboot.git] / src / cpu / amd / model_fxx / fidvid.c
1 #if K8_SET_FIDVID == 1
2
3 #define K8_SET_FIDVID_DEBUG 0
4
5 #define K8_SET_FIDVID_ONE_BY_ONE 1
6
7 #define K8_SET_FIDVID_STORE_AP_APICID_AT_FIRST 1
8
9 #ifndef SB_VFSMAF
10 #define SB_VFSMAF 1
11 #endif
12
13 #define FX_SUPPORT 1
14
15 static inline void print_debug_fv(const char *str, unsigned val)
16 {
17 #if K8_SET_FIDVID_DEBUG == 1
18         #if CONFIG_USE_PRINTK_IN_CAR
19                 printk_debug("%s%x\r\n", str, val);
20         #else
21                 print_debug(str); print_debug_hex32(val); print_debug("\r\n");
22         #endif
23 #endif
24 }
25
26 static inline void print_debug_fv_8(const char *str, unsigned val)
27 {
28 #if K8_SET_FIDVID_DEBUG == 1
29         #if CONFIG_USE_PRINTK_IN_CAR
30                 printk_debug("%s%02x\r\n", str, val);
31         #else
32                 print_debug(str); print_debug_hex8(val); print_debug("\r\n");
33         #endif
34 #endif
35 }
36
37 static inline void print_debug_fv_64(const char *str, unsigned val, unsigned val2)
38 {
39 #if K8_SET_FIDVID_DEBUG == 1
40         #if CONFIG_USE_PRINTK_IN_CAR
41                 printk_debug("%s%x%x\r\n", str, val, val2);
42         #else
43                 print_debug(str); print_debug_hex32(val); print_debug_hex32(val2); print_debug("\r\n");
44         #endif
45 #endif
46 }
47
48
49 static void enable_fid_change(void)
50 {
51         uint32_t dword;
52         unsigned nodes;
53         int i;
54
55         nodes = ((pci_read_config32(PCI_DEV(0, 0x18, 0), 0x60) >> 4) & 7) + 1;
56
57         for (i = 0; i < nodes; i++) {
58                 dword = pci_read_config32(PCI_DEV(0, 0x18+i, 3), 0xd8);
59                 dword &= 0x8ff00000;
60                 dword |= (2 << 28) | (0x02710);
61                 pci_write_config32(PCI_DEV(0, 0x18+i, 3), 0xd8, dword);
62
63                 dword = 0x04e2a707;
64                 pci_write_config32(PCI_DEV(0, 0x18+i, 3), 0xd4, dword);
65
66                 /* disable the DRAM interface at first, it will be enabled
67                  * by raminit again */
68                 dword = pci_read_config32(PCI_DEV(0, 0x18+i, 2), 0x94);
69                 dword |= (1 << 14);
70                 pci_write_config32(PCI_DEV(0, 0x18+i, 2), 0x94, dword);
71
72                 dword = 0x23070700; /* enable FID/VID change */
73 //              dword = 0x00070000; /* enable FID/VID change */
74                 pci_write_config32(PCI_DEV(0, 0x18+i, 3), 0x80, dword);
75
76                 dword = 0x00132113;
77                 pci_write_config32(PCI_DEV(0, 0x18+i, 3), 0x84, dword);
78
79         }
80 }
81
82 #if K8_SET_FIDVID_ONE_BY_ONE == 0
83 static unsigned set_fidvid_without_init(unsigned fidvid)
84 {
85         msr_t msr;
86         uint32_t vid;
87         uint32_t fid;
88
89         fid = (fidvid >> 8) & 0x3f;
90         vid = (fidvid >> 16) & 0x3f;
91
92         /* set new FID/VID */
93         msr.hi = 1;
94         msr.lo = (vid<<8) | fid;
95         wrmsr(0xc0010041, msr);
96         return fidvid;
97 }
98 #endif
99
100 static u32 set_fidvid(unsigned apicid, unsigned fidvid, int showmessage)
101 {
102
103 /*  CurrentFID--> 4x(00h)   5x(02h)   6x(04h)   7x(06h) ...
104  *       --------------------------------------
105  * TargetFID   | Next_FID, Next_FID, Next_FID, Next_FID ...
106  *      |      | Next_FID, Next_FID, Next_FID, Next_FID ...
107  *     \|/     | Next_FID, Next_FID, Next_FID, Next_FID ...
108  */
109         static const u8 next_fid_200[] = {
110 /*         x4  x5  x6  x7  x8  x9 x10 x11 x12 x13 x14 x15  x16 */
111 /* x4 */    0, -1, -1, -1,  0,  0,  9, 10, 11, 12, 13, 14, 15, /*  800 */
112 /* x5 */   -1,  0, -1, -1, -1,  5,  5,  5, 11, 12, 13, 14, 15, /* 1000 */
113 /* x6 */   -1, -1,  0, -1, -1, -1, -1,  6,  6,  6, 13, 14, 15, /* 1200 */
114 /* x7 */   -1, -1, -1,  0, -1, -1, -1, -1, -1,  7,  7,  7, 15, /* 1400 */
115 /* lower table to upper table boarder (table 70 and 71 in BKDG) */
116 /* x8 */    8, -1, -1, -1,  0,  8,  9, 10, 11, 12, 13, 14, 15, /* 1600 */
117 /* x9 */    9,  9, -1, -1,  9,  0,  9, 10, 11, 12, 13, 14, 15, /* 1800 */
118 /*x10 */    9, 10, -1, -1,  9, 10,  0, 10, 11, 12, 13, 14, 15, /* 2000 */
119 /*x11 */    9, 11, 11, -1,  9, 10, 11,  0, 11, 12, 13, 14, 15, /* 2200 */
120 /*x12 */    9, 11, 12, -1,  9, 10, 11, 12,  0, 12, 13, 14, 15, /* 2400 */
121 /*x13 */    9, 11, 13, 13,  9, 10, 11, 12, 13,  0, 13, 14, 15, /* 2600 */
122 /*x14 */    9, 11, 13, 14,  9, 10, 11, 12, 13, 14,  0, 14, 15, /* 2800 */
123 /*x15 */    9, 11, 13, 15,  9, 10, 11, 12, 13, 14, 15,  0, 15, /* 3000 */
124 /*x15 */    9, 11, 13, 15,  9, 10, 11, 12, 13, 14, 15, 16,  0, /* 3200 */
125         };
126
127         msr_t msr;
128         uint32_t vid_new;
129         uint32_t fid_new;
130         uint32_t vid_max;
131         uint32_t fid_max;
132         uint32_t vid_cur;
133         uint32_t fid_cur;
134         unsigned apicidx;
135
136         int step_limit;
137         int loop;
138
139         apicidx = lapicid();
140
141         if (apicid != apicidx) {
142 #if CONFIG_USE_PRINTK_IN_CAR
143                 printk_err("wrong apicid, we want change %x, but it is %x\r\n", apicid, apicidx);
144 #else
145                 print_err("wrong apicid, we want change "); print_err_hex8(apicid); print_err(" but it is "); print_err_hex8(apicidx); print_err("\r\n");
146 #endif
147                 return fidvid;
148         }
149
150         fid_new = (fidvid >> 8) & 0x3f;
151         vid_new = (fidvid >> 16) & 0x3f;
152
153         msr = rdmsr(0xc0010042);
154
155         vid_cur = msr.hi & 0x3f;
156         fid_cur = msr.lo & 0x3f;
157
158         if ((vid_cur == vid_new) && (fid_cur == fid_new))
159                 return fidvid;
160
161         vid_max = (msr.hi >> (48-32)) & 0x3f;
162         fid_max = ((msr.lo >> 16) & 0x3f); /* max fid */
163
164 #if FX_SUPPORT
165         if (fid_max >= ((25 - 4) * 2)) { /* FX max fid is 5G */
166                 fid_max = ((msr.lo >> 8) & 0x3f) + 5 * 2; /* max FID is min fid + 1G */
167                 if (fid_max >= ((25-4) * 2)) {
168                         fid_max = (10-4) * 2; /* hard set to 2G */
169                 }
170         }
171 #endif
172
173         /* set vid to max */
174         /* TODO - make this more correct. Not a big deal for setting max...
175          * BKDG figure 11
176          * if TargetFID > InitialFID
177          *      TargetVID = FinalVID - RVO
178          * else
179          *      if CurrentVID > FinalVID
180          *              TargetVID = FinalVID - RVO
181          *      else
182          *              TargetVID = CurrentVIDD - RVO
183          */
184         msr.hi = 1;
185         msr.lo = (vid_max << 8) | (fid_cur);
186 #if SB_VFSMAF == 1
187         msr.lo |= (1 << 16); /* init changes */
188 #endif
189         wrmsr(0xc0010041, msr);
190 #if SB_VFSMAF == 0
191         ldtstop_sb();
192 #endif
193
194
195         for (loop=0; loop < 100000; loop++){
196                 msr = rdmsr(0xc0010042);
197                 if (!(msr.lo & (1 << 31)))
198                         break;
199         }
200         vid_cur = msr.hi & 0x3f;
201
202         /* BKDG figure 12 and 13
203          * if current fid is odd
204          *      current fid -1 (next lower and even fid)(odd fid for rev G)
205          * if current fid in high-freq table
206          *      while current fid < target fid
207          *              transition to next higher fid in table
208          * else if target fid > VCO portal of current fid
209          *      transition to highest portal fid in higher fid table
210          *              while current fid < target fid
211          *                      transition to next higher fid in table
212          * else
213          *      transition to target fid
214          */
215
216         printk_debug("Current fid_cur: 0x%x, fid_max: 0x%x\n", fid_cur, fid_max);
217         printk_debug("Requested fid_new: 0x%x\n", fid_new);
218
219         step_limit = 8; /* max 8 steps just in case... */
220         while ((fid_cur != fid_new) && (step_limit--)) {
221                 u32 fid_temp;
222                 int step;
223
224                 if (fid_cur < fid_new)
225                         /* Force Fid steps even. step == 0 means 100MHz step */
226                         step = ((fid_new/2) - (fid_cur/2)) * 2;
227                 else
228                         step = ((fid_cur/2) - (fid_new/2)) * 2;
229
230                 /* If 200Mhz step OR past 3200 max table value */
231                 if ((step == 2) || (fid_new >= 0x18 || fid_cur >= 0x18)) {
232
233                         printk_debug("200MHZ step ");
234
235                         /* Step +/- 200MHz at a time */
236                         if (fid_cur < fid_new)
237                                 fid_temp = fid_cur + 2;
238                         else
239                                 fid_temp = fid_cur - 2;
240
241
242                 } else if ( step > 2) { /* If more than a 200Mhz step */
243                         int temp;
244
245                         /* look it up in the table */
246                         printk_debug("FidVid table step ");
247
248                         temp = next_fid_200[((fid_new/2) * 13) + (fid_cur/2)];
249
250                         if (temp > 0)
251                                 fid_temp = (temp-4) * 2; /* Table 108 */
252                         else if (temp == 0)
253                                 fid_temp = fid_new;
254                         else
255                                 break; /* table error */
256
257                 } else { /* step < 2 (100MHZ) */
258                         printk_debug("100MHZ step ");
259
260                         /* The table adjust in 200MHz increments. If requested,
261                          * do the 100MHz increment if the CPU supports it.*/
262                         if (cpuid_edx(0x80000007) & (1 << 6)) {
263                                 fid_temp = fid_cur + 1;
264                         } else {
265                                 /* 100 MHZ not supported. Get out of the loop */
266                                 printk_debug("is not supported.\n");
267                                 break;
268                         }
269                 }
270
271                 if(fid_temp > fid_max) {
272                         printk_debug("fid_temp 0x%x > fid_max 0x%x\n", fid_temp, fid_max);
273                         break;
274                 }
275
276                 printk_debug("fidvid: 0x%x\n", fid_temp);
277
278                 /* set target fid */
279                 msr.hi = 0x190; /* 2 us for AMD NPT Family 0Fh Processors */
280                 msr.lo = (vid_cur << 8) | fid_temp;
281 #if SB_VFSMAF == 1
282                 msr.lo |= (1 << 16); /* init changes */
283 #endif
284                 wrmsr(0xc0010041, msr);
285 #if SB_VFSMAF == 0
286                 ldtstop_sb();
287 #endif
288
289
290 #if K8_SET_FIDVID_DEBUG == 1
291                 if (showmessage) {
292                         print_debug_fv_8("set_fidvid APICID = ", apicid);
293                         print_debug_fv_64("fidvid ctrl msr ", msr.hi, msr.lo);
294                 }
295 #endif
296
297                 for (loop = 0; loop < 100000; loop++){
298                         msr = rdmsr(0xc0010042);
299                         if (!(msr.lo & (1 << 31)))
300                                 break;
301                 }
302                 fid_cur = msr.lo & 0x3f;
303
304 #if K8_SET_FIDVID_DEBUG == 1
305                 if (showmessage)        {
306                         print_debug_fv_64("fidvid status msr ", msr.hi, msr.lo);
307                 }
308 #endif
309         }
310
311         /* set vid to final */
312         /* TODO - make this more correct. Not a big deal for setting max...
313          * BKDG figure 11
314          * if TargetFID > InitialFID
315          *      TargetVID = FinalVID - RVO
316          * else
317          *      if CurrentVID > FinalVID
318          *              TargetVID = FinalVID - RVO
319          *      else
320          *              TargetVID = CurrentVIDD - RVO
321          */
322         msr.hi = 1;
323         msr.lo = (vid_new << 8) | (fid_cur);
324 #if SB_VFSMAF == 1
325         msr.lo |= (1 << 16); // init changes
326 #endif
327         wrmsr(0xc0010041, msr);
328 #if SB_VFSMAF == 0
329         ldtstop_sb();
330 #endif
331
332         for (loop = 0; loop < 100000; loop++){
333                 msr = rdmsr(0xc0010042);
334                 if (!(msr.lo & (1 << 31)))
335                         break;
336         }
337         vid_cur = msr.hi & 0x3f;
338
339         fidvid = (vid_cur << 16) | (fid_cur << 8);
340
341         if (showmessage) {
342                 if (vid_new != vid_cur) {
343                         print_err("set vid failed for apicid ="); print_err_hex8(apicidx);  print_err("\r\n");
344                 }
345                 if (fid_new != fid_cur) {
346                         print_err("set fid failed for apicid ="); print_err_hex8(apicidx); print_err("\r\n");
347                 }
348         }
349
350         return fidvid;
351
352 }
353
354 static void init_fidvid_ap(unsigned bsp_apicid, unsigned apicid)
355 {
356         uint32_t send;
357         uint32_t readback = 0;
358         unsigned timeout = 1;
359         msr_t msr;
360         uint32_t vid_cur;
361         uint32_t fid_cur;
362         uint32_t fid_max;
363         int loop;
364
365         msr =   rdmsr(0xc0010042);
366         fid_max = ((msr.lo >> 16) & 0x3f); /* max fid */
367 #if FX_SUPPORT
368         if (fid_max >= ((25-4) * 2)) { /* FX max fid is 5G */
369                 fid_max = ((msr.lo>>8) & 0x3f) + 5*2; /* maxFID = minFID + 1G */
370                 if (fid_max >= ((25-4) * 2)) {
371                         fid_max = (10-4) * 2; // hard set to 2G
372                 }
373         }
374 #endif
375         send = fid_max<<8;
376
377         send |= ((msr.hi >> (48-32)) & 0x3f) << 16; /* max vid */
378         send |= (apicid << 24); /* ap apicid */
379
380 #if K8_SET_FIDVID_ONE_BY_ONE == 1
381         vid_cur = msr.hi & 0x3f;
382         fid_cur = msr.lo & 0x3f;
383
384         /* set to current */ 
385         msr.hi = 1;
386         msr.lo = (vid_cur << 8) | (fid_cur);
387         wrmsr(0xc0010041, msr);
388 #endif
389
390         timeout = wait_cpu_state(bsp_apicid, 1);
391         if (timeout) {
392                 print_initcpu8("fidvid_ap_stage1: time out while reading from BSP on ", apicid);
393         }
394         /* send signal to BSP about this AP max fid and vid */
395         /* AP at state 1 that sent our fid and vid */
396         lapic_write(LAPIC_MSG_REG, send | 1);
397
398 //      wait_cpu_state(bsp_apicid, 2); /* don't need we can use apicid directly */
399         loop = 1000000;
400         while (--loop > 0) {
401                 /* remote read BSP signal that include vid/fid that need to set */
402                 if (lapic_remote_read(bsp_apicid, LAPIC_MSG_REG, &readback)!=0)
403                         continue;
404                 if (((readback >> 24) & 0xff) == apicid)
405                         break; /* it is this cpu turn */
406         }
407
408         if (loop > 0) {
409         #if K8_SET_FIDVID_ONE_BY_ONE == 1
410                         readback = set_fidvid(apicid, readback & 0xffff00, 1); // this AP
411         #else
412                 readback = set_fidvid_without_init(readback & 0xffff00); // this AP
413         #endif
414                 /* send signal to BSP that this AP fid/vid is set */
415                 /* allow to change state2 is together with apicid */
416                 /* AP at state that We set the requested fid/vid */
417                 send = (apicid<<24) | (readback & 0x00ffff00); 
418         } else {
419                 print_initcpu8("fidvid_ap_stage2: time out while reading from BSP on ", apicid);
420         }
421
422                 lapic_write(LAPIC_MSG_REG, send | 2);
423
424         timeout = wait_cpu_state(bsp_apicid, 3);
425         if (timeout) {
426                 print_initcpu8("fidvid_ap_stage3: time out while reading from BSP on ", apicid);
427         }
428 }
429
430 static unsigned calc_common_fidvid(unsigned fidvid, unsigned fidvidx)
431 {
432         /* FIXME: need to check the change path to verify if it is reachable 
433          * when common fid is small than 1.6G */
434         if ((fidvid & 0xff00) <= (fidvidx & 0xff00)) {
435                 return fidvid;
436         }
437         else {
438                 return fidvidx;
439         }
440 }
441
442 struct fidvid_st {
443         unsigned common_fidvid;
444 };
445
446 static void init_fidvid_bsp_stage1(unsigned ap_apicid, void *gp )
447 {
448         unsigned readback = 0;
449         unsigned timeout = 1;
450
451         struct fidvid_st *fvp = gp;
452         int loop;
453
454         print_debug_fv("state 1: ap_apicid=", ap_apicid);
455
456         loop = 1000000;
457         while (--loop > 0) {
458                 if (lapic_remote_read(ap_apicid, LAPIC_MSG_REG, &readback)!=0)
459                         continue;
460                 if ((readback & 0xff) == 1) {
461                         timeout = 0;
462                         break; /* target ap is in stage 1 */
463                 }
464         }
465         if (timeout) {
466                 print_initcpu8("fidvid_bsp_stage1: time out while reading from ap ", ap_apicid);
467                 return;
468         }
469
470         print_debug_fv("\treadback=", readback);
471
472         fvp->common_fidvid = calc_common_fidvid(fvp->common_fidvid, readback & 0xffff00);
473
474         print_debug_fv("\tcommon_fidvid=", fvp->common_fidvid);
475 }
476
477 static void init_fidvid_bsp_stage2(unsigned ap_apicid, void *gp)
478 {
479         unsigned readback = 0;
480         unsigned timeout = 1;
481
482         struct fidvid_st *fvp = gp;
483         int loop;
484
485         print_debug_fv("state 2: ap_apicid=", ap_apicid);
486
487         /* all set to state2 */
488         lapic_write(LAPIC_MSG_REG, fvp->common_fidvid | (ap_apicid<<24) | 2);
489
490         loop = 1000000;
491         while (--loop > 0) {
492                 if (lapic_remote_read(ap_apicid, LAPIC_MSG_REG, &readback)!=0)
493                         continue;
494                 if ((readback & 0xff) == 2) {
495                         timeout = 0;
496                         break; /* target ap is stage 2, it's FID has beed set */
497                 }
498         }
499
500         if (timeout) {
501                 print_initcpu8("fidvid_bsp_stage2: time out while reading from ap ", ap_apicid);
502                 return;
503         }
504
505         print_debug_fv("\treadback=", readback);
506 }
507
508 #if K8_SET_FIDVID_STORE_AP_APICID_AT_FIRST == 1
509 struct ap_apicid_st {
510         unsigned num;
511         unsigned apicid[16]; /* 8 way dual core need 16 */
512         /* FIXME: 32 node quad core, may need 128 */
513 };
514
515 static void store_ap_apicid(unsigned ap_apicid, void *gp)
516 {
517         struct ap_apicid_st *p = gp;
518
519         p->apicid[p->num++] = ap_apicid;
520
521 }
522 #endif
523
524 static void init_fidvid_bsp(unsigned bsp_apicid)
525 {
526         uint32_t vid_max;
527         uint32_t fid_max;
528
529         struct fidvid_st fv;
530
531 #if K8_SET_FIDVID_STORE_AP_APICID_AT_FIRST == 1
532         struct ap_apicid_st ap_apicidx;
533         unsigned i;
534 #endif
535
536         msr_t msr;
537         msr =   rdmsr(0xc0010042);
538         fid_max = ((msr.lo >> 16) & 0x3f); /* max fid */
539 #if FX_SUPPORT == 1
540         if (fid_max >= ((25-4) * 2)) { /* FX max fid is 5G */
541                 fid_max = ((msr.lo >> 8) & 0x3f) + 5*2; /* maxFID = minFID + 1G */
542                 if (fid_max >= ((25-4) * 2)) {
543                         fid_max = (10-4) * 2; /* hard set to 2G */
544                 }
545         }
546 #endif
547         vid_max = ((msr.hi>>(48-32)) & 0x3f); //max vid
548         fv.common_fidvid = (fid_max << 8)|(vid_max << 16);
549
550
551         /* for all APs (We know the APIC ID of all APs even the APIC ID is lifted)
552          * remote read from AP about max fid/vid */
553
554         /* let all ap trains to state 1 */
555         lapic_write(LAPIC_MSG_REG,  (bsp_apicid << 24) | 1);
556
557         /* calculate the common max fid/vid that could be used for 
558          * all APs and BSP */
559 #if K8_SET_FIDVID_STORE_AP_APICID_AT_FIRST == 1
560         ap_apicidx.num = 0;
561
562         for_each_ap(bsp_apicid, K8_SET_FIDVID_CORE0_ONLY, store_ap_apicid, &ap_apicidx);
563
564         for (i = 0; i < ap_apicidx.num; i++) {
565                 init_fidvid_bsp_stage1(ap_apicidx.apicid[i], &fv);
566         }
567 #else
568         for_each_ap(bsp_apicid, K8_SET_FIDVID_CORE0_ONLY, init_fidvid_bsp_stage1, &fv);
569 #endif
570
571
572 #if 0
573         unsigned fid, vid;
574         /* Can we use max only? So we can only set fid in one around,
575          * otherwise we need to set that to max after raminit */
576         /* set fid vid to DQS training required */
577         fid = (fv.common_fidvid >> 8)  & 0x3f;
578         vid = (fv.common_fidvid >> 16) & 0x3f;
579
580         if (fid > (10-4) * 2) {
581                 fid = (10-4) * 2; // x10
582         }
583
584         if (vid >= 0x1f) {
585                 vid += 4; /* unit is 12.5mV */
586         } else {
587                 vid += 2; /* unit is 25mV */
588         }
589
590         fv.common_fidvid = (fid<<8) | (vid<<16);
591
592         print_debug_fv("common_fidvid=", fv.common_fidvid);
593
594 #endif
595
596 #if K8_SET_FIDVID_ONE_BY_ONE == 1
597         /* set BSP fid and vid */
598         print_debug_fv("bsp apicid=", bsp_apicid);
599         fv.common_fidvid = set_fidvid(bsp_apicid, fv.common_fidvid, 1);
600         print_debug_fv("common_fidvid=", fv.common_fidvid);
601 #endif
602
603         /* For all APs ( We know the APIC ID of all AP even the APIC ID is lifted)
604          *  send signal to the AP it could change it's fid/vid */
605         /* remote read singnal from AP that AP is done */
606
607         fv.common_fidvid &= 0xffff00;
608
609         /* set state 2 allow is in init_fidvid_bsp_stage2 */
610 #if K8_SET_FIDVID_STORE_AP_APICID_AT_FIRST == 1
611         for (i = 0; i < ap_apicidx.num; i++) {
612                 init_fidvid_bsp_stage2(ap_apicidx.apicid[i], &fv);
613         }
614 #else
615         for_each_ap(bsp_apicid, K8_SET_FIDVID_CORE0_ONLY, init_fidvid_bsp_stage2, &fv);
616 #endif
617
618 #if K8_SET_FIDVID_ONE_BY_ONE == 0
619         /* set BSP fid and vid */
620         print_debug_fv("bsp apicid=", bsp_apicid);
621         fv.common_fidvid = set_fidvid(bsp_apicid, fv.common_fidvid, 1);
622         print_debug_fv("common_fidvid=", fv.common_fidvid);
623
624 #endif
625
626         /* clear the state */
627         lapic_write(LAPIC_MSG_REG, fv.common_fidvid | (bsp_apicid << 24) | 3);
628
629         /* here wait a while, so last ap could read pack, and stop it, don't
630          * call init_timer too early or just don't use init_timer */
631
632 }
633
634 #endif