From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::241; helo=mail-pg0-x241.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 C8D372242384D for ; Wed, 28 Feb 2018 22:51:56 -0800 (PST) Received: by mail-pg0-x241.google.com with SMTP id i14so1974195pgv.3 for ; Wed, 28 Feb 2018 22:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=bEJrHALBP5sZBhCG8iELqW6i6kZQegbglx/Zp8dhedM=; b=SHky5visqodMcd2Y7fSkHYqO7V1mw+UpiPlJELDrqzYXy7QiAnK1xr5OH1NMmm59y1 hvB75uJFJ4vGiycOukMpMEA6RQQDVjaM8XuyR1Jl01SWRjZKFmOgXJTpao5Hq0wSOjQx tu1C04cfiQHLGBTLvhWthVYdIJ04/uaq656hs= 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; bh=bEJrHALBP5sZBhCG8iELqW6i6kZQegbglx/Zp8dhedM=; b=g5FjLeVJjxGy/a4GFTLgefwrhD1iXSWCQ+Dyuu2Bd7axgpKDsmtG3Er/ffuvWu2uRX TQRj8cubCtkRa2aLfiD+eJldnCiT74DAPybB09jP8UZ9xsgC0R4alr4xjJCN0Hs0AEGP fd/BOHuVdH2eeigHcObTN9ZvxkxBTXnu/WCSUwrzFuvABgrhH+z+hjnuR6ppVhrtSv5s wdb5WNS7MTkT7gh6l1yp4Owkxr0hnjGGbWROUrxZHG6J/zNj668hE6Xm9nWVodbJiAVN Aw8bttbiSWFqEi5h0UXyAMwn1xKXStIvBdDILun/HclD4qW9BxKzQDXSDxKSNjtA90dC x4yA== X-Gm-Message-State: APf1xPBajMi4Blt9pusmtqHHVq9B420NQHVOgl1ufm18zwIuDseSL8B+ xc5Bu6k5iT6wfE52yH4XOdsDzZGgoSM= X-Google-Smtp-Source: AG47ELudqQLryplLBdpM5CCISEyU72QiOCkTxiFHn4GRrxrpVR5Yi3nBqlOROrvxnYp7Fh0jhYBw4A== X-Received: by 10.98.166.200 with SMTP id r69mr892160pfl.205.1519887484023; Wed, 28 Feb 2018 22:58:04 -0800 (PST) Received: from localhost.localdomain ([45.56.152.115]) by smtp.gmail.com with ESMTPSA id p63sm6489867pfk.74.2018.02.28.22.58.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 22:58:03 -0800 (PST) From: Heyi Guo To: edk2-devel@lists.01.org Cc: Heyi Guo , Ruiyu Ni , Ard Biesheuvel , Star Zeng , Eric Dong , Laszlo Ersek , Michael D Kinney , Maurice Ma , Prince Agyeman , Benjamin You , Jordan Justen , Anthony Perard , Julien Grall Date: Thu, 1 Mar 2018 14:57:18 +0800 Message-Id: <1519887444-75510-1-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [PATCH v5 0/6] Add translation support to generic PciHostBridge X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2018 06:51:57 -0000 Patch v5 inherits the code from RFC v4; we don't restart the version number for RFC to PATCH change. v5: - Patch 4/6: Modify the code according to the comments from Ray. - Patch 1/6 and 2/6 are totally new. They add initialization for all fields of PCI_ROOT_BRIDGE_APERTURE temporary variables in PciHostBridgeLib instances, so that they will not suffer from extension of PCI_ROOT_BRIDGE_APERTURE structure. - Generate a separate patch (3/6) for PciHostBridgeLib.h change. Though it is a prerequisite for patch 4/6, it does not change the code in PciHostBridge driver and won't cause any build failure or functional issue. v4: - Modify the code according to the comments from Ray, Laszlo and Ard (Please see the notes of Patch 1/3) - Ignore translation of bus in CreateRootBridge. v3: - Keep definition of Translation consistent in EDKII code: Translation = device address - host address. - Patch 2/2 is split into 2 patches (2/3 and 3/3). - Refine comments and commit messages to make the code easier to understand. v2: Changs are made according to the discussion on the mailing list, including: - PciRootBridgeIo->Configuration should return CPU view address, as well as PciIo->GetBarAttributes, and Translation Offset should be equal to PCI view address - CPU view address. - Add translation offset to PCI_ROOT_BRIDGE_APERTURE structure definition. - PciHostBridge driver internally used Base Address is still based on PCI view address, and translation offset = CPU view - PCI view, which follows the definition in ACPI, and not the same as that in UEFI spec. Cc: Ruiyu Ni Cc: Ard Biesheuvel Cc: Star Zeng Cc: Eric Dong Cc: Laszlo Ersek Cc: Michael D Kinney Cc: Maurice Ma Cc: Prince Agyeman Cc: Benjamin You Cc: Jordan Justen Cc: Anthony Perard Cc: Julien Grall Heyi Guo (6): CorebootPayloadPkg/PciHostBridgeLib: Init PCI aperture to 0 OvmfPkg/PciHostBridgeLib: Init PCI aperture to 0 MdeModulePkg/PciHostBridgeLib.h: add address Translation MdeModulePkg/PciHostBridgeDxe: Add support for address translation MdeModulePkg/PciBus: convert host address to device address MdeModulePkg/PciBus: return CPU address for GetBarAttributes MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.h | 21 ++++ MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostResource.h | 3 + MdeModulePkg/Include/Library/PciHostBridgeLib.h | 19 +++ CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c | 5 + MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 12 +- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 129 +++++++++++++++++--- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 118 ++++++++++++++++-- OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 + OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 5 + 9 files changed, 288 insertions(+), 28 deletions(-) -- 2.7.4