From: Maksim Perov <coder@frtk.ru>
To: qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Cc: Maksim Perov <coder@frtk.ru>
Subject: [PATCH] hw/riscv: Setting address of vector reset is improved
Date: Mon, 15 Aug 2022 20:41:38 +0300 [thread overview]
Message-ID: <20220815174138.19766-1-coder@frtk.ru> (raw)
Previously address is set by default value 0x1000 which is hardcoded in target/riscv/cpu_bits.h
If add to new RISC-V Machine in which ROM area is not based on 0x1000 address than there is problem of running simulation
Signed-off-by: Maksim Perov <coder@frtk.ru>
---
hw/riscv/boot.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 06b4fc5ac3..5e2438d39a 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -327,6 +327,10 @@ void riscv_setup_rom_reset_vec(MachineState *machine, RISCVHartArrayState *harts
riscv_rom_copy_firmware_info(machine, rom_base, rom_size, sizeof(reset_vec),
kernel_entry);
+ /* change reset vector address */
+ for (i = 0; i < harts->num_harts; i++) {
+ harts->harts[i].env.resetvec = rom_base;
+ }
return;
}
--
2.17.1
next reply other threads:[~2022-08-15 20:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 17:41 Maksim Perov [this message]
2022-08-15 23:47 ` [PATCH] hw/riscv: Setting address of vector reset is improved Alistair Francis
-- strict thread matches above, loose matches on Subject: below --
2022-08-15 17:30 Maksim Perov
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=20220815174138.19766-1-coder@frtk.ru \
--to=coder@frtk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@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).