On 03/06/2017 09:03 AM, York Sun wrote: > A recent debug revealed MMU for DDR shouldn't be enabled before > DDR is initialized. Otherwise, a "normal memory" mapping may cause > speculative access which may hang the system if accessing to DDR > is not allowed at time. For Layerscape platforms, we have early > MMU setup to speed up execution on emulators. The solution is to > update MMU after DDR is ready. The same idea goes to final MMU as > well. Actual DDR size is used to create the mappings. Non-exist > address should be marked as "fault", i.e. invalid to avoid unwanted > speculative access. Break-before-make process is followed when > change is made for MMU. > > Aside from the DDR size, reserved memory used for secure RAM and > Management Complex (MC) makes things more complicated. To simplify > it, a new global is added to track the reserved RAM. Secure RAM > is excluded from U-Boot MMU. The reserved RAM is still mapped > under U-Boot since we will need to copy data into it. Reserved > RAM is excluded when device tree is fixed up so OS won't see it. > An SoC level efi_add_known_memory() is implemented to add valid > memory banks. DP-DDR is not added as memory. > > Some MC configurations are moved to Kconfig. > > Verified on LS2080ARDB with regular Linux boot and distro boot from USB. > > Changes in v5: > Rename RESV_RAM_TOP to RESV_RAM in Kconfig > Revise "help" message and add comment to explain how RESV_RAM is used. > > Changes in v4: > Revert the change of C bit in v3 patch. > > Changes in v3: > Instead of flushing d-cache, following the break-before-make process > to change MMU table. > Add a patch to drop early MMU setup for LS2080A SPL build. > > Changes in v2: > Add change to efi mapping > Implement SoC level efi_add_known_memory(). DP-DDR is skipped so no > need to add it as reserved memory later. > > York Sun (11): > armv8: Add global variable resv_ram > armv8: ls2080a: Move CONFIG_FSL_MC_ENET to Kconfig > armv8: ls2080a: Move CONFIG_SYS_MC_RSV_MEM_ALIGN to Kconfig > efi: Add a hook to allow adding memory mapping > armv8: layerscape: Rewrite memory reservation > driver: net: fsl-mc: Update calculation of MC RAM > armv8: layerscape: Update MMU mapping with actual DDR size > armv8: layerscape: Fix the sequence of changing MMU table > armv8: ls2080a: Drop early MMU for SPL build > armv8: mmu: Add a function to change mapping attributes > armv8: layerscape: Update early MMU for DDR after initialization >
Applied to u-boot-fsl-qoriq master, awaiting upstream. York _______________________________________________ U-Boot mailing list [email protected] https://lists.denx.de/listinfo/u-boot

