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::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-Google-Smtp-Source: AH8x2267cXULZCOJm7+V18dAU+gV6axEOOA5JkLC2DOfZb+7PZZ47oFTjN8N3yvFWW3XvRsqnIcqYw== 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 Cc: Heyi Guo , Ruiyu Ni , Ard Biesheuvel , Star Zeng , Eric Dong , Laszlo Ersek , Michael D Kinney 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: [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: , X-List-Received-Date: Fri, 23 Feb 2018 08:47:42 -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. 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