[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v5 15/31] sdhci: check Spec v2 capabilities qtest
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-arm] [PATCH v5 15/31] sdhci: check Spec v2 capabilities qtest |
Date: |
Mon, 8 Jan 2018 12:42:47 -0300 |
with check_capab_capareg()
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/sdhci-test.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c
index 492b332588..200d7bcee2 100644
--- a/tests/sdhci-test.c
+++ b/tests/sdhci-test.c
@@ -9,6 +9,7 @@
#include "qemu/osdep.h"
#include "libqtest.h"
+#define SDHC_CAPAB 0x40
#define SDHC_HCVER 0xFE
static const struct sdhci_t {
@@ -40,6 +41,13 @@ static uint32_t sdhci_readl(uintptr_t base, uint32_t
reg_addr)
return qtest_readl(qtest, base + reg_addr);
}
+static uint64_t sdhci_readq(uintptr_t base, uint32_t reg_addr)
+{
+ QTestState *qtest = global_qtest;
+
+ return qtest_readq(qtest, base + reg_addr);
+}
+
static void check_specs_version(uintptr_t addr, uint8_t version)
{
uint32_t v;
@@ -50,12 +58,21 @@ static void check_specs_version(uintptr_t addr, uint8_t
version)
g_assert_cmpuint(v, ==, version);
}
+static void check_capab_capareg(uintptr_t addr, uint64_t expected_capab)
+{
+ uint64_t capab;
+
+ capab = sdhci_readq(addr, SDHC_CAPAB);
+ g_assert_cmphex(capab, ==, expected_capab);
+}
+
static void test_machine(const void *data)
{
const struct sdhci_t *test = data;
global_qtest = qtest_startf("-machine %s -d unimp", test->machine);
+ check_capab_capareg(test->sdhci.addr, test->sdhci.capab.reg);
check_specs_version(test->sdhci.addr, test->sdhci.version);
qtest_quit(global_qtest);
--
2.15.1
- Re: [Qemu-arm] [Qemu-devel] [PATCH v5 08/31] hw/sd: clean/reorder the Makefile adding few comments, (continued)
- [Qemu-arm] [PATCH v5 09/31] sdhci: add a common class, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 10/31] sdhci: add a Designware/Samsung host controller, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 11/31] hw/arm/exynos4210: use the "samsung, exynos4210-dw-mshc" device, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 12/31] sdhci: add the generic Arasan SDHCI 4.9a PHY controller, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 13/31] hw/arm/xilinx_zynq: use the "arasan, sdhci-4.9a" device, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 14/31] sdhci: add qtest to check the SD Spec version, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 15/31] sdhci: check Spec v2 capabilities qtest,
Philippe Mathieu-Daudé <=
- [Qemu-arm] [PATCH v5 16/31] sdhci: add v3 capabilities, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 17/31] sdhci: rename the hostctl1 register, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 18/31] sdhci: add the Broadcom BCM2835 SDHCI controller, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 19/31] hw/arm/bcm2835_peripherals: use the "brcm, bcm2835-sdhci" device, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 20/31] sdhci: add the Freescale controller for i.MX, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 21/31] hw/arm/fsl-imx6: use the "fsl, imx6q-usdhc" controller, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 22/31] sdhci: add the generic Arasan SDHCI 8.9a PHY, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 23/31] hw/arm/xilinx_zynqmp: use the "arasan, sdhci-8.9a" device, Philippe Mathieu-Daudé, 2018/01/08
- [Qemu-arm] [PATCH v5 24/31] sdhci: let the SYSBUS_SDHCI type be abstract, Philippe Mathieu-Daudé, 2018/01/08