cpu.c 809 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * (C) Copyright 2003
  3. * Wolfgang Denk, DENX Software Engineering, <wd@denx.de>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <command.h>
  9. #include <linux/compiler.h>
  10. #include <asm/cache.h>
  11. #include <asm/mipsregs.h>
  12. #include <asm/reboot.h>
  13. #ifndef CONFIG_SYSRESET
  14. void __weak _machine_restart(void)
  15. {
  16. fprintf(stderr, "*** reset failed ***\n");
  17. while (1)
  18. /* NOP */;
  19. }
  20. int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  21. {
  22. _machine_restart();
  23. return 0;
  24. }
  25. #endif
  26. void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
  27. {
  28. write_c0_entrylo0(low0);
  29. write_c0_pagemask(pagemask);
  30. write_c0_entrylo1(low1);
  31. write_c0_entryhi(hi);
  32. write_c0_index(index);
  33. tlb_write_indexed();
  34. }
  35. int arch_cpu_init(void)
  36. {
  37. mips_cache_probe();
  38. return 0;
  39. }