blob: 1b919ed82289d1d4d30e4daccf057c8c4e89e9ed [file] [log] [blame]
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +02001/*
2 * (C) Copyright 2003
3 * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +02006 */
7
8#include <common.h>
9#include <command.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
Daniel Schwierzecked160502015-01-29 14:56:20 +010015void __weak _machine_restart(void)
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020016{
17 fprintf(stderr, "*** reset failed ***\n");
18
19 while (1)
20 /* NOP */;
21}
22
23int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
24{
25 _machine_restart();
26
27 return 0;
28}
29
Zhi-zhou Zhange0d6df52012-10-16 15:02:08 +020030void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
31{
32 write_c0_entrylo0(low0);
33 write_c0_pagemask(pagemask);
34 write_c0_entrylo1(low1);
35 write_c0_entryhi(hi);
36 write_c0_index(index);
37 tlb_write_indexed();
38}
Paul Burtondc2037e2016-09-21 11:18:48 +010039
40int arch_cpu_init(void)
41{
42 mips_cache_probe();
43 return 0;
44}