From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::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 9BA472218E923 for ; Tue, 5 Dec 2017 09:57:37 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id z34so1237655wrz.10 for ; Tue, 05 Dec 2017 10:02:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=aXR1Kh9ZItc5gKnWbIazxDn4WS7hMDGATF/6sMqHJLw=; b=HQ4YUt+hBPDFYMih6iOqHnl4GdIwH5fvcbNO1IpplOlmSpKLwO1GZXIvdxO+adygSa udnn+QqdKi3rJEFxvwvDiX6nWGNbnZUICB475rDSxOwHRhsGD2Ins3hSmvUxv6Ujma1N eOiy+1EtXR3YjFzIKcFLILzWr2QJmpbIx+F98= 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; bh=aXR1Kh9ZItc5gKnWbIazxDn4WS7hMDGATF/6sMqHJLw=; b=mB3Dor3B0StrGpaD41hA8Cg4JBAAHeyBsWBpOG/WlCYfWl9W2mVCuIqa7u0pqNhAz5 nSGmlxT6j+0xF7i+6dt8dVBwG98RxK58yKKZ4w6iFNGOE7Khho17gKGhMYplhnbfCMkg qfTzxTY6VKsPVd8iupWSq5jUTSTSDD0IO4/ObBvDbpGlKZubC6h0U2luFkfKNOUc0LW4 Oy8HihPrH5KCEEkd3O5g9Yvjwhprbq37YxDgkyKoIDIPB4CWE6SIEQDbC8rhWeIhSMaS atOXeczc+cGM8R63HAH2+XdkFA727+bbyB4GwkN6ERGvqpbRME7ZhXUvufAudDWHxlwc 3FcQ== X-Gm-Message-State: AJaThX6defBZmTJX6Yj0Cjfj8BX0d1alRvFOTFvx7V5cu29DvLrxOYT4 RDU6CVlfwAAzEOBuv/pL/pd4HvUEwJs= X-Google-Smtp-Source: AGs4zMYvHM0fF5pRnxqC9X8S46kREalOf9PN7mtp/IS8u/az6tZ1myMRWCvWUqr3qhYlxC7BdBiO3Q== X-Received: by 10.223.134.230 with SMTP id 35mr15804824wry.74.1512496926847; Tue, 05 Dec 2017 10:02:06 -0800 (PST) Received: from localhost.localdomain ([105.150.171.234]) by smtp.gmail.com with ESMTPSA id 43sm735403wru.81.2017.12.05.10.02.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 10:02:04 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, michael.d.kinney@intel.com, star.zeng@intel.com, feng.tian@intel.com, ruiyu.ni@intel.com, hao.a.wu@intel.com, Ard Biesheuvel Date: Tue, 5 Dec 2017 18:01:50 +0000 Message-Id: <20171205180152.15758-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [PATCH v3 0/2] quirks handling for SDHCI controllers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 17:57:38 -0000 Many SDHCI implementations exist that are almost spec complicant, and could be driven by the generic SD/MMC host controller driver except for some minimal necessary init time tweaks. Adding such tweaks to the generic driver is undesirable. On the other hand, forking the driver for every platform that has such a SDHCI controller is problematic when it comes to upstreaming and ongoing maintenance (which is arguably the point of upstreaming in the first place). So these patches propose a workaround that is minimally invasive on the EDK2 side, but gives platforms a lot of leeway when it comes to applying SDHCI quirks. Changes since v2: - use a singleton instance of the SD/MMC protocol rather than one per controller; this is needed to support 'reconnect -r', as pointed out by Ray - use EDKII prefixes for all types defined by the protocol - replace 'hook' with 'notify', and tweak some other identifiers - add missing function comment headers for factored out functions Changes since RFC/v1: - add EFI_SD_MMC_PASS_THRU_PROTOCOL* member to override methods - use UINT64* not VOID* to pass capability structure (which is always 64 bits in size) Ard Biesheuvel (2): MdeModulePkg: introduce SD/MMC override protocol MdeModulePkg/SdMmcPciHcDxe: allow HC capabilities to be overridden MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 134 +++++++++++++++++++- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h | 1 + MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf | 2 + MdeModulePkg/Include/Protocol/SdMmcOverride.h | 103 +++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 + 5 files changed, 239 insertions(+), 4 deletions(-) create mode 100644 MdeModulePkg/Include/Protocol/SdMmcOverride.h -- 2.11.0