blob: 5eeba2358b07d9440d8776ba3eec7d95bb06bbc9 [file] [log] [blame]
Suneel Garapatiaddfabc2019-10-19 18:37:55 -07001// 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
13DECLARE_GLOBAL_DATA_PTR;
14
15ssize_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