diff options
| author | Stefan Roese <sr@denx.de> | 2007-08-14 16:36:29 +0200 | 
|---|---|---|
| committer | Stefan Roese <sr@denx.de> | 2007-08-14 16:36:29 +0200 | 
| commit | 3b3bff4cbf2cb14f9a3e7d03f26ebab900efe4ae (patch) | |
| tree | fb66bf8861d9f78765160d734a438856f5317cdb /cpu/mpc83xx/cpu_init.c | |
| parent | 4ce846ec59f36b85d6644a769690ad3feb667575 (diff) | |
| parent | 4ef35e53c693556c54b0c22d6f873de87bade253 (diff) | |
| download | olio-uboot-2014.01-3b3bff4cbf2cb14f9a3e7d03f26ebab900efe4ae.tar.xz olio-uboot-2014.01-3b3bff4cbf2cb14f9a3e7d03f26ebab900efe4ae.zip | |
Merge with git://www.denx.de/git/u-boot.git
Diffstat (limited to 'cpu/mpc83xx/cpu_init.c')
| -rw-r--r-- | cpu/mpc83xx/cpu_init.c | 50 | 
1 files changed, 48 insertions, 2 deletions
| diff --git a/cpu/mpc83xx/cpu_init.c b/cpu/mpc83xx/cpu_init.c index 3ac91619c..722497966 100644 --- a/cpu/mpc83xx/cpu_init.c +++ b/cpu/mpc83xx/cpu_init.c @@ -83,20 +83,30 @@ void cpu_init_f (volatile immap_t * im)  	im->sysconf.spcr = (im->sysconf.spcr & ~SPCR_TSEC2EP) | (CFG_SPCR_TSEC2EP << SPCR_TSEC2EP_SHIFT);  #endif -#ifdef CONFIG_MPC834X  #ifdef CFG_SCCR_TSEC1CM  	/* TSEC1 clock mode */  	im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1CM) | (CFG_SCCR_TSEC1CM << SCCR_TSEC1CM_SHIFT);  #endif +  #ifdef CFG_SCCR_TSEC2CM  	/* TSEC2 & I2C1 clock mode */  	im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC2CM) | (CFG_SCCR_TSEC2CM << SCCR_TSEC2CM_SHIFT);  #endif + +#ifdef CFG_SCCR_TSEC1ON +	/* TSEC1 clock switch */ +	im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC1ON) | (CFG_SCCR_TSEC1ON << SCCR_TSEC1ON_SHIFT); +#endif + +#ifdef CFG_SCCR_TSEC2ON +	/* TSEC2 clock switch */ +	im->clk.sccr = (im->clk.sccr & ~SCCR_TSEC2ON) | (CFG_SCCR_TSEC2ON << SCCR_TSEC2ON_SHIFT); +#endif +  #ifdef CFG_SCCR_USBMPHCM  	/* USB MPH clock mode */  	im->clk.sccr = (im->clk.sccr & ~SCCR_USBMPHCM) | (CFG_SCCR_USBMPHCM << SCCR_USBMPHCM_SHIFT);  #endif -#endif /* CONFIG_MPC834X */  #ifdef CFG_SCCR_PCICM  	/* PCI & DMA clock mode */ @@ -247,3 +257,39 @@ int cpu_init_r (void)  #endif  	return 0;  } + +/* + * Figure out the cause of the reset + */ +int prt_83xx_rsr(void) +{ +	static struct { +		ulong mask; +		char *desc; +	} bits[] = { +		{ +		RSR_SWSR, "Software Soft"}, { +		RSR_SWHR, "Software Hard"}, { +		RSR_JSRS, "JTAG Soft"}, { +		RSR_CSHR, "Check Stop"}, { +		RSR_SWRS, "Software Watchdog"}, { +		RSR_BMRS, "Bus Monitor"}, { +		RSR_SRS,  "External/Internal Soft"}, { +		RSR_HRS,  "External/Internal Hard"} +	}; +	static int n = sizeof bits / sizeof bits[0]; +	ulong rsr = gd->reset_status; +	int i; +	char *sep; + +	puts("Reset Status:"); + +	sep = " "; +	for (i = 0; i < n; i++) +		if (rsr & bits[i].mask) { +			printf("%s%s", sep, bits[i].desc); +			sep = ", "; +		} +	puts("\n\n"); +	return 0; +} |