blob: 92a0ef76895ce5185aaba18fb7d3ae48c973a255 [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
Simon Glassed38aef2020-05-10 11:40:03 -06007#include <command.h>
Simon Glass97589732020-05-10 11:40:02 -06008#include <init.h>
Simon Glassf5c208d2019-11-14 12:57:20 -07009#include <vsprintf.h>
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010010#include <asm/immap.h>
11#include <asm/io.h>
12
13#ifdef CONFIG_M5307
Simon Glassed38aef2020-05-10 11:40:03 -060014int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010015{
16 sim_t *sim = (sim_t *)(MMAP_SIM);
17
18 /* enable watchdog/reset, set timeout to 0 and wait */
19 out_8(&sim->sypcr, SYPCR_SWE | SYPCR_SWRI);
20
21 /* wait for watchdog reset */
22 for (;;)
23 ;
24
25 /* we don't return! */
26 return 0;
27}
28
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020029#if defined(CONFIG_DISPLAY_CPUINFO)
30int print_cpuinfo(void)
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010031{
32 char buf[32];
33
34 printf("CPU: Freescale Coldfire MCF5307 at %s MHz\n",
Tom Rini6a5dccc2022-11-16 13:10:41 -050035 strmhz(buf, CFG_SYS_CPU_CLK));
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010036 return 0;
37}
Angelo Dureghello3146b4d2017-08-20 00:01:55 +020038#endif /* CONFIG_DISPLAY_CPUINFO */
angelo@sysam.itbb4ba2c2015-02-12 01:40:00 +010039#endif