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:c01::243; helo=mail-pl0-x243.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (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 291B8209574EF for ; Mon, 26 Feb 2018 18:04:37 -0800 (PST) Received: by mail-pl0-x243.google.com with SMTP id bb3so10472903plb.2 for ; Mon, 26 Feb 2018 18:10:42 -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=0mcGucF8lG+T0nZ43SfAC2sNgO+JNbaaTJnMFPx7+48=; b=VheHcmNxCkRlUaPkx7Po3r/qvgFXfdJSF1Yr6MnNnrBrtcK94Mm1xB0DjxSU5O8MCi fmCI65NQ/M+e1F8dbgEB34nu0u0cPvvcT0Y6X16J4WBvGRo/oB9rJF1sWu95SNqQa43U oDMp1U4oKKYDK7M/2XtotPTQoGLPnCAA5uG4E= 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=0mcGucF8lG+T0nZ43SfAC2sNgO+JNbaaTJnMFPx7+48=; b=q8NWjlJtQaYRvKs9MQq0Nd4APcjQzHmL4+W+cgpNruibFFfjhkD3E21M9JejqmWU7l xhue8bJtEC62tLmH+DZUuh8TcV4yiLU5Iob751fWnTmOEucu2/jexnZ/Xcw1xZ863AqF TAzygqSCLRTc39ru/c5at/3ByEr/eiyIdTODqv2hL+b//cb9Sn+kx6O6N1fnc093wkkV TKvU2+IPggc8HoNRspdx4GMz1AQvhNyAKATcamap2OpaDuV3l+Q7yJf5OubLAVRg7Td1 kJFxq3bpIY/jmHKXoTazC40EjnkGc8aBSIljx9k2Idg6915CqFgxo3iVqUGUkdpn4oNL hbsw== X-Gm-Message-State: APf1xPBPSLlxN2mNQhJiQyh7GJsv0zWZygHbGP3xcJwRmu7G6F96Qcko kIycnzpkQselayv94RB8Q/vFMfRPUco= X-Google-Smtp-Source: AH8x225OhbMjcHTDwyT73n/wfsoZGMuMP9JJEC0ALhk9HiL2JIWC3waDDgwMk5nWSMZTnJlq4iR1Aw== X-Received: by 2002:a17:902:2863:: with SMTP id e90-v6mr12495191plb.232.1519697442239; Mon, 26 Feb 2018 18:10:42 -0800 (PST) Received: from localhost.localdomain ([104.237.91.49]) by smtp.gmail.com with ESMTPSA id a138sm21289210pfd.47.2018.02.26.18.10.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Feb 2018 18:10:41 -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 Date: Tue, 27 Feb 2018 10:09:46 +0800 Message-Id: <1519697389-3525-1-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [RFC v4 0/3] 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: Tue, 27 Feb 2018 02:04:37 -0000 Please note: this is still *RFC* version, so we have not gone thru all the code in EDK2 for applying the change of PciSegmentLib definition. 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 Heyi Guo (3): 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/PciHostResource.h | 2 + MdeModulePkg/Include/Library/PciHostBridgeLib.h | 14 +++ MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c | 12 +- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 85 +++++++++++--- MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 122 +++++++++++++++++--- 5 files changed, 204 insertions(+), 31 deletions(-) -- 2.7.4