soc.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Actions Semi Owl SoCs platform support.
  4. *
  5. * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  6. */
  7. #include <cpu_func.h>
  8. #include <asm/cache.h>
  9. #include <linux/arm-smccc.h>
  10. #include <linux/psci.h>
  11. #include <common.h>
  12. #include <asm/io.h>
  13. #include <asm/mach-types.h>
  14. #include <asm/psci.h>
  15. DECLARE_GLOBAL_DATA_PTR;
  16. /*
  17. * dram_init - sets uboots idea of sdram size
  18. */
  19. int dram_init(void)
  20. {
  21. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  22. return 0;
  23. }
  24. /* This is called after dram_init() so use get_ram_size result */
  25. int dram_init_banksize(void)
  26. {
  27. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  28. gd->bd->bi_dram[0].size = gd->ram_size;
  29. return 0;
  30. }
  31. static void show_psci_version(void)
  32. {
  33. struct arm_smccc_res res;
  34. arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
  35. printf("PSCI: v%ld.%ld\n",
  36. PSCI_VERSION_MAJOR(res.a0),
  37. PSCI_VERSION_MINOR(res.a0));
  38. }
  39. int board_init(void)
  40. {
  41. show_psci_version();
  42. return 0;
  43. }
  44. void reset_cpu(ulong addr)
  45. {
  46. psci_system_reset();
  47. }