From patchwork Fri Feb 23 08:53:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 129333 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp361906lja; Fri, 23 Feb 2018 00:53:46 -0800 (PST) X-Google-Smtp-Source: AH8x2276/fUNYr8Fyw1fFbCCBd6TqpufjXDVXFrV/HokuzJl4JhgEeO4ulRHnhGPwgpnhi8Rlw4U X-Received: by 10.98.20.22 with SMTP id 22mr1010779pfu.141.1519376026130; Fri, 23 Feb 2018 00:53:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519376026; cv=none; d=google.com; s=arc-20160816; b=yaLef3M3pb2oK5UlBJMAQLWgF72itUYz8f8AssCXQpEM3n/2r4rl5uypXECmMWZknL npPqkWR2R7M+e4VoYBCkdXHnITD+E+wMWtsrl6JwK0KXRLL8O3WcOgHFDRJ+oMqpY0n8 OMPrSRhVfNot6gE/9cxfQ9krroYvROk7pBm06r7jkbIdxb3HC4O41BGnKkAR+9S7/j0k +l1JYknOtmPWwVy029/UdIm9umdiiGr8zGGbHtKD8Vw7HoJCeZHpPcYsgVXerJLpsiV5 yyiMURsmS6s/1GcJP/ZHatPic3lHQ+4zGEZqyg2T1Roo+f/RovPAI/Wrxkgx30yzcSL3 raKQ== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=ef9RGDkhjnln490jw9xCwWAHQUAqc/Gzi+3OGLk+Ulo=; b=kPIkcEbanSYn1xIfCeZnJf3NaBT+nj2GLDBPUWdPUtHxPgeq+7/fAHdeAjMjo+qhRZ YK92BDua8kqyGzxuHpsyUiwxE1ViE5xy61SnzO1hAhrAb8/E4aHNPUX34POBSDiEAUUb flBpem5dGrnoXZx3NgG2NYxOCWQ2WIDaBXI28yb5gMtb4vyJAzCkipDhcv85ZEV6L5hx 7FqDToA440FCSmrrqbd5TM94Wemn9cW2q06AAQQkQDcKGWLYmx7lY/bnjQ+laStm9nzV ZRM4gpvJZx2byfoYuhkwdbVldXUNbXVVEU2kjwG8h3wwR+SzunavTlVHMw8ApjzRqcTz YdOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PhQc6dh3; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id y22-v6si284084pll.77.2018.02.23.00.53.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 00:53:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PhQc6dh3; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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 B9BAA2243694F; Fri, 23 Feb 2018 00:47:43 -0800 (PST) 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:400e:c05::242; helo=mail-pg0-x242.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (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 7222B2243694C for ; Fri, 23 Feb 2018 00:47:42 -0800 (PST) Received: by mail-pg0-x242.google.com with SMTP id y26so3128011pgv.4 for ; Fri, 23 Feb 2018 00:53:43 -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=TSTQId6DMGhiV9RYsOcsRJn/cVlvjSNpKZ1/tkBPJsw=; b=PhQc6dh36TaHOmfBMMONno83w1IGmqBk04EVH/vn1199P6UOegnlK4M6zAR//cAlEj RDFkAw2Qb0CIwkOiTTSfT6uNWCMFNlJ2ogpEF+Cz/+CHXVlv6STPMpISdbAJixEEnpDa UDmSzHR+9V3BMlybJN62pGYFDfC9UsywZhWes= 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=TSTQId6DMGhiV9RYsOcsRJn/cVlvjSNpKZ1/tkBPJsw=; b=dtIDsTibfTTAxoI7sEzcNRBFyC/U6kW79kxhvTJdUbrPSkeTHBspw7FvkcY7vrnhkt /Hol36SNgjQpIHfWJZNw4bP9zD6L44QvSNcF8K5nc8dIda4JT9oDudYS3d8RF68HOVx3 tXkPM1Wf9IlbFomw76lm3ICml14E2p/zk9ywtJC0Ym0zqyHTwj0HosnKzou+4an+nnVB wmLeqdhYxaZjUZq2rTtI89+L7F8ro/PSSgmS7UV4ahc9E0nF883Udyxvn+HUCbSzdCSP nCOhOjF49sJsy3rEBaQGMZ44F6vI7w+Lg7W7nCYVpKbhSVQCyTERcZwkPJhHIQtLrfUe 8rhw== X-Gm-Message-State: APf1xPA7O8IvVn8pGar02jTnWjVBbLviSoEB+KWcqy1cUWalp0RR1TZ1 LYPFn8Ne96y6SBEf+f9bykOBUU8424w= X-Received: by 10.99.150.2 with SMTP id c2mr889726pge.424.1519376023307; Fri, 23 Feb 2018 00:53:43 -0800 (PST) Received: from localhost.localdomain ([45.56.152.187]) by smtp.gmail.com with ESMTPSA id j25sm3422694pgn.92.2018.02.23.00.53.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Feb 2018 00:53:42 -0800 (PST) From: Heyi Guo To: edk2-devel@lists.01.org Date: Fri, 23 Feb 2018 16:53:25 +0800 Message-Id: <1519376008-110662-1-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [RFC v3 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: , Cc: Ruiyu Ni , Eric Dong , Ard Biesheuvel , Heyi Guo , Michael D Kinney , Laszlo Ersek , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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. v3: 1. Keep definition of Translation consistent in EDKII code: Translation = device address - host address. 2. Patch 2/2 is split into 2 patches (2/3 and 3/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: 1. 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. 2. Add translation offset to PCI_ROOT_BRIDGE_APERTURE structure definition. 3. 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. This is still RFC version, so we have not gone thru all the code in EDK2 for applying the change of PciSegmentLib definition. 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/PciBusDxe/PciIo.c | 12 ++- .../Bus/Pci/PciHostBridgeDxe/PciHostBridge.c | 74 +++++++++++--- .../Bus/Pci/PciHostBridgeDxe/PciHostResource.h | 2 + .../Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 112 ++++++++++++++++++--- MdeModulePkg/Include/Library/PciHostBridgeLib.h | 8 ++ 5 files changed, 177 insertions(+), 31 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel