blob: 0659bf6558119f22059df20b9d996880e5d08e0e [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 Glassed38aef2020-05-10 11:40:03 -06008#include <command.h>
Simon Glass97589732020-05-10 11:40:02 -06009#include <init.h>
Simon Glassf5c208d2019-11-14 12:57:20 -070010#include <vsprintf.h>
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010011#include <asm/immap.h>
12#include <asm/io.h>
13
14#ifdef CONFIG_M5307
Simon Glassed38aef2020-05-10 11:40:03 -060015int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010016{
17 sim_t *sim = (sim_t *)(MMAP_SIM);
18
19 /* enable watchdog/reset, set timeout to 0 and wait */
20 out_8(&sim->sypcr, SYPCR_SWE | SYPCR_SWRI);
21
22 /* wait for watchdog reset */
23 for (;;)
24 ;
25
26 /* we don't return! */
27 return 0;
28}
29
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020030#if defined(CONFIG_DISPLAY_CPUINFO)
31int print_cpuinfo(void)
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010032{
33 char buf[32];
34
35 printf("CPU: Freescale Coldfire MCF5307 at %s MHz\n",
36 strmhz(buf, CONFIG_SYS_CPU_CLK));
37 return 0;
38}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020039#endif /* CONFIG_DISPLAY_CPUINFO */
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010040#endif