[U-Boot] [PATCH 05/12] arm: Don't try to support CONFIG_ARMV7_LPAE on ARMv4T

Tom Rini trini at konsulko.com
Fri Jun 9 11:16:23 UTC 2017


On Thu, Jun 08, 2017 at 09:00:17PM -0600, Simon Glass wrote:
> Hi Tom.
> 
> On 22 May 2017 at 19:15, Tom Rini <trini at konsulko.com> wrote:
> > On Mon, May 22, 2017 at 05:17:25AM -0600, Simon Glass wrote:
> >
> >> At present if CONFIG_ARMV7_LPAE is defined then mmu_setup() will use
> >> instructions which are invalid on ARMv4T. This happens on Tegra since it
> >> has an ARMv4T boot CPU. Add a check for the architecture version to allow
> >> the code to be built. It will not actually be executed by the boot CPU,
> >> but needs to compile.
> >>
> >> Signed-off-by: Simon Glass <sjg at chromium.org>
> >> ---
> >>
> >>  arch/arm/lib/cache-cp15.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
> >> index 0f7020a315..f293573601 100644
> >> --- a/arch/arm/lib/cache-cp15.c
> >> +++ b/arch/arm/lib/cache-cp15.c
> >> @@ -129,7 +129,7 @@ static inline void mmu_setup(void)
> >>               dram_bank_mmu_setup(i);
> >>       }
> >>
> >> -#ifdef CONFIG_ARMV7_LPAE
> >> +#if defined(CONFIG_ARMV7_LPAE) && __LINUX_ARM_ARCH__ != 4
> >>       /* Set up 4 PTE entries pointing to our 4 1GB page tables */
> >>       for (i = 0; i < 4; i++) {
> >>               u64 *page_table = (u64 *)(gd->arch.tlb_addr + (4096 * 4));
> >
> > Wait, how do we get to this situation again, and how does it end up
> > being OK?  SPL gets built for ARMv4T and U-Boot proper is built for v7,
> > and we end up doing LPAE enable in full U-Boot?
> 
> Eek sorry I missed this question. The problem is that with ARMv4T this
> code does not currently build. On Tegra, if we enable
> CONFIG_ARMV7_LPAE, this code runs on ARMv7, but it still compiled by
> the ARMv7 boot CPU. So the change here is to make sure it is not
> compiled for ARMv4T.
> 
> Another way of thinking about this is that ARMv4T does not support
> LPAE but we have no way to enable the option only for ARMv7. Both CPUs
> compile the same code. The __LINUX_ARM_ARCH__ option helps with this.

Ah, right.  Thanks.

Reviewed-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170609/30b85cb5/attachment.sig>


More information about the U-Boot mailing list