3 /* ***************************************************************************/
7 /* * GX2 BISTs need to be run before BTB or caches are enabled.*/
8 /* * BIST result left in registers on failure to be checked with FS2.*/
10 /* ***************************************************************************/
17 msrnum = CPU_DM_CONFIG0;
19 msr.lo |= DM_CONFIG0_LOWER_DCDIS_SET;
27 outb(POST_CPU_DM_BIST_FAILURE, 0x80); /* 0x29*/
28 msr = rdmsr(msrnum); /* read back for pass fail*/
29 msr.lo &= 0x0F3FF0000;
30 if (msr.lo != 0xfeff0000)
33 msrnum = CPU_DM_CONFIG0;
35 msr.lo &= ~ DM_CONFIG0_LOWER_DCDIS_SET;
41 msrnum = CPU_FP_UROM_BIST;
44 outb(POST_CPU_FPU_BIST_FAILURE, 0x80); /* 0x89*/
45 inb(0x80); /* IO delay*/
46 msr = rdmsr(msrnum); /* read back for pass fail*/
47 while ((msr.lo&0x884) != 0x884)
48 msr = rdmsr(msrnum); /* Endless loop if BIST is broken*/
49 if ((msr.lo&0x642) != 0x642)
52 msr.lo = msr.hi = 0; /* clear FPU BIST bits*/
53 msrnum = CPU_FP_UROM_BIST;
60 msrnum = CPU_PF_BTBRMA_BIST;
63 outb(POST_CPU_BTB_BIST_FAILURE , 0x80); /* 0x8A*/
64 msr = rdmsr(msrnum); /* read back for pass fail*/
65 if ((msr.lo & 0x3030) != 0x3030)
71 print_err("BIST failed!\n");
74 /* ***************************************************************************/
76 /* ***************************************************************************/
82 //GX3 suspend: what is desired?
84 /* Enable Suspend on Halt*/
85 /*msrnum = CPU_XC_CONFIG;
87 msr.lo |= XC_CONFIG_SUSP_ON_HLT;
90 /* ENable SUSP and allow TSC to run in Suspend */
91 /* to keep speed detection happy*/
92 /*msrnum = CPU_BC_CONF_0;
94 msr.lo |= TSC_SUSP_SET | SUSP_EN_SET;
97 /* Setup throttling to proper mode if it is ever enabled.*/
100 msr.lo = 0x00000603C;
101 wrmsr(msrnum, msr); // GX3 OK +/-
104 /* Only do this if we are building for 5535*/
109 /* Enable CIS mode B in FooGlue*/
110 msrnum = MSR_FG + 0x10;
113 msr.lo |= 2; /* ModeB*/
118 /* Disable DOT PLL. Graphics init will enable it if needed.*/
121 // GX3: Disable DOT PLL? No. Lets tick.
123 /* msrnum = GLCP_DOTPLL;
125 msr.lo |= DOTPPL_LOWER_PD_SET;
126 wrmsr(msrnum, msr); */
134 wrmsr(msrnum, msr); //GX3 OK
140 /*if (getnvram( TOKEN_BIST_ENABLE) & == TVALUE_DISABLE) {*/
149 /* I hate to put this check here but it doesn't really work in cpubug.asm*/
151 //GX3: BTB is enabled by default
153 /* msrnum = MSR_GLCP+0x17;
155 if (msr.lo >= CPU_REV_2_1){
156 msrnum = CPU_PF_BTB_CONF;
158 msr.lo |= BTB_ENABLE_SET | RETURN_STACK_ENABLE_SET;
165 /* FPU impercise exceptions bit*/
167 /*if (getnvram( TOKEN_FPU_IE_ENABLE) != TVALUE_DISABLE) {*/
171 // GX3: FPU impercise exceptions bit - what's that?
173 msrnum = CPU_FPU_MSR_MODE;
175 msr.lo |= FPU_IE_SET;
185 /* This code disables the data cache. Don't execute this
186 * unless you're testing something.
188 /* Allow NVRam to override DM Setup*/
189 /*if (getnvram( TOKEN_CACHE_DM_MODE) != 1) {*/
192 msrnum = CPU_DM_CONFIG0;
194 msr.lo |= DM_CONFIG0_LOWER_DCDIS_SET;
197 /* This code disables the instruction cache. Don't execute
198 * this unless you're testing something.
200 /* Allow NVRam to override IM Setup*/
201 /*if (getnvram( TOKEN_CACHE_IM_MODE) ==1) {*/
203 msrnum = CPU_IM_CONFIG;
205 msr.lo |= IM_CONFIG_LOWER_ICD_SET;
214 /* ***************************************************************************/
216 /* * MTestPinCheckBX*/
218 /* * Set MTEST pins to expected values from OPTIONS.INC/NVRAM*/
219 /* * This version is called when there isn't a stack available*/
221 /* ***************************************************************************/
223 MTestPinCheckBX (void){
227 /*if (getnvram( TOKEN_MTEST_ENABLE) ==TVALUE_DISABLE ) {*/
232 msrnum = MC_CFCLK_DBUG;
234 msr.hi |= CFCLK_UPPER_MTST_B2B_DIS_SET | CFCLK_UPPER_MTEST_EN_SET;
237 msrnum = GLCP_SYS_RSTPLL /* Get SDR/DDR mode from GLCP*/;
239 msr.lo >>= RSTPPL_LOWER_SDRMODE_SHIFT;
241 msrnum = MC_CFCLK_DBUG; /* Turn on SDR MTEST stuff*/
243 msr.lo |= CFCLK_LOWER_SDCLK_SET;
244 msr.hi |= CFCLK_UPPER_MTST_DQS_EN_SET;
248 /* Lock the cache down here.*/