blob: 443465047715c43d7af2cd56b95ccfef143120fd [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +02002/*
3 * (C) Copyright 2003
4 * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +02005 */
6
Simon Glassfaf73282023-12-15 20:14:05 -07007#include <cpu_func.h>
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +02008#include <command.h>
Simon Glass97589732020-05-10 11:40:02 -06009#include <init.h>
Daniel Schwierzecked160502015-01-29 14:56:20 +010010#include <linux/compiler.h>
Paul Burtondc2037e2016-09-21 11:18:48 +010011#include <asm/cache.h>
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020012#include <asm/mipsregs.h>
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020013#include <asm/reboot.h>
14
developer80e446e2020-11-12 16:35:38 +080015#if !CONFIG_IS_ENABLED(SYSRESET)
Daniel Schwierzecked160502015-01-29 14:56:20 +010016void __weak _machine_restart(void)
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020017{
Marek Vasutf5b356d2023-06-23 20:49:21 +020018 puts("*** reset failed ***\n");
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020019
20 while (1)
21 /* NOP */;
22}
23
Simon Glassfaf73282023-12-15 20:14:05 -070024void reset_cpu(void)
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020025{
26 _machine_restart();
Simon Glassfaf73282023-12-15 20:14:05 -070027}
28
29int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
30{
31 reset_cpu();
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020032
33 return 0;
34}
Álvaro Fernández Rojas2ec1f982017-04-25 00:39:15 +020035#endif
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020036
Paul Burtondc2037e2016-09-21 11:18:48 +010037int arch_cpu_init(void)
38{
39 mips_cache_probe();
40 return 0;
41}