From patchwork Fri Apr 19 19:46:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10909685 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 ADB6F13B5 for ; Fri, 19 Apr 2019 19:46:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FC0B28AF8 for ; Fri, 19 Apr 2019 19:46:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93C9128C46; Fri, 19 Apr 2019 19:46:28 +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,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 43DEB28AF8 for ; Fri, 19 Apr 2019 19:46:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30A648925D; Fri, 19 Apr 2019 19:46:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E472891FF; Fri, 19 Apr 2019 19:46:23 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3D3DC6155D; Fri, 19 Apr 2019 19:46:22 +0000 (UTC) Received: from jcrouse1-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7331560DA8; Fri, 19 Apr 2019 19:46:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7331560DA8 From: Jordan Crouse To: freedreno@lists.freedesktop.org Subject: [PATCH v2 0/3] drm/msm/a6xx: Add support for zap shader Date: Fri, 19 Apr 2019 13:46:13 -0600 Message-Id: <1555703176-5499-1-git-send-email-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1555703183; bh=efOXqiZEApACOspyq6NCpyux/k3Yp91jYp7zsyeW3Xg=; h=From:To:Cc:Subject:Date:From; b=WsDFoTDy4zGxQX3LMcfNVMb+qjS4ncTFeEI9ct7jP4tUmMXMkPmOGfr1oryaKY2E8 s+2Ksgk7lYaU3k0gxt4sPSUaSZJWyuayQtxn0ABCBjGj0ZxdBb0cRBvxxjNBK46MXE ls1jrM9U0q/mUPoQKXuLKo9d4w/5UujZBRGn8ksk= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1555703182; bh=efOXqiZEApACOspyq6NCpyux/k3Yp91jYp7zsyeW3Xg=; h=From:To:Cc:Subject:Date:From; b=PE6rftCe733wjfx3ygRqFxXIiWgkxllGHP5vr85f7cJ7fdCxif4MRaMxRzMkrEUFb RIQsDp/jNqZLdT/X9KpUcuybFscBR8o1t0WteQbbNNvQwZTtsqu2HtFFLWjy0ynu5U jgRI9Gs636oeX7M39ZvTGFJT16HoAVoI7Y7Mq098= X-Mailman-Original-Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org X-Mailman-Original-Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org 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: Mark Rutland , devicetree@vger.kernel.org, Douglas Anderson , Kees Cook , Jonathan Marek , David Airlie , linux-arm-msm@vger.kernel.org, Sharat Masetty , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Bjorn Andersson , Rob Herring , Mamta Shukla , Thomas Zimmermann , Sean Paul , Wen Yang , Daniel Mack MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch series adds support for loading the zap shader on a6xx and using it to get the GPU out of secure mode. The Adreno a5xx and a6xx GPUs boot in "secure" mode which restricts the memory the GPU is allowed to use. To get the GPU out of secure mode we need to write to a register. However some bootloaders block access to this register and require that the GPU instead perform a sequence to pull the GPU out of secure mode. This sequence requires a special "zap" shader that will execute in secure mode, clear out all the internal GPU settings and then transition to in-secure mode. This series adds support for loading and using the zap shader on a6xx assuming that the shader exists and that the bootloader supports the secure mode. If any part of the sequence fails then fall back to writing the register. If we get it wrong, then writing to the register will trigger a protection mode error and the system will go down. The actual zap shader works almost identically to the one on 5xx outside of a minor workaround for system resume. The first patch moves the a5xx specific support to the generic adreno driver. The second patch add support for the zap shader and the final two patches add the DT bindings and DT settings for setting up the reserved memory that the shader requires. v2: Reduced the redundant log messages for targets that don't need the zap shader Jordan Crouse (3): drm/msm/gpu: Move zap shader loading to adreno drm/msm/a6xx: Add zap shader load dt-bindings: drm/msm/gpu: Document a5xx / a6xx zap shader region .../devicetree/bindings/display/msm/gpu.txt | 7 ++ drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 111 +---------------- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 38 +++++- drivers/gpu/drm/msm/adreno/adreno_device.c | 1 + drivers/gpu/drm/msm/adreno/adreno_gpu.c | 135 +++++++++++++++++++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 6 + 6 files changed, 187 insertions(+), 111 deletions(-)