7 /* The following is only for diagnostics mode; do not use for OLPC */
9 /* Set Diagnostic Mode */
10 msrnum = CPU_GLD_MSR_DIAG;
12 msr.lo = DIAG_SEL1_SET | DIAG_SET0_SET;
15 /* Set up GLCP to grab BTM data. */
16 msrnum = GLCP_DBGOUT; /* GLCP_DBGOUT MSR */
18 msr.lo = 0x08; /* reset value (SCOPE_SEL = 0) causes FIFO toshift out, */
19 wrmsr(msrnum, msr); /* exchange it to anything else to prevent this */
21 /* Turn off debug clock */
22 msrnum = GLCP_DBGCLKCTL; /* DBG_CLK_CTL */
23 msr.lo = 0x00; /* No clock */
27 /* Set debug clock to CPU */
28 msrnum = GLCP_DBGCLKCTL; /* DBG_CLK_CTL */
29 msr.lo = 0x01; /* CPU CLOCK */
33 /* Set fifo ctl to BTM bits wide */
34 msrnum = GLCP_FIFOCTL; /* FIFO_CTL */
35 msr.lo = 0x003880000; /* Bit [25:24] are size (11=BTM, 10 = 64 bit, 01= 32 bit, 00 = 16bit) */
36 wrmsr(msrnum, msr); /* Bit [23:21] are position (100 = CPU downto0) */
37 /* Bit [19] sets it up in slow data mode. */
39 /* enable fifo loading - BTM sizing will constrain */
40 /* only valid BTM packets to load - this action should always be on */
41 msrnum = 0x04C00006F; /* GLCP ACTION7 - load fifo */
42 msr.lo = 0x00000F000; /* Any nibble all 1's will always trigger */
46 /* start storing diag data in the fifo */
47 msrnum = 0x04C00005F; /* DIAG CTL */
48 msr.lo = 0x080000000; /* enable actions */
52 /* Set up delay on data lines, so that the hold time */
54 msrnum = GLCP_PROCSTAT; /* GLCP IO DELAY CONTROLS */
56 msr.hi = 0x080ad6b57; /* RGB delay = 0x07 */
59 /* Set up DF to output diag information on DF pins. */
60 msrnum = DF_GLD_MSR_MASTER_CONF;
65 msrnum = GLCP_DBGOUT; /* GLCP_DBGOUT MSR */
67 msr.lo = 0x0; /* reset value (SCOPE_SEL = 0) causes FIFO to shift out, */
69 /* end of code for BTM */
72 /* Enable Suspend on Halt */
73 msrnum = CPU_XC_CONFIG;
75 msr.lo |= XC_CONFIG_SUSP_ON_HLT;
78 /* ENable SUSP and allow TSC to run in Suspend */
79 /* to keep speed detection happy */
80 msrnum = CPU_BC_CONF_0;
82 msr.lo |= TSC_SUSP_SET | SUSP_EN_SET;
85 /* Setup throttling to proper mode if it is ever enabled. */
91 /* Only do this if we are building for 5535 */
94 /* Enable CIS mode B in FooGlue */
95 msrnum = MSR_FG + 0x10;
98 msr.lo |= 2; /* ModeB */
102 /* Disable DOT PLL. Graphics init will enable it if needed. */
103 msrnum = GLCP_DOTPLL;
105 msr.lo |= DOTPPL_LOWER_PD_SET;
109 msrnum = CPU_AC_SMM_CTL;
115 /* I hate to put this check here but it doesn't really work in cpubug.asm */
116 msrnum = GLCP_CHIP_REVID;
118 if (msr.lo >= CPU_REV_2_1){
119 msrnum = CPU_PF_BTB_CONF;
121 msr.lo |= BTB_ENABLE_SET | RETURN_STACK_ENABLE_SET;
125 /* FPU impercise exceptions bit */
127 msrnum = CPU_FPU_MSR_MODE;
129 msr.lo |= FPU_IE_SET;