From patchwork Tue Jul 24 06:32:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142677 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6898986ljj; Mon, 23 Jul 2018 23:32:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcNTkU1FuDQgl5GKiQxhIwHlJrSOI+jV6dO28Gh3jlxXr9EKfRTQf14tgqdNzXrhFii9H5d X-Received: by 2002:a17:902:968c:: with SMTP id n12-v6mr15686249plp.15.1532413963870; Mon, 23 Jul 2018 23:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532413963; cv=none; d=google.com; s=arc-20160816; b=bEuaz1h98n1K/M7D0hxnJejjKauY3A+d6QixfrJv2Gk1Yf73Hy27UtCCcFfKl9QOzx 7nRYfveq6fLfGnqCd57c1x9zCH22gLYWN7YKwVyrfiy5iEFrkRBi/JR6PxWxe0V19Fn2 uf/qqsTwiAxuTHQfqhatiQGyF+id+KDotqe76xnJedA0wR75WwExu2dZWah4slaApZSu icN/5gm+6cRNqApygMsFJ4czs5zC7dSYKJtyVIoUPny7bU8Ae5gnpTSbc2OI8ZmLhNXl DVXmQBJL/lz7uKOM3VIJb/6OvW9JWBApNGHybIbdC3MpS9+5UDhsu1crEL0FM3XOXC6E 6qzw== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=ssSXOc5g1vyp1X4G7NX7YgfDFU/Fx3meM5DfDcS6IMQ=; b=leRoLqnu5DQOgbL/DvVtmUl3X0i71DRem8xB0ZxfbqeEyxmXI+FKI/xuvrp06/COAC 88JUvmYLogu1DFwsShQ+nTmmG4ooHb3dxvpYxcq9BolYNuOoIkPTa34lQuszEKwlZ1OI wWj+cYTxSpyOISQ6WXIWUr/93pCuMF2hya2InCsWpHeWB+enT99A2mUe+vdFDEkMxxEt uTi+wilB9JU+ByTE/5vPr6gN/vxHuUkyeQIXiQ3UFg9t5ESCTzORiMOI2MD/u/plEGvH 5lvGPxHT2LH1Eh0Rmh3jMHKKI8XY0Ea2oV8lNdEuMieBu6wYQLxUv0Ox69c7khZlLW3C SzDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kbVLXFne; 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 34-v6si9857648plz.479.2018.07.23.23.32.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 23:32:43 -0700 (PDT) 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=kbVLXFne; 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 7D89C210C122C; Mon, 23 Jul 2018 23:32:43 -0700 (PDT) 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=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-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 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: [edk2] [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: , Cc: huangming23@huawei.com, xinliang.liu@linaro.org, john.garry@huawei.com, zhangjinsong2@huawei.com, huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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