ebisu.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * board/renesas/ebisu/ebisu.c
  4. * This file is Ebisu board support.
  5. *
  6. * Copyright (C) 2018 Marek Vasut <marek.vasut+renesas@gmail.com>
  7. */
  8. #include <common.h>
  9. #include <cpu_func.h>
  10. #include <hang.h>
  11. #include <malloc.h>
  12. #include <netdev.h>
  13. #include <dm.h>
  14. #include <dm/platform_data/serial_sh.h>
  15. #include <asm/processor.h>
  16. #include <asm/mach-types.h>
  17. #include <asm/io.h>
  18. #include <linux/errno.h>
  19. #include <asm/arch/sys_proto.h>
  20. #include <asm/gpio.h>
  21. #include <asm/arch/gpio.h>
  22. #include <asm/arch/rmobile.h>
  23. #include <asm/arch/rcar-mstp.h>
  24. #include <asm/arch/sh_sdhi.h>
  25. #include <i2c.h>
  26. #include <mmc.h>
  27. DECLARE_GLOBAL_DATA_PTR;
  28. void s_init(void)
  29. {
  30. }
  31. int board_early_init_f(void)
  32. {
  33. return 0;
  34. }
  35. int board_init(void)
  36. {
  37. /* adress of boot parameters */
  38. gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000;
  39. return 0;
  40. }
  41. #define RST_BASE 0xE6160000
  42. #define RST_CA57RESCNT (RST_BASE + 0x40)
  43. #define RST_CA53RESCNT (RST_BASE + 0x44)
  44. #define RST_RSTOUTCR (RST_BASE + 0x58)
  45. #define RST_CA57_CODE 0xA5A5000F
  46. #define RST_CA53_CODE 0x5A5A000F
  47. void reset_cpu(ulong addr)
  48. {
  49. unsigned long midr, cputype;
  50. asm volatile("mrs %0, midr_el1" : "=r" (midr));
  51. cputype = (midr >> 4) & 0xfff;
  52. if (cputype == 0xd03)
  53. writel(RST_CA53_CODE, RST_CA53RESCNT);
  54. else if (cputype == 0xd07)
  55. writel(RST_CA57_CODE, RST_CA57RESCNT);
  56. else
  57. hang();
  58. }