From patchwork Sat Mar 28 14:25:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 244460 List-Id: U-Boot discussion From: bmeng.cn at gmail.com (Bin Meng) Date: Sat, 28 Mar 2020 07:25:28 -0700 Subject: [PATCH v2 4/5] test/py: Update u_boot_utils.find_ram_base to bypass the low 2MiB memory In-Reply-To: <1585405529-21397-1-git-send-email-bmeng.cn@gmail.com> References: <1585405529-21397-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1585405529-21397-5-git-send-email-bmeng.cn@gmail.com> On some RISC-V targets the low memory is protected that prevents S-mode U-Boot from access. Signed-off-by: Bin Meng --- Changes in v2: None test/py/u_boot_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py index bf2a0fc..939d82e 100644 --- a/test/py/u_boot_utils.py +++ b/test/py/u_boot_utils.py @@ -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