From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: mateusz.albecki@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 26 Jun 2019 06:10:21 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 06:10:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,420,1557212400"; d="scan'208";a="155862647" Received: from gklab-27-32.ger.corp.intel.com ([10.102.10.44]) by orsmga008.jf.intel.com with ESMTP; 26 Jun 2019 06:10:18 -0700 From: "Albecki, Mateusz" To: devel@edk2.groups.io Cc: Mateusz Albecki , Hao A Wu Subject: [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol Date: Wed, 26 Jun 2019 15:10:01 +0200 Message-Id: <20190626131003.3088-1-mateusz.albecki@intel.com> X-Mailer: git-send-email 2.14.1.windows.1 To allow platform greater control over the bus settings for SD card and eMMC card we have added a new notify phase to SdMmcOverrideProtocol called GetOperatingParam. This phase is signaled before SD card/eMMC initialization and allows platform to tweak the values in new structure called EDKII_SD_MMC_OPERATING_PARAMETERS which allows to configure bus width, clock frequency and driver strength. Other bus parameters can be configured by overriding host controller capabilities. Changes in v2: - Fixed stylistic issues and documentation issues pointed out in v1 review - Changed bus width to be UINT8 - Reordered the SD_MMC_BUS_MODE to fix problem with driver never choosing the DDR50 speed mode - Fixed the bug with driver not switching the controller into correct driver strength for SD card slots - Fixed bug with the driver not considering driver strength support for SD card slots - Fixed bug with driver choosing SdMmcMmcHsSdr if card doesn't support frequencies above 26MHz - Fixed bug with driver choosing driver strength for legacy speed modes Changes in v3: - Changed BusWidth field of EDKII_SD_MMC_OPERATING_PARAMETERS to UINT16 Changes in v4 - Fixed typos and ordering in SD_MMC_BUS_MODE(this time for real) - Fixed non boolean types usage in if statements - Fixed code that checks if there was an error in switch response for SD card. The code has been updated to check if switch failed due to function being busy Tests: - OS boot from eMMC without SdMmcOverride protocol installed - OS boot from eMMC with SdMmcOverride installed and clock frequency lowered to 100MHz in HS200 - OS boot from eMMC with driver strength changed to Type1 - OS boot from eMMC in HS400 without override protocol installed - SD card enumeration in UEFI shell on default speed and high speed(non UHS-I) with SdMmcOverride installed and UHS-I disabled in capability - SD card enumeration in UEFI shell on default speed and high speed(non UHS-I) with no Override protocol(legacy card used) Cc: Hao A Wu Albecki, Mateusz (1): MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol Mateusz Albecki (1): MdeModulePkg/SdMmcOverride: Add GetOperatingParam notify phase MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c | 512 +++++++++++++++------ MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 410 ++++++++++++++--- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 52 ++- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h | 18 +- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 34 ++ MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h | 19 + MdeModulePkg/Include/Protocol/SdMmcOverride.h | 60 ++- 7 files changed, 867 insertions(+), 238 deletions(-) -- 2.14.1.windows.1 -------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.