• Siarhei Siamashka's avatar
    fel: Support for enabling MMU after running SPL on new SoC variants · a275b246
    Siarhei Siamashka authored
    The BROM in newer SoC variants doesn't enable MMU by default anymore.
    So in order to benefit from e4b3da2b
    
    
    ("fel: Faster USB transfers via 'fel write' to DRAM"), we need to
    be able to enable it from the 'sunxi-fel' tool.
    
    This patch can be interpreted as simply reverting the changes done
    by Allwinner and bringing back the MMU support in roughly the same
    way as it was before. That's why the values in the hardware
    registers and the translation table entries replicate the A20 setup.
    
    Additionally, the code is now more defensive and introduces new
    "canary" checks for certain known magic values in the coprocessor
    registers in order to safeguard against any unpleasant surprises.
    
    MMU tuning for A80 and A64 will probably need a more sophisticated
    setup with a second level page table. Because both the SRAM and
    the BROM reside in the same 1MB section there and we need finer
    granularity. In other words, enabling the MMU on A80 and A64 is
    not supported yet.
    Signed-off-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
    Acked-by: default avatarPeter Korsgaard <peter@korsgaard.com>
    a275b246
fel.c 41.8 KB