[U-Boot] [PATCH] arm: use common instructions applicable to armv7m & other arm archs

Vikas MANOCHA
2016-01-29T23:36:55Z

Hi Albert,

> -----Original Message-----
> From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net]
> Sent: Friday, January 29, 2016 9:16 AM
> To: Vikas MANOCHA
> Cc: u-boot at lists.denx.de; Simon Glass; rev13 at wp.pl; Bo Shen; Przemyslaw
> Marczak
> Subject: Re: [PATCH] arm: use common instructions applicable to armv7m &
> other arm archs
>
> Hello Vikas,
>
> On Mon, 18 Jan 2016 18:52:57 -0800, Vikas Manocha
> <vikas.manocha@st.com> wrote:
> > BIC instruction to clear the SP is not allowed in armv7m & is
> > deprecated in ARMv6T2 & above. This patch cleans the code by using
> > instructions allowed for armv7m as well as other Arm archs.
>
> I am not against this patch, which has merits on its own; but the commit
> message above raises a couple of questions.
>
> 1. It seems to imply that in the current arch/arm/lib/crt0.S, BIC is
> incorrectly being used on sp. However, it is *not*; it is used on r3,
> precisely because it cannot be used directly on sp, as the comment
> before the bic instruction clearly states. Why does the commit
> message raise this non-issue?

For sure, BIC is used correctly. Currently BIC instruction is being used on r3 for armv7m & on SP for others.
The patch is to use same instruction for all ISAs & to make code cleaner.
The intention of message " BIC instruction to clear the SP is not allowed in armv7m" is to justify the usage of register (r0) instead of SP for BIC.
Sorry if it created some confusion, how about following commit message for v2:

"This patch cleans the code by using instructions allowed for armv7m as well as other Arm archs.
Just for information, BIC instruction to clear the SP is not allowed in armv7m & is deprecated in ARMv6T2 & above"

>
> 2. I could not find any information on BIC being deprecated in
> Architecture Reference Manuals of either ArmV7 (section "Deprecated
> Features in ARMv7-M", or ARMv6-M (section "Deprecated and Obsolete
> Features"). Where does this information come from?

I got it from some of the web locations, one of them is:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473j/dom1361289864906.html

Cheers,
Vikas

>
> Amicalement,
> --
> Albert.