cpu.c 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* CPU specific code for the LEON3 CPU
  2. *
  3. * (C) Copyright 2007
  4. * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #include <common.h>
  9. #include <watchdog.h>
  10. #include <command.h>
  11. #include <netdev.h>
  12. #include <asm/io.h>
  13. #include <asm/processor.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. extern void _reset_reloc(void);
  16. int checkcpu(void)
  17. {
  18. /* check LEON version here */
  19. printf("CPU: LEON3\n");
  20. return 0;
  21. }
  22. /* ------------------------------------------------------------------------- */
  23. void cpu_reset(void)
  24. {
  25. /* Interrupts off */
  26. disable_interrupts();
  27. /* jump to restart in flash */
  28. _reset_reloc();
  29. }
  30. int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
  31. {
  32. cpu_reset();
  33. return 1;
  34. }
  35. u64 flash_read64(void *addr)
  36. {
  37. return __raw_readq(addr);
  38. }
  39. /* ------------------------------------------------------------------------- */
  40. #ifdef CONFIG_GRETH
  41. int cpu_eth_init(bd_t *bis)
  42. {
  43. return greth_initialize(bis);
  44. }
  45. #endif