From patchwork Thu Sep 17 10:07:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11782147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE9DB139A for ; Thu, 17 Sep 2020 10:12:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 858BB206A2 for ; Thu, 17 Sep 2020 10:12:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PlsXVAj8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tQSs3303" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 858BB206A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2Ig6vcM3yDFnohlSypnSpNr36aiqUzbuN9/OYFr/kyc=; b=PlsXVAj8k3u9hgbte6V67skaE VLVeIrzHnj+63Lbxq3IfRSP4kSdLOa4kaU0j2Nbw8w/rmwEMP/+7DmSkOCuzG05Rx9zQVel6l1C+5 Q+Gl9Fd+HbsaqpYe4XINoWI4GwEDTub3pg9AjidvCCMrEM0KyvmlyxXt0U0/OwjTsE3m6jvUa/gpN sihKVgwLHlGkQ8klVm3xJj6myHNDy2nEtKslHZRDJcplMpqE4me5AuLuxPgSfmU+oS/5n17q4pyjS CdsSdReTi/MvmZ2yFdXW6mqnGtd3d4KOU6M0lA9M7pcjsU0iZsRk6oQIYG8Vi1Ri7VHPG1qVgDdMI t4R1rjCww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIqry-0000xi-9l; Thu, 17 Sep 2020 10:10:26 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIqq9-0008RM-Tj for linux-arm-kernel@lists.infradead.org; Thu, 17 Sep 2020 10:08:34 +0000 Received: by mail-wr1-x443.google.com with SMTP id o5so1383392wrn.13 for ; Thu, 17 Sep 2020 03:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TiJR36A6WzVMF6xqdDOcepS7F4dEZ9OVgowRWFZ1uks=; b=tQSs3303aEdukcfpHyNesIC7F63IBi+loPYOYanS55q/KqNEMlKQyZJOqWW+PDaIdy Hzl3dmK1CsDW3oNj4JMtelUVB2zs2H+s2LfZFYJ8a1BAp3lVK0SlCl3LKFcr1Rg7ectM QkdA535G27LaZOykS9/XPKmtEJkM52bEgyitkf8ubOYdWMAjTu9zqftA5WbZ4aXOaLj+ 2W2+r58U0BMhzBzrRCwwhxGQjSRFZx1MC83qMtwkOw2V46YrAzqqCFOLRCKzO4cEq/5g oI86hCCnPTqZtN82QvnmAt/wb3RBr/FbyVi464WaR/JxJy6q1nUfzm8TcdLHGQA9+B9+ ORFw== 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:mime-version:content-transfer-encoding; bh=TiJR36A6WzVMF6xqdDOcepS7F4dEZ9OVgowRWFZ1uks=; b=daijXJxy8wd5MBR+I7rlTkdnB/WyRCy+sA5iKOQ9FE8vRqkcKBbtr9gGJ7BfTGHGAG PjsQp+l8AR1Bc0FbTkE/akVoQzLwLm6+6Ck31rzM5XT5luhVqKwk1itWmAH6/sCpe2Wu Syw6gllTfa5A8P53hf9muHJkeeaNN2eU3BX1EIe5Qhex2zvz2XHH92oTehlEcF5Ud137 +zfr5pRhaEcAd/xKqbYtxCnTGziL+cPUXwzhcXp0g0kHW7owzWWkoJ9EPWt2dIfJk1vj TZr56WhjuXnbbOWpNS5KSePYCuabMCU6OBMkqfoJtkIrGBwp5ipV/39WKIvFGfMBcJEX QEJA== X-Gm-Message-State: AOAM530sQt2WfsJxXu9+TTvc6ngIhf1WP9PtDTenDZrysZvd7qmwRuuQ on0wNFWhlT0HnMOAQwt2BGo= X-Google-Smtp-Source: ABdhPJzKfbB/ieqKnYMMtGHW2A1dx/j0OzK0xW4LCwmh8FFA4m8tRA17CVIdhPuORy0L8AIxISw+kA== X-Received: by 2002:adf:9bcf:: with SMTP id e15mr26392211wrc.93.1600337312861; Thu, 17 Sep 2020 03:08:32 -0700 (PDT) Received: from localhost ([217.111.27.204]) by smtp.gmail.com with ESMTPSA id h76sm11507895wme.10.2020.09.17.03.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 03:08:31 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH v2 13/14] firmware: tegra: Enable BPMP support on Tegra234 Date: Thu, 17 Sep 2020 12:07:51 +0200 Message-Id: <20200917100752.3516153-14-thierry.reding@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200917100752.3516153-1-thierry.reding@gmail.com> References: <20200917100752.3516153-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_060834_007343_9A712D66 X-CRM114-Status: GOOD ( 17.87 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [thierry.reding[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jon Hunter Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Thierry Reding Enable support for the BPMP on Tegra234 to avoid relying on Tegra194 being enabled to pull in the needed OF device ID table entry. On simulation platforms the BPMP hasn't booted up yet by the time we probe the BPMP driver and the BPMP hasn't had a chance to mark the doorbell as ringable by the CCPLEX. This corresponding check in the BPMP driver will therefore fail. Work around this by disabling the check on simulation platforms. Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding --- drivers/firmware/tegra/bpmp.c | 3 ++- drivers/mailbox/tegra-hsp.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index 4d93d8925e14..0742a90cb844 100644 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@ -856,7 +856,8 @@ static const struct tegra_bpmp_soc tegra210_soc = { static const struct of_device_id tegra_bpmp_match[] = { #if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC) || \ - IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) + IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \ + IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) { .compatible = "nvidia,tegra186-bpmp", .data = &tegra186_soc }, #endif #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC) diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c index 834b35dc3b13..e07091d71986 100644 --- a/drivers/mailbox/tegra-hsp.c +++ b/drivers/mailbox/tegra-hsp.c @@ -13,6 +13,8 @@ #include #include +#include + #include #include "mailbox.h" @@ -322,7 +324,12 @@ static int tegra_hsp_doorbell_startup(struct mbox_chan *chan) if (!ccplex) return -ENODEV; - if (!tegra_hsp_doorbell_can_ring(db)) + /* + * On simulation platforms the BPMP hasn't had a chance yet to mark + * the doorbell as ringable by the CCPLEX, so we want to skip extra + * checks here. + */ + if (tegra_is_silicon() && !tegra_hsp_doorbell_can_ring(db)) return -ENODEV; spin_lock_irqsave(&hsp->lock, flags);