soc.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 <linux/arm-smccc.h>
  9. #include <linux/psci.h>
  10. #include <common.h>
  11. #include <asm/io.h>
  12. #include <asm/mach-types.h>
  13. #include <asm/psci.h>
  14. DECLARE_GLOBAL_DATA_PTR;
  15. /*
  16. * dram_init - sets uboots idea of sdram size
  17. */
  18. int dram_init(void)
  19. {
  20. gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
  21. return 0;
  22. }
  23. /* This is called after dram_init() so use get_ram_size result */
  24. int dram_init_banksize(void)
  25. {
  26. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  27. gd->bd->bi_dram[0].size = gd->ram_size;
  28. return 0;
  29. }
  30. static void show_psci_version(void)
  31. {
  32. struct arm_smccc_res res;
  33. arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
  34. printf("PSCI: v%ld.%ld\n",
  35. PSCI_VERSION_MAJOR(res.a0),
  36. PSCI_VERSION_MINOR(res.a0));
  37. }
  38. int board_init(void)
  39. {
  40. show_psci_version();
  41. return 0;
  42. }
  43. void reset_cpu(ulong addr)
  44. {
  45. psci_system_reset();
  46. }