smc.c 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2018 Marvell International Ltd.
  4. *
  5. * https://spdx.org/licenses
  6. */
  7. #include <asm/global_data.h>
  8. #include <asm/io.h>
  9. #include <asm/psci.h>
  10. #include <asm/ptrace.h>
  11. #include <asm/system.h>
  12. #include <asm/arch/smc.h>
  13. DECLARE_GLOBAL_DATA_PTR;
  14. ssize_t smc_dram_size(unsigned int node)
  15. {
  16. struct pt_regs regs;
  17. regs.regs[0] = OCTEONTX2_DRAM_SIZE;
  18. regs.regs[1] = node;
  19. smc_call(&regs);
  20. return regs.regs[0];
  21. }
  22. ssize_t smc_disable_rvu_lfs(unsigned int node)
  23. {
  24. struct pt_regs regs;
  25. regs.regs[0] = OCTEONTX2_DISABLE_RVU_LFS;
  26. regs.regs[1] = node;
  27. smc_call(&regs);
  28. return regs.regs[0];
  29. }
  30. ssize_t smc_configure_ooo(unsigned int val)
  31. {
  32. struct pt_regs regs;
  33. regs.regs[0] = OCTEONTX2_CONFIG_OOO;
  34. regs.regs[1] = val;
  35. smc_call(&regs);
  36. return regs.regs[0];
  37. }
  38. ssize_t smc_flsf_fw_booted(void)
  39. {
  40. struct pt_regs regs;
  41. regs.regs[0] = OCTEONTX2_FSAFE_PR_BOOT_SUCCESS;
  42. smc_call(&regs);
  43. return regs.regs[0];
  44. }