aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-30 16:37:15 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-03-30 16:37:15 +0100
commitb471d5549188d01730131a322c4d154585ba1e60 (patch)
treea591d8f004ac1a80c9dff7eab34dae81df6454b9 /tests
parent4a0ba67c77a425436e867fcbb8c513b44d7e7d6e (diff)
parentb9e3f1579a4b06fc63dfa8cdb68df1c58eeb0cf1 (diff)
downloadqemu-b471d5549188d01730131a322c4d154585ba1e60.zip
qemu-b471d5549188d01730131a322c4d154585ba1e60.tar.gz
qemu-b471d5549188d01730131a322c4d154585ba1e60.tar.bz2
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210330' into staging
* net/npcm7xx_emc.c: Fix handling of receiving packets when RSDR not set * hw/display/xlnx_dp: Free FIFOs adding xlnx_dp_finalize() * hw/arm/smmuv3: Drop unused CDM_VALID() and is_cd_valid() * target/arm: Make number of counters in PMCR follow the CPU * hw/timer/renesas_tmr: Add default-case asserts in read_tcnt() # gpg: Signature made Tue 30 Mar 2021 14:23:33 BST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20210330: hw/timer/renesas_tmr: Add default-case asserts in read_tcnt() target/arm: Make number of counters in PMCR follow the CPU hw/arm/smmuv3: Drop unused CDM_VALID() and is_cd_valid() hw/display/xlnx_dp: Free FIFOs adding xlnx_dp_finalize() net/npcm7xx_emc.c: Fix handling of receiving packets when RSDR not set Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/npcm7xx_emc-test.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c
index 7a28173..9eec71d 100644
--- a/tests/qtest/npcm7xx_emc-test.c
+++ b/tests/qtest/npcm7xx_emc-test.c
@@ -492,9 +492,6 @@ static void enable_tx(QTestState *qts, const EMCModule *mod,
mcmdr |= REG_MCMDR_TXON;
emc_write(qts, mod, REG_MCMDR, mcmdr);
}
-
- /* Prod the device to send the packet. */
- emc_write(qts, mod, REG_TSDR, 1);
}
static void emc_send_verify1(QTestState *qts, const EMCModule *mod, int fd,
@@ -558,6 +555,9 @@ static void emc_send_verify(QTestState *qts, const EMCModule *mod, int fd,
enable_tx(qts, mod, &desc[0], NUM_TX_DESCRIPTORS, desc_addr,
with_irq ? REG_MIEN_ENTXINTR : 0);
+ /* Prod the device to send the packet. */
+ emc_write(qts, mod, REG_TSDR, 1);
+
/*
* It's problematic to observe the interrupt for each packet.
* Instead just wait until all the packets go out.
@@ -643,13 +643,10 @@ static void enable_rx(QTestState *qts, const EMCModule *mod,
mcmdr |= REG_MCMDR_RXON | mcmdr_flags;
emc_write(qts, mod, REG_MCMDR, mcmdr);
}
-
- /* Prod the device to accept a packet. */
- emc_write(qts, mod, REG_RSDR, 1);
}
static void emc_recv_verify(QTestState *qts, const EMCModule *mod, int fd,
- bool with_irq)
+ bool with_irq, bool pump_rsdr)
{
NPCM7xxEMCRxDesc desc[NUM_RX_DESCRIPTORS];
uint32_t desc_addr = DESC_ADDR;
@@ -679,6 +676,15 @@ static void emc_recv_verify(QTestState *qts, const EMCModule *mod, int fd,
enable_rx(qts, mod, &desc[0], NUM_RX_DESCRIPTORS, desc_addr,
with_irq ? REG_MIEN_ENRXINTR : 0, 0);
+ /*
+ * If requested, prod the device to accept a packet.
+ * This isn't necessary, the linux driver doesn't do this.
+ * Test doing/not-doing this for robustness.
+ */
+ if (pump_rsdr) {
+ emc_write(qts, mod, REG_RSDR, 1);
+ }
+
/* Send test packet to device's socket. */
ret = iov_send(fd, iov, 2, 0, sizeof(len) + sizeof(test));
g_assert_cmpint(ret, == , sizeof(test) + sizeof(len));
@@ -826,8 +832,14 @@ static void test_rx(gconstpointer test_data)
qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic");
- emc_recv_verify(qts, td->module, test_sockets[0], /*with_irq=*/false);
- emc_recv_verify(qts, td->module, test_sockets[0], /*with_irq=*/true);
+ emc_recv_verify(qts, td->module, test_sockets[0], /*with_irq=*/false,
+ /*pump_rsdr=*/false);
+ emc_recv_verify(qts, td->module, test_sockets[0], /*with_irq=*/false,
+ /*pump_rsdr=*/true);
+ emc_recv_verify(qts, td->module, test_sockets[0], /*with_irq=*/true,
+ /*pump_rsdr=*/false);
+ emc_recv_verify(qts, td->module, test_sockets[0], /*with_irq=*/true,
+ /*pump_rsdr=*/true);
emc_test_ptle(qts, td->module, test_sockets[0]);
qtest_quit(qts);