From patchwork Fri Nov 23 12:06:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10695713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2561A15A7 for ; Fri, 23 Nov 2018 12:06:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1484B2AEF7 for ; Fri, 23 Nov 2018 12:06:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0887B2B9C8; Fri, 23 Nov 2018 12:06:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C33A32AEF7 for ; Fri, 23 Nov 2018 12:06:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3515E6E0A1; Fri, 23 Nov 2018 12:06:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id A91B16E08E for ; Fri, 23 Nov 2018 12:06:45 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id d39so10043996edb.12 for ; Fri, 23 Nov 2018 04:06:45 -0800 (PST) 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=LmSfTSYiNHwRh/ulZS6uMw1khgT7uazWkLgcZFIFVFg=; b=lbFyp84hUlfSeUEXKs6dWs9J8azgmVZApfUbawUof2l7idV0EtV7AgeUUYtGNyKNUp TXMnEQ8wTcd4sk/bP2LwXPdJ7ZAHDKv1lQGU2WxTNUiL0rW+f3o+8PxIs2KO+DgkZKcO qsDB4KTQOyS7K3EM9YR3KAVCXr7qwhpRKO75iW1hs7PzpFHligfZN2VDvKWuvk5YoLPD izQDbiEoZrvWNImwJF4+K+ic5DcPerSY/M0Da1Ux93RYoZAzAgHh/nKmPoS8CSMgt1Dq J7393iaU0AnkOJX7GX01y3xGsGm+bBzhwEjSa+V0bp46eH4LHiqNIBnKxKv11jdwznjZ nY2Q== X-Gm-Message-State: AGRZ1gKoYRQ70hmAqDtwSKXUxZ1DvaKy0UbnyzHgKXxsXyLR9fJESbJA MaUhdhPOSBO3eUtKON55Amg= X-Google-Smtp-Source: AJdET5eaibA8wjMW2UgjSUmTwSJaEogOoFfHml1SxwkGmvjrXTiRhSRlTCpXfn1o1cgCZumZNrv9sQ== X-Received: by 2002:a17:906:4a4b:: with SMTP id a11-v6mr11341294ejv.68.1542974804266; Fri, 23 Nov 2018 04:06:44 -0800 (PST) Received: from localhost (pD9E51040.dip0.t-ipconnect.de. [217.229.16.64]) by smtp.gmail.com with ESMTPSA id w10sm11000141eda.77.2018.11.23.04.06.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Nov 2018 04:06:43 -0800 (PST) From: Thierry Reding To: Thierry Reding Subject: [PATCH 3/3] drm/tegra: falcon: Wait for memory scrubbing to complete Date: Fri, 23 Nov 2018 13:06:39 +0100 Message-Id: <20181123120639.16706-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123120639.16706-1-thierry.reding@gmail.com> References: <20181123120639.16706-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, Mikko Perttunen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Before booting the Falcon processor, make sure to wait for memory scrubbing to complete. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/falcon.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/tegra/falcon.c b/drivers/gpu/drm/tegra/falcon.c index 78c7a0156601..352d05feabb0 100644 --- a/drivers/gpu/drm/tegra/falcon.c +++ b/drivers/gpu/drm/tegra/falcon.c @@ -197,11 +197,19 @@ void falcon_exit(struct falcon *falcon) int falcon_boot(struct falcon *falcon) { unsigned long offset; + u32 value; int err; if (!falcon->firmware.vaddr) return -EINVAL; + err = readl_poll_timeout(falcon->regs + FALCON_DMACTL, value, + (value & (FALCON_DMACTL_IMEM_SCRUBBING | + FALCON_DMACTL_DMEM_SCRUBBING)) == 0, + 10, 10000); + if (err < 0) + return err; + falcon_writel(falcon, 0, FALCON_DMACTL); /* setup the address of the binary data so Falcon can access it later */