Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75D3DC25B08 for ; Sat, 20 Aug 2022 19:13:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA9CC83FE9; Sat, 20 Aug 2022 21:13:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="J57TkMIt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2C4E08044A; Sat, 20 Aug 2022 21:13:53 +0200 (CEST) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4214183FE9 for ; Sat, 20 Aug 2022 21:13:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82a.google.com with SMTP id j17so5460773qtp.12 for ; Sat, 20 Aug 2022 12:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=EUNm2GDckHScPCgW8iPO6EY61lSe1/Z+VsO+Bey90Tk=; b=J57TkMItZsP6FYwABQmId8JcJuebumyzLe8XinuBm1fN0INcS690Y2/bL3SEBMPh/e 1bo+Vc4/K+tUarH7PTT+G6ig8/esaU/U8Q2zjbA1C5KzzczZEydr5C0Ihg7KOqO/SSRi Xrb0iaUwNT4918FDQ7nSkTOlSArI9eJ6iC9fU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=EUNm2GDckHScPCgW8iPO6EY61lSe1/Z+VsO+Bey90Tk=; b=x2E0PKjscCLP6GYd8ucRAGZNtL2894QdX723BW4GX9QQhsblow84dPnVWB5IRsrjVA HNcfOjOEWkQ+Elh2nSrwgkyRJ/NLFiYj/99LS++S6fXjJsZxDnv6A0RIa5VV7IoTGFF1 +CV5oJN4ySoo8Ah4nI8vTFd4zWC1umCL0QyW3DVmUleNtavK979hZdeCln9uiDb6NwfE 2jsWztOqhb7RTX/QFc309OZwgn7YdYgJGotbuc/QZteAs4G1wl5C08dlx5RKJjtr83sC +LVF4WyFhQ+QJbYMXS4+gMgi+FTorvuRqmfw8vs3/f6pEMckfLSvOVJktvia0Ej0xTZc NcvQ== X-Gm-Message-State: ACgBeo3Z4A9Bn5wl1f6o1AJT4TLRSKIIoNxftuCTrcAmM+JcGLYg4xcF aywdDtf3iy8cA+D7oNw1AOQ6vg== X-Google-Smtp-Source: AA6agR5UpYSA7CwnWY/G4QMxvAfbu4cS3SV/ZU6eBWpLkHuEzmh7DIH7nbFmPAqI4TGqE35opAdkug== X-Received: by 2002:a05:622a:591:b0:344:5946:8da5 with SMTP id c17-20020a05622a059100b0034459468da5mr10674040qtb.473.1661022826716; Sat, 20 Aug 2022 12:13:46 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id c26-20020ac8111a000000b003431446588fsm5466681qtj.5.2022.08.20.12.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Aug 2022 12:13:46 -0700 (PDT) Date: Sat, 20 Aug 2022 15:13:43 -0400 From: Tom Rini To: Sergei Antonov Cc: Andre Przywara , u-boot@lists.denx.de, Samuel Holland , Ye Li , Simon Glass , Marek Vasut , Sean Anderson , Wolfgang Denk Subject: Re: [PATCH] arm: ARMv4 assembly compatibility Message-ID: <20220820191343.GK1146598@bill-the-cat> References: <20220810090446.1469742-1-saproj@gmail.com> <20220816171736.5c7a78cc@donnerap.cambridge.arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Iq1/bap0gQmEOD4q" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --Iq1/bap0gQmEOD4q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 17, 2022 at 11:27:39AM +0300, Sergei Antonov wrote: > On Tue, 16 Aug 2022 at 19:17, Andre Przywara wro= te: > > > > On Wed, 10 Aug 2022 12:04:46 +0300 > > Sergei Antonov 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 her= e in > > the first hunk, which says: > > /* > > * We only support cores that support at least Thumb-1 and thus we use > > * 'bx lr' > > */ >=20 > I did not notice it. Thanks. >=20 > > 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? >=20 > 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=3D1. >=20 > > 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? >=20 > 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. --=20 Tom --Iq1/bap0gQmEOD4q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMBMmQACgkQFHw5/5Y0 tyw91Av/dpGlT1+wGdNWOqxyaPBBbxRc7vBnx2m72nyM6prtCh8FAFc8gMF0G6co x7HLAFH0SNH0pGlZ6l0weK6ugMP9UqoUsDVGwih3ttL6HU5x/heg/Gpfr7qHtm41 P2kdSi6FrG88EOYa39CN0Bcs4Zad9lGIvmOuVjl34SDtliJgs00/s+PKJGYdX65y mjKyB3SHSHo1YAusNQyppU9F5cMx3W3q1W/YhlKVe7yr4Bc4Wqr/tfNRkFV61UVC uWvRCg9L8RmqYEBAee55OWZfm81vnIKrg9ogW9cjvC3TSdRq8mEVYnebr4gai+Gb dFkZMA72wRdOEa8DnNoa5jmEWKJH9GD94eUkaqNrbjZmbfm4lBqs+KMdKCOjmJuj D3vyY4KPpsKj/QqhSE1YRJw6W2mWJztbnfgebcWWZpeW4tIpAnVWG+wAAmRYlpLe QKr/H/ETHkWiR0ZscB6QDMtqX3EPOZi5/mIdo8cSPeYx8YsXoAAdV2CM+Z6ARAXr 5Lfl6eSW =k8l5 -----END PGP SIGNATURE----- --Iq1/bap0gQmEOD4q--