summaryrefslogtreecommitdiff
path: root/board/Marvell/octeontx/smc.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/Marvell/octeontx/smc.c')
-rw-r--r--board/Marvell/octeontx/smc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/board/Marvell/octeontx/smc.c b/board/Marvell/octeontx/smc.c
new file mode 100644
index 0000000000..5eeba2358b
--- /dev/null
+++ b/board/Marvell/octeontx/smc.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018 Marvell International Ltd.
+ *
+ * https://spdx.org/licenses
+ */
+
+#include <asm/global_data.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+#include <asm/arch/smc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+ssize_t smc_dram_size(unsigned int node)
+{
+ struct pt_regs regs;
+
+ regs.regs[0] = OCTEONTX_DRAM_SIZE;
+ regs.regs[1] = node;
+ smc_call(&regs);
+
+ return regs.regs[0];
+}
+