From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (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 CBBC8210C122B for ; Mon, 23 Jul 2018 23:32:41 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id x17-v6so608141pfh.5 for ; Mon, 23 Jul 2018 23:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sixuv8RbFLESXIcEXKS2nBVYu/5A5sKX136a0HHvXOs=; b=kbVLXFnekf4RUtW544VB8OocID2+h0aMnjaoR3c7f6Ui5USm+++AiF5NkgJ+Brhd34 YlQABdpROOe4r6pO6Yq0AHq0kIBg9rOcciuzJ2VI+ns57o69uIsDSN5EBYH5vKdLloAq Q8qjn/PD3XFd25oLuaJptPl62iA8X1IJUDwWg= 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:in-reply-to :references; bh=sixuv8RbFLESXIcEXKS2nBVYu/5A5sKX136a0HHvXOs=; b=UHNkldzHQGn/h50OeaOdvb46KJEZH7KDGEn95kjSrxdu1nv1MmmrkgHk17AeQz2mdd D6uLPTNUizNpgZi77A0lbVTWVQX+YPiCdFtQrgSEaXopaS3fPIPNVlsC5ID6Vz2nFg4D OBFuR1xeO/axe+Q2nsh2YIXz4euhRmIGNQ+W+pQ4aQd9HEWphlSNM7VuPl7GZc4xrHs9 CBuNJSBkV3FMrSaJU8nyeDLOmEpDfsSEnZ/X2V4B7wjpaP5b1NACoAe6faeNBOpfnwKd iK7668DFR5w4WAVVD4F54HuDujgbn0zYVjyVhG3GQcEINeZnUK5hHcQ0cQyL29SRS1w0 d9xQ== X-Gm-Message-State: AOUpUlGMpgd8BiVClGaYlKD0wNwUT3qdJeD1gVgkyAM5BGAQ37yFMY9c D5tVcaNP8dkGmSOiNAARQyiR/g== X-Google-Smtp-Source: AAOMgpf3aRnlZ3TntfCrH8ifcN3Dc1TUWeXfbPsD5ThOjplpAKxCdLIEP0IJeKIogFxZ/+QRMMgeqg== X-Received: by 2002:a63:d10c:: with SMTP id k12-v6mr15384651pgg.49.1532413961592; Mon, 23 Jul 2018 23:32:41 -0700 (PDT) Received: from localhost.localdomain ([120.31.149.194]) by smtp.gmail.com with ESMTPSA id e2-v6sm12086575pgo.92.2018.07.23.23.32.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jul 2018 23:32:41 -0700 (PDT) From: Ming Huang 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 , Heyi Guo Date: Tue, 24 Jul 2018 14:32:12 +0800 Message-Id: <20180724063220.61679-5-ming.huang@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180724063220.61679-1-ming.huang@linaro.org> References: <20180724063220.61679-1-ming.huang@linaro.org> Subject: [PATCH edk2-platforms v2 04/12] Hisilicon/Pci: Add two api for PciPlatform driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 06:32:42 -0000 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 Signed-off-by: Heyi Guo --- 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