Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3042547pxp; Mon, 14 Mar 2022 09:39:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwZjWjSdTDGX0TZ/2PlOF5W2GJsqYQs6Ly8GvecmD0cK0nv3O32q6BI1fxJBYxMqa4FmvJ X-Received: by 2002:a17:902:82c1:b0:153:87f0:69ef with SMTP id u1-20020a17090282c100b0015387f069efmr2477943plz.75.1647275992050; Mon, 14 Mar 2022 09:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647275992; cv=none; d=google.com; s=arc-20160816; b=pXdIsHut+4iLU+JE6AEC7QhuAtivhA6djNqw969F9zLiP83geVxINVJ1t/hBjLq3Fw KmrMLLLeArngk+fzkBRZyw1ugYAPg4ScNABKRc+4EX/QuuREYbDO+LkHDpUVP3ydoh1J oTU4uCL0Ipm5Py8pNnxhsyEcBnVDI1gbxWlU4gMYV8OHNjAARW56W6ge7WDbtPubsSoF XiEgTMYuMbppHWh1GAPgf38vkM/pFcO1pCpUtiU8KXosJEgCmG47EOS+5Sg3cX+I9puV tirAbIuSnKW/PQNkhmzMUPYgKsLKOZMfM3EsDGKgGV1fr2xZ7MprC8wdJUFnhsexCexD q0Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=uAviE+ICta+te1V5taBxEX1+rY5ad3ad40dXTkQLikA=; b=nwAejEBJ3urRCFr80Q6nFIQ2WUg80Gxbv+OEWF7Dn1SEqj8Ps2SjkzUZ1K/ZITUpOM bQE1AM9aOac9WWpQed9OLjJykG3d6e/DTeJPSnf7s2Jt2C0DaY8Q5YLcqNNgE8CPIxrO XmG6iaAxZ3LSWGSEGYaKqvThlhjHr2+zJoZldD7vpC3Qw9yeQNAVBcUZt+dWFgYZtClB gJTuU2qoiGRp0ZspeCdlrWxh1JRZVi+yYtbu8fQS1gsb+Pt7Ohr4WTyDI1+lv+9PxeCf s6KEFh3Gbd4YSXLJoV7ALWmm6/r7nlAXJrBXKk1865/xJtm1OCgCBKsKcrLidrTNkqsf vRmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oxNqZQJr; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a17090311cc00b0015196106816si17461509plh.269.2022.03.14.09.39.39; Mon, 14 Mar 2022 09:39:52 -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=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oxNqZQJr; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239315AbiCNLkn (ORCPT + 99 others); Mon, 14 Mar 2022 07:40:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239261AbiCNLjy (ORCPT ); Mon, 14 Mar 2022 07:39:54 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AC2747AF6 for ; Mon, 14 Mar 2022 04:38:07 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 22EBbfEg003547; Mon, 14 Mar 2022 06:37:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1647257861; bh=uAviE+ICta+te1V5taBxEX1+rY5ad3ad40dXTkQLikA=; h=From:To:CC:Subject:Date; b=oxNqZQJreYWTK8hOZTnf15j+RElxwl1L4cU79BJcCcDPRIdAWkdErk6EJ2Z6YbD2S JcHN6rWxbYZW+WF73+OZ1pD7zn/s5ph6WtuJPrIMepRmE6q2mbfVHnNEhcHHTr57uk LwVemee5OSDEex1b+J+z6ZncSKSGNWYz3xvwFFFU= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 22EBbfAS084991 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 14 Mar 2022 06:37:41 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 14 Mar 2022 06:37:41 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Mon, 14 Mar 2022 06:37:41 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 22EBbdZW020066; Mon, 14 Mar 2022 06:37:40 -0500 From: Devarsh Thakkar To: , , , , , CC: , , , , , , , , Subject: [PATCH] drm/tidss: Soft Reset DISPC on startup Date: Mon, 14 Mar 2022 17:07:39 +0530 Message-ID: <20220314113739.18000-1-devarsht@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 Soft reset the display subsystem controller on startup and wait for the reset to complete. This helps the scenario where display was already in use by some other core before the linux was booted. Signed-off-by: Devarsh Thakkar --- drivers/gpu/drm/tidss/tidss_dispc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index 60b92df615aa..dae47853b728 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2650,6 +2650,20 @@ static void dispc_init_errata(struct dispc_device *dispc) } } +static void dispc_softreset(struct dispc_device *dispc) +{ + u32 val; + int ret = 0; + + /* Soft reset */ + REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1); + /* Wait for reset to complete */ + ret = readl_poll_timeout(dispc->base_common + DSS_SYSSTATUS, + val, val & 1, 100, 5000); + if (ret) + dev_warn(dispc->dev, "failed to reset dispc\n"); +} + int dispc_init(struct tidss_device *tidss) { struct device *dev = tidss->dev; @@ -2709,6 +2723,10 @@ int dispc_init(struct tidss_device *tidss) return r; } + /* K2G display controller does not support soft reset */ + if (feat->subrev != DISPC_K2G) + dispc_softreset(dispc); + for (i = 0; i < dispc->feat->num_vps; i++) { u32 gamma_size = dispc->feat->vp_feat.color.gamma_size; u32 *gamma_table; -- 2.17.1