condor.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * board/renesas/condor/condor.c
  4. * This file is Condor board support.
  5. *
  6. * Copyright (C) 2019 Marek Vasut <marek.vasut+renesas@gmail.com>
  7. */
  8. #include <common.h>
  9. #include <cpu_func.h>
  10. #include <hang.h>
  11. #include <init.h>
  12. #include <asm/processor.h>
  13. #include <asm/mach-types.h>
  14. #include <asm/io.h>
  15. #include <linux/errno.h>
  16. #include <asm/arch/sys_proto.h>
  17. DECLARE_GLOBAL_DATA_PTR;
  18. int board_init(void)
  19. {
  20. /* adress of boot parameters */
  21. gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000;
  22. return 0;
  23. }
  24. #define RST_BASE 0xE6160000
  25. #define RST_CA57RESCNT (RST_BASE + 0x40)
  26. #define RST_CA53RESCNT (RST_BASE + 0x44)
  27. #define RST_RSTOUTCR (RST_BASE + 0x58)
  28. #define RST_CA57_CODE 0xA5A5000F
  29. #define RST_CA53_CODE 0x5A5A000F
  30. void reset_cpu(ulong addr)
  31. {
  32. unsigned long midr, cputype;
  33. asm volatile("mrs %0, midr_el1" : "=r" (midr));
  34. cputype = (midr >> 4) & 0xfff;
  35. if (cputype == 0xd03)
  36. writel(RST_CA53_CODE, RST_CA53RESCNT);
  37. else if (cputype == 0xd07)
  38. writel(RST_CA57_CODE, RST_CA57RESCNT);
  39. else
  40. hang();
  41. }