aboutsummaryrefslogtreecommitdiff
path: root/arch/m68k/cpu/mcf530x/cpu.c
blob: bef9047b3581c3f0b3388153a95d7e99d3140a5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: GPL-2.0+
/*
 * (C) Copyright 2014  Angelo Dureghello <angelo@sysam.it>
 *
 */

#include <common.h>
#include <init.h>
#include <vsprintf.h>
#include <asm/immap.h>
#include <asm/io.h>

#ifdef CONFIG_M5307
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	sim_t *sim = (sim_t *)(MMAP_SIM);

	/* enable watchdog/reset, set timeout to 0 and wait */
	out_8(&sim->sypcr, SYPCR_SWE | SYPCR_SWRI);

	/* wait for watchdog reset */
	for (;;)
		;

	/* we don't return! */
	return 0;
}

#if defined(CONFIG_DISPLAY_CPUINFO)
int print_cpuinfo(void)
{
	char buf[32];

	printf("CPU:   Freescale Coldfire MCF5307 at %s MHz\n",
	       strmhz(buf, CONFIG_SYS_CPU_CLK));
	return 0;
}
#endif /* CONFIG_DISPLAY_CPUINFO */
#endif