From patchwork Tue Mar 12 18:13:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10849767 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 7555C6C2 for ; Tue, 12 Mar 2019 18:14:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60BBA284C9 for ; Tue, 12 Mar 2019 18:14:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5158F2869A; Tue, 12 Mar 2019 18:14:15 +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 00E24284C9 for ; Tue, 12 Mar 2019 18:14:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63AD489C86; Tue, 12 Mar 2019 18:14:12 +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 0080689C86; Tue, 12 Mar 2019 18:14:10 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E6FE86141C; Tue, 12 Mar 2019 18:14:09 +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 80F6B619B1; Tue, 12 Mar 2019 18:14:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 80F6B619B1 From: Jordan Crouse To: freedreno@lists.freedesktop.org Subject: [PATCH v1 0/4] drm/msm/a6xx: Add support for zap shader Date: Tue, 12 Mar 2019 12:13:38 -0600 Message-Id: <1552414422-9568-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=1552414450; bh=VfoQ9P+nBV3qLb1P5GFp8/EbXMKBz+LBU60OvazZA68=; h=From:To:Cc:Subject:Date:From; b=XBz8tWaw8ZAv2yBWcgrkIoGhpYyN6lytj76doOhNnxoUIGPa+4TLuh53aTMGlU4/s 9dAh5h5KdkjrQmGD1BtUY7d3fj7TfpLzpz1pLWKMLQ7ET157N6lmagenjFrifkdUu7 vCbkjG1PE0YHJENYUXmx9+hmyYC87/KSukCtPCAE= X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552414447; bh=VfoQ9P+nBV3qLb1P5GFp8/EbXMKBz+LBU60OvazZA68=; h=From:To:Cc:Subject:Date:From; b=kasUnOmq7pYyOiMC/Jm9UKzf34zQZbFOFwKU5PzuHxCQUZAz2HoJI5Am9gXXfe3so h2KICw3FVFB+HpulmDBBtnuGuJ/pAntOOHR9s1iaunTxbfAe3zdhZBoKC99W4umcbl TmNPssS5xHQua16yrVOiLrmRP0XYeg3w1m3mgqf8= 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, linux-kernel@vger.kernel.org, Kees Cook , Arnd Bergmann , David Airlie , linux-arm-msm@vger.kernel.org, Sharat Masetty , Douglas Anderson , dri-devel@lists.freedesktop.org, Bjorn Andersson , David Brown , Rob Herring , Jonathan Marek , Thomas Zimmermann , Mamta Shukla , Andy Gross , Sean Paul , 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. Jordan Crouse (4): 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 arm64: dts: sdm845: Add zap shader region for GPU .../devicetree/bindings/display/msm/gpu.txt | 7 ++ arch/arm64/boot/dts/qcom/sdm845.dtsi | 11 ++ drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 109 +------------------- 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 | 113 +++++++++++++++++++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 6 ++ 7 files changed, 176 insertions(+), 109 deletions(-)