From patchwork Tue Jul 24 06:32:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 142676 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6898934ljj; Mon, 23 Jul 2018 23:32:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfUFoHgRPdDFNU2/37AhC6+K2qIF/zDdwjhOT1gc6VvIwYPcM7ql/EWsjm1rIDwEFG9Mj/v X-Received: by 2002:a62:283:: with SMTP id 125-v6mr16377492pfc.51.1532413960690; Mon, 23 Jul 2018 23:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532413960; cv=none; d=google.com; s=arc-20160816; b=G3njVIESwSKNWHcMkOW2TQhNNWNjfeQwX/6EEzNHLjST1ncME45OwPIWudRk33RjM9 H5DhTM6gyRrVQwR4rhmBjAql0m0XqfKCYZV46FViN/9aPjhfn/WY8WQo+HwZhS06wsDm P5MYk3vg9QZ+/XsMOH23g7ZLDCknKCmF5jRITtb4iZgxBDMjO6QicG2EgbSYUU+XUr3V UaYbixWDb0b+hLOqHbeIqrGM/9NmSGosyB6ifXw9ZelEQVb1egm9ouRggu7r6QC5L3WH 0Cj5L2Jc/u2a/k9+ieP9Ozvv/oz1yCA+jqDpVhFmgNWmauMt6993ewr5/uHW48rz4xFl Za7A== 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=Gkxp40/MQuKUBd2uzijcNA4M6iaOdIcvULt0HPRilh8=; b=T0z7hIJt6DhYEmzq1sO4pUD6QE+PPWscnBChn8WrdcDNZTjVCAupZPHWjYFdAny+zp 7Unb2oBkOrsRstsIQJ2DVXcwdFQ2Ya21l7kcsGO8ytZUs+wNPHqFnSvRXeozR+z9JwU4 N3n/sgPK/cVqHIDGewxu1pKRqDHdQ4dclvYlclkoWPpyEXLg3a0GZOUcwpw5Jo1+bbMS kYPi2fJIwrhy0OpuwGqxli+Rb0+ANsWx3YQhld/w+wIKNL+nryy99T5uu0KAMxxWOuU4 9BGTMwDCaz2532gbiBW1TGWtAjAwl5oJvkIJ2DGM2AvhVyMxSoiIgmb7znqAbhWaJS55 xXdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EDJxv6Wo; 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 p14-v6si11126055pfk.275.2018.07.23.23.32.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 23:32:40 -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=EDJxv6Wo; 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 4F36B210C1226; Mon, 23 Jul 2018 23:32:40 -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::544; helo=mail-pg1-x544.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (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 D410A210C0F72 for ; Mon, 23 Jul 2018 23:32:38 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id s7-v6so2142071pgv.3 for ; Mon, 23 Jul 2018 23:32:38 -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=acUyKEBrffdBTEDM7s5VtpAgSxHTcz0C3mdgnwJcnBU=; b=EDJxv6WobgKmquGg8WTTaewG/2UbbUTU3Kw9ENI4qNtd80WHggNA+JmOPHdT+h5hVD QBZDZ0gELRbISxS/xMzWcU5MWfftoH89LWcpMS26Hx2k/8SNOuvgulSbfsJo2HWW7Q8S iJwbcVZfD7bIhuWyHd8ezXv4zuMdWUfry5Bsc= 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=acUyKEBrffdBTEDM7s5VtpAgSxHTcz0C3mdgnwJcnBU=; b=r8KgQbQcdHVP0x6SQd4Rh6kUWwsyx7dErRC0O/bEBBIcyFDVA9fCXqVbx6WRsqiVml W86+51NO2OkEeOzmVNVA8rtCZPKxRi0nWA0dWw1vFGEQd+rXV3ksIFQCMRWgOSV6jqRV QwD+MZePMNgarxKNfQTaRGix9WGsbe/FDvYWVLQ3HWv4RGJJ7F2+S6lkEnos6FzjvVf9 zm9UUdrhS5OsV0aGGt+889fjGZfvidX45A/kKWprjDmhm9rygleG8lKbvzF+sZMryf1m Be7yEK/rRsV0Xg729dJdkQG9NQP7utxCpnicWOnKJRCeeVMSJLLPJPFmXZT3TVk/gWaj 1vNg== X-Gm-Message-State: AOUpUlE9WY+yPtds7NFHYUgyAxCo7jaqgX4igFhto3hX7ZnkwVxxMbHr V8ChyoiXmnWSenXX3OUCY5clIQ== X-Received: by 2002:a65:6086:: with SMTP id t6-v6mr15281455pgu.424.1532413958364; Mon, 23 Jul 2018 23:32:38 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jul 2018 23:32:37 -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:11 +0800 Message-Id: <20180724063220.61679-4-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 03/12] Hisilicon/Pci: Move PciPlatform to common directory 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, Michael D Kinney , huangdaode@hisilicon.com, guoheyi@huawei.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Heyi Guo This is to prepare for switching to generic PciHostBridge driver, so we move all platform specific code to platform specific drivers, not in PciHostBridge driver. The PciPlatform driver is design a common driver in Hisilicon,so move this driver to Hisilion/Drvers. Remove the useless file PciPlatform.h. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo Signed-off-by: Ming Huang Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Michael D Kinney --- Platform/Hisilicon/D03/D03.dsc | 2 +- Platform/Hisilicon/D03/D03.fdf | 2 +- Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.h | 180 -------------------- Platform/Hisilicon/D05/D05.dsc | 2 +- Platform/Hisilicon/D05/D05.fdf | 2 +- {Platform/Hisilicon/D03 => Silicon/Hisilicon}/Drivers/PciPlatform/PciPlatform.c | 0 {Platform/Hisilicon/D03 => Silicon/Hisilicon}/Drivers/PciPlatform/PciPlatform.inf | 0 7 files changed, 4 insertions(+), 184 deletions(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc index 3fce2174fe..6ceebba4ee 100644 --- a/Platform/Hisilicon/D03/D03.dsc +++ b/Platform/Hisilicon/D03/D03.dsc @@ -458,7 +458,7 @@ NULL|Platform/Hisilicon/D03/Library/PlatformPciLib/PlatformPciLib.inf } - Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf + Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf { DmaLib|EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf diff --git a/Platform/Hisilicon/D03/D03.fdf b/Platform/Hisilicon/D03/D03.fdf index 1383aa1091..264d134f98 100644 --- a/Platform/Hisilicon/D03/D03.fdf +++ b/Platform/Hisilicon/D03/D03.fdf @@ -263,7 +263,7 @@ READ_LOCK_STATUS = TRUE # PCI Support # INF Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf - INF Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf + INF Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf INF Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf diff --git a/Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.h b/Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.h deleted file mode 100644 index a89f7c61b6..0000000000 --- a/Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.h +++ /dev/null @@ -1,180 +0,0 @@ -/** @file -* -* Copyright (c) 2016, Hisilicon Limited. All rights reserved. -* Copyright (c) 2016, Linaro Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the BSD License -* which accompanies this distribution. The full text of the license may be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -* -**/ - -#ifndef PCI_PLATFORM_H_ -#define PCI_PLATFORM_H_ - -#include -#include -#include -#include - - -// -// Global variables for Option ROMs -// -#define NULL_ROM_FILE_GUID \ - { \ - 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \ - } - - -typedef struct { - EFI_GUID FileName; - UINTN Segment; - UINTN Bus; - UINTN Device; - UINTN Function; - UINT16 VendorId; - UINT16 DeviceId; -} PCI_OPTION_ROM_TABLE; - -#define INVALID 0xBD - - -typedef struct { - EFI_HANDLE PciPlatformHandle; - EFI_PCI_PLATFORM_PROTOCOL PciPlatform; -} PCI_PLATFORM_PRIVATE_DATA; - - - -extern PCI_PLATFORM_PRIVATE_DATA mPciPrivateData; - -EFI_STATUS -EFIAPI -PhaseNotify ( - IN EFI_PCI_PLATFORM_PROTOCOL *This, - IN EFI_HANDLE HostBridge, - IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase, - IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase - ) -/*++ - -Routine Description: - - Perform initialization by the phase indicated. - -Arguments: - - This - Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance. - 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: - - EFI_SUCCESS - Must return with success. - ---*/ -; - -EFI_STATUS -EFIAPI -PlatformPrepController ( - IN EFI_PCI_PLATFORM_PROTOCOL *This, - IN EFI_HANDLE HostBridge, - IN EFI_HANDLE RootBridge, - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress, - IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase, - IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase - ) -/*++ - -Routine Description: - - The PlatformPrepController() function can be used to notify the platform driver so that - it can perform platform-specific actions. No specific actions are required. - Several notification points are defined at this time. More synchronization points may be - added as required in the future. The PCI bus driver calls the platform driver twice for - every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver - is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has - been notified. - This member function may not perform any error checking on the input parameters. It also - does not return any error codes. If this member function detects any error condition, it - needs to handle those errors on its own because there is no way to surface any errors to - the caller. - -Arguments: - - This - Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance. - HostBridge - The associated PCI host bridge handle. - RootBridge - The associated PCI root bridge handle. - PciAddress - The address of the PCI device on the PCI bus. - Phase - The phase of the PCI controller enumeration. - ChipsetPhase - Defines the execution phase of the PCI chipset driver. - -Returns: - - EFI_SUCCESS - The function completed successfully. - ---*/ -; - -EFI_STATUS -EFIAPI -GetPlatformPolicy ( - IN EFI_PCI_PLATFORM_PROTOCOL *This, - OUT EFI_PCI_PLATFORM_POLICY *PciPolicy - ) -/*++ - -Routine Description: - - Set the PciPolicy as EFI_RESERVE_ISA_IO_NO_ALIAS | EFI_RESERVE_VGA_IO_NO_ALIAS. - -Arguments: - - This - The pointer to the Protocol itself. - PciPolicy - the returned Policy. - -Returns: - - EFI_UNSUPPORTED - Function not supported. - EFI_INVALID_PARAMETER - Invalid PciPolicy value. - ---*/ -; - -EFI_STATUS -EFIAPI -GetPciRom ( - IN EFI_PCI_PLATFORM_PROTOCOL *This, - IN EFI_HANDLE PciHandle, - OUT VOID **RomImage, - OUT UINTN *RomSize - ) -/*++ - -Routine Description: - - Return a PCI ROM image for the onboard device represented by PciHandle. - -Arguments: - - This - Protocol instance pointer. - PciHandle - PCI device to return the ROM image for. - RomImage - PCI Rom Image for onboard device. - RomSize - Size of RomImage in bytes. - -Returns: - - EFI_SUCCESS - RomImage is valid. - EFI_NOT_FOUND - No RomImage. - ---*/ -; - -#endif diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc index ab7c5caf86..585184654b 100644 --- a/Platform/Hisilicon/D05/D05.dsc +++ b/Platform/Hisilicon/D05/D05.dsc @@ -611,7 +611,7 @@ NULL|Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf } - Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf + Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf { DmaLib|EmbeddedPkg/Library/CoherentDmaLib/CoherentDmaLib.inf diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf index 61e8d907f9..2fa7a63d72 100644 --- a/Platform/Hisilicon/D05/D05.fdf +++ b/Platform/Hisilicon/D05/D05.fdf @@ -285,7 +285,7 @@ READ_LOCK_STATUS = TRUE # PCI Support # INF Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf - INF Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf + INF Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf INF Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridgeDxe.inf INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf diff --git a/Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.c b/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.c similarity index 100% rename from Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.c rename to Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.c diff --git a/Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf b/Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf similarity index 100% rename from Platform/Hisilicon/D03/Drivers/PciPlatform/PciPlatform.inf rename to Silicon/Hisilicon/Drivers/PciPlatform/PciPlatform.inf