blob: a76deebc68ac366920ad84b59d418db07605777e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +01002/*
3 * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it>
4 *
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +01005 */
6
7#include <common.h>
Simon Glassf5c208d2019-11-14 12:57:20 -07008#include <vsprintf.h>
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +01009#include <asm/immap.h>
10#include <asm/io.h>
11
12#ifdef CONFIG_M5307
13int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
14{
15 sim_t *sim = (sim_t *)(MMAP_SIM);
16
17 /* enable watchdog/reset, set timeout to 0 and wait */
18 out_8(&sim->sypcr, SYPCR_SWE | SYPCR_SWRI);
19
20 /* wait for watchdog reset */
21 for (;;)
22 ;
23
24 /* we don't return! */
25 return 0;
26}
27
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020028#if defined(CONFIG_DISPLAY_CPUINFO)
29int print_cpuinfo(void)
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010030{
31 char buf[32];
32
33 printf("CPU: Freescale Coldfire MCF5307 at %s MHz\n",
34 strmhz(buf, CONFIG_SYS_CPU_CLK));
35 return 0;
36}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020037#endif /* CONFIG_DISPLAY_CPUINFO */
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010038#endif