angelo@sysam.it | bb4ba2c | 2015-02-12 01:40:00 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <asm/immap.h> |
| 10 | #include <asm/io.h> |
| 11 | |
| 12 | #ifdef CONFIG_M5307 |
| 13 | int 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 | |
| 28 | int checkcpu(void) |
| 29 | { |
| 30 | char buf[32]; |
| 31 | |
| 32 | printf("CPU: Freescale Coldfire MCF5307 at %s MHz\n", |
| 33 | strmhz(buf, CONFIG_SYS_CPU_CLK)); |
| 34 | return 0; |
| 35 | } |
| 36 | #endif |