smc.c 426 B

12345678910111213141516171819202122232425
  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/ptrace.h>
  9. #include <asm/system.h>
  10. #include <asm/arch/smc.h>
  11. DECLARE_GLOBAL_DATA_PTR;
  12. ssize_t smc_dram_size(unsigned int node)
  13. {
  14. struct pt_regs regs;
  15. regs.regs[0] = OCTEONTX_DRAM_SIZE;
  16. regs.regs[1] = node;
  17. smc_call(&regs);
  18. return regs.regs[0];
  19. }