From patchwork Tue Jun 27 13:21:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 106424 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp1198514qge; Tue, 27 Jun 2017 06:23:19 -0700 (PDT) X-Received: by 10.200.3.132 with SMTP id t4mr3382405qtg.232.1498569798965; Tue, 27 Jun 2017 06:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498569798; cv=none; d=google.com; s=arc-20160816; b=NKvSlRcZSB69eBRXUu3m9N7+3k7YDrJ8j9u0V7cLmZ475SdmrCinpsUnHwbuU46vhT bGOPlGntQr6miAaiGabgVdn9DR3871OT0ws6voGSzMpxtTq3C3+IiSXrGFiKqg/iSTQb yOnIGaK+3zOwlssGzotyEn3KajFeAkA2RFmkjHuL3xhuXX24hUb76wHP72ZjG1/qzAjC 8Ke12WeCYW+kOuJPx6+To/Nvy0mRAklAlFfhIdUUx66fvEk1CYvTHSv7dFrq/9DuJfKc tTjZSrj1ReUDl21lzqG3jXegh3P5RnDz+ubdgsnbd8lrm1dvs+trvvlj1bmVwrOoP4fI UZ+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 :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=JmpVJNy2Izh9zE/wuFRgdJAxeDkqJfZr7ahN/xqk24AddyIsS4kjLXH/09Nlj7E11r ghAZ7AaPvzFGDvp5sa7f1INKVm0yP2sGR90ki2558OAhf/m9xtbpoDdED+08Oo9XcheE +5P6ANlgVdCkbRFBWHuuLUyDSKPzEU4O4WcaUrwB5c1q3wFD/TzsDQFwuKFEReaJZhtu rk1k1k8Nv0x+a+J9sm2J35kria0Wi5+v9qOP3lhI1qGjpIab1UeGerLafrcS2u3TeaQ3 FoMcs3Fc9KenrxFbyBo9xYMKvECpYYxRO/fjpnEJYnZlFK1Rq+jj3MyTqcwEtlbFg+zx 4zTQ== 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 f62si2627208qkb.197.2017.06.27.06.23.18; Tue, 27 Jun 2017 06:23:18 -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 A3A5360C21; Tue, 27 Jun 2017 13:23:18 +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=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM 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 D145060C19; Tue, 27 Jun 2017 13:22:40 +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 111EF60C1C; Tue, 27 Jun 2017 13:22:35 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by lists.linaro.org (Postfix) with ESMTPS id 6D31D60C24 for ; Tue, 27 Jun 2017 13:22:04 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id b184so26523063wme.1 for ; Tue, 27 Jun 2017 06:22:04 -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=SssMxDvj3z2vr1O8j8brkD02PfRJFmpsgtBykcXm/l0fM4j1SreQQ8Xf9JWjH9PucB 1ToiGvFeumLRx9JBxiwdjp1GCDcDH8xdLtbRbf0NWxtuX1oEuO1UygKtgYubpXdIyHX2 ZeZ5KxpyY0V5EGNA/QBMPoQwv2RGOmzKiVIjxHUmueek7+TR9dopdJn/EstLgTo+LOjP l1rbL5bnKRdMCApCwImFA2TMPJqiogGfja8I901qOSm1HmRXQHSsF5D/1Y0EGOath7Wl +NCqPyBVGc2kwHUZ9qqOlEFpTeKm4f1Ro/+678UeXLrUbDAgThEaReafmNPTRYUIrSha TG7Q== X-Gm-Message-State: AKS2vOzZfm3pjn/JzNCwaz0JNZq8RDaZturppApvjr3aECYOl0wHnchg 3PxGIXTffx09FdbxyOqtu4NC X-Received: by 10.28.69.67 with SMTP id s64mr3589809wma.100.1498569723366; Tue, 27 Jun 2017 06:22:03 -0700 (PDT) Received: from localhost.localdomain ([105.133.250.69]) by smtp.gmail.com with ESMTPSA id p99sm18801062wrb.6.2017.06.27.06.22.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jun 2017 06:22:02 -0700 (PDT) From: Ard Biesheuvel To: linaro-uefi@lists.linaro.org Date: Tue, 27 Jun 2017 13:21:39 +0000 Message-Id: <20170627132145.28159-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170627132145.28159-1-ard.biesheuvel@linaro.org> References: <20170627132145.28159-1-ard.biesheuvel@linaro.org> Cc: rfranz@cavium.com, alan@softiron.co.uk Subject: [Linaro-uefi] [PATCH v2 04/10] 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 Reviewed-by: Leif Lindholm --- 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 } }