Zhi-zhou Zhang | 32afad7 | 2012-10-16 15:02:08 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2003 |
| 3 | * Wolfgang Denk, DENX Software Engineering, <wd@denx.de> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Zhi-zhou Zhang | 32afad7 | 2012-10-16 15:02:08 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <command.h> |
Daniel Schwierzeck | eef88df | 2015-01-29 14:56:20 +0100 | [diff] [blame] | 10 | #include <linux/compiler.h> |
Zhi-zhou Zhang | 32afad7 | 2012-10-16 15:02:08 +0200 | [diff] [blame] | 11 | #include <asm/mipsregs.h> |
Zhi-zhou Zhang | 32afad7 | 2012-10-16 15:02:08 +0200 | [diff] [blame] | 12 | #include <asm/reboot.h> |
| 13 | |
Daniel Schwierzeck | eef88df | 2015-01-29 14:56:20 +0100 | [diff] [blame] | 14 | void __weak _machine_restart(void) |
Zhi-zhou Zhang | 32afad7 | 2012-10-16 15:02:08 +0200 | [diff] [blame] | 15 | { |
| 16 | fprintf(stderr, "*** reset failed ***\n"); |
| 17 | |
| 18 | while (1) |
| 19 | /* NOP */; |
| 20 | } |
| 21 | |
| 22 | int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 23 | { |
| 24 | _machine_restart(); |
| 25 | |
| 26 | return 0; |
| 27 | } |
| 28 | |
Zhi-zhou Zhang | 32afad7 | 2012-10-16 15:02:08 +0200 | [diff] [blame] | 29 | void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1) |
| 30 | { |
| 31 | write_c0_entrylo0(low0); |
| 32 | write_c0_pagemask(pagemask); |
| 33 | write_c0_entrylo1(low1); |
| 34 | write_c0_entryhi(hi); |
| 35 | write_c0_index(index); |
| 36 | tlb_write_indexed(); |
| 37 | } |