From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Bensch, Alexander" <Alexander.Bensch@parsons.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: MIPS cache bypass on custom board
Date: Sat, 14 Dec 2019 02:38:59 +0100 [thread overview]
Message-ID: <9ba23651-746a-5085-eff8-a048385e29ed@redhat.com> (raw)
In-Reply-To: <e3c2df7ae90747729a47d5f854e450e5@ALHUN12EXCH02.Parsons.com>
Hi Alexander,
On 12/13/19 7:59 PM, Bensch, Alexander wrote:
> Hi all,
>
> Currently stuck on a problem in QEMU 4.0.0. I’m trying to implement a
> custom device using a MIPS 24Kc CPU. The device boots from an SPI flash
> device that is mapped to 0x9F000000 (physical address 0x1F000000). I got
> the initial load and execute working by direct loading a flash dump to a
> MemoryRegion based at 0x1F000000, which worked great until the ROM
> needed to access the SPI registers that are addressed to 0xBF000000
> (/also /physical address 0x1F000000). QEMU cannot differentiate reads
> and writes to 0xBF000000 from reads and writes to 0x9F000000.
>
> Initially I assumed this was a caching problem, as I know that the SPI
> registers are located in the KSEG1 memory segment which uses uncached
> writes, while the flash mapping is in KSEG0 with cached writes. I also
> can see that QEMU has logic to handle caching in a few source files
> within /targets/mips//. However, when I read from addresses in the KSEG1
> region, I still see contents from the KSEG0 region.
>
> My question is whether there is any way to configure a MIPS board such
> that I can correctly bypass the cache for KSEG1 as expressed by the MIPS
> documentation?
Unfortunately QEMU doesn't model microarchitecture, thus no cache is
modelled, meaning KSEG1 is the same as KSEG0.
Peter Maydell had the similar problem you describe last year:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg556999.html
>
> Apologies if details are lacking. Please request more info if needed.
>
> Thank you,
>
> *Alex Bensch*
next prev parent reply other threads:[~2019-12-14 1:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 18:59 MIPS cache bypass on custom board Bensch, Alexander
2019-12-14 1:38 ` Philippe Mathieu-Daudé [this message]
2019-12-26 14:59 ` [EXTERNAL] " Bensch, Alexander
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=9ba23651-746a-5085-eff8-a048385e29ed@redhat.com \
--to=philmd@redhat.com \
--cc=Alexander.Bensch@parsons.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).