From patchwork Thu Jan 11 19:30:17 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: 859267 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="brcSZwdR"; 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 3zHbpv1jd5z9s4q for ; Fri, 12 Jan 2018 06:41:27 +1100 (AEDT) Received: from localhost ([::1]:36932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZij7-0002xF-8s for incoming@patchwork.ozlabs.org; Thu, 11 Jan 2018 14:41:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZiYz-0002vN-0E for qemu-devel@nongnu.org; Thu, 11 Jan 2018 14:30:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZiYy-0005gV-5r for qemu-devel@nongnu.org; Thu, 11 Jan 2018 14:30:57 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:32947) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZiYy-0005g6-1O for qemu-devel@nongnu.org; Thu, 11 Jan 2018 14:30:56 -0500 Received: by mail-qk0-x243.google.com with SMTP id i141so5790431qke.0 for ; Thu, 11 Jan 2018 11:30:55 -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=o6fXLn/GGzx50T/l+jQAJNNhWxxRZuRdyr0VY1tEhWQ=; b=brcSZwdRyBGYgI5f5UWdKXRvVmXSzjj7+fOglOzBJdvmD+tNXWghMdk3xrdMfBl/IV dNo/W/8zrtOAyLRixris9p3DerRz39AUOPf9jMjaZFwRKSfth0SdOEiagAHuL/iPoUAF Oh8qwb8IoBcRHuyFNCy5JwZKVkc3GvmaUHcKemPU8kPmTIl6HOvbBcKKxmIWUGjm0kCM U1cunJT0arIvHeqXwuQtMzTMnUpb5qn3w9TaIOCjlbJiz/2p0u1bYTO4TbOjLtbfomEM RFMvDGu1GKMY+fglDMsGxUyXFWT7L11DCqNlztHyYXnMjUr3b0GboDg0Eyle9y7Inghm /Pnw== 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=o6fXLn/GGzx50T/l+jQAJNNhWxxRZuRdyr0VY1tEhWQ=; b=IbJ5PuiEhSWXYayS2qPhGIRmMshqa9HYSVFVaFzr3HQ3hoFon4vT/qu4IoDb93McDS qQcS0ZH4StAd5gw46gXbML0nuGy6wISmpUQ+/NScaMsGWQx5Fr5bS3KPeuWXr63n/Qe1 d/0j4Jtph3skRkcsVL5GuwbTx2Ggi8vZRCyXsfTwU2gzIizPr0QRBNGv6G8KyAJRxxNg eu8/02bNhdf+NpYXqS0sXqypM6ORoYcZolwy71QTC1MxOvTdaDpTWP3tYCQe470cHaHS KU/uTHBKlkmWNrW7Dl9Ko7Ol4Kh2Q2BNssHuFYuPHe6s6tOe4a2bzo1J29lBad80RyoT C+bw== X-Gm-Message-State: AKwxytfAP6TLzmzzL2lgMMy1WTad6YiOW0YGwFqhdhFMfF3Em9CHgWbo sGCnowcKHqrhSRdGfzbYHCY= X-Google-Smtp-Source: ACJfBotu2ZhVPktqDMqWwlqCWFUNnxomGe6IxJV+gy5c2tAAGULwt8WfCmTIYLELi5Ggv++Qbj16Gg== X-Received: by 10.55.101.215 with SMTP id z206mr9991132qkb.62.1515699055579; Thu, 11 Jan 2018 11:30:55 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id i37sm4870538qtc.80.2018.01.11.11.30.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 11:30:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Alistair Francis , Peter Maydell Date: Thu, 11 Jan 2018 16:30:17 -0300 Message-Id: <20180111193021.17466-10-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180111193021.17466-1-f4bug@amsat.org> References: <20180111193021.17466-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:c09::243 Subject: [Qemu-devel] [PATCH v6 09/13] sdhci: move MASK_TRNMOD with other SDHC_TRN* defines in "sd-internal.h" 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" , Andrey Smirnov , =?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: Alistair Francis --- hw/sd/sdhci-internal.h | 1 + hw/sd/sdhci.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h index 248fd027f9..e941bc2386 100644 --- a/hw/sd/sdhci-internal.h +++ b/hw/sd/sdhci-internal.h @@ -43,6 +43,7 @@ #define SDHC_TRNS_ACMD12 0x0004 #define SDHC_TRNS_READ 0x0010 #define SDHC_TRNS_MULTI 0x0020 +#define SDHC_TRNMOD_MASK 0x0037 /* R/W Command Register 0x0 */ #define SDHC_CMDREG 0x0E diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index ad60cd50d3..73c1efbef3 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -98,7 +98,6 @@ (SDHC_CAPAB_BASECLKFREQ << 8) | (SDHC_CAPAB_TOUNIT << 7) | \ (SDHC_CAPAB_TOCLKFREQ)) -#define MASK_TRNMOD 0x0037 #define MASKED_WRITE(reg, mask, val) (reg = (reg & (mask)) | (val)) static uint8_t sdhci_slotint(SDHCIState *s) @@ -1025,7 +1024,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) if (!(s->capareg & SDHC_CAN_DO_DMA)) { value &= ~SDHC_TRNS_DMA; } - MASKED_WRITE(s->trnmod, mask, value & MASK_TRNMOD); + MASKED_WRITE(s->trnmod, mask, value & SDHC_TRNMOD_MASK); MASKED_WRITE(s->cmdreg, mask >> 16, value >> 16); /* Writing to the upper byte of CMDREG triggers SD command generation */