blob: 55e6498b6557c75b265328b3eb3958ded4d5d758 [file] [log] [blame]
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +02001/*
2 * (C) Copyright 2003
3 * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +02006 */
7
8#include <common.h>
9#include <command.h>
Daniel Schwierzeckeef88df2015-01-29 14:56:20 +010010#include <linux/compiler.h>
Paul Burton8cb48172016-09-21 11:18:48 +010011#include <asm/cache.h>
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020012#include <asm/mipsregs.h>
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020013#include <asm/reboot.h>
14
Álvaro Fernández Rojas5e365462017-04-25 00:39:15 +020015#ifndef CONFIG_SYSRESET
Daniel Schwierzeckeef88df2015-01-29 14:56:20 +010016void __weak _machine_restart(void)
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020017{
18 fprintf(stderr, "*** reset failed ***\n");
19
20 while (1)
21 /* NOP */;
22}
23
24int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
25{
26 _machine_restart();
27
28 return 0;
29}
Álvaro Fernández Rojas5e365462017-04-25 00:39:15 +020030#endif
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020031
Zhi-zhou Zhang32afad72012-10-16 15:02:08 +020032void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
33{
34 write_c0_entrylo0(low0);
35 write_c0_pagemask(pagemask);
36 write_c0_entrylo1(low1);
37 write_c0_entryhi(hi);
38 write_c0_index(index);
39 tlb_write_indexed();
40}
Paul Burton8cb48172016-09-21 11:18:48 +010041
42int arch_cpu_init(void)
43{
44 mips_cache_probe();
45 return 0;
46}