From: Siva Durga Prasad Paladugu Date: Wed, 13 Jan 2016 10:55:35 +0000 (+0530) Subject: arm: smc: Add helper asm code for invoking smc X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f4dc97747abd75fb23f8d9f43f9acbf49408da6;p=thirdparty%2Fu-boot.git arm: smc: Add helper asm code for invoking smc Added helper ASM code for calling SMC instructions Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- diff --git a/README b/README index 2294e2dfffe..7b38320cf34 100644 --- 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 index 00000000000..f5a790f7604 --- /dev/null +++ b/arch/arm/include/asm/smc.h @@ -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__ */ diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index f3db7b58cb5..6ca67f29444 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -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 index 00000000000..08a9c2ee2e4 --- /dev/null +++ b/arch/arm/lib/smc.S @@ -0,0 +1,14 @@ +/* + * (C) Copyright 2015 - 2016, Xilinx, Inc, + * Michal Simek + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#include +#include + +ENTRY(invoke_smc) + smc #0 + ret +ENDPROC(invoke_smc)