[PATCH] arm: ARMv4 assembly compatibility

Tom Rini trini at konsulko.com
Sat Aug 20 21:13:43 CEST 2022


On Wed, Aug 17, 2022 at 11:27:39AM +0300, Sergei Antonov wrote:
> On Tue, 16 Aug 2022 at 19:17, Andre Przywara <andre.przywara at arm.com> wrote:
> >
> > On Wed, 10 Aug 2022 12:04:46 +0300
> > Sergei Antonov <saproj at gmail.com> wrote:
> >
> > Hi,
> >
> > > There is currently a problem that U-Boot can not work on ARMv4
> > > because assembly imlementations of memcpy() and some other functions
> > > use "bx lr" instruction that is not available on ARMv4 ("mov pc, lr"
> > > should be used instead).
> >
> > So there is a comment in the current code, right above what's shown here in
> > the first hunk, which says:
> > /*
> >  * We only support cores that support at least Thumb-1 and thus we use
> >  * 'bx lr'
> >  */
> 
> I did not notice it. Thanks.
> 
> > This was added by Tom in commit 431afb4ef9fe, when he removed some code
> > very close to what you are adding back now.
> >
> > So what is the story here? This commit seems to suggest U-Boot doesn't support
> > even ARMv5 without "T", has this changed? There are probably other code
> > places which would need adjustment to run on ARMv4?
> 
> I can not explain why there was __ARM_ARCH_5E__ in the removed code. I
> am dealing with the issue that ARMv4 ("four" without letter "t") does
> not understand "bx lr" while ARMv4T does. The device on which I run
> modern U-Boot has FA526 - a CPU similar to ARM810 which is ARMv4
> without Thumb. Its MIDR register is 0x66015261 which means that
> Architecture=1.
> 
> > Tom, can you say why support for Thumb-less code / older architectures was
> > dropped? No users, I guess?
> >
> > Sergei, can you say what is this for? Are you adding support for a SoC
> > with an ARM810 core from 1996?
> 
> Yes.
> And U-Boot for this device is already working: able to boot Linux and
> do TFTP stuff. My company is going to use it on hundreds of devices.
> It would be great for us to not have to patch U-Boot locally and have
> ARMv4-compatible assembly in the mainline.

So, my recollection at the time was that we were / had removed all
upstream platforms that were using a core design that didn't accept "bx
lr". If you're going to upstream the rest of your platform, please do a
v2 that also updates the comment Andre pointed out. But by itself, the
general policy is that we support platforms that are upstream, and
anything else is functionally dead code.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220820/655958d3/attachment.sig>


More information about the U-Boot mailing list