From patchwork Tue Dec 5 18:01:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 120731 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6059057qgn; Tue, 5 Dec 2017 10:02:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMaO1g9j+oksIMP216Al7gF4qhpVRC6KEfNSLIaLhnoXCZY4kPmCUWOFQsC2v9Vi2hG/esg+ X-Received: by 10.99.108.66 with SMTP id h63mr18482256pgc.362.1512496931163; Tue, 05 Dec 2017 10:02:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512496931; cv=none; d=google.com; s=arc-20160816; b=GZ66cnI+smQiIFxqQ89XewG4dFj6seYzjkEyGp0EqIG10BVSrFeEcOJOSsPGUvLVpw j0lcsqSR6xirhD9Xbsb7j2U9u9kLZfruYpWWRvC6CilyKA4rq8inLXA7/nWs/93wMw69 Gtll8Bqc6o+yGmWxcjsLKBeop9TI1CvwIhZZnjApOs5eRm9Q0K8Ymo3y/sWv1esLg11J 1Cy8X9EtJVzB1dWoPr8Ri1tuoPSjku1O0gVBjLVd3K/DFdFhDkLwKJFUk7eTmd2Ea2FV DNUnVBD03eBP14CUhJ0o0XxRE2k0KNJcI5A4ko75BVNL65GtOVDTBXsKVYr3lenKIon6 fqdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=8Q/DxPb78AKN70TKaBK3/f6gsImZnxfbVRx2/6CJ3iY=; b=Ia6ezmshLkpCe94nQ+hP88/Wc6RGF9BTD3UESh5wYekxurmnZqOmVG79iZTDENW94i j+anuMjI1g7v5PV0MmJww+LotyDYtSF1MaEMtf7dQ8gXIwj0/CWqooW1n57jSCUfbY1g nB2gipvilrGYpiZfp6VsglP1JdZrD5ihiBSj0q/1ZiFlOhhXpvVmOSbnmc8pNI69y5xS tT57P+YPWFoj9lWvR68bI9XBedLW3MAEtWW8QXjjOKeXKqseeThYoCbBN656DlFd3bO6 PGEfT3mQWrCbfa3LvI2DSZunj5V11fHapb3yX5uiUSPduIdTxQlaJVsXkj/h5k/fM2UI UslQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HQ4YUt+h; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id e6si395760pgt.433.2017.12.05.10.02.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 10:02:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HQ4YUt+h; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 80AB42218E925; Tue, 5 Dec 2017 09:57:39 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: ruiyu.ni@intel.com, feng.tian@intel.com, Ard Biesheuvel , hao.a.wu@intel.com, leif.lindholm@linaro.org, michael.d.kinney@intel.com, star.zeng@intel.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel