cpu.c 720 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it>
  4. *
  5. */
  6. #include <common.h>
  7. #include <asm/immap.h>
  8. #include <asm/io.h>
  9. #ifdef CONFIG_M5307
  10. int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  11. {
  12. sim_t *sim = (sim_t *)(MMAP_SIM);
  13. /* enable watchdog/reset, set timeout to 0 and wait */
  14. out_8(&sim->sypcr, SYPCR_SWE | SYPCR_SWRI);
  15. /* wait for watchdog reset */
  16. for (;;)
  17. ;
  18. /* we don't return! */
  19. return 0;
  20. }
  21. #if defined(CONFIG_DISPLAY_CPUINFO)
  22. int print_cpuinfo(void)
  23. {
  24. char buf[32];
  25. printf("CPU: Freescale Coldfire MCF5307 at %s MHz\n",
  26. strmhz(buf, CONFIG_SYS_CPU_CLK));
  27. return 0;
  28. }
  29. #endif /* CONFIG_DISPLAY_CPUINFO */
  30. #endif