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::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-Google-Smtp-Source: AAOMgpcejrXik2wdqUBBq4OrmE1fO202cil/xJeg/15ZvLb6tYpGryKAaxBStoPs5sUGWVeO/ZxisA== 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 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, Heyi Guo , Ming Huang , Michael D Kinney 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: [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: , X-List-Received-Date: Tue, 24 Jul 2018 06:32:39 -0000 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(-) 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 -- 2.17.0