From patchwork Tue Jun 26 10:44:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 139930 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5075561lji; Tue, 26 Jun 2018 03:44:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLRM8gquP/EcFuOSyY+OiWFQuRMPwIes0XvAuizxpx5eXH1QftD09UbldOejW3ZG34bEEdB X-Received: by 2002:a63:3686:: with SMTP id d128-v6mr886740pga.18.1530009873469; Tue, 26 Jun 2018 03:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530009873; cv=none; d=google.com; s=arc-20160816; b=fHv6DL7dxkHWb0L06zktRmO2wAPXQxmB16VXuDicfEfEemeoM2lg84gFbmWHyguz64 iOpbsepbCtxKLZBUhzeIMEk8IqK0BkGtaSLPYbrGmPLPNMIHmpHwH8kSGH95NHga7bRt frPeE3obtC5cP29FQhwZg2xnlp3WgjYlWs7ZLNCzhFrc61b2ZBkNpafmw5M/OrKl61/h z/isd4L7o3Lk2HEP/+rJmE7Q4Ods7UxsxujCPJfZKd3pDHKKf2Hlpy7jBw0paPmnitja gR5ilbGcjoVQjTXaJLpcie2c9poqZSZMDoVFq+7iBgT/skKl1MfKKfSLA+oTepMkcQbI U0+g== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=ih1zgE7hspg1LtOkLGcCTW9cWVGV5C+48GcCvZR2ZIg=; b=uAsfJeHYfzffbd4AAbUkhkT8BSSkDv0v/TpMAevtQx5EeBas5w9pufyJYS0WgCzTzZ rlriM7AawYqfzrhSlrD2cPNDE+vk+P1k4fnUZe305fieg9Qxa2M3HGosiY5DEATmvhYq iu6ndownQ6GJ9nK2iu7vJI7NubpmFwoZj8Yg9Ym6ECJ2FtbkgNLt2QaKoHhFnrIx7V1k d26BYrd9IEx7hDToJa1U/0iHzRmJeBwbhcLdFGWuCtH1rHI5ityqij6/wGGjHQzGiUa7 WztvlszIIPubIN+XGJlG09Gb7ui0KgTn+MfAuPy75wiy49o9huXJuXr8YvlwFsRMmMJJ YxyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=k1prieOz; 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 e4-v6si1169586pgs.476.2018.06.26.03.44.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 03:44:33 -0700 (PDT) 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=k1prieOz; 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 7F4EA209605A1; Tue, 26 Jun 2018 03:44:32 -0700 (PDT) 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=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::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 DC7CB20337359 for ; Tue, 26 Jun 2018 03:44:30 -0700 (PDT) Received: by mail-wm0-x242.google.com with SMTP id p126-v6so1345372wmb.2 for ; Tue, 26 Jun 2018 03:44:30 -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=Ncn1osWfMrS7upp6S4ylRtmpn8KuTXIK//8lCKzczSk=; b=k1prieOzs/VHAFNyNt9Em9S74fJddmFEGNu9e0ML8K3a9T+KlbfK48i0nPPNweMHKy uKX/QGaYAxGIEwT3Jhxt82Y9cuUa99t8VlrrWE1W2OEZPk9JnHy9sv+lOXAoJlwLHupx m8NEXVCoOk2edP7fPxtP3qWvbrbIBqZZSzakQ= 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=Ncn1osWfMrS7upp6S4ylRtmpn8KuTXIK//8lCKzczSk=; b=q4j9ofN0SKQTK9HQXRrDMlnyNwCLhFFWPsT59ixAxSWArw5IgEyfrK9EXFJNx93MwU SL8rIiUta0LOwZg+PVYgpMkXxJOSjoWBsPyh5XIVqMygSI0IqEi1uJqL4Jj41aSa/+L8 LU4PArNIGBRPrxIxJOiuFqQ14naFVOzpO9HTOfiTzoqEneB32Pz5auQx2zWECxgR2Hvs C08aI124JzWjYalk8kSGEWWPYsvsEvM7lR9kHEGEZUdnuCtjDdqnFqL6S1gcyMB40+0N w0Yf095ThemPTKCyrZoGBm0/TrscwtqteXYZ78p8o5T3PB3hkXDFFivRGbOTsAHkaL0/ gRCg== X-Gm-Message-State: APt69E0IRd4MRUxu/egdhue8V8f+64TYJ769eUS8aGuO+jAodLaMg/8q kYTtJDf0OZbNwexpJNUaznzZoiWhqrw= X-Received: by 2002:a1c:5b0d:: with SMTP id p13-v6mr1174942wmb.53.1530009868774; Tue, 26 Jun 2018 03:44:28 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:a044:5ea2:f748:d67a]) by smtp.gmail.com with ESMTPSA id m58-v6sm2557745wrf.61.2018.06.26.03.44.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 03:44:27 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 26 Jun 2018 12:44:23 +0200 Message-Id: <20180626104424.3524-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626104424.3524-1-ard.biesheuvel@linaro.org> References: <20180626104424.3524-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms 1/2] Silicon/SynQuacer: add preliminary support for PCIe MMIO32 translation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add the basic support for enabling PCIe MMIO32 translation on the SynQuacer, without actually enabling it just yet. It would allow us to increase the bus range to 255 MB [from 127 MB] and the MMIO32 range to 512 MB or more [from 128 MB], but it is more likely to cause compatibility issues with code ported from the PC platform. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl | 8 ++++---- Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h | 2 ++ Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c | 6 ++++-- Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLibConstructor.c | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl index 51e9d0b22c3d..77d4763d1a85 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl +++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl @@ -86,14 +86,14 @@ DefinitionBlock ("SsdtPci.aml", "SSDT", 1, "SNI", "SYNQUACR", SYNQUACER_PCI_SEG0_BUSNUM_RANGE // RangeLength - # of Busses ) - DWordMemory ( // 32-bit BAR Windows + QWordMemory ( // 32-bit BAR Windows ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, 0x00000000, // Granularity SYNQUACER_PCI_SEG0_MMIO32_MIN, // Min Base Address SYNQUACER_PCI_SEG0_MMIO32_MAX, // Max Base Address - 0x00000000, // Translate + SYNQUACER_PCI_SEG0_MMIO32_XLATE, // Translate SYNQUACER_PCI_SEG0_MMIO32_SIZE // Length ) @@ -224,14 +224,14 @@ DefinitionBlock ("SsdtPci.aml", "SSDT", 1, "SNI", "SYNQUACR", SYNQUACER_PCI_SEG1_BUSNUM_RANGE // RangeLength - # of Busses ) - DWordMemory ( // 32-bit BAR Windows + QWordMemory ( // 32-bit BAR Windows ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, 0x00000000, // Granularity SYNQUACER_PCI_SEG1_MMIO32_MIN, // Min Base Address SYNQUACER_PCI_SEG1_MMIO32_MAX, // Max Base Address - 0x00000000, // Translate + SYNQUACER_PCI_SEG1_MMIO32_XLATE, // Translate SYNQUACER_PCI_SEG1_MMIO32_SIZE // Length ) diff --git a/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h b/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h index 950cece13e81..798f59db2a94 100644 --- a/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h +++ b/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h @@ -34,6 +34,7 @@ #define SYNQUACER_PCI_SEG0_MMIO32_MIN 0x68000000 #define SYNQUACER_PCI_SEG0_MMIO32_MAX 0x6fffffff #define SYNQUACER_PCI_SEG0_MMIO32_SIZE 0x08000000 +#define SYNQUACER_PCI_SEG0_MMIO32_XLATE 0x0 #define SYNQUACER_PCI_SEG0_MMIO64_MIN 0x3e00000000 #define SYNQUACER_PCI_SEG0_MMIO64_MAX 0x3effffffff @@ -57,6 +58,7 @@ #define SYNQUACER_PCI_SEG1_MMIO32_MIN 0x78000000 #define SYNQUACER_PCI_SEG1_MMIO32_MAX 0x7fffffff #define SYNQUACER_PCI_SEG1_MMIO32_SIZE 0x08000000 +#define SYNQUACER_PCI_SEG1_MMIO32_XLATE 0x0 #define SYNQUACER_PCI_SEG1_MMIO64_MIN 0x3f00000000 #define SYNQUACER_PCI_SEG1_MMIO64_MAX 0x3fffffffff diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c index 341939876bd3..7c096f0801dd 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c @@ -107,7 +107,8 @@ PCI_ROOT_BRIDGE mPciRootBridges[] = { SYNQUACER_PCI_SEG0_PORTIO_MAX, MAX_UINT64 - SYNQUACER_PCI_SEG0_PORTIO_OFFSET + 1 }, // Io { SYNQUACER_PCI_SEG0_MMIO32_MIN, - SYNQUACER_PCI_SEG0_MMIO32_MAX }, // Mem + SYNQUACER_PCI_SEG0_MMIO32_MAX, + MAX_UINT64 - SYNQUACER_PCI_SEG0_MMIO32_XLATE + 1 }, // Mem { SYNQUACER_PCI_SEG0_MMIO64_MIN, SYNQUACER_PCI_SEG0_MMIO64_MAX }, // MemAbove4G { MAX_UINT64, 0x0 }, // PMem @@ -127,7 +128,8 @@ PCI_ROOT_BRIDGE mPciRootBridges[] = { SYNQUACER_PCI_SEG1_PORTIO_MAX, MAX_UINT64 - SYNQUACER_PCI_SEG1_PORTIO_OFFSET + 1 }, // Io { SYNQUACER_PCI_SEG1_MMIO32_MIN, - SYNQUACER_PCI_SEG1_MMIO32_MAX }, // Mem + SYNQUACER_PCI_SEG1_MMIO32_MAX, + MAX_UINT64 - SYNQUACER_PCI_SEG1_MMIO32_XLATE + 1 }, // Mem { SYNQUACER_PCI_SEG1_MMIO64_MIN, SYNQUACER_PCI_SEG1_MMIO64_MAX }, // MemAbove4G { MAX_UINT64, 0x0 }, // PMem diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLibConstructor.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLibConstructor.c index 227f9a725ce8..75a663e974e1 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLibConstructor.c +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLibConstructor.c @@ -322,7 +322,7 @@ PciInitControllerPost ( // Region 0: MMIO32 range ConfigureWindow (DbiBase, 0, - RootBridge->Mem.Base, + RootBridge->Mem.Base - RootBridge->Mem.Translation, RootBridge->Mem.Base, RootBridge->Mem.Limit - RootBridge->Mem.Base + 1, IATU_REGION_CTRL_1_OFF_OUTBOUND_0_TYPE_MEM | From patchwork Tue Jun 26 10:44:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 139931 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5075610lji; Tue, 26 Jun 2018 03:44:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe7gpMC/KVXLmVdMN6YGZkLew1DywaWeDbFLRRquzl6UacGE6ynHCNnrVEykMwMV4RWnbnY X-Received: by 2002:a62:e816:: with SMTP id c22-v6mr1008136pfi.124.1530009877133; Tue, 26 Jun 2018 03:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530009877; cv=none; d=google.com; s=arc-20160816; b=bjrBIoRJKixiVj0uv9sqGSjq0MEtzDRHVp4X7PHENAHTlXB02AC4i6UjlBqMK4HRYf XNzsuXaF6d4pHVGyYSl6EM7QzHtzQRpaL8GzwVFZDjKcsbWozefi5FzQkXME/u+oNEAM TLresj2arPoSH32RXqubwHpysZCl6ZUqvrb0dRUwmHgkhsLfBhObTibXcXqiJivZ5poY zJC8EVgRn67cLPhSrc5KAcDNB/Qgf7BuqXhjOTrJs0bwLlqGrm+JwsLH9WB4pBFF/4UI 2Va27iwVDCys5LtfFQ0/arvLqfIIt4m9pbFz9x6hc1H4JwE46DuBlTVFMramPOsYXVjt nmlg== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=Irawb2N4j+iHWfXiFavzF/ZsOPpgpT2R6YavIAPPRDk=; b=0ItYavYxvRmiXFNTw1v831ddC3rzu5wDtC4BlhDf66MuMH2g6yxYdbnBI1as9FT1ff lfyGqYgORtWJojb1XWKim5FlSYyX0dXElPJId1phiv5skqoVyAwdkH7KqXjH/dLiS9+/ oFyEDAlrRCmoQvfWANbG0VSmRxOJR7UDaYjnsugIWLPBYdnemCYVE5p9d8UI5KePceED XIEMLa1eio0Zy/6DTkgj4GU0DuiRmtOu9Ix+5R7LVIzBwkNGYgIvYPAU+KAQTN4vtfSC MgZIPSMmtxFHmsb5QN/V//ZseBRzKs9WTkc6w3YzdpXn57aT86unawUy4wGAe7OZ6Q9E hjKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=S984D2RJ; 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 p7-v6si1393323plq.81.2018.06.26.03.44.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 03:44:37 -0700 (PDT) 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=S984D2RJ; 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 B0552209605A4; Tue, 26 Jun 2018 03:44:32 -0700 (PDT) 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=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::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 8855A202E53E8 for ; Tue, 26 Jun 2018 03:44:31 -0700 (PDT) Received: by mail-wm0-x242.google.com with SMTP id x6-v6so1324037wmc.3 for ; Tue, 26 Jun 2018 03:44:31 -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=dh9E9ZL1kkwDK7Vjpkvh1WhzMDl3Lw0uYUeUc00UC6A=; b=S984D2RJKAzCY+ElstbArskpT669MXg3PaCWP6zete7nYK2OrvHgJVm4SmznYT3ZGd KtQ7HSd46WmS2FRowgbssAvPhdVluU3YFoOO6lbAjKdRrZcpqAvxhGO1R5+1B7Ts20qF Rz/FkeRkK+PaS8k8YSWSfp5hOt99PnwNwiQhU= 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=dh9E9ZL1kkwDK7Vjpkvh1WhzMDl3Lw0uYUeUc00UC6A=; b=owZKOz31SJUcBYAYGx2ccDw2KAVxdOgHosvzU91zteKZvnYxywjrcJZGiPlWqZAokp achL3cNg+e3eBI9EGS5fxoDImPBJxUK97q5zxCvAQJQOadb5xjvFE1zN68/jAbQG9WtE OS+M53rgdcnKycvSuVso2mWYL/EKC+4OHomTJbUrmRMghQi7s3fmVgEkXSsBHqN525Bu SlsrdhCTcs9OJGC/mzQ33nVsaxm4djgOzkezVkv75CMOjxQ2vQ3wyf4j2OWRktpffJzu DkVCd1yBfRdkbxG3winkS4QIHTgM0DsdXAc3I9eBLyN/AeF1IRd7zfzOvs1eXLVzwQCi VsUw== X-Gm-Message-State: APt69E2QkZg4B4iNAtlSQyHWOluX+ZFBiuomeZIt1MLeKGrFP1Y4HeIi STqKiOuiawyIKBgc8NJEcLosE56fYfA= X-Received: by 2002:a1c:d7c3:: with SMTP id o186-v6mr1138107wmg.67.1530009869889; Tue, 26 Jun 2018 03:44:29 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:a044:5ea2:f748:d67a]) by smtp.gmail.com with ESMTPSA id m58-v6sm2557745wrf.61.2018.06.26.03.44.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 03:44:29 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 26 Jun 2018 12:44:24 +0200 Message-Id: <20180626104424.3524-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626104424.3524-1-ard.biesheuvel@linaro.org> References: <20180626104424.3524-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms 2/2] Silicon/Socionext/SynQuacer: use single translated MMIO window for PCI1 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" For testing purposes, reconfigure the second PCI host bridge to only expose a single MMIO window of 512 MB in size, and map it below 4 GB on the PCI side (so 32-bit BARs can be allocated from it) and above 4 GB on the CPU side. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl | 11 ----------- Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi | 11 +++++------ Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h | 20 ++++++++++---------- Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c | 5 ++--- 4 files changed, 17 insertions(+), 30 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl index 77d4763d1a85..e59d4cf98ebe 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl +++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiSsdtRootPci.asl @@ -235,17 +235,6 @@ DefinitionBlock ("SsdtPci.aml", "SSDT", 1, "SNI", "SYNQUACR", SYNQUACER_PCI_SEG1_MMIO32_SIZE // Length ) - QWordMemory ( // 64-bit BAR Windows - ResourceProducer, PosDecode, - MinFixed, MaxFixed, - Cacheable, ReadWrite, - 0x00000000, // Granularity - SYNQUACER_PCI_SEG1_MMIO64_MIN, // Min Base Address - SYNQUACER_PCI_SEG1_MMIO64_MAX, // Max Base Address - 0x00000000, // Translate - SYNQUACER_PCI_SEG1_MMIO64_SIZE // Length - ) - DWordIo ( // IO window ResourceProducer, MinFixed, diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi index 37d642e4b237..57d111c65bc2 100644 --- a/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi +++ b/Silicon/Socionext/SynQuacer/DeviceTree/SynQuacer.dtsi @@ -478,19 +478,18 @@ pcie1: pcie@70000000 { compatible = "socionext,synquacer-pcie-ecam", "snps,dw-pcie-ecam"; device_type = "pci"; - reg = <0x0 0x70000000 0x0 0x7f00000>; - bus-range = <0x0 0x7e>; + reg = <0x0 0x70000000 0x0 0xff00000>; + bus-range = <0x0 0xfe>; #address-cells = <3>; #size-cells = <2>; - ranges = <0x1000000 0x00 0x00000000 0x00 0x77f00000 0x0 0x00010000>, - <0x2000000 0x00 0x78000000 0x00 0x78000000 0x0 0x08000000>, - <0x3000000 0x3f 0x00000000 0x3f 0x00000000 0x1 0x00000000>; + ranges = <0x1000000 0x00 0x00000000 0x00 0x7ff00000 0x0 0x00010000>, + <0x2000000 0x3f 0xe0000000 0x00 0x20000000 0x0 0x20000000>; #interrupt-cells = <0x1>; interrupt-map-mask = <0x0 0x0 0x0 0x0>; interrupt-map = <0x0 0x0 0x0 0x0 &gic 0x0 0x0 GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>; - msi-map = <0x0 &its 0x10000 0x7f00>; + msi-map = <0x0 &its 0x10000 0xff00>; dma-coherent; }; diff --git a/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h b/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h index 798f59db2a94..643c1a581d0a 100644 --- a/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h +++ b/Silicon/Socionext/SynQuacer/Include/Platform/Pcie.h @@ -41,28 +41,28 @@ #define SYNQUACER_PCI_SEG0_MMIO64_SIZE 0x100000000 #define SYNQUACER_PCI_SEG1_CONFIG_BASE 0x70000000 -#define SYNQUACER_PCI_SEG1_CONFIG_SIZE 0x07f00000 +#define SYNQUACER_PCI_SEG1_CONFIG_SIZE 0x0ff00000 #define SYNQUACER_PCI_SEG1_DBI_BASE 0x583c0000 #define SYNQUACER_PCI_SEG1_EXS_BASE 0x58380000 #define SYNQUACER_PCI_SEG1_BUSNUM_MIN 0x0 -#define SYNQUACER_PCI_SEG1_BUSNUM_MAX 0x7e -#define SYNQUACER_PCI_SEG1_BUSNUM_RANGE 0x7f +#define SYNQUACER_PCI_SEG1_BUSNUM_MAX 0xfe +#define SYNQUACER_PCI_SEG1_BUSNUM_RANGE 0xff #define SYNQUACER_PCI_SEG1_PORTIO_MIN 0x0 #define SYNQUACER_PCI_SEG1_PORTIO_MAX 0xffff -#define SYNQUACER_PCI_SEG1_PORTIO_MEMBASE 0x77f00000 +#define SYNQUACER_PCI_SEG1_PORTIO_MEMBASE 0x7ff00000 #define SYNQUACER_PCI_SEG1_PORTIO_MEMSIZE 0x10000 #define SYNQUACER_PCI_SEG1_PORTIO_OFFSET 0x10000 -#define SYNQUACER_PCI_SEG1_MMIO32_MIN 0x78000000 -#define SYNQUACER_PCI_SEG1_MMIO32_MAX 0x7fffffff -#define SYNQUACER_PCI_SEG1_MMIO32_SIZE 0x08000000 -#define SYNQUACER_PCI_SEG1_MMIO32_XLATE 0x0 +#define SYNQUACER_PCI_SEG1_MMIO32_MIN 0x20000000 +#define SYNQUACER_PCI_SEG1_MMIO32_MAX 0x3fffffff +#define SYNQUACER_PCI_SEG1_MMIO32_SIZE 0x20000000 +#define SYNQUACER_PCI_SEG1_MMIO32_XLATE 0x3fc0000000 #define SYNQUACER_PCI_SEG1_MMIO64_MIN 0x3f00000000 -#define SYNQUACER_PCI_SEG1_MMIO64_MAX 0x3fffffffff -#define SYNQUACER_PCI_SEG1_MMIO64_SIZE 0x100000000 +#define SYNQUACER_PCI_SEG1_MMIO64_MAX 0x3fdfffffff +#define SYNQUACER_PCI_SEG1_MMIO64_SIZE 0xe0000000 #define SYNQUACER_PCI_LOCATION(s,b,d) (((s) << 16) | ((b) << 8) | (d)) #define SYNQUACER_PCI_SLOT0_LOCATION SYNQUACER_PCI_LOCATION(1, 0, 0) diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c index 7c096f0801dd..cf8ea6da2095 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPciHostBridgeLib/SynQuacerPciHostBridgeLib.c @@ -121,7 +121,7 @@ PCI_ROOT_BRIDGE mPciRootBridges[] = { TRUE, // DmaAbove4G FALSE, // NoExtendedConfigSpace FALSE, // ResourceAssigned - PCI_ALLOCATION_ATTRIBUTES, // AllocationAttributes + EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM, // AllocationAttributes { SYNQUACER_PCI_SEG1_BUSNUM_MIN, SYNQUACER_PCI_SEG1_BUSNUM_MAX }, // Bus { SYNQUACER_PCI_SEG1_PORTIO_MIN, @@ -130,8 +130,7 @@ PCI_ROOT_BRIDGE mPciRootBridges[] = { { SYNQUACER_PCI_SEG1_MMIO32_MIN, SYNQUACER_PCI_SEG1_MMIO32_MAX, MAX_UINT64 - SYNQUACER_PCI_SEG1_MMIO32_XLATE + 1 }, // Mem - { SYNQUACER_PCI_SEG1_MMIO64_MIN, - SYNQUACER_PCI_SEG1_MMIO64_MAX }, // MemAbove4G + { MAX_UINT64, 0x0 }, // MemAbove4G { MAX_UINT64, 0x0 }, // PMem { MAX_UINT64, 0x0 }, // PMemAbove4G (EFI_DEVICE_PATH_PROTOCOL *)&mEfiPciRootBridgeDevicePath[1]