blob: 9e3169576c65ec052001ce43d57f1143d68a46d6 [file] [log] [blame]
Suneel Garapati0a668f62019-10-19 18:47:37 -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/io.h>
10#include <asm/psci.h>
11#include <asm/ptrace.h>
12#include <asm/system.h>
13#include <asm/arch/smc.h>
14
15DECLARE_GLOBAL_DATA_PTR;
16
17ssize_t smc_dram_size(unsigned int node)
18{
19 struct pt_regs regs;
20
21 regs.regs[0] = OCTEONTX2_DRAM_SIZE;
22 regs.regs[1] = node;
23 smc_call(&regs);
24
25 return regs.regs[0];
26}
27
28ssize_t smc_disable_rvu_lfs(unsigned int node)
29{
30 struct pt_regs regs;
31
32 regs.regs[0] = OCTEONTX2_DISABLE_RVU_LFS;
33 regs.regs[1] = node;
34 smc_call(&regs);
35
36 return regs.regs[0];
37}
38
39ssize_t smc_configure_ooo(unsigned int val)
40{
41 struct pt_regs regs;
42
43 regs.regs[0] = OCTEONTX2_CONFIG_OOO;
44 regs.regs[1] = val;
45 smc_call(&regs);
46
47 return regs.regs[0];
48}
49
50ssize_t smc_flsf_fw_booted(void)
51{
52 struct pt_regs regs;
53
54 regs.regs[0] = OCTEONTX2_FSAFE_PR_BOOT_SUCCESS;
55 smc_call(&regs);
56
57 return regs.regs[0];
58}