Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3199182iob; Mon, 16 May 2022 15:50:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXbCjZOy/Io4aa+8Jc+C8WDoABrrLulPnBH2829OtzrakirLf1oJQ54MGxUgA8MOGmNzxh X-Received: by 2002:a17:907:3da1:b0:6f4:2d69:75f6 with SMTP id he33-20020a1709073da100b006f42d6975f6mr17429525ejc.389.1652741405771; Mon, 16 May 2022 15:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652741405; cv=none; d=google.com; s=arc-20160816; b=Xh5WZYq09LQ5DFI0B88EHDl6iFxmD/Ba8xRW3EyXtUX8zq5jQrndQnqaQcp8P4lBHb K7WTvU14V0OrRG+k2VJxQvJG8F7dHijjMS+3JsY++xNG006LxaMoCKvaY4UXOOQOLdvJ t2YUCfdZjJ26IYI/a/KJOUkKzsPXF6sbUHHkKbrdgK3aJGafaUzMUm3feOD1jm9wXcSI itVHUU/yuc98n8s7wVQeVLeiG+Uc37eRw7xCjIoOMXUpqGa32ebG4rdxUyvyqanScfS8 DTW8te4zhPGL0cDOe+YfNYrEW8g97eaiyrP2fUtZw0mPV2Dx0QKA7VVyNJ2TVDDHKVa7 a0ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uAYlVlaSKiCol2osSU9jEMs5Zkro7eHEKz4SvQwuMgY=; b=ndVrq/qcJzSiBPW5ylzNVAAeeCBmLv5VsiZ3RNreL2AYws0gYb9r0Ez0KqC5ziDBX5 kZyEB/tbk/1FkB5ETmuaIrKyocIv+pM1BbH8zWgbkCaTJrNmpNuS7s+mPzfzy8owaqRy B4pIrYn/nptAnCLM3YuObYDGTz32XWUIk81XdFiZUZ9WRFKgKQMEOiXp9oGwTE6bxHJi y5hBwT4WLg0nGrvW30ePYqBeGOYLyEhNYd4n/4DxLYqx/9M8ipAPwmgKzGL6XImOgnC3 cDmPhcX4f8P3yMWOfQFgXDsHJ+9PiiqcWaKsoSrSRO5QQUVzs4cgabPpWRUbPjaAC7Ms 0olQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=cCYp7Uik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq9-20020a1709073f0900b006ec0aaff9cfsi682133ejc.932.2022.05.16.15.49.40; Mon, 16 May 2022 15:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=cCYp7Uik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242066AbiEPIxr (ORCPT + 99 others); Mon, 16 May 2022 04:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242045AbiEPIxk (ORCPT ); Mon, 16 May 2022 04:53:40 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83EAA13F5C; Mon, 16 May 2022 01:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=uAYlVlaSKiCol2osSU9jEMs5Zkro7eHEKz4SvQwuMgY=; b=cCYp7Uikdwy4YMIyYFg9ak33VM fqrRscO41wzaLajhphHvOMz0bgejJ1Q/EjsjYJXfo17Q9RgxkM+8p8N2BksmBKCZ6hfu4SuKDWeAH s+GCMR8khut5BBvOp86/atCC8yOk9RHCzaD2Y94b4B9ZOb0k5Caef8pY/FXDJvxLJBx+zjaoZUpgl b5b/3mZc9OytMUowQOt8HvTF6HA6hqKgRK3FxkV20wX5WxgfjOqaq9H70FR2C/w4aaSg2wQJ8wPan RR8O/XYPAqM2f7kVCKS5ykOom8V+vA2OIDAke3svSs6n0kyceqcI/RFY3FiSnDvZVeR2RxJXGVmkw vTEWB4SA==; Received: from 91-158-25-70.elisa-laajakaista.fi ([91.158.25.70] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqWTf-0005fd-2o; Mon, 16 May 2022 11:53:19 +0300 From: cyndis@kapsi.fi To: thierry.reding@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mikko Perttunen Subject: [PATCH v5 7/9] drm/tegra: falcon: Set DMACTX field on DMA transactions Date: Mon, 16 May 2022 11:52:56 +0300 Message-Id: <20220516085258.1227691-8-cyndis@kapsi.fi> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220516085258.1227691-1-cyndis@kapsi.fi> References: <20220516085258.1227691-1-cyndis@kapsi.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 91.158.25.70 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikko Perttunen The DMACTX field determines which context, as specified in the TRANSCFG register, is used. While during boot it doesn't matter which is used, later on it matters and this value is reused by the firmware. Signed-off-by: Mikko Perttunen --- drivers/gpu/drm/tegra/falcon.c | 8 ++++++++ drivers/gpu/drm/tegra/falcon.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/tegra/falcon.c b/drivers/gpu/drm/tegra/falcon.c index 3762d87759d9..c0d85463eb1a 100644 --- a/drivers/gpu/drm/tegra/falcon.c +++ b/drivers/gpu/drm/tegra/falcon.c @@ -48,6 +48,14 @@ static int falcon_copy_chunk(struct falcon *falcon, if (target == FALCON_MEMORY_IMEM) cmd |= FALCON_DMATRFCMD_IMEM; + /* + * Use second DMA context (i.e. the one for firmware). Strictly + * speaking, at this point both DMA contexts point to the firmware + * stream ID, but this register's value will be reused by the firmware + * for later DMA transactions, so we need to use the correct value. + */ + cmd |= FALCON_DMATRFCMD_DMACTX(1); + falcon_writel(falcon, offset, FALCON_DMATRFMOFFS); falcon_writel(falcon, base, FALCON_DMATRFFBOFFS); falcon_writel(falcon, cmd, FALCON_DMATRFCMD); diff --git a/drivers/gpu/drm/tegra/falcon.h b/drivers/gpu/drm/tegra/falcon.h index c56ee32d92ee..1955cf11a8a6 100644 --- a/drivers/gpu/drm/tegra/falcon.h +++ b/drivers/gpu/drm/tegra/falcon.h @@ -50,6 +50,7 @@ #define FALCON_DMATRFCMD_IDLE (1 << 1) #define FALCON_DMATRFCMD_IMEM (1 << 4) #define FALCON_DMATRFCMD_SIZE_256B (6 << 8) +#define FALCON_DMATRFCMD_DMACTX(v) (((v) & 0x7) << 12) #define FALCON_DMATRFFBOFFS 0x0000111c -- 2.36.1