From patchwork Fri Feb 9 14:54:29 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: 871462 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="KUNi4iDx"; 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 3zdJm65lR6z9s7f for ; Sat, 10 Feb 2018 02:25:26 +1100 (AEDT) Received: from localhost ([::1]:32996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekAYG-0001dr-OU for incoming@patchwork.ozlabs.org; Fri, 09 Feb 2018 10:25:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekA5s-0002sL-At for qemu-devel@nongnu.org; Fri, 09 Feb 2018 09:56:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekA5p-0005tU-8R for qemu-devel@nongnu.org; Fri, 09 Feb 2018 09:56:04 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:38048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ekA5p-0005tL-49 for qemu-devel@nongnu.org; Fri, 09 Feb 2018 09:56:01 -0500 Received: by mail-qt0-x242.google.com with SMTP id z10so10828508qti.5 for ; Fri, 09 Feb 2018 06:56:00 -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=CSw+keFj0KiM8UJfh3gLP/ZZp830fZk9bqy5fPHP4cc=; b=KUNi4iDx1xMqa/2SvljHimBVGI5BgmJw2kbW/AzDR2wwb/hVyD9UPOSxvA1AIq+4Yq wzXCwrGc0nSDAiYa8FADbHxhXNrLMEypcIDVt/CMJEyEagJ0YnK+VjCl/2TpSYQZ0QGW AbHu9eJIlV6ytx8X/pJXje/Fz7o7V6mykDTYNysFXXp/CdlOkcGUHj9CpETHj3ktVZ6B PXkiMXCAMGbmBvdtbLZd+5qVPhGiQfHHUXZUkRNNJOKTswe910R0s2u+hq5zu8XWbaeo 7RinYFjjqX3n1RmuPG6D8sbjOuzdFRDAiuV8yLrmkJjScIff5sfQ73XS0RFeohOhoI4O L/sA== 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=CSw+keFj0KiM8UJfh3gLP/ZZp830fZk9bqy5fPHP4cc=; b=twTFRR9AD9qpRUo2OpoxWbuFR/RpYxAjZO355waNZyQw4/BSMvFGfzW6Y3niNdeAU2 KqgigWTIuuq9mOVn2CN2JC6sjJVW0yHYOZOfrirx/10cTcjPOMZvxDixfU/1c50lFYFB /k8cWj6foiWgk27aX8kVcZVbXc1LSVPjRhbrGkVHf9pkjN/oaGRblODGm20uhX9HSmR6 t8AO2MT3clwVr//fFXatUgSKzswUpU8HlK+xFPfZOZnJbO0dC12DNJ9nbJCLe7WIFg0F WmK947i6AeEaQ3Uxs4Vc7O6eWmWfrwegFq00rssYLfqDlnfx7MNfN8mF9FqtJY6A3RDU I2Sg== X-Gm-Message-State: APf1xPCxVFQ9NFTQalZpZjzHu6Ms2bnSd24EyQqJSjMzYBaC3hRKK2wQ HRRQwLaKYuIFf/tvFOly3uI= X-Google-Smtp-Source: AH8x224v4kh6nUFF3I7/mQCXS1w8FxvYhU5kQCi2ulL58lMVBVIr9WCZ153K8WgExIwHhadF6a6YOg== X-Received: by 10.237.41.164 with SMTP id o33mr4816590qtd.2.1518188160606; Fri, 09 Feb 2018 06:56:00 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id b29sm747841qkb.28.2018.02.09.06.55.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:56:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini Date: Fri, 9 Feb 2018 11:54:29 -0300 Message-Id: <20180209145430.26007-30-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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH v12 29/30] sdhci: add a check_capab_v3() 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_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index 39d0f87788..c0b45da88a 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -16,6 +16,8 @@ #define SDHC_CAPAB 0x40 FIELD(SDHC_CAPAB, BASECLKFREQ, 8, 8); /* since v2 */ FIELD(SDHC_CAPAB, SDMA, 22, 1); +FIELD(SDHC_CAPAB, SDR, 32, 3); /* since v3 */ +FIELD(SDHC_CAPAB, DRIVER, 36, 3); /* since v3 */ #define SDHC_HCVER 0xFE static const struct sdhci_t { @@ -161,6 +163,20 @@ static void check_capab_sdma(QSDHCI *s, bool supported) g_assert_cmpuint(capab_sdma, ==, supported); } +static void check_capab_v3(QSDHCI *s, uint8_t version) +{ + uint64_t capab, capab_v3; + + if (version < 3) { + /* before v3 those fields are RESERVED */ + capab = sdhci_readq(s, SDHC_CAPAB); + capab_v3 = FIELD_EX64(capab, SDHC_CAPAB, SDR); + g_assert_cmpuint(capab_v3, ==, 0); + capab_v3 = FIELD_EX64(capab, SDHC_CAPAB, DRIVER); + g_assert_cmpuint(capab_v3, ==, 0); + } +} + static QSDHCI *machine_start(const struct sdhci_t *test) { QSDHCI *s = g_new0(QSDHCI, 1); @@ -209,6 +225,7 @@ static void test_machine(const void *data) check_specs_version(s, test->sdhci.version); check_capab_capareg(s, test->sdhci.capab.reg); check_capab_readonly(s); + check_capab_v3(s, test->sdhci.version); check_capab_sdma(s, test->sdhci.capab.sdma); check_capab_baseclock(s, test->sdhci.baseclock);