diff options
author | TsiChungLiew <Tsi-Chung.Liew@freescale.com> | 2007-08-16 13:20:50 -0500 |
---|---|---|
committer | John Rigby <jrigby@freescale.com> | 2007-08-16 17:43:21 -0600 |
commit | a1436a842654a8d3927d082a8ae9ee0a10da62d7 (patch) | |
tree | 1dccbd40831f7ad96d9cfecb0be82644dcb48279 /cpu/mcf52x2/cpu.c | |
parent | a605aacd8324094199402816cc6d9124aba57b8d (diff) | |
download | u-boot-imx-a1436a842654a8d3927d082a8ae9ee0a10da62d7.zip u-boot-imx-a1436a842654a8d3927d082a8ae9ee0a10da62d7.tar.gz u-boot-imx-a1436a842654a8d3927d082a8ae9ee0a10da62d7.tar.bz2 |
ColdFire: Add M5253EVBE platform for MCF52x2
Signed-off-by: TsiChungLiew <Tsi-Chung.Liew@freescale.com>
Diffstat (limited to 'cpu/mcf52x2/cpu.c')
-rw-r--r-- | cpu/mcf52x2/cpu.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/cpu/mcf52x2/cpu.c b/cpu/mcf52x2/cpu.c index 96fe371..71ea408 100644 --- a/cpu/mcf52x2/cpu.c +++ b/cpu/mcf52x2/cpu.c @@ -205,7 +205,7 @@ int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) }; #endif -#ifdef CONFIG_M5249 /* test-only: todo... */ +#ifdef CONFIG_M5249 int checkcpu(void) { char buf[32]; @@ -225,3 +225,33 @@ int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) return 0; }; #endif + +#ifdef CONFIG_M5253 +int checkcpu(void) +{ + char buf[32]; + + unsigned char resetsource = mbar_readLong(SIM_RSR); + printf("CPU: Freescale Coldfire MCF5253 at %s MHz\n", + strmhz(buf, CFG_CLK)); + + if ((resetsource & SIM_RSR_HRST) || (resetsource & SIM_RSR_SWTR)) { + printf("Reset:%s%s\n", + (resetsource & SIM_RSR_HRST) ? " Hardware/ System Reset" + : "", + (resetsource & SIM_RSR_SWTR) ? " Software Watchdog" : + ""); + } + return 0; +} + +int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[]) +{ + /* enable watchdog, set timeout to 0 and wait */ + mbar_writeByte(SIM_SYPCR, 0xc0); + while (1) ; + + /* we don't return! */ + return 0; +}; +#endif |