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::12a; helo=mail-lf1-x12a.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (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 533C821124FFE for ; Fri, 7 Sep 2018 02:11:03 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id l26-v6so11458398lfc.8 for ; Fri, 07 Sep 2018 02:11:03 -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=bpsio9/VNAvVwnx6y3fqnXZBBMbK8CecESy/5HckUlM=; b=T78Zu4jpNE9VqbJtuYllHbx031vU1XnCzX+z5ViFnDN/ITKSBG6FjvaCvzXkAzznew jjB9GwDq5rrppvEC3GXX9sqer5F0XAwtSrgEtfsDeQMe587DNM4kqQBdtKrfzNt53E3I 1M8pWYKqRNRZT8I85YXcQXqnsB234sf2Ts0v2jpz3xpeRYXT4l8cvt4J/k+fHrCvBr7l 4J14pfzy5ZpjJ1r9dtFdwzVQGHe2GlC5RrL583xtuF/iPPz/kQiuGzruA5LKgPRwG53m zeRmVpckflHJKVfdtZ1w1WfVSo4TVA2RErb4X1rbv60DCkYvvEAyhmdB1ALi+B+3mVBy V6DQ== 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=bpsio9/VNAvVwnx6y3fqnXZBBMbK8CecESy/5HckUlM=; b=HZlcC1sPSq0cECLlLfFrs1dnvw5opwYHmTztU/h0fGAMDqihyXAyKkxzaHN/6k23HX qGqlXy//N+Tq8V4lIUJTAHn3jt95GbfKW9c50jNvu/lmW/xTjmmzV5uZCK7OBVHuOVWH Ey1S55qjOMc9yE6y2DKqkO12SAn1QHbAq36NFenYITI3wMn6wfnCS9ohw4LNrnOjP2op 9R9Qdh+8JVR41sa9Vt2R84IscFfGnj9gfrj+7l9uEuT6878tqDWvSSaDk0agREL4vYSu Okp5rxVuode4MUJ+PfndGhMFdOZEO7xYoIjpfSMpF1xIvEYl4QVDxLzTyKbj2sxxLxAv +Zow== X-Gm-Message-State: APzg51DDuphy+1wnPf2hGkO3sGafD4GYqw4wjVsiRouHudh/ywV01EzO dASk9GpNynA1LIGZcFHjfv4/7lZX12Q= X-Google-Smtp-Source: ANB0VdYadknjrJhCIQNJKsd8L6JsNniT+oXQMeOtf/VjC0veLpR+c45EOMuY4MA/79ONrDgX1Zze8A== X-Received: by 2002:a19:a401:: with SMTP id q1-v6mr4614873lfc.111.1536311461321; Fri, 07 Sep 2018 02:11:01 -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 q16-v6sm1197337ljj.68.2018.09.07.02.11.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Sep 2018 02:11:00 -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, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, tm@semihalf.com Date: Fri, 7 Sep 2018 11:10:15 +0200 Message-Id: <1536311416-2751-4-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536311416-2751-1-git-send-email-mw@semihalf.com> References: <1536311416-2751-1-git-send-email-mw@semihalf.com> Subject: [PATCH v2 3/4] 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: Fri, 07 Sep 2018 09:11:03 -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 e3fadb5..ec90d1e 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h @@ -68,6 +68,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define SD_MMC_HC_HOST_CTRL1_HS_ENABLE (1 << 2) // +// SD Software Reset Register bits description +// +#define SD_MMC_HC_SW_RST_ALL (1 << 0) + +// // 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