changes for the lx and artecgroup mobo
[coreboot.git] / src / northbridge / amd / lx / pll_reset.c
1 #define POST_CODE(x) outb(0x80, x)
2
3 static void pll_reset(void)
4 {
5         msr_t msrGlcpSysRstpll;
6
7         msrGlcpSysRstpll = rdmsr(GLCP_SYS_RSTPLL);
8         
9         print_debug("_MSR GLCP_SYS_RSTPLL (");
10                 print_debug_hex32(GLCP_SYS_RSTPLL);
11                 print_debug(") value is: ");
12                 print_debug_hex32(msrGlcpSysRstpll.hi);
13                 print_debug(":");
14                 print_debug_hex32(msrGlcpSysRstpll.lo);
15                 print_debug("\n");
16         
17         msrGlcpSysRstpll.lo &= 0x80000000;
18
19         // If the "we've already been here" flag is set, don't reconfigure the pll
20         if ( !(msrGlcpSysRstpll.lo) )
21         { // we haven't configured the PLL; do it now
22             print_debug("CONFIGURING PLL");
23         
24                 POST_CODE(0x77);
25         
26                 // HARDCODED VALUES MOVED BACK TO auto.c AS THEY HAVE TO BE BOARD-SPECIFIC
27                 // (this file is included from there)
28
29                         /* CPU and GLIU mult/div (GLMC_CLK = GLIU_CLK / 2)  */
30                 msrGlcpSysRstpll.hi = PLLMSRhi;
31
32                         /* Hold Count - how long we will sit in reset */
33                 msrGlcpSysRstpll.lo = PLLMSRlo;
34
35                         /* Use SWFLAGS to remember: "we've already been here"  */
36                         msrGlcpSysRstpll.lo |= 0x80000000;
37
38                         /* "reset the chip" value */
39                         msrGlcpSysRstpll.lo |= 0x00000001;
40
41                 wrmsr(GLCP_SYS_RSTPLL, msrGlcpSysRstpll);
42         }
43 }