cpu.c 723 B

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