]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: smc: Add helper asm code for invoking smc
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Wed, 13 Jan 2016 10:55:35 +0000 (16:25 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Jan 2016 10:50:37 +0000 (11:50 +0100)
Added helper ASM code for calling SMC instructions

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
README
arch/arm/include/asm/smc.h [new file with mode: 0644]
arch/arm/lib/Makefile
arch/arm/lib/smc.S [new file with mode: 0644]

diff --git a/README b/README
index 2294e2dfffea554087e72740ba14065b26ee3f2a..7b38320cf34dc1daf5d0afacefdccfdc1e75b16e 100644 (file)
--- a/README
+++ b/README
@@ -669,6 +669,10 @@ The following options need to be configured:
                CONFIG_ARM_ERRATA_798870
                CONFIG_ARM_ERRATA_801819
 
+               CONFIG_ARM_SMC
+
+               Enable compilation of helper ASM code for calling SMC instructions.
+
 - Tegra SoC options:
                CONFIG_TEGRA_SUPPORT_NON_SECURE
 
diff --git a/arch/arm/include/asm/smc.h b/arch/arm/include/asm/smc.h
new file mode 100644 (file)
index 0000000..f5a790f
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2015 - Xilinx, Inc., Michal Simek
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __ARM_SMC_H__
+#define __ARM_SMC_H__
+
+extern int invoke_smc(u64 function_id, u64 arg0, u64 arg1, u64 arg2);
+
+#endif /* __ARM_SMC_H__ */
index f3db7b58cb593fdc3116b2a5cd5a9f0952780e65..6ca67f29444468ddcd11d6a27d1e6382b1e73160 100644 (file)
@@ -12,6 +12,7 @@ ifdef CONFIG_CPU_V7M
 obj-y  += vectors_m.o crt0.o
 else ifdef CONFIG_ARM64
 obj-y  += crt0_64.o
+obj-$(CONFIG_ARM_SMC) += smc.o
 else
 obj-y  += vectors.o crt0.o
 endif
diff --git a/arch/arm/lib/smc.S b/arch/arm/lib/smc.S
new file mode 100644 (file)
index 0000000..08a9c2e
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * (C) Copyright 2015 - 2016, Xilinx, Inc,
+ * Michal Simek <michal.simek@xilinx.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+
+ENTRY(invoke_smc)
+       smc     #0
+       ret
+ENDPROC(invoke_smc)