cpu.c 646 B

123456789101112131415161718192021222324252627282930313233343536
  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. int checkcpu(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