cpu.c 785 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 <command.h>
  8. #include <init.h>
  9. #include <vsprintf.h>
  10. #include <asm/immap.h>
  11. #include <asm/io.h>
  12. #ifdef CONFIG_M5307
  13. int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
  14. {
  15. sim_t *sim = (sim_t *)(MMAP_SIM);
  16. /* enable watchdog/reset, set timeout to 0 and wait */
  17. out_8(&sim->sypcr, SYPCR_SWE | SYPCR_SWRI);
  18. /* wait for watchdog reset */
  19. for (;;)
  20. ;
  21. /* we don't return! */
  22. return 0;
  23. }
  24. #if defined(CONFIG_DISPLAY_CPUINFO)
  25. int print_cpuinfo(void)
  26. {
  27. char buf[32];
  28. printf("CPU: Freescale Coldfire MCF5307 at %s MHz\n",
  29. strmhz(buf, CONFIG_SYS_CPU_CLK));
  30. return 0;
  31. }
  32. #endif /* CONFIG_DISPLAY_CPUINFO */
  33. #endif