[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v11 05/30] sdhci: add a check_capab_sdma() qtest
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v11 05/30] sdhci: add a check_capab_sdma() qtest |
Date: |
Thu, 8 Feb 2018 13:47:53 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
tests/sdhci-test.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c
index 45caf66455..4b901b6cf1 100644
--- a/tests/sdhci-test.c
+++ b/tests/sdhci-test.c
@@ -15,6 +15,7 @@
#define SDHC_CAPAB 0x40
FIELD(SDHC_CAPAB, BASECLKFREQ, 8, 8); /* since v2 */
+FIELD(SDHC_CAPAB, SDMA, 22, 1);
#define SDHC_HCVER 0xFE
static const struct sdhci_t {
@@ -106,6 +107,15 @@ static void check_capab_baseclock(QSDHCI *s, uintptr_t
addr, uint8_t expec_freq)
g_assert_cmpuint(capab_freq, ==, expec_freq);
}
+static void check_capab_sdma(QSDHCI *s, uintptr_t addr, bool supported)
+{
+ uint64_t capab, capab_sdma;
+
+ capab = sdhci_readq(s, addr, SDHC_CAPAB);
+ capab_sdma = FIELD_EX64(capab, SDHC_CAPAB, SDMA);
+ g_assert_cmpuint(capab_sdma, ==, supported);
+}
+
static QSDHCI *machine_start(const struct sdhci_t *test)
{
QSDHCI *s = g_new0(QSDHCI, 1);
@@ -152,6 +162,7 @@ static void test_machine(const void *data)
check_capab_capareg(s, test->sdhci.addr, test->sdhci.capab.reg);
check_capab_readonly(s, test->sdhci.addr);
+ check_capab_sdma(s, test->sdhci.addr, test->sdhci.capab.sdma);
check_capab_baseclock(s, test->sdhci.addr, test->sdhci.baseclock);
machine_stop(s);
--
2.16.1
- [Qemu-devel] [PATCH v11 00/30] SDHCI: clean v1/2 Specs, UHS-I cards tuning sequence, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 01/30] sdhci: use error_propagate(local_err) in realize(), Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 02/30] sdhci: add qtest to check the SD capabilities register, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 03/30] sdhci: add check_capab_readonly() qtest, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 04/30] sdhci: add a check_capab_baseclock() qtest, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 05/30] sdhci: add a check_capab_sdma() qtest,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v11 06/30] sdhci: add qtest to check the SD Spec version, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 07/30] sdhci: add a 'spec_version property' (default to v2), Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 09/30] sdhci: simplify sdhci_get_fifolen(), Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 08/30] sdhci: use a numeric value for the default CAPAB register, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 10/30] sdhci: check the Spec v1 capabilities correctness, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 12/30] sdhci: Fix 64-bit ADMA2, Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 13/30] sdhci: check Spec v2 capabilities (DMA and 64-bit bus), Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 14/30] hw/arm/exynos4210: access the 64-bit capareg with qdev_prop_set_uint64(), Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 15/30] hw/arm/exynos4210: add a comment about a very similar SDHCI (Spec. v2), Philippe Mathieu-Daudé, 2018/02/08
- [Qemu-devel] [PATCH v11 16/30] hw/arm/xilinx_zynq: fix the capabilities register to match the datasheet, Philippe Mathieu-Daudé, 2018/02/08