From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::244; helo=mail-lj1-x244.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 21F53211350FC for ; Sat, 15 Sep 2018 15:26:08 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id j19-v6so10198362ljc.7 for ; Sat, 15 Sep 2018 15:26:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v1UkARxHQ7hOvER+cCqpXiD89SQqMKWN623Ee2Nzdh0=; b=hm8ZO+6jrkR4WwLMER2aW2GLNN7OzO0nNXC8WihRMat/QuTlGxZTnSn/4jhtnLv8yu N6RvszQGCj8sFViaeulTeLUUwbRUKl6cUxly3z3D1vfFibeOJcUBtskJ+Z5dji7xVNgZ rgmLrSEmou/aA9o1N5sh6dCCRKWwvOISzy8awIoqx2/kXkDLsP+uk9NWX6lJq6zKINwa oIODhyOt0MzUGRT1lfzzqmVlCDl60AsJByG1Hf0MQMvqCq3xKGHR9X6Qmf0vOJqgC6d8 26BH7sI39djN6xkdEmmNtuQG2WT5uzvBETJDkbMqqMXW8MSLXKz+w/qqTssmW9VV/tUp ilxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v1UkARxHQ7hOvER+cCqpXiD89SQqMKWN623Ee2Nzdh0=; b=VexCaiyD87+/8Nhb2LGXPQkTOYg6ZuiDbDwayn2wb2N+dNMQhWGLpNCU4+7Li3AC4J JIaRWrOCWkHZqINrJ+zrryv1vE9M7alHzllsW8f6PG9S6CmdRfsoDdwVtJvFcIkAjzAW wvdq34cAdeVlcU5nh+qNN3h9j3l241xF5b1XE/JmQpEkRRELB7j97VhwxRbPcNkKBqKT /N0i+Ao+Z4Xibh3JlixbkiWi4fA8OmUlPNuEt3g2xF9kGG3Udb9i+4I4PoSy1t2Hijfk armDp/KljkBnoNYENr4VNfhisvrxhVuK158tWincRaTP7fKxIrC4YeLs4uqlckclGM4K Jbyw== X-Gm-Message-State: APzg51CrhaAGt4HwVtKrlnOjIKimSyOJTsszGkTiCel6881xXXvEKPB3 +NJbL3T4ym+JNVm4+ZxPL1HnlBrPSL4= X-Google-Smtp-Source: ANB0VdZfG0HILRJ6bVrN1V4EyQgvahG3nbFXuGO3BFKfyDMgmkWB9q2EWSiAAHUvMddeqpijeWQiAQ== X-Received: by 2002:a2e:8457:: with SMTP id u23-v6mr10785538ljh.95.1537050365990; Sat, 15 Sep 2018 15:26:05 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id c2-v6sm2044974lfg.45.2018.09.15.15.26.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Sep 2018 15:26:05 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: feng.tian@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, leif.lindholm@linaro.org, hao.a.wu@intel.com, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, tm@semihalf.com Date: Sun, 16 Sep 2018 00:25:45 +0200 Message-Id: <1537050346-16445-3-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537050346-16445-1-git-send-email-mw@semihalf.com> References: <1537050346-16445-1-git-send-email-mw@semihalf.com> Subject: [PATCH v3 2/3] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2018 22:26:08 -0000 From: Tomasz Michalec SdMmcHcReset used to set all bits of Software Reset Register to 1 including reserved ones. Now only first bit is set which means "Software Reset for All". Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h | 5 +++++ MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h index e389d52..bcc31bd 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h @@ -63,6 +63,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define SD_MMC_HC_CTRL_VER 0xFE // +// SD Software Reset Register bits description +// +#define SD_MMC_HC_SW_RST_ALL BIT0 + +// // The transfer modes supported by SD Host Controller // Simplified Spec 3.0 Table 1-2 // diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c index 9672b5b..9d9bca8 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c @@ -454,8 +454,8 @@ SdMmcHcReset ( } PciIo = Private->PciIo; - SwReset = 0xFF; - Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_SW_RST, FALSE, sizeof (SwReset), &SwReset); + SwReset = SD_MMC_HC_SW_RST_ALL; + Status = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_SW_RST, sizeof (SwReset), &SwReset); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "SdMmcHcReset: write full 1 fails: %r\n", Status)); @@ -467,7 +467,7 @@ SdMmcHcReset ( Slot, SD_MMC_HC_SW_RST, sizeof (SwReset), - 0xFF, + SD_MMC_HC_SW_RST_ALL, 0x00, SD_MMC_HC_GENERIC_TIMEOUT ); -- 2.7.4