From nobody Tue Feb 10 15:29:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518188419232967.1475634637353; Fri, 9 Feb 2018 07:00:19 -0800 (PST) Received: from localhost ([::1]:60240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekA9x-0005qo-05 for importer@patchew.org; Fri, 09 Feb 2018 10:00:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekA4h-0001eB-JL for qemu-devel@nongnu.org; Fri, 09 Feb 2018 09:54:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekA4g-0004ze-NP for qemu-devel@nongnu.org; Fri, 09 Feb 2018 09:54:51 -0500 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:37109) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ekA4g-0004zW-Ic for qemu-devel@nongnu.org; Fri, 09 Feb 2018 09:54:50 -0500 Received: by mail-qk0-x242.google.com with SMTP id c128so10271522qkb.4 for ; Fri, 09 Feb 2018 06:54:50 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id b29sm747841qkb.28.2018.02.09.06.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SauahonrmTtixgwy8mK3ZO5tl7yNBs9Ewk65/VkyDcA=; b=ux05f8ZAYmHSzDpR8YTZYkWgEKxTRLd12tImAXF3AfUFNYjkKeUwWxZEfhT2wuI0X5 0hUtm0dEgf3PLeCtUVHXCMzLHXFiWEdzgBVsWMHKqyju4s1pkPdU0y+gnc3oHIoNRLtm 5p/b6w/1z0znBKYxnQPLXkJzXmdTkX5uSlIwLCEgchGi6eQOafgwXS6wjXmCZ9tyJxK+ x4oKbIU1xv0lMOJiQAVPXFoW2jddxFa2yw4x4XXWYopPgaUix2wRPvFwu8cLOqTXoIxu tLACBL8ln+91C+FJizvqAlqUe/WtqXwI0Hoah/XAZg38F1FkHQSdh9jRMGN3aaUWu4dJ Pa3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SauahonrmTtixgwy8mK3ZO5tl7yNBs9Ewk65/VkyDcA=; b=CmF/oeOE9H9ip95Cx5cE6BFIwOFlRMUqr0qI2SJeqT0Z9H+I7PH9aBrBKvzNVvZr6V NDCUi5HURAS6gSMwbkZIOFsD+W1UzW1erxVRukmxk4FCR5MYT9vFfv3A1iCs3BRzzhlZ jJFj40h7TzC7lj/Ii9AVeS1A6Et+SiXfLWLTL21uwGQlMHw5QKPra1CAF3XteCP3SZyR o0IwubSYmjqTeuiTcPBOHCfRrMOrE7o+WQNGlIS/sefCq91GWbhWYGcG0u60SlPIiegx aSftfj6nlDLxkuRjR+I95O3Vmv5zC+7eGt58UAMc0muk/3OCoTH427+unKBOAYHKhru2 uA+A== X-Gm-Message-State: APf1xPCwlKTOOJ43omMarXma5byGo8H1RrA4cOC2657C8TtEk9GZo9zA FOmWHhCtsPCvmEk3u3Rwtz4Lxw3L X-Google-Smtp-Source: AH8x227Un15OZBnhkPSHQyRc9dN19gQiIIRyVhu5k8MSshOVFVpP0rG/7HUyLWIi/ho5Wu2Z/w5j1w== X-Received: by 10.55.154.13 with SMTP id c13mr4225852qke.197.1518188089979; Fri, 09 Feb 2018 06:54:49 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini Date: Fri, 9 Feb 2018 11:54:04 -0300 Message-Id: <20180209145430.26007-5-f4bug@amsat.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209145430.26007-1-f4bug@amsat.org> References: <20180209145430.26007-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH v12 04/30] sdhci: add a check_capab_baseclock() qtest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias" , Peter Maydell , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- tests/sdhci-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index 51af5eac67..d6eb3c3a48 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -14,6 +14,7 @@ #include "hw/pci/pci.h" =20 #define SDHC_CAPAB 0x40 +FIELD(SDHC_CAPAB, BASECLKFREQ, 8, 8); /* since v2 */ #define SDHC_HCVER 0xFE =20 static const struct sdhci_t { @@ -98,6 +99,18 @@ static void check_capab_readonly(QSDHCI *s) g_assert_cmpuint(capab1, =3D=3D, capab0); } =20 +static void check_capab_baseclock(QSDHCI *s, uint8_t expected_freq) +{ + uint64_t capab, capab_freq; + + if (!expected_freq) { + return; + } + capab =3D sdhci_readq(s, SDHC_CAPAB); + capab_freq =3D FIELD_EX64(capab, SDHC_CAPAB, BASECLKFREQ); + g_assert_cmpuint(capab_freq, =3D=3D, expected_freq); +} + static QSDHCI *machine_start(const struct sdhci_t *test) { QSDHCI *s =3D g_new0(QSDHCI, 1); @@ -145,6 +158,7 @@ static void test_machine(const void *data) =20 check_capab_capareg(s, test->sdhci.capab.reg); check_capab_readonly(s); + check_capab_baseclock(s, test->sdhci.baseclock); =20 machine_stop(s); } --=20 2.16.1