soc.c 1.1 KB

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