xref: /openbmc/u-boot/arch/mips/cpu/cpu.c (revision 86a390d3)
1 /*
2  * (C) Copyright 2003
3  * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #include <common.h>
9 #include <command.h>
10 #include <netdev.h>
11 #include <linux/compiler.h>
12 #include <asm/mipsregs.h>
13 #include <asm/reboot.h>
14 
15 void __weak _machine_restart(void)
16 {
17 	fprintf(stderr, "*** reset failed ***\n");
18 
19 	while (1)
20 		/* NOP */;
21 }
22 
23 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
24 {
25 	_machine_restart();
26 
27 	return 0;
28 }
29 
30 void 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 }
39