From patchwork Tue Feb 13 04:07:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 872571 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gVJbmyfC"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zgTjY3yH3z9sRW for ; Tue, 13 Feb 2018 15:15:45 +1100 (AEDT) Received: from localhost ([::1]:37395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elS0N-0006Ms-G9 for incoming@patchwork.ozlabs.org; Mon, 12 Feb 2018 23:15:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elRtR-0000em-7g for qemu-devel@nongnu.org; Mon, 12 Feb 2018 23:08:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elRtQ-0007LV-Dx for qemu-devel@nongnu.org; Mon, 12 Feb 2018 23:08:33 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:38310) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1elRtQ-0007L1-8m for qemu-devel@nongnu.org; Mon, 12 Feb 2018 23:08:32 -0500 Received: by mail-qt0-x244.google.com with SMTP id k13so2227030qtg.5 for ; Mon, 12 Feb 2018 20:08:32 -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=gVJbmyfCRMJHcsH+beA5WQfGhoVjFJ56lakUNKKlcGu481gaXbfnFAhgwVKlx6lVPs 3sLcmvqPp1ahiI5y0QAhNXuBxSpsUwdYvo0ZkAFrSYRsC20dggcIKhAjg9KJWOD7PA6n 2YDJj4lSEY7Zb/vwDY2H7ovNMcilNu8og6s5P8xYhzDX03hC9MjmebCR0ODl4iYz5MFL OPfMSVENfUiyyPcw5wE2XgaIhthziNicoJAeNR5CPadeorsr33zh5CkltjkK5IXsjAl4 rLwOOD0KCTF2r4R7XE0W816ApvbsVVlkEh+4ianE3XgnZkc/3a/Fwo8d1C1E9zTnM6Nn xhEA== 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=oc1HCF1d1bFTHTggM8pslldksg5UgtwWoJB7PTbQFD+ZyJ/4L7utl8ofV5zrWVlsZ4 3tTfe1ore/1+UzaCgh+yfPkp4QNSmiIXftRLbuWb3low22iaiYf4kzLN/fJ3m5ZXMk8g K2R+vyhKtclE6w9yfFA9QOK0Dt1tbmDEe0gEbjS2KoMdV6/IR3iYwzDzD7v5/ZCjb0bq jn2i4tJr+YmDFtRCqU661xuNV4AAX5LnFpdoW4NMAircDfUGrFbK8MGUYyil6ULxHxJq vaXLDy0gOsGWmozoGcZRZf1DYUdbaHUHoDFI1BvYkxMTYlhVmqAnnvxBjXcFFKjhtqfd IAQg== X-Gm-Message-State: APf1xPDA1nCulYY1LCt+3BhwIaopviiA3N4aWKcJv203OOEtSxuTWnlU HIljKoIv6Cy2/NONwWoyHTg= X-Google-Smtp-Source: AH8x227aTlrWy04cqC8uU0E1FBOQE4Ah8NROSgGl0eiqiC3Pii45FY7pmyMYhlVvLYfZzWp4VXse4Q== X-Received: by 10.200.12.138 with SMTP id n10mr21714603qti.186.1518494911928; Mon, 12 Feb 2018 20:08:31 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id q2sm7350435qki.10.2018.02.12.20.08.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 20:08:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini Date: Tue, 13 Feb 2018 01:07:43 -0300 Message-Id: <20180213040809.26021-5-f4bug@amsat.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180213040809.26021-1-f4bug@amsat.org> References: <20180213040809.26021-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v13 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 , Fam Zheng , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé 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" #define SDHC_CAPAB 0x40 +FIELD(SDHC_CAPAB, BASECLKFREQ, 8, 8); /* since v2 */ #define SDHC_HCVER 0xFE static const struct sdhci_t { @@ -98,6 +99,18 @@ static void check_capab_readonly(QSDHCI *s) g_assert_cmpuint(capab1, ==, capab0); } +static void check_capab_baseclock(QSDHCI *s, uint8_t expected_freq) +{ + uint64_t capab, capab_freq; + + if (!expected_freq) { + return; + } + capab = sdhci_readq(s, SDHC_CAPAB); + capab_freq = FIELD_EX64(capab, SDHC_CAPAB, BASECLKFREQ); + g_assert_cmpuint(capab_freq, ==, expected_freq); +} + static QSDHCI *machine_start(const struct sdhci_t *test) { QSDHCI *s = g_new0(QSDHCI, 1); @@ -145,6 +158,7 @@ static void test_machine(const void *data) check_capab_capareg(s, test->sdhci.capab.reg); check_capab_readonly(s); + check_capab_baseclock(s, test->sdhci.baseclock); machine_stop(s); }