qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tim Lee <timlee660101@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: farosas@suse.de, lvivier@redhat.com, pbonzini@redhat.com,
	 wuhaotsh@google.com, kfting@nuvoton.com, chli30@nuvoton.com,
	 qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [v2] tests/qtest: Add qtest for NPCM8XX PSPI module
Date: Mon, 12 May 2025 09:25:05 +0800	[thread overview]
Message-ID: <CAJG6D+g=87TT8qyHvztiLjr83Lm7oTR2qV89Pm4EfQC9zz25RQ@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA8qYRa+CHD+z687ATYwOBenrm_c1hg=yvVq-hzRDxMdRA@mail.gmail.com>

Hi Peter,
Sorry about that. When I ran this qtest and I found an error then I
tried to modify npcm_pspi driver to make data register read/write test
pass.

[R +0.080118] writew 0xf0201002 0x4
[S +0.080126] OK
[R +0.080148] readw 0xf0201002
[S +0.080153] OK 0x0000000000000004
[R +0.080168] writew 0xf0201000 0x1234
[S +0.080171] OK
[R +0.080191] readw 0xf0201000
[S +0.080194] OK 0x0000000000001234
[I +0.080445] CLOSED
ok 3 /aarch64/npcm8xx_pspi/data
# End of npcm8xx_pspi tests
# End of aarch64 tests

Here is the change diff of what I modified in npcm_pspi_write_data()
Should I submit this patch for npcm_pspi driver? I'm not sure if I
modified it correctly. Thanks for your time.

 static void npcm_pspi_write_data(NPCMPSPIState *s, uint16_t data)
 {
-    uint16_t value = 0;
+    uint16_t data_l, data_h = 0;

     if (FIELD_EX16(s->regs[R_PSPI_CTL1], PSPI_CTL1, MOD)) {
-        value = ssi_transfer(s->spi, extract16(data, 8, 8)) << 8;
+        data_h = (extract16(data, 8, 8) << 8);
+        ssi_transfer(s->spi, data_h);
     }
-    value |= ssi_transfer(s->spi, extract16(data, 0, 8));
-    s->regs[R_PSPI_DATA] = value;
+    data_l = extract16(data, 0, 8);
+    ssi_transfer(s->spi, data_l);
+    s->regs[R_PSPI_DATA] = (data_h | data_l);

Peter Maydell <peter.maydell@linaro.org> 於 2025年5月11日 週日 下午9:58寫道:
>
> On Sun, 11 May 2025 at 14:47, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Wed, 7 May 2025 at 10:19, Tim Lee <timlee660101@gmail.com> wrote:
> > >
> > > - Created qtest to check initialization of registers in PSPI Module
> > > - Implemented test into Build File
> > >
> > > Tested:
> > > ./build/tests/qtest/npcm8xx-pspi_test
> > >
> > > Signed-off-by: Tim Lee <timlee660101@gmail.com>
> > > ---
> > > Changes since v1:
> > > - MAINTAINERS file not need to change
> > > - Add comment for copyright/license information
> > > - Correct CTL registers to use 16 bits
> > > - Remove printf() in test cases
> >
> >
> >
> > Applied to target-arm.next, thanks.
>
> ...but it fails "make check", so I've dropped it:
>
> not ok /aarch64/npcm8xx_pspi/data - ERROR:../../tests/qtest/npcm8xx_pspi-test.c:
> 80:test_data: assertion failed (output == test): (0x00000000 == 0x00001234)
> Bail out!
> ----------------------------------- stderr -----------------------------------
> **
> ERROR:../../tests/qtest/npcm8xx_pspi-test.c:80:test_data: assertion failed (outp
> ut == test): (0x00000000 == 0x00001234)
>
> (test program exited with status code -6)
>
> thanks
> -- PMM

-- 
Best regards,
Tim Lee


  reply	other threads:[~2025-05-12  1:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07  9:18 [v2] tests/qtest: Add qtest for NPCM8XX PSPI module Tim Lee
2025-05-08  1:31 ` KFTING
2025-05-11 13:47 ` Peter Maydell
2025-05-11 13:58   ` Peter Maydell
2025-05-12  1:25     ` Tim Lee [this message]
2025-05-12  8:43       ` 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='CAJG6D+g=87TT8qyHvztiLjr83Lm7oTR2qV89Pm4EfQC9zz25RQ@mail.gmail.com' \
    --to=timlee660101@gmail.com \
    --cc=chli30@nuvoton.com \
    --cc=farosas@suse.de \
    --cc=kfting@nuvoton.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wuhaotsh@google.com \
    /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).