From: Marek Vasut Date: Tue, 7 Mar 2017 07:35:47 +0100 Subject: [U-Boot] [PATCH v5 09/11] armv8: ls2080a: Drop early MMU for SPL build In-Reply-To: References: <1488819754-23590-1-git-send-email-york.sun@nxp.com> <1488819754-23590-10-git-send-email-york.sun@nxp.com> <79a6341b-8627-c11b-2bf6-20c435a8232e@denx.de> Message-ID: <0f640105-dbe5-a468-1c3b-e30711349180@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/07/2017 05:31 AM, york sun wrote: > On 03/06/2017 07:59 PM, Marek Vasut wrote: >> On 03/06/2017 06:02 PM, York Sun wrote: >>> Early MMU improves performance especially on emulators. However, the >>> early MMU is left enabled after the first stage of SPL boot. Instead >>> of flushing D-cache and dealing with re-enabling MMU for the second >>> stage U-Boot, disabling it for SPL build simplifies the process. The >>> performance penalty is unnoticeable on the real hardware. As of now, >>> SPL boot is not supported by existing emulators. So this should have >>> no impact on emulators. >>> >>> Signed-off-by: York Sun >> >> This looks stupid. Why don't you just keep it enabled between SPL and >> U-Boot ? That'd be much more logical and sensible ... > > Mark, > > We are probably the only one using early MMU to speed up execution on > emulators. I only noticed recently the cache/MMU wasn't enabled for most > ARMv8 layerscape SoCs for SPL, except LS2080A (which is where we > started). During recent debug, I learned the process of > break-before-make process should be strictly followed when changing MMU. I don't think I understand this part. > The normal boot part surely creates MMU tables. If the SPL also creates > MMU table and enables cache, then we need to flush cache and disable MMU > before the normal boot part begins to run. Instead of dealing all these > steps just for LS2080A, I figure it would be a lot easier to drop it as > I proposed in this patch. But then this is a step back and makes the whole platform slower, right? > York > >> >>> --- >>> >>> Changes in v5: None >>> Changes in v4: None >>> Changes in v3: >>> Add a patch to drop early MMU setup for LS2080A SPL build. >>> >>> Changes in v2: None >>> >>> arch/arm/cpu/armv8/fsl-layerscape/spl.c | 3 --- >>> 1 file changed, 3 deletions(-) >>> >>> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c >>> index 1dabdbb..73a8680 100644 >>> --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c >>> +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c >>> @@ -45,9 +45,6 @@ void board_init_f(ulong dummy) >>> { >>> /* Clear global data */ >>> memset((void *)gd, 0, sizeof(gd_t)); >>> -#ifdef CONFIG_LS2080A >>> - arch_cpu_init(); >>> -#endif >>> board_early_init_f(); >>> timer_init(); >>> #ifdef CONFIG_LS2080A >>> >> >> >