Hi,<div><br></div><div>While trying to compile barebox for ARM processor with TrustZone security extension, the assembler complained about unsupported ARM instruction "SMC".</div><div>-----------------------------------</div>
<div> {standard input}: Assembler messages:</div><div>{standard input}:12: Error: selected processor does not support ARM mode `smc #0'</div><div>-----------------------------------</div><div><br></div><div>On searching online I found the following link which explains the solution.</div>
<div><a href="https://lists.yoctoproject.org/pipermail/poky/2011-May/005939.html">https://lists.yoctoproject.org/pipermail/poky/2011-May/005939.html</a></div><div><br></div><div><br></div><div>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.</div>
<div><br></div><div>In order to resolve my issue, I just had to make a minor change to arch/arm/Makefile</div><div><br></div><div><div>diff --git a/arch/arm/Makefile b/arch/arm/Makefile</div><div>index 6201a9b..b0bc8b9 100644</div>
<div>--- a/arch/arm/Makefile</div><div>+++ b/arch/arm/Makefile</div><div>@@ -15,11 +15,12 @@ endif</div><div><br></div><div> comma = ,</div><div><br></div><div>+</div><div> # This selects which instruction set is used.</div>
<div> # Note that GCC does not numerically define an architecture version</div><div> # macro, but instead defines a whole series of macros which makes</div><div> # testing for a specific architecture or later rather impossible.</div>
<div>-arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)</div><div>+arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a+sec,-march=armv5t -Wa$(comma)-march=armv7-a+sec)</div>
<div> arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)</div><div> arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)</div>
<div> arch-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4 -march=armv4t</div></div><div><br></div><div>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.</div>
<div><br></div><div>Thanks,</div><div>Calvin</div><div><br></div>