Merge tag 'u-boot-imx-20200825' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[platform/kernel/u-boot.git] / board / Marvell / octeontx / smc.c
1 // SPDX-License-Identifier:    GPL-2.0
2 /*
3  * Copyright (C) 2018 Marvell International Ltd.
4  *
5  * https://spdx.org/licenses
6  */
7
8 #include <asm/global_data.h>
9 #include <asm/ptrace.h>
10 #include <asm/system.h>
11 #include <asm/arch/smc.h>
12
13 DECLARE_GLOBAL_DATA_PTR;
14
15 ssize_t smc_dram_size(unsigned int node)
16 {
17         struct pt_regs regs;
18
19         regs.regs[0] = OCTEONTX_DRAM_SIZE;
20         regs.regs[1] = node;
21         smc_call(&regs);
22
23         return regs.regs[0];
24 }
25