From nobody Mon Feb 9 20:13:11 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 1518108848853669.1918716042105; Thu, 8 Feb 2018 08:54:08 -0800 (PST) Received: from localhost ([::1]:52850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejpSZ-0003U9-RT for importer@patchew.org; Thu, 08 Feb 2018 11:54:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejpNO-0007fx-Bi for qemu-devel@nongnu.org; Thu, 08 Feb 2018 11:48:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejpNN-0003cm-JG for qemu-devel@nongnu.org; Thu, 08 Feb 2018 11:48:46 -0500 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:42933) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejpNN-0003cX-El for qemu-devel@nongnu.org; Thu, 08 Feb 2018 11:48:45 -0500 Received: by mail-qt0-x243.google.com with SMTP id i8so6976352qtj.9 for ; Thu, 08 Feb 2018 08:48:45 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id z66sm240905qkc.9.2018.02.08.08.48.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 08:48:44 -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=AZcMY6xPmBEfotEw61DJKIDTlhztcBppL/0d6W7Pgyw=; b=o8/OooUl7WulYdb8bj8WeLx18NhYkTQBhzIEiTk1gNrM2ec2sIg/ETEJ/WxDly41/u ZHVaEDzEt5CtESChjGXbml071OWuFIFAi/CMvy6RFSVIuaXPGDvl4wiFA268dLb/1kvI 75hVfzTyJLLPZ0XO0vqaR5nQLqCoyj59g3kRjzcoL8yt10pqENnKRJttHqTB4+8YKzI+ z5zl/2BRO/7rbqS3DESicGV14Vb4YFJLZ/xnQgQfk99L8q5qHJlNJvkoTsVOlsuhRX5U 5axblU30SBjshcqMov88jmT//oA9elA/HhZpxxOPdo9lqdFEU0hobTV57NqqokTrME+U CTvQ== 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=AZcMY6xPmBEfotEw61DJKIDTlhztcBppL/0d6W7Pgyw=; b=qLRtMFAAEeLaDRbSH/yZGqolZ7m6K7oorZLABMPGyFzufVujq6SmcwempBcE1vbm/B GyMDCMvu0UEud29+ByhZp1Kl1N+ZxbeDA2m+HiqwGNcnBY4x7oet7eenKeknyi+0iFY5 aKl79rnvh8g4Vzr6q8UXeGHTwrfAwAWiJJPI0qItGSVBFwOcWUJfp03AdlTCBpj94h6h ggBOUNyTv2Qd3qAzd7MRW268LmOGceQBiBTbifkAaZX7nx5KlyeV59aVf6HbrREZU6fd K68WDyg5dfS1vzj9fdnfToxGlb24Ppwf1nGkscsk92tjdq8DrKw5BJj0/VLukLkyvflG EnEQ== X-Gm-Message-State: APf1xPCSvIQd7p/bjpmY5HR54XYLvMlwUdT14bmupfSVJsO9l1mjSgW9 ymEakfyhUuRh0gcQu1VfAQI= X-Google-Smtp-Source: AH8x2275XHZcU77tZ2otDk1L6Yv4WxOoYVwGZi4GnJmTchojaBQNYpHn/VxZnU1pXjkCwR5/cm83Ng== X-Received: by 10.200.61.90 with SMTP id u26mr2048031qtf.168.1518108524936; Thu, 08 Feb 2018 08:48:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Peter Maydell Date: Thu, 8 Feb 2018 13:47:52 -0300 Message-Id: <20180208164818.7961-5-f4bug@amsat.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180208164818.7961-1-f4bug@amsat.org> References: <20180208164818.7961-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:c0d::243 Subject: [Qemu-devel] [PATCH v11 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" , 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 e961f2b997..45caf66455 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 { @@ -93,6 +94,18 @@ static void check_capab_readonly(QSDHCI *s, uintptr_t ad= dr) g_assert_cmpuint(capab1, =3D=3D, capab0); } =20 +static void check_capab_baseclock(QSDHCI *s, uintptr_t addr, uint8_t expec= _freq) +{ + uint64_t capab, capab_freq; + + if (!expec_freq) { + return; + } + capab =3D sdhci_readq(s, addr, SDHC_CAPAB); + capab_freq =3D FIELD_EX64(capab, SDHC_CAPAB, BASECLKFREQ); + g_assert_cmpuint(capab_freq, =3D=3D, expec_freq); +} + static QSDHCI *machine_start(const struct sdhci_t *test) { QSDHCI *s =3D g_new0(QSDHCI, 1); @@ -139,6 +152,7 @@ static void test_machine(const void *data) =20 check_capab_capareg(s, test->sdhci.addr, test->sdhci.capab.reg); check_capab_readonly(s, test->sdhci.addr); + check_capab_baseclock(s, test->sdhci.addr, test->sdhci.baseclock); =20 machine_stop(s); } --=20 2.16.1