public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ming Huang <ming.huang@linaro.org>
To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org,
	edk2-devel@lists.01.org, graeme.gregory@linaro.org
Cc: ard.biesheuvel@linaro.org, guoheyi@huawei.com,
	wanghuiqiang@huawei.com, huangming23@huawei.com,
	zhangjinsong2@huawei.com, huangdaode@hisilicon.com,
	john.garry@huawei.com, xinliang.liu@linaro.org,
	Ming Huang <ming.huang@linaro.org>,
	Heyi Guo <heyi.guo@linaro.org>
Subject: [PATCH edk2-platforms v2 04/12] Hisilicon/Pci: Add two api for PciPlatform driver
Date: Tue, 24 Jul 2018 14:32:12 +0800	[thread overview]
Message-ID: <20180724063220.61679-5-ming.huang@linaro.org> (raw)
In-Reply-To: <20180724063220.61679-1-ming.huang@linaro.org>

PciPlatform may add some features platform special, like
InitAtu and EnlargeAtu for Hi161x, MaxPlayload for Hi1620.
So Add two api for expansibility.

This patch is to prepare moving EnlargeAtuConfig0() out of
PciHostBridge. Since the function was originally called in
NotifyPhase() of phase EfiPciHostBridgeEndEnumeration, so we propose
to move it to EFI_PCI_PLATFORM_PROTOCOL->PlatformNotify().

To reduce redundant ATU definitions, we also move InitAtu to
PciPlatformLib in Hi161x.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang <ming.huang@linaro.org>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
---
 Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.c   | 45 ++++++++++++++++++++
 Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf |  1 +
 2 files changed, 46 insertions(+)

diff --git a/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.c b/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.c
index 8bfac2d99f..fcdd36cf94 100644
--- a/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.c
+++ b/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.c
@@ -103,6 +103,48 @@ PCI_OPTION_ROM_TABLE      mPciOptionRomTable[] = {
   }
 };
 
+/*++
+
+ Routine Description:
+
+   Perform Platform initialization first in PciPlatform.
+
+   Arguments:
+
+   Returns:
+
+    VOID.
+
+--*/
+VOID
+EFIAPI
+PciInitPlatform (
+  VOID
+  );
+
+/*++
+
+ Routine Description:
+
+   Perform Platform initialization by the phase indicated.
+
+   Arguments:
+
+   HostBridge    -  The associated PCI host bridge handle.
+   Phase         -  The phase of the PCI controller enumeration.
+   ChipsetPhase  -  Defines the execution phase of the PCI chipset driver.
+
+   Returns:
+
+--*/
+VOID
+EFIAPI
+PhaseNotifyPlatform (
+  IN  EFI_HANDLE                                     HostBridge,
+  IN  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE  Phase,
+  IN  EFI_PCI_CHIPSET_EXECUTION_PHASE                ChipsetPhase
+  );
+
 EFI_STATUS
 EFIAPI
 GetPlatformPolicy (
@@ -387,6 +429,7 @@ Returns:
 
 --*/
 {
+  PhaseNotifyPlatform (HostBridge, Phase, ChipsetPhase);
 
   return EFI_SUCCESS;
 }
@@ -415,6 +458,8 @@ Returns:
   EFI_STATUS  Status;
   PCI_PLATFORM_PRIVATE_DATA *PciPrivateData;
 
+  PciInitPlatform ();
+
   PciPrivateData = AllocateZeroPool (sizeof (PCI_PLATFORM_PRIVATE_DATA));
   mPciPrivateData = PciPrivateData;
 
diff --git a/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf b/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf
index 8b170d2654..099021fcc8 100644
--- a/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf
+++ b/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf
@@ -38,6 +38,7 @@
   ArmLib
   IoLib
   MemoryAllocationLib
+  PciPlatformLib
 
 [Protocols]
   gEfiPciPlatformProtocolGuid
-- 
2.17.0



  parent reply	other threads:[~2018-07-24  6:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24  6:32 [PATCH edk2-platforms v2 00/12] Switching to generic PciHostBridge driver Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 01/12] Hisilicon: Enable WARN and INFO debug message Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 02/12] Hisilicon/D05/PlatformPciLib: fix misuse of macro Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 03/12] Hisilicon/Pci: Move PciPlatform to common directory Ming Huang
2018-07-24  6:32 ` Ming Huang [this message]
2018-07-24  6:32 ` [PATCH edk2-platforms v2 05/12] Hisilicon/Pci: move ATU configuration to PciPlatformLib Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 06/12] Hisilicon/Pci: move EnlargeAtuConfig0() " Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 07/12] Hisilicon/PlatformPciLib: add segment for each root bridge Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 08/12] Hisilicon: add PciHostBridgeLib Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 09/12] Hisilicon: add PciSegmentLib for Hi161x Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 10/12] Hisilicon/D0x: Switch to generic PciHostBridge driver Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 11/12] Hisilicon: remove platform specific PciHostBridge Ming Huang
2018-07-24  6:32 ` [PATCH edk2-platforms v2 12/12] Hisilicon/PlatformPciLib: clear redundant felds in RESOURCE_APPETURE Ming Huang
2018-07-25 11:41 ` [PATCH edk2-platforms v2 00/12] Switching to generic PciHostBridge driver 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=20180724063220.61679-5-ming.huang@linaro.org \
    --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