]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
test/py: Update u_boot_utils.find_ram_base to bypass the low 2MiB memory
authorBin Meng <bmeng.cn@gmail.com>
Sat, 28 Mar 2020 14:25:28 +0000 (07:25 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 10 Apr 2020 19:54:16 +0000 (15:54 -0400)
On some RISC-V targets the low memory is protected that prevents
S-mode U-Boot from access.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
test/py/u_boot_utils.py

index bf2a0fc0e24898178e683d83217b3743121397f9..939d82eec12a622b6c4dcc6b3b80057d9037be59 100644 (file)
@@ -237,10 +237,11 @@ def find_ram_base(u_boot_console):
             raise Exception('Failed to find RAM bank start in `bdinfo`')
 
     # We don't want ram_base to be zero as some functions test if the given
-    # address is NULL (0). Let's add 2MiB then (size of an ARM LPAE/v8 section).
+    # address is NULL (0). Besides, on some RISC-V targets the low memory
+    # is protected that prevents S-mode U-Boot from access.
+    # Let's add 2MiB then (size of an ARM LPAE/v8 section).
 
-    if ram_base == 0:
-        ram_base += 1024 * 1024 * 2
+    ram_base += 1024 * 1024 * 2
 
     return ram_base