cpu.c 806 B

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