From patchwork Fri Jun 23 18:30:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 106281 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp346032qgd; Fri, 23 Jun 2017 11:31:50 -0700 (PDT) X-Received: by 10.200.8.67 with SMTP id x3mr10753568qth.195.1498242710369; Fri, 23 Jun 2017 11:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498242710; cv=none; d=google.com; s=arc-20160816; b=G4cfVMXcfJPEMgewYU77zQeZzRV7PfR7VFGMqFvp41PV+0j5pcC92SC61n6iXuSelg sd08cokA9Wvq1pAL/dQ4HdpQFKk9EoWMd5drcXbXwrVW1u8o6ktwYx48osATwqRwGnw2 jEYJRahHEK58EeOtCPaTNwWszV9yEO0VmNbjFRpLZGb7rYCFAZ6IJM1lvRj6Ug8WGqZY xE8PnZ08pmDbfkKllDBo7MmweXi44d0XXX/TaEXTW6eMJ8ozXmp23x6MstXHp7jVL8qB bdjf57NgYfoqDg3v/NZrIQtLx3pYzHG7O/xP9yNimMeEeU5MsaPXGrc76GmARp8NqzVb wnmw== 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 :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=gFVSm0YzeNV2C8NPw45587WUFC/7/X7wcrpnbkmOFqI=; b=JVPbkguiOMWcL95zu1HGXXqUf8mm+7yj0W/kClvyKewumT8ergiDyI/4JpvuLWG5eH 0J1hElih3/yWzsZzhQC4szV4ZF5tAlEpJeK/p/NtW3FFLVAi31VN6y4LdSqdxyjK0oCk 99RQL3Dy9VGY6/fSW7Sukd3/xxunbezUQb7Kbwih45wInE+JDm5yTvOe5U2TvY95Fz3V lQZiJIWAY7A5xl/GcYC7IDFKVbTBPbp8iv1CfqsPvcEw5ravrCzWR4cPeeSM0FsJB9bT SyETymfhXVM4jmZQr6lyHoUcXm1FYbWL8gWakKP+B2Z/k6pM8hX3cDDroMXYc08HYoAu JGAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q77si4487696qka.83.2017.06.23.11.31.50; Fri, 23 Jun 2017 11:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 070F760C56; Fri, 23 Jun 2017 18:31:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 34A9960C37; Fri, 23 Jun 2017 18:31:21 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1F05660C30; Fri, 23 Jun 2017 18:31:15 +0000 (UTC) Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by lists.linaro.org (Postfix) with ESMTPS id 7F09060C32 for ; Fri, 23 Jun 2017 18:31:02 +0000 (UTC) Received: by mail-wr0-f178.google.com with SMTP id c11so76545300wrc.3 for ; Fri, 23 Jun 2017 11:31:02 -0700 (PDT) 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=I0vcZsVXXapZPGiQsdSMzv5q3TFSQ0Bqj/NNJ8Q8Mko=; b=MLsjkaSVq+wtpwVx188Xf19nFPDIww4x656EEZy0rYFsy5szWWmHWjGGor5GTYQs8m FBmwQOBxjTqVlCzM85t5dQ0m4F4Di6H8Pta1IccCuuEsBZGehiQCLrgZ3TeybuQT5JoS n78PYAdqwiB44zP9O+o1hf89P1Q+KuS4rZ4qlUEVhX0ZyrDR1whibEEpcwM6MZLeirVt DglA4BniH1Ac9M3HPxBRduh0ROXKMh78ViR8LHYSBb/cCmp/R2oVtE94/bhrNI+MFFf6 iJBzEiHdzUkmoVqx5otSRRnpKP22239uhHNDaoSV7UWigGnMVSib9tmIO89mkB8MaFnt 3Ddw== X-Gm-Message-State: AKS2vOyjwSNlkjnPYMHZdPfUUstbd3qPU8Xo0SdcPdRcjhUdgSZk27q4 dm1Crwhjj3V9G8vW0uZo+05W X-Received: by 10.28.87.72 with SMTP id l69mr6082297wmb.111.1498242661319; Fri, 23 Jun 2017 11:31:01 -0700 (PDT) Received: from localhost.localdomain ([160.171.41.197]) by smtp.gmail.com with ESMTPSA id l190sm5632336wmb.18.2017.06.23.11.30.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 11:31:00 -0700 (PDT) From: Ard Biesheuvel To: linaro-uefi@lists.linaro.org Date: Fri, 23 Jun 2017 18:30:42 +0000 Message-Id: <20170623183045.21494-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170623183045.21494-1-ard.biesheuvel@linaro.org> References: <20170623183045.21494-1-ard.biesheuvel@linaro.org> Cc: rfranz@cavium.com, alan@softiron.co.uk Subject: [Linaro-uefi] [PATCH 3/6] Platforms/AMD/StyxDtbLoaderLib: disable SMMUs for absent hardware X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "For discussions about Linaro-related UEFI development. Not a substitute for edk2-devel." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" The logic regarding how the various SMMUs are exposed in the device tree is inverted, in the sense that they are present in the static DTB image, and are removed if no SMMU support is requested. However, the logic is flawed in the sense that it did not remove SMMUs for hardware that is not there to begin with, i.e., the XGBE network ports on Cello/Softiron 1000 or the second SATA controller on B1 silicon. So fix that. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- Platforms/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Platforms/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Platforms/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c index 093db6517c1a..0da00655396e 100644 --- a/Platforms/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c +++ b/Platforms/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c @@ -261,11 +261,18 @@ SetSocIdStatus ( if (!PcdGetBool (PcdEnableSmmus)) { DisableSmmu (Fdt, "iommu-map", "/smb/smmu@e0a00000", "/smb/pcie@f0000000"); DisableSmmu (Fdt, "iommus", "/smb/smmu@e0200000", "/smb/sata@e0300000"); + } + + if (!PcdGetBool (PcdEnableSmmus) || !IsRevB1 || FixedPcdGet8 (PcdSata1PortCount) == 0) { DisableSmmu (Fdt, "iommus", "/smb/smmu@e0c00000", "/smb/sata@e0d00000"); + } + #if DO_XGBE + if (!PcdGetBool (PcdEnableSmmus)) +#endif + { DisableSmmu (Fdt, "iommus", "/smb/smmu@e0600000", "/smb/xgmac@e0700000"); DisableSmmu (Fdt, "iommus", "/smb/smmu@e0800000", "/smb/xgmac@e0900000"); -#endif } }