diff options
| author | Stefan Roese <sr@denx.de> | 2007-08-15 21:06:27 +0200 | 
|---|---|---|
| committer | Stefan Roese <sr@denx.de> | 2007-08-15 21:06:27 +0200 | 
| commit | b706d63559aeec352bc72dd86d7d5423c15f6a60 (patch) | |
| tree | fdeda4d61970fef239d9d66ecd851fa46cfe5ec0 /cpu/mpc83xx/cpu_init.c | |
| parent | c8603cfbd4573379a6076c9c208545ba2bbf019a (diff) | |
| parent | 594e79838ce5078a90d0c27abb2b2d61d5f8e8a7 (diff) | |
| download | olio-uboot-2014.01-b706d63559aeec352bc72dd86d7d5423c15f6a60.tar.xz olio-uboot-2014.01-b706d63559aeec352bc72dd86d7d5423c15f6a60.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; +} |