Hi,
While trying to compile barebox for ARM processor with TrustZone security extension, the assembler complained about unsupported ARM instruction "SMC".
-----------------------------------
{standard input}: Assembler messages:
{standard input}:12: Error: selected processor does not support ARM mode `smc #0'
-----------------------------------
On searching online I found the following link which explains the solution.
I feel that we may have to bring ARM TrustZone security extension support to barebox at least as a conditional compilation option, as this may be widely used in ARM based embedded systems.
In order to resolve my issue, I just had to make a minor change to arch/arm/Makefile
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 6201a9b..b0bc8b9 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -15,11 +15,12 @@ endif
comma = ,
+
# This selects which instruction set is used.
# Note that GCC does not numerically define an architecture version
# macro, but instead defines a whole series of macros which makes
# testing for a specific architecture or later rather impossible.
-arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
+arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a+sec,-march=armv5t -Wa$(comma)-march=armv7-a+sec)
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
arch-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4 -march=armv4t
As I'm new to barebox, I'm not sure whether this change will break something. It would be good if experts can have look at the link provided and submit a patch.
Thanks,
Calvin