blob: 5c56ab0289e05173d02e51541abea724468ee590 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +02002/*
3 * (C) Copyright 2003
4 * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +02005 */
6
7#include <common.h>
8#include <command.h>
Daniel Schwierzeckeef88df2015-01-29 14:56:20 +01009#include <linux/compiler.h>
Paul Burton8cb48172016-09-21 11:18:48 +010010#include <asm/cache.h>
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020011#include <asm/mipsregs.h>
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020012#include <asm/reboot.h>
13
Álvaro Fernández Rojas5e365462017-04-25 00:39:15 +020014#ifndef CONFIG_SYSRESET
Daniel Schwierzeckeef88df2015-01-29 14:56:20 +010015void __weak _machine_restart(void)
Zhi-zhou Zhang32afad72012-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}
Álvaro Fernández Rojas5e365462017-04-25 00:39:15 +020029#endif
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020030
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020031void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
32{
33 write_c0_entrylo0(low0);
34 write_c0_pagemask(pagemask);
35 write_c0_entrylo1(low1);
36 write_c0_entryhi(hi);
37 write_c0_index(index);
38 tlb_write_indexed();
39}
Paul Burton8cb48172016-09-21 11:18:48 +010040
41int arch_cpu_init(void)
42{
43 mips_cache_probe();
44 return 0;
45}