qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: qemu-devel@nongnu.org
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	chenhuacai@kernel.org, f4bug@amsat.org, paulburton@kernel.org
Subject: [PATCH v2 2/8] hw/mips/malta: Use address translation helper to calculate bootloader_run_addr
Date: Tue, 15 Dec 2020 14:41:54 +0800	[thread overview]
Message-ID: <20201215064200.28751-3-jiaxun.yang@flygoat.com> (raw)
In-Reply-To: <20201215064200.28751-1-jiaxun.yang@flygoat.com>

So it will sign extend adresses properly.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 hw/mips/malta.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 7db009a3e9..1fbb8a3220 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1302,9 +1302,9 @@ void mips_malta_init(MachineState *machine)
         /* For KVM we reserve 1MB of RAM for running bootloader */
         if (kvm_enabled()) {
             ram_low_size -= 0x100000;
-            bootloader_run_addr = 0x40000000 + ram_low_size;
+            bootloader_run_addr = cpu_mips_kvm_um_phys_to_kseg0(NULL, ram_low_size);
         } else {
-            bootloader_run_addr = 0xbfc00000;
+            bootloader_run_addr = cpu_mips_phys_to_kseg0(NULL, RESET_ADDRESS);
         }
 
         /* Write a small bootloader to the flash location. */
-- 
2.29.2


  parent reply	other threads:[~2020-12-15  6:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15  6:41 [PATCH v2 0/8] MIPS Bootloader helper Jiaxun Yang
2020-12-15  6:41 ` [PATCH v2 1/8] hw/mips: Make bootloader addresses unsgined Jiaxun Yang
2021-01-01 23:15   ` Philippe Mathieu-Daudé
2021-01-03 15:57     ` Philippe Mathieu-Daudé
2021-01-03 20:41       ` Philippe Mathieu-Daudé
2020-12-15  6:41 ` Jiaxun Yang [this message]
2021-01-01 20:40   ` [PATCH v2 2/8] hw/mips/malta: Use address translation helper to calculate bootloader_run_addr Philippe Mathieu-Daudé
2020-12-15  6:41 ` [PATCH v2 3/8] hw/mips: Use address translation helper to handle ENVP_ADDR Jiaxun Yang
2021-01-01 20:38   ` Philippe Mathieu-Daudé
2021-01-01 23:16     ` Philippe Mathieu-Daudé
2020-12-15  6:45 ` [PATCH v2 4/8] hw/mips: Add a bootloader helper Jiaxun Yang
2020-12-15  6:45 ` [PATCH v2 5/8] hw/mips: Use bl_gen_kernel_jump to generate bootloaders Jiaxun Yang
2021-01-06 17:48   ` Philippe Mathieu-Daudé
2021-01-27  3:03     ` Jiaxun Yang
2020-12-15  6:45 ` [PATCH v2 6/8] target/mips/addr: Add translation helpers for KSEG1 Jiaxun Yang
2021-01-01 20:42   ` Philippe Mathieu-Daudé
2021-01-01 23:16     ` Philippe Mathieu-Daudé
2021-01-03  1:46       ` Huacai Chen
2020-12-15  6:45 ` [PATCH v2 7/8] hw/mips/malta: Use bootloader helper to set BAR resgiters Jiaxun Yang
2021-01-06 17:21   ` Philippe Mathieu-Daudé
2020-12-15  6:46 ` [PATCH v2 8/8] hw/mips/boston: Use bootloader helper to set GCRs Jiaxun Yang
2021-01-06 17:28   ` Philippe Mathieu-Daudé
2021-01-06 17:30     ` Philippe Mathieu-Daudé
2021-01-06 17:35       ` Philippe Mathieu-Daudé
2020-12-19  6:20 ` [PATCH v2 0/8] MIPS Bootloader helper Jiaxun Yang
2020-12-19 19:04 ` Philippe Mathieu-Daudé
2021-01-03 20:42 ` Philippe Mathieu-Daudé
2021-01-06 17:50   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201215064200.28751-3-jiaxun.yang@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhuacai@kernel.org \
    --cc=f4bug@amsat.org \
    --cc=paulburton@kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).