qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: "mar.krzeminski" <mar.krzeminski@gmail.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Kevin Wolf <kwolf@redhat.com>, Andrew Jeffery <andrew@aj.id.au>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v5 9/9] tests: add a m25p80 test
Date: Mon, 4 Jul 2016 13:11:26 +0100	[thread overview]
Message-ID: <CAFEAcA-26vuv+7uXBfzzccydOjeg1eG=YVCqnXEfcLuDW=fdBQ@mail.gmail.com> (raw)
In-Reply-To: <b7a505f6-459f-377d-9e88-c42ba1b2897c@kaod.org>

On 4 July 2016 at 13:01, Cédric Le Goater <clg@kaod.org> wrote:
> On 07/04/2016 01:14 PM, Peter Maydell wrote:
>> What is the test actually supposed to be doing?
>> writel() says "write this 32 bit value as if the (guest) CPU
>> wrote it to memory with a 32-bit write instruction".
>
> The test (and the guest) is writing and reading data on the memory
> region used by the SPI controller. This 'data' is then passed on
> to the SPI flash module objects which expects BE order when there
> are flash storage addresses are in the flow.
>
> So I think the test needs to use mem{write,read} and not write*.
> The result looks correct in the code. I will send a patchset
> right after starting with this patch.

If you were writing this test in a bit of native ARM code
running in the guest, how would you write it?
memread/memwrite are only the correct answer if you'd write
the native arm code as something like
memcpy(SPI_REGISTER, buf, len), which is not generally the
way you talk to devices.

thanks
-- PMM

  reply	other threads:[~2016-07-04 12:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 18:24 [Qemu-devel] [PATCH v5 0/9] ast2400: SMC controllers Cédric Le Goater
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 1/9] ssi: change ssi_slave_init to be a realize ops Cédric Le Goater
2016-07-01 15:16   ` Peter Maydell
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 2/9] m25p80: do not put iovec on the stack Cédric Le Goater
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 3/9] m25p80: avoid out of bounds accesses Cédric Le Goater
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 4/9] m25p80: change cur_addr to 32 bit integer Cédric Le Goater
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 5/9] m25p80: qdev-ify drive property Cédric Le Goater
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 6/9] ast2400: add SMC controllers (FMC and SPI) Cédric Le Goater
2016-06-29  7:58   ` Cédric Le Goater
2016-07-02 17:00     ` mar.krzeminski
2016-07-04  6:58       ` Cédric Le Goater
2016-07-04  7:12         ` Marcin Krzemiński
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 7/9] ast2400: add SPI flash slaves Cédric Le Goater
2016-07-01 16:24   ` Peter Maydell
2016-07-01 16:44     ` Cédric Le Goater
2016-07-01 17:00       ` Peter Maydell
2016-07-02 17:08   ` mar.krzeminski
2016-07-02 17:51     ` mar.krzeminski
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 8/9] ast2400: create " Cédric Le Goater
2016-07-01 15:19   ` Peter Maydell
2016-06-28 18:24 ` [Qemu-devel] [PATCH v5 9/9] tests: add a m25p80 test Cédric Le Goater
2016-07-01 17:18   ` Peter Maydell
2016-07-01 17:22     ` Peter Maydell
2016-07-01 17:30     ` Cédric Le Goater
2016-07-01 21:46       ` Greg Kurz
2016-07-02 18:05   ` mar.krzeminski
2016-07-04  9:15     ` Cédric Le Goater
2016-07-04  9:50       ` Cédric Le Goater
2016-07-04 11:14       ` Peter Maydell
2016-07-04 12:01         ` Cédric Le Goater
2016-07-04 12:11           ` Peter Maydell [this message]
2016-07-04 12:32             ` Cédric Le Goater
2016-07-01 16:25 ` [Qemu-devel] [PATCH v5 0/9] ast2400: SMC controllers Peter Maydell

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='CAFEAcA-26vuv+7uXBfzzccydOjeg1eG=YVCqnXEfcLuDW=fdBQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=andrew@aj.id.au \
    --cc=armbru@redhat.com \
    --cc=clg@kaod.org \
    --cc=crosthwaite.peter@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mar.krzeminski@gmail.com \
    --cc=qemu-arm@nongnu.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).