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, Ming Huang <ming.huang@linaro.org>,
Heyi Guo <heyi.guo@linaro.org>
Subject: [PATCH edk2-platforms v1 04/13] Hisilicon/Pci: Add two api for PciPlatform driver
Date: Fri, 20 Jul 2018 16:02:33 +0800 [thread overview]
Message-ID: <20180720080242.3777-5-ming.huang@linaro.org> (raw)
In-Reply-To: <20180720080242.3777-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
next prev parent reply other threads:[~2018-07-20 8:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 8:02 [PATCH edk2-platforms v1 00/13] Switching to generic PciHostBridge driver Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 01/13] Hisilicon: Enable WARN and INFO debug message Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 02/13] Hisilicon/D05/PlatformPciLib: fix misuse of macro Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 03/13] Hisilicon/Pci: Move PciPlatform to common directory Ming Huang
2018-07-20 8:02 ` Ming Huang [this message]
2018-07-20 8:02 ` [PATCH edk2-platforms v1 05/13] Hisilicon/Pci: move ATU configuration to PciPlatformLib Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 06/13] Hisilicon/Pci: move EnlargeAtuConfig0() " Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 07/13] Hisilicon/PlatformPciLib: add segment for each root bridge Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 08/13] Hisilicon: add PciHostBridgeLib Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 09/13] Hisilicon: add PciCpuIo2Dxe Ming Huang
2018-07-20 10:31 ` Ard Biesheuvel
2018-07-23 1:12 ` Ming
2018-07-20 8:02 ` [PATCH edk2-platforms v1 10/13] Hisilicon: add PciSegmentLib for Hi161x Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 11/13] Hisilicon/D0x: Switch to generic PciHostBridge driver Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 12/13] Hisilicon: remove platform specific PciHostBridge Ming Huang
2018-07-20 8:02 ` [PATCH edk2-platforms v1 13/13] Hisilicon/PlatformPciLib: clear redundant felds in RESOURCE_APPETURE Ming Huang
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=20180720080242.3777-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