From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK2j4-0001sM-Vp for qemu-devel@nongnu.org; Mon, 04 Jul 2016 08:11:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK2j4-0001uF-28 for qemu-devel@nongnu.org; Mon, 04 Jul 2016 08:11:46 -0400 Received: from mail-vk0-x22b.google.com ([2607:f8b0:400c:c05::22b]:36730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK2j3-0001u4-Ul for qemu-devel@nongnu.org; Mon, 04 Jul 2016 08:11:46 -0400 Received: by mail-vk0-x22b.google.com with SMTP id m127so169497786vkb.3 for ; Mon, 04 Jul 2016 05:11:45 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1467138270-32481-1-git-send-email-clg@kaod.org> <1467138270-32481-10-git-send-email-clg@kaod.org> <5778025A.9020608@gmail.com> <8ace1056-de8d-cfbb-9e63-e0e26df71952@kaod.org> From: Peter Maydell Date: Mon, 4 Jul 2016 13:11:26 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v5 9/9] tests: add a m25p80 test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= Cc: "mar.krzeminski" , Peter Crosthwaite , Kevin Wolf , Andrew Jeffery , QEMU Developers , Markus Armbruster , qemu-arm On 4 July 2016 at 13:01, C=C3=A9dric Le Goater 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