From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34FF2C433E7 for ; Sun, 18 Oct 2020 19:57:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F14C922267 for ; Sun, 18 Oct 2020 19:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603051049; bh=Fo0hmO1Sa6p8badjcsPN4o/MRceWT+SFDl+f6VPJMIo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=T3tOaZRT2B0B7znNY1p+2de2Pe5O9LYN6dqJJcmt0/+ztF1o2PGjk/AceuEjGMEEb 5K40Pe/GkMCIxP2wvNybUg0eqqXK6DPXgcYP1khetzJHBgJbA6bBunfJyjZGMr+WVP rqHFNtbM8O+Faw1VpCnU1FajDRWoN/wSsACM0fHg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388321AbgJRT51 (ORCPT ); Sun, 18 Oct 2020 15:57:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:58042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728216AbgJRTTY (ORCPT ); Sun, 18 Oct 2020 15:19:24 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD031222E7; Sun, 18 Oct 2020 19:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603048763; bh=Fo0hmO1Sa6p8badjcsPN4o/MRceWT+SFDl+f6VPJMIo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X/QYK23HujsK6rkcieXbMPzqvBDRXhwqHQZj0M0ZwlKFVmLpItM8U1of5OuCGm6e3 Oz04ATN3hZQYjB2M/z29guzjRGqs8VLp7yzjSKbXnoUniG9G43EAR6FSaK1A/Z123B sSOz2MN6SXbfOjB15xccjjKMyFWi79ho4tjkB2Po= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Neil Armstrong , Steven Price , Alyssa Rosenzweig , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.9 063/111] drm/panfrost: add support for vendor quirk Date: Sun, 18 Oct 2020 15:17:19 -0400 Message-Id: <20201018191807.4052726-63-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201018191807.4052726-1-sashal@kernel.org> References: <20201018191807.4052726-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Neil Armstrong [ Upstream commit 91e89097b86f566636ea5a7329c79d5521be46d2 ] The T820, G31 & G52 GPUs integrated by Amlogic in the respective GXM, G12A/SM1 & G12B SoCs needs a quirk in the PWR registers after each reset. This adds a callback in the device compatible struct of permit this. Signed-off-by: Neil Armstrong [Steven: Fix typo in commit log] Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20200916150147.25753-2-narmstrong@baylibre.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/panfrost/panfrost_device.h | 3 +++ drivers/gpu/drm/panfrost/panfrost_gpu.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index c30c719a80594..3c4a85213c15f 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -69,6 +69,9 @@ struct panfrost_compatible { int num_pm_domains; /* Only required if num_pm_domains > 1. */ const char * const *pm_domain_names; + + /* Vendor implementation quirks callback */ + void (*vendor_quirk)(struct panfrost_device *pfdev); }; struct panfrost_device { diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index 6606643850fc6..502b1f1f7b204 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -146,6 +146,10 @@ static void panfrost_gpu_init_quirks(struct panfrost_device *pfdev) if (quirks) gpu_write(pfdev, GPU_JM_CONFIG, quirks); + + /* Here goes platform specific quirks */ + if (pfdev->comp->vendor_quirk) + pfdev->comp->vendor_quirk(pfdev); } #define MAX_HW_REVS 6 -- 2.25.1