Clean up some more comments and white space in model_gx2/cpureginit.c.
This is Abuild and boot tested. Signed-off-by: Nils Jacobs <njacobs8@hetnet.nl> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6015 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
		| @@ -1,16 +1,12 @@ | |||||||
|  |  | ||||||
| /* ***************************************************************************/ | /* cpuRegInit */ | ||||||
| /* *	cpuRegInit*/ |  | ||||||
| /* ***************************************************************************/ |  | ||||||
| void cpuRegInit (void) | void cpuRegInit (void) | ||||||
| { | { | ||||||
| 	int msrnum; | 	int msrnum; | ||||||
| 	msr_t msr; | 	msr_t msr; | ||||||
| 	/* Turn on BTM for early debug based on setup. */ | 	/* Turn on BTM for early debug based on setup. */ | ||||||
| 	/* if (getnvram( TOKEN_BTM_DIAG_MODE) & 3) { */ | 	/* if (getnvram( TOKEN_BTM_DIAG_MODE) & 3) { */ | ||||||
| 	/* | 	/* The following is only for diagnostics mode; do not use for OLPC */ | ||||||
| 	 * The following is only for diagnostics mode; do not use for OLPC |  | ||||||
| 	 */ |  | ||||||
| 	if (0) { | 	if (0) { | ||||||
| 		/* Set Diagnostic Mode */ | 		/* Set Diagnostic Mode */ | ||||||
| 		msrnum = CPU_GLD_MSR_DIAG; | 		msrnum = CPU_GLD_MSR_DIAG; | ||||||
| @@ -24,33 +20,32 @@ void cpuRegInit (void) | |||||||
| 		msr.lo =  0x08;			/* reset value (SCOPE_SEL = 0) causes FIFO toshift out, */ | 		msr.lo =  0x08;			/* reset value (SCOPE_SEL = 0) causes FIFO toshift out, */ | ||||||
| 		wrmsr(msrnum, msr);		/* exchange it to anything else to prevent this */ | 		wrmsr(msrnum, msr);		/* exchange it to anything else to prevent this */ | ||||||
|  |  | ||||||
| 		/* ;Turn off debug clock*/ | 		/* Turn off debug clock */ | ||||||
| 		msrnum = 0x04C000016;		/* DBG_CLK_CTL*/ | 		msrnum = 0x04C000016;		/* DBG_CLK_CTL*/ | ||||||
| 		msr.lo =  0x00;			/* No clock*/ | 		msr.lo =  0x00;			/* No clock*/ | ||||||
| 		msr.hi =  0x00; | 		msr.hi =  0x00; | ||||||
| 		wrmsr(msrnum, msr); | 		wrmsr(msrnum, msr); | ||||||
|  |  | ||||||
| 		/* ;Set debug clock to CPU*/ | 		/* Set debug clock to CPU */ | ||||||
| 		msrnum = 0x04C000016;		/* DBG_CLK_CTL */ | 		msrnum = 0x04C000016;		/* DBG_CLK_CTL */ | ||||||
| 		msr.lo =  0x01;			/* CPU CLOCK */ | 		msr.lo =  0x01;			/* CPU CLOCK */ | ||||||
| 		msr.hi =  0x00; | 		msr.hi =  0x00; | ||||||
| 		wrmsr(msrnum, msr); | 		wrmsr(msrnum, msr); | ||||||
|  |  | ||||||
| 		/* ;Set fifo ctl to BTM bits wide*/ | 		/* Set fifo ctl to BTM bits wide */ | ||||||
| 		msrnum = 0x04C00005E;		/* FIFO_CTL */ | 		msrnum = 0x04C00005E;		/* FIFO_CTL */ | ||||||
| 		msr.lo =  0x003880000;		/* Bit [25:24] are size (11=BTM, 10 = 64 bit, 01= 32 bit, 00 = 16bit) */ | 		msr.lo =  0x003880000;		/* Bit [25:24] are size (11=BTM, 10 = 64 bit, 01= 32 bit, 00 = 16bit) */ | ||||||
| 		wrmsr(msrnum, msr);		/* Bit [23:21] are position (100 = CPU downto0) */ | 		wrmsr(msrnum, msr);		/* Bit [23:21] are position (100 = CPU downto0) */ | ||||||
| 						/* Bit [19] sets it up in slow data mode. */ | 						/* Bit [19] sets it up in slow data mode. */ | ||||||
|  |  | ||||||
| 		/* ;enable fifo loading - BTM sizing will constrain*/ | 		/* enable fifo loading - BTM sizing will constrain */ | ||||||
| 		/* ; only valid BTM packets to load - this action should always be on*/ | 		/* only valid BTM packets to load - this action should always be on */ | ||||||
|  |  | ||||||
| 		msrnum = 0x04C00006F;		/* GLCP ACTION7 - load fifo */ | 		msrnum = 0x04C00006F;		/* GLCP ACTION7 - load fifo */ | ||||||
| 		msr.lo =  0x00000F000;		/* Any nibble all 1's will always trigger */ | 		msr.lo =  0x00000F000;		/* Any nibble all 1's will always trigger */ | ||||||
| 		msr.hi =  0x000000000;		/* */ | 		msr.hi =  0x000000000; | ||||||
| 		wrmsr(msrnum, msr); | 		wrmsr(msrnum, msr); | ||||||
|  |  | ||||||
| 		/* ;start storing diag data in the fifo*/ | 		/* start storing diag data in the fifo */ | ||||||
| 		msrnum = 0x04C00005F;		/* DIAG CTL */ | 		msrnum = 0x04C00005F;		/* DIAG CTL */ | ||||||
| 		msr.lo =  0x080000000;		/* enable actions */ | 		msr.lo =  0x080000000;		/* enable actions */ | ||||||
| 		msr.hi =  0x000000000; | 		msr.hi =  0x000000000; | ||||||
| @@ -95,11 +90,8 @@ void cpuRegInit (void) | |||||||
| 	msr.lo =  0x00000603C; | 	msr.lo =  0x00000603C; | ||||||
| 	wrmsr(msrnum, msr); | 	wrmsr(msrnum, msr); | ||||||
|  |  | ||||||
|  |  | ||||||
| /* Only do this if we are building for 5535 */ | /* Only do this if we are building for 5535 */ | ||||||
| /* */ |  | ||||||
| /* FooGlue Setup */ | /* FooGlue Setup */ | ||||||
| /* */ |  | ||||||
| #if 1 | #if 1 | ||||||
| 	/* Enable CIS mode B in FooGlue */ | 	/* Enable CIS mode B in FooGlue */ | ||||||
| 	msrnum = MSR_FG + 0x10; | 	msrnum = MSR_FG + 0x10; | ||||||
| @@ -109,25 +101,19 @@ void cpuRegInit (void) | |||||||
| 	wrmsr(msrnum, msr); | 	wrmsr(msrnum, msr); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* */ |  | ||||||
| /* Disable DOT PLL. Graphics init will enable it if needed. */ | /* Disable DOT PLL. Graphics init will enable it if needed. */ | ||||||
| /* */ |  | ||||||
| 	msrnum = GLCP_DOTPLL; | 	msrnum = GLCP_DOTPLL; | ||||||
| 	msr = rdmsr(msrnum); | 	msr = rdmsr(msrnum); | ||||||
| 	msr.lo |= DOTPPL_LOWER_PD_SET; | 	msr.lo |= DOTPPL_LOWER_PD_SET; | ||||||
| 	wrmsr(msrnum, msr); | 	wrmsr(msrnum, msr); | ||||||
|  |  | ||||||
| /* */ |  | ||||||
| /* Enable RSDC */ | /* Enable RSDC */ | ||||||
| /* */ |  | ||||||
| 	msrnum = 0x1301 ; | 	msrnum = 0x1301 ; | ||||||
| 	msr = rdmsr(msrnum); | 	msr = rdmsr(msrnum); | ||||||
| 	msr.lo |=  0x08; | 	msr.lo |=  0x08; | ||||||
| 	wrmsr(msrnum, msr); | 	wrmsr(msrnum, msr); | ||||||
|  |  | ||||||
| /* */ |  | ||||||
| /* Enable BTB */ | /* Enable BTB */ | ||||||
| /* */ |  | ||||||
| 	/* I hate to put this check here but it doesn't really work in cpubug.asm */ | 	/* I hate to put this check here but it doesn't really work in cpubug.asm */ | ||||||
| 	msrnum = MSR_GLCP+0x17; | 	msrnum = MSR_GLCP+0x17; | ||||||
| 	msr = rdmsr(msrnum); | 	msr = rdmsr(msrnum); | ||||||
| @@ -138,9 +124,7 @@ void cpuRegInit (void) | |||||||
| 		wrmsr(msrnum, msr); | 		wrmsr(msrnum, msr); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| /* */ |  | ||||||
| /* FPU impercise exceptions bit */ | /* FPU impercise exceptions bit */ | ||||||
| /* */ |  | ||||||
| 	/* if (getnvram( TOKEN_FPU_IE_ENABLE) != TVALUE_DISABLE) { */ | 	/* if (getnvram( TOKEN_FPU_IE_ENABLE) != TVALUE_DISABLE) { */ | ||||||
| 	{ | 	{ | ||||||
| 		msrnum = CPU_FPU_MSR_MODE; | 		msrnum = CPU_FPU_MSR_MODE; | ||||||
| @@ -150,16 +134,13 @@ void cpuRegInit (void) | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| #if 0 | #if 0 | ||||||
| 	/* */ |  | ||||||
| 	/* Cache Overides */ | 	/* Cache Overides */ | ||||||
| 	/* */ |  | ||||||
| 	/* This code disables the data cache.  Don't execute this | 	/* This code disables the data cache.  Don't execute this | ||||||
| 	 * unless you're testing something. | 	 * unless you're testing something. | ||||||
| 	 */ | 	 */ | ||||||
| 	/* Allow NVRam to override DM Setup */ | 	/* Allow NVRam to override DM Setup */ | ||||||
| 	/* if (getnvram( TOKEN_CACHE_DM_MODE) != 1) { */ | 	/* if (getnvram( TOKEN_CACHE_DM_MODE) != 1) { */ | ||||||
| 	{ | 	{ | ||||||
|  |  | ||||||
| 		msrnum = CPU_DM_CONFIG0; | 		msrnum = CPU_DM_CONFIG0; | ||||||
| 		msr = rdmsr(msrnum); | 		msr = rdmsr(msrnum); | ||||||
| 		msr.lo |=  DM_CONFIG0_LOWER_DCDIS_SET; | 		msr.lo |=  DM_CONFIG0_LOWER_DCDIS_SET; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user