From: Benjamin Bagland <bagland@ashesoftime.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Cortex m3 initialisation
Date: Sun, 14 Mar 2010 14:56:16 +0100 [thread overview]
Message-ID: <4b94fe2a1003140656q1cf408e7y9f0d20715a5fb38d@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 742 bytes --]
Hi,
I'm having an issue while trying to use the lm3s811 board emulation with
qemu 0.12.3 or git. It works fine however with qemu-0.11.1.
The problem comes from hw/armv7m.c, around line 231, the initial PC and SP
are set by reading from physical memory, however the rom data is not copied
in physical memory until the reset later on in the initialisation (comes
from commit 45a50b1668822c23afc I think). Since the initial PC is invalid,
the cpu goes straight into UsageFault instead of going to the proper reset
routine.
I've made a small patch to read from rom instead of physical memory, that
fixes the issue with my test program but I'm not sure if it's the proper
thing to do, or even if it works with other arm boards.
Rgds,
Benjamin
[-- Attachment #1.2: Type: text/html, Size: 816 bytes --]
[-- Attachment #2: init.patch --]
[-- Type: application/octet-stream, Size: 573 bytes --]
diff --git a/hw/armv7m.c b/hw/armv7m.c
index 034323d..674a8b4 100644
--- a/hw/armv7m.c
+++ b/hw/armv7m.c
@@ -231,8 +231,10 @@ qemu_irq *armv7m_init(int flash_size, int sram_size,
regular ROM image and perform the normal CPU reset sequence.
Otherwise jump directly to the entry point. */
if (lowaddr == 0) {
- env->regs[13] = ldl_phys(0);
- pc = ldl_phys(4);
+ /* roms are not loaded in physical memory until reset */
+ uint32_t *rom = rom_ptr(0);
+ env->regs[13] = rom[0];
+ pc = rom[1];
} else {
pc = entry;
}
next reply other threads:[~2010-03-14 13:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-14 13:56 Benjamin Bagland [this message]
2010-04-22 2:25 ` [Qemu-devel] Cortex m3 initialisation andrzej zaborowski
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=4b94fe2a1003140656q1cf408e7y9f0d20715a5fb38d@mail.gmail.com \
--to=bagland@ashesoftime.net \
--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).