Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it> |
| 4 | * |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 8 | #include <command.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 9 | #include <init.h> |
Simon Glass | f5c208d | 2019-11-14 12:57:20 -0700 | [diff] [blame] | 10 | #include <vsprintf.h> |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 11 | #include <asm/immap.h> |
| 12 | #include <asm/io.h> |
| 13 | |
| 14 | #ifdef CONFIG_M5307 |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 15 | int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 16 | { |
| 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 Dureghello | 3146b4d | 2017-08-20 00:01:55 +0200 | [diff] [blame] | 30 | #if defined(CONFIG_DISPLAY_CPUINFO) |
| 31 | int print_cpuinfo(void) |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 32 | { |
| 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 Dureghello | 3146b4d | 2017-08-20 00:01:55 +0200 | [diff] [blame] | 39 | #endif /* CONFIG_DISPLAY_CPUINFO */ |
angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 40 | #endif |