public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, hao.a.wu@intel.com,
	michael.d.kinney@intel.com, liming.gao@intel.com,
	ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com,
	jsd@semihalf.com, tm@semihalf.com, jaz@semihalf.com
Subject: [PATCH v3 1/4] MdeModulePkg/SdMmcPciHcDxe: Add an optional parameter in NotifyPhase
Date: Thu,  8 Nov 2018 02:57:32 +0100	[thread overview]
Message-ID: <1541642255-15602-2-git-send-email-mw@semihalf.com> (raw)
In-Reply-To: <1541642255-15602-1-git-send-email-mw@semihalf.com>

In order to ensure bigger flexibility in the NotifyPhase
routine of the SdMmcOverride protocol, enable using an
optional phase-specific data. This will allow to exchange
more information between the protocol producer driver
and SdMmcPciHcDxe in the newly added callbacks.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 MdeModulePkg/Include/Protocol/SdMmcOverride.h    |  4 +++-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 12 ++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
index 0766252..8a7669e 100644
--- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
+++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
@@ -63,6 +63,7 @@ EFI_STATUS
   @param[in]      PhaseType             The type of operation and whether the
                                         hook is invoked right before (pre) or
                                         right after (post)
+  @param[in,out]  PhaseData             The pointer to a phase-specific data.
 
   @retval EFI_SUCCESS           The override function completed successfully.
   @retval EFI_NOT_FOUND         The specified controller or slot does not exist.
@@ -74,7 +75,8 @@ EFI_STATUS
 (EFIAPI * EDKII_SD_MMC_NOTIFY_PHASE) (
   IN      EFI_HANDLE                      ControllerHandle,
   IN      UINT8                           Slot,
-  IN      EDKII_SD_MMC_PHASE_TYPE         PhaseType
+  IN      EDKII_SD_MMC_PHASE_TYPE         PhaseType,
+  IN OUT  VOID                           *PhaseData
   );
 
 struct _EDKII_SD_MMC_OVERRIDE {
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
index bedc968..923c55b 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
@@ -444,7 +444,8 @@ SdMmcHcReset (
     Status = mOverride->NotifyPhase (
                           Private->ControllerHandle,
                           Slot,
-                          EdkiiSdMmcResetPre);
+                          EdkiiSdMmcResetPre,
+                          NULL);
     if (EFI_ERROR (Status)) {
       DEBUG ((DEBUG_WARN,
         "%a: SD/MMC pre reset notifier callback failed - %r\n",
@@ -494,7 +495,8 @@ SdMmcHcReset (
     Status = mOverride->NotifyPhase (
                           Private->ControllerHandle,
                           Slot,
-                          EdkiiSdMmcResetPost);
+                          EdkiiSdMmcResetPost,
+                          NULL);
     if (EFI_ERROR (Status)) {
       DEBUG ((DEBUG_WARN,
         "%a: SD/MMC post reset notifier callback failed - %r\n",
@@ -1088,7 +1090,8 @@ SdMmcHcInitHost (
     Status = mOverride->NotifyPhase (
                           Private->ControllerHandle,
                           Slot,
-                          EdkiiSdMmcInitHostPre);
+                          EdkiiSdMmcInitHostPre,
+                          NULL);
     if (EFI_ERROR (Status)) {
       DEBUG ((DEBUG_WARN,
         "%a: SD/MMC pre init notifier callback failed - %r\n",
@@ -1123,7 +1126,8 @@ SdMmcHcInitHost (
     Status = mOverride->NotifyPhase (
                           Private->ControllerHandle,
                           Slot,
-                          EdkiiSdMmcInitHostPost);
+                          EdkiiSdMmcInitHostPost,
+                          NULL);
     if (EFI_ERROR (Status)) {
       DEBUG ((DEBUG_WARN,
         "%a: SD/MMC post init notifier callback failed - %r\n",
-- 
2.7.4



  reply	other threads:[~2018-11-08  1:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08  1:57 [PATCH v3 0/4] SdMmcOverride extension Marcin Wojtas
2018-11-08  1:57 ` Marcin Wojtas [this message]
2018-11-08  1:57 ` [PATCH v3 2/4] MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol Marcin Wojtas
2018-11-08 11:06   ` Ard Biesheuvel
2018-11-08 11:15     ` Marcin Wojtas
2018-11-08  1:57 ` [PATCH v3 3/4] MdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to SdMmcOverride Marcin Wojtas
2018-11-08 11:09   ` Ard Biesheuvel
2018-11-08 11:18     ` Marcin Wojtas
2018-11-08  1:57 ` [PATCH v3 4/4] MdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequency Marcin Wojtas
2018-11-08 11:10   ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541642255-15602-2-git-send-email-mw@semihalf.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox