condor.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/global_data.h>
  13. #include <asm/processor.h>
  14. #include <asm/mach-types.h>
  15. #include <asm/io.h>
  16. #include <linux/errno.h>
  17. #include <asm/arch/sys_proto.h>
  18. DECLARE_GLOBAL_DATA_PTR;
  19. int board_init(void)
  20. {
  21. /* adress of boot parameters */
  22. gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000;
  23. return 0;
  24. }
  25. #define RST_BASE 0xE6160000
  26. #define RST_CA57RESCNT (RST_BASE + 0x40)
  27. #define RST_CA53RESCNT (RST_BASE + 0x44)
  28. #define RST_RSTOUTCR (RST_BASE + 0x58)
  29. #define RST_CA57_CODE 0xA5A5000F
  30. #define RST_CA53_CODE 0x5A5A000F
  31. void reset_cpu(void)
  32. {
  33. unsigned long midr, cputype;
  34. asm volatile("mrs %0, midr_el1" : "=r" (midr));
  35. cputype = (midr >> 4) & 0xfff;
  36. if (cputype == 0xd03)
  37. writel(RST_CA53_CODE, RST_CA53RESCNT);
  38. else if (cputype == 0xd07)
  39. writel(RST_CA57_CODE, RST_CA57RESCNT);
  40. else
  41. hang();
  42. }