Suneel Garapati | addfabc | 2019-10-19 18:37:55 -0700 | [diff] [blame] | 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(®s); | ||||
22 | |||||
23 | return regs.regs[0]; | ||||
24 | } | ||||
25 |