From patchwork Thu Oct 31 10:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11220887 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E10E1668 for ; Thu, 31 Oct 2019 10:44:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D45D2173E for ; Thu, 31 Oct 2019 10:44:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Vjx22jOA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbfJaKoM (ORCPT ); Thu, 31 Oct 2019 06:44:12 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42862 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbfJaKoL (ORCPT ); Thu, 31 Oct 2019 06:44:11 -0400 Received: by mail-wr1-f68.google.com with SMTP id a15so5654747wrf.9 for ; Thu, 31 Oct 2019 03:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WvSHBpX9lS7H/7h03OBUZGWizg4wyuzQ6h+W62egxjQ=; b=Vjx22jOAuDKUp3zgblNS0LdjjxujAQl2/ARRTmo3LQXhidPT+z4nMCPRKb9iB5OIy9 /J06LIS3zoauIwJFHBCbiMZTTZf7acrneJGWnbQdYW+9aUeQn1WuF1wEWLc4UZ5i4iL6 Q0zNMmKLsRf8jiYBEuvTreX5bvOkET1U4wNrRnaQwdAytLNO3tqU2dlu5YxNWB+q5u7U ZAIe8m7ZiurX0sRNlIlytDWwCX16dKjHfAiKw0ERAvEzp/bnAk7h5mIl0KnLJHaapeKJ YrXJwQsCeHVMTkb3YGb2xMAgCKrdQKP/WvqKkwfbTHjdZdeURR+oTeliwuCaIiKv2yYV jFwg== 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=WvSHBpX9lS7H/7h03OBUZGWizg4wyuzQ6h+W62egxjQ=; b=F0knklzkLQtOCnASrGbI5QcLCB8Nflrm1/GCXDM91OMHp1oFWk3GM2WUXgwNWqr3vQ 0Z5AQl6qim8Xe/ptdOTIGfz/V8GYs4aC4lqafW2N4Gm+2Uk4idw2mjcc333UE00othCj efBJ6hTQ0kk4jFEgc60vTcILbZcFt/PzSuOLMKUyNYFZ6OBIKotuAfwySe4J8IjU/StU d+geTebEFpIR+jkhdD7LmOlAIJMLksk7h3N8o6nLjlNeyquAvG7OBvGu4ANerpDykdu7 Ft6IKdLQs0AeqGaxGeGAXZmmXSUfuTqh3esCYd+VnyZ/smxzMTPEjic8T1pKXWnPpIaL 3++A== X-Gm-Message-State: APjAAAWwiL6He6RQkht2BSHlsl55UneY16yHgFzLOxVmSA+MWyBcF9QV 1HoX0Ielh1U9L13ik/j0FCA/nD/uwTY= X-Google-Smtp-Source: APXvYqxH8oTHqLA63a1Uj/b4VAZDUACC4QbsyC80mYG0ahfDrOcSQv4/iYny9FdB+G3gt3lS0nfK0Q== X-Received: by 2002:adf:d850:: with SMTP id k16mr5042506wrl.204.1572518649714; Thu, 31 Oct 2019 03:44:09 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([93.51.16.173]) by smtp.gmail.com with ESMTPSA id q25sm4141389wra.3.2019.10.31.03.44.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 03:44:09 -0700 (PDT) From: kholk11@gmail.com To: linux-arm-msm@vger.kernel.org Cc: kholk11@gmail.com, marijns95@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, jonathan@marek.ca, bjorn.andersson@linaro.org, georgi.djakov@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 1/7] drm/msm/mdp5: Add optional TBU and TBU_RT clocks Date: Thu, 31 Oct 2019 11:43:56 +0100 Message-Id: <20191031104402.31813-2-kholk11@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191031104402.31813-1-kholk11@gmail.com> References: <20191031104402.31813-1-kholk11@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: AngeloGioacchino Del Regno Some SoCs, like MSM8956/8976 (and APQ variants), do feature these clocks and we need to enable them in order to get both of the hw (mdp5/rot) Translation Buffer Units (TBUs) to properly work. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 10 ++++++++++ drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 5476892a335f..e43ecd4be10a 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -309,6 +309,10 @@ int mdp5_disable(struct mdp5_kms *mdp5_kms) mdp5_kms->enable_count--; WARN_ON(mdp5_kms->enable_count < 0); + if (mdp5_kms->tbu_rt_clk) + clk_disable_unprepare(mdp5_kms->tbu_rt_clk); + if (mdp5_kms->tbu_clk) + clk_disable_unprepare(mdp5_kms->tbu_clk); clk_disable_unprepare(mdp5_kms->ahb_clk); clk_disable_unprepare(mdp5_kms->axi_clk); clk_disable_unprepare(mdp5_kms->core_clk); @@ -329,6 +333,10 @@ int mdp5_enable(struct mdp5_kms *mdp5_kms) clk_prepare_enable(mdp5_kms->core_clk); if (mdp5_kms->lut_clk) clk_prepare_enable(mdp5_kms->lut_clk); + if (mdp5_kms->tbu_clk) + clk_prepare_enable(mdp5_kms->tbu_clk); + if (mdp5_kms->tbu_rt_clk) + clk_prepare_enable(mdp5_kms->tbu_rt_clk); return 0; } @@ -965,6 +973,8 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev) /* optional clocks: */ get_clk(pdev, &mdp5_kms->lut_clk, "lut", false); + get_clk(pdev, &mdp5_kms->tbu_clk, "tbu", false); + get_clk(pdev, &mdp5_kms->tbu_rt_clk, "tbu_rt", false); /* we need to set a default rate before enabling. Set a safe * rate first, then figure out hw revision, and then set a diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index d1bf4fdfc815..128866742593 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -53,6 +53,8 @@ struct mdp5_kms { struct clk *ahb_clk; struct clk *core_clk; struct clk *lut_clk; + struct clk *tbu_clk; + struct clk *tbu_rt_clk; struct clk *vsync_clk; /* From patchwork Thu Oct 31 10:43:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11220889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D25C81668 for ; Thu, 31 Oct 2019 10:44:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0C35208E3 for ; Thu, 31 Oct 2019 10:44:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p0OVbe70" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727262AbfJaKoN (ORCPT ); Thu, 31 Oct 2019 06:44:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37023 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbfJaKoN (ORCPT ); Thu, 31 Oct 2019 06:44:13 -0400 Received: by mail-wr1-f67.google.com with SMTP id e11so5678659wrv.4 for ; Thu, 31 Oct 2019 03:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ekKfkWDCfgvdYFBqJ7b5n66skD2pbjEj/Fafy9wVYoE=; b=p0OVbe70YJ3RbJ4RWYVXcCAEw3/iNsvZ3oB49YKg88yOpRl/02se9mwZF0WkYijZeZ ImG8ouyKUEdhrL3zGAO3p547KVwY1NwUr0MwmDW4me3nkHz9c8TxZqO8p9C7wQ9O84ya Fi1Bat8I+S6ikAilP7xF8kRaCSXQsnSpoMf1tQoDbPochwjtjeITXUMgj+MOWwHifv0C P+m8gWBNc92UyF3M4g+DIkR/74N/O2NgaUEvMR54PMxMq61DgpgRTX75jvc2bsYqceJd UBejyM+RIpcf+pTcGMIy+Gcj/g/nAFO3AKFejlmdAucOxh5XpqDuzg43WTM0lsXfwQJq XLWg== 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=ekKfkWDCfgvdYFBqJ7b5n66skD2pbjEj/Fafy9wVYoE=; b=pa9Q4BsHMxK+IXNU2fXZvVpiJosVAeBJLmZEAX119Pnu2U/6SoCWB/YgLugl/DxQMn JoM+CNIQDMqP40KmfFrPHPXAsq66p50I0U0GbFO7nD69PhenIIB/y3Gxk8f4IhwIINbv TXIK0B3gEWJikFtc5VoIt5RiUkHdDz2DJDIaFqqnwhazXC8YJpo+vYf625XweBBbSjcU uaaHw8T9GHMzrkXdp+kL8Y7bHxrJzgnCiz/iFN1JPJhV3BC4boguanayuLiGXyByyu1Q qoZho3I1x2d2WL7fp6FQcAaEw9ZoDSs2OnighGbyOC4peQnoMyUdrr6FHuII+9KDtfYC JeEQ== X-Gm-Message-State: APjAAAWh12EMGByihv1t//NDZyLJW6bMcdLjxNu0s3IFieb8XwsgS6DR RQCALNLzgZenpDsGH3gCbi8VnThPt6I= X-Google-Smtp-Source: APXvYqwkj1tdfMd7sFp61o4YJ6Z6LJARFJVTUzZlGz//Zb+BVBYTcPJi9esZBNQ2DBME+krRoRPLXQ== X-Received: by 2002:adf:e50b:: with SMTP id j11mr5209626wrm.340.1572518650726; Thu, 31 Oct 2019 03:44:10 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([93.51.16.173]) by smtp.gmail.com with ESMTPSA id q25sm4141389wra.3.2019.10.31.03.44.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 03:44:10 -0700 (PDT) From: kholk11@gmail.com To: linux-arm-msm@vger.kernel.org Cc: kholk11@gmail.com, marijns95@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, jonathan@marek.ca, bjorn.andersson@linaro.org, georgi.djakov@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 2/7] dt-bindings: msm/mdp5: Document optional TBU and TBU_RT clocks Date: Thu, 31 Oct 2019 11:43:57 +0100 Message-Id: <20191031104402.31813-3-kholk11@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191031104402.31813-1-kholk11@gmail.com> References: <20191031104402.31813-1-kholk11@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: AngeloGioacchino Del Regno These two clocks aren't present in all versions of the MDP5 HW: where present, they are needed to enable the Translation Buffer Unit(s). Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring --- Documentation/devicetree/bindings/display/msm/mdp5.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/msm/mdp5.txt b/Documentation/devicetree/bindings/display/msm/mdp5.txt index 4e11338548aa..43d11279c925 100644 --- a/Documentation/devicetree/bindings/display/msm/mdp5.txt +++ b/Documentation/devicetree/bindings/display/msm/mdp5.txt @@ -76,6 +76,8 @@ Required properties: Optional properties: - clock-names: the following clocks are optional: * "lut" + * "tbu" + * "tbu_rt" Example: From patchwork Thu Oct 31 10:43:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11220891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B04815AB for ; Thu, 31 Oct 2019 10:44:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B802208E3 for ; Thu, 31 Oct 2019 10:44:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZjLZfc7n" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727207AbfJaKoP (ORCPT ); Thu, 31 Oct 2019 06:44:15 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43785 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbfJaKoO (ORCPT ); Thu, 31 Oct 2019 06:44:14 -0400 Received: by mail-wr1-f67.google.com with SMTP id n1so5658428wra.10 for ; Thu, 31 Oct 2019 03:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NM0ZQ0YqLj9AAkiTqqi3iRVNKR68xa3LpemkjK2oJlo=; b=ZjLZfc7nE+46nibZZiP0fBMLPB+5vGGJh5lEBWo3TmzmDxhvT3nO2okc+6tkBEW9Eg 1hi/aRP6qhzbjvIfWBVRz1IGfkKCjBpzkYCxceGXHHy6o4dys75BmrL4VvMDpUgsQ/58 vi2LZXBYHcFhliqVZEIFAnD8Xos/ujbRBqfKDyxaCGJbqiLK359pt5CZ+ozaeHpvcwZP eFXHEHX0Xl9p5ihQs9Sl7WTulNSTEMyORcZcPK2ljOy/9AYGX++X6i8SGL3yvuxlzGVw kL8KU5ZayxDME0bDDtf82yW3v6Cep7pQSyNGAwUPJxR4LI7p1L0SKyLDNcGb7fed7ed4 6ebw== 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=NM0ZQ0YqLj9AAkiTqqi3iRVNKR68xa3LpemkjK2oJlo=; b=mAuIZb1b2NCyZ7aPPFIcTzhxfKIbMIXmw4fTD7oMgz4Y7iRgtO4YJyL/1DtAMBUD5D SttQzIxML0QB+4feVQenuc1zNXFeAZq8Yu7KMGHpIVoa58VS+TTMteTSbphQlk5uSZCV LJwSlV6v605tEC9pRqy4CQyuflvg6EJyn6AQJD6FNw17mRALka461B2UOy+yz3pB8eVN 885epyYtnCMcdRHB41bkCFK/3PEIAO1cYPbW4f3juGHBLZVqOMN7YJHwu7D9gYE6cy8n QYBZU9YYV9P0xNCPndUoY7/2C6VTfANcTivsgJaWdF7W+LazY4J7Y3RWH2BojNN0vDi7 +hMw== X-Gm-Message-State: APjAAAX4vJv2uUwUekb1+pR1zI9Ra7r3jGSNedPI1bgOkiQBcHAJNNio rjxkA28fOGpNLb6gJLQsVgDCqobJbZg= X-Google-Smtp-Source: APXvYqwwV2FDAYew06BczHOcmRSBKQ86j1b6KPyVWTtXbhIIaRTinyvwMpz24ADKRLRF+C7LZg345w== X-Received: by 2002:adf:f685:: with SMTP id v5mr5092282wrp.246.1572518651782; Thu, 31 Oct 2019 03:44:11 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([93.51.16.173]) by smtp.gmail.com with ESMTPSA id q25sm4141389wra.3.2019.10.31.03.44.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 03:44:11 -0700 (PDT) From: kholk11@gmail.com To: linux-arm-msm@vger.kernel.org Cc: kholk11@gmail.com, marijns95@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, jonathan@marek.ca, bjorn.andersson@linaro.org, georgi.djakov@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 3/7] drm/msm/mdp5: Add configuration for msm8x76 Date: Thu, 31 Oct 2019 11:43:58 +0100 Message-Id: <20191031104402.31813-4-kholk11@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191031104402.31813-1-kholk11@gmail.com> References: <20191031104402.31813-1-kholk11@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: AngeloGioacchino Del Regno Add the configuration entries for the MDP5 v1.11, found on MSM8956, MSM8976 and APQ variants. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 98 ++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c index 7c9c1ddae821..1f48f64539a2 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c @@ -545,6 +545,103 @@ static const struct mdp5_cfg_hw msm8x96_config = { .max_clk = 412500000, }; +const struct mdp5_cfg_hw msm8x76_config = { + .name = "msm8x76", + .mdp = { + .count = 1, + .caps = MDP_CAP_SMP | + MDP_CAP_DSC | + MDP_CAP_SRC_SPLIT | + 0, + }, + .ctl = { + .count = 3, + .base = { 0x01000, 0x01200, 0x01400 }, + .flush_hw_mask = 0xffffffff, + }, + .smp = { + .mmb_count = 10, + .mmb_size = 10240, + .clients = { + [SSPP_VIG0] = 1, [SSPP_VIG1] = 9, + [SSPP_DMA0] = 4, + [SSPP_RGB0] = 7, [SSPP_RGB1] = 8, + }, + }, + .pipe_vig = { + .count = 2, + .base = { 0x04000, 0x06000 }, + .caps = MDP_PIPE_CAP_HFLIP | + MDP_PIPE_CAP_VFLIP | + MDP_PIPE_CAP_SCALE | + MDP_PIPE_CAP_CSC | + MDP_PIPE_CAP_DECIMATION | + MDP_PIPE_CAP_SW_PIX_EXT | + 0, + }, + .pipe_rgb = { + .count = 2, + .base = { 0x14000, 0x16000 }, + .caps = MDP_PIPE_CAP_HFLIP | + MDP_PIPE_CAP_VFLIP | + MDP_PIPE_CAP_DECIMATION | + MDP_PIPE_CAP_SW_PIX_EXT | + 0, + }, + .pipe_dma = { + .count = 1, + .base = { 0x24000 }, + .caps = MDP_PIPE_CAP_HFLIP | + MDP_PIPE_CAP_VFLIP | + MDP_PIPE_CAP_SW_PIX_EXT | + 0, + }, + .pipe_cursor = { + .count = 1, + .base = { 0x440DC }, + .caps = MDP_PIPE_CAP_HFLIP | + MDP_PIPE_CAP_VFLIP | + MDP_PIPE_CAP_SW_PIX_EXT | + MDP_PIPE_CAP_CURSOR | + 0, + }, + .lm = { + .count = 2, + .base = { 0x44000, 0x45000 }, + .instances = { + { .id = 0, .pp = 0, .dspp = 0, + .caps = MDP_LM_CAP_DISPLAY, }, + { .id = 1, .pp = -1, .dspp = -1, + .caps = MDP_LM_CAP_WB }, + }, + .nb_stages = 8, + .max_width = 2560, + .max_height = 0xFFFF, + }, + .dspp = { + .count = 1, + .base = { 0x54000 }, + + }, + .pp = { + .count = 3, + .base = { 0x70000, 0x70800, 0x72000 }, + }, + .dsc = { + .count = 2, + .base = { 0x80000, 0x80400 }, + }, + .intf = { + .base = { 0x6a000, 0x6a800, 0x6b000 }, + .connect = { + [0] = INTF_DISABLED, + [1] = INTF_DSI, + [2] = INTF_DSI, + }, + }, + .max_clk = 360000000, +}; + static const struct mdp5_cfg_hw msm8917_config = { .name = "msm8917", .mdp = { @@ -745,6 +842,7 @@ static const struct mdp5_cfg_handler cfg_handlers_v1[] = { { .revision = 6, .config = { .hw = &msm8x16_config } }, { .revision = 9, .config = { .hw = &msm8x94_config } }, { .revision = 7, .config = { .hw = &msm8x96_config } }, + { .revision = 11, .config = { .hw = &msm8x76_config } }, { .revision = 15, .config = { .hw = &msm8917_config } }, }; From patchwork Thu Oct 31 10:43:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11220893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62B9615AB for ; Thu, 31 Oct 2019 10:44:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 419F02173E for ; Thu, 31 Oct 2019 10:44:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cQBA1tLQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbfJaKoP (ORCPT ); Thu, 31 Oct 2019 06:44:15 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39367 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbfJaKoP (ORCPT ); Thu, 31 Oct 2019 06:44:15 -0400 Received: by mail-wr1-f66.google.com with SMTP id a11so5662250wra.6 for ; Thu, 31 Oct 2019 03:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2V3G3eqO0b2zEeTGJ2/qICJ5g4Ftbp7opa3Bf/EES5w=; b=cQBA1tLQt7c0V6n710Dum1PpYILvFekB8wiJGk2TTMzOLwrFR/i1T/WhlO6OB0Xh1W vXxA9iHIvpU2BPMAsmc45ecurrtOB2Mey6rlgs9Q39myDqntyist+AG0g/8UkRoKYZ/7 s21oJJcF/xbtdYyFeWYU7DAn6mtiLffG+V5bG7Yt3J9TrZdOBEAWEgYTstC0XrMYARUd VgXxmxH6GKbDLP48TFm0Uv8meCqWbnO4vBjOwhuJLYRpW624YC5a/4AxrkUYKq9Iu0XR Db5ibgagVOLskTsgtKgtZH1H2i894D6BXpObadIaVzZpbrecz7D0Zt0tTsyPC9HrmyzN B2Cg== 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=2V3G3eqO0b2zEeTGJ2/qICJ5g4Ftbp7opa3Bf/EES5w=; b=e7PO9Go/+GZYog3WqyeJzFlX7HU33nv3CMaSnJJM/M/t/dYUzFYJo96dHzusvG3sjm rUBC2JvhvRBYk3HF2/CdgHAirnHWM5HlAjri8VTEazzZRflvNzgIIDFjE9+8dRsfKCHe t1+x/3Rrs2Je2MC6/MGfgkdZ0AnyAS1dy7svq0VsSG6eiHFgu+yX5f0ez2QwR/5ieO5Q IrZnY9aU/c+h82I9cPewVz3W72VY/qRA/jQKgvZ7lsD7pqzO/BzdeP6jTguRpX30955S hOn9JaYG0b72h+nYHlmvYoR4+GFHiPpoQ20+Agl05LxVUUFvdfVhefkZtVuVd/Jsp63a Dw9w== X-Gm-Message-State: APjAAAU41xrKvwfvKxq9AW8nrmNoIdcfIm8GXSukEw5i7t0xms4ffSQe 4kQHxp56daXON6TlDETsnG7uOW/LOLM= X-Google-Smtp-Source: APXvYqwRHYSziJoiQR+nup4mTG0Zlw2/c3rwnMJrjI4CVn73leuABFCBOWBC85SvizBg56y8Gzeh/A== X-Received: by 2002:a5d:6947:: with SMTP id r7mr4132519wrw.129.1572518652788; Thu, 31 Oct 2019 03:44:12 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([93.51.16.173]) by smtp.gmail.com with ESMTPSA id q25sm4141389wra.3.2019.10.31.03.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 03:44:12 -0700 (PDT) From: kholk11@gmail.com To: linux-arm-msm@vger.kernel.org Cc: kholk11@gmail.com, marijns95@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, jonathan@marek.ca, bjorn.andersson@linaro.org, georgi.djakov@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 4/7] drm/msm/dsi: Add configuration for 28nm PLL on family B Date: Thu, 31 Oct 2019 11:43:59 +0100 Message-Id: <20191031104402.31813-5-kholk11@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191031104402.31813-1-kholk11@gmail.com> References: <20191031104402.31813-1-kholk11@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: AngeloGioacchino Del Regno The 28nm PLL has a different iospace on MSM/APQ family B SoCs: add a new configuration and use it when the DT reports the "qcom,dsi-phy-28nm-hpm-fam-b" compatible. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 2 ++ drivers/gpu/drm/msm/dsi/phy/dsi_phy.h | 1 + drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c index aa22c3ae5230..b0cfa67d2a57 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c @@ -483,6 +483,8 @@ static const struct of_device_id dsi_phy_dt_match[] = { #ifdef CONFIG_DRM_MSM_DSI_28NM_PHY { .compatible = "qcom,dsi-phy-28nm-hpm", .data = &dsi_phy_28nm_hpm_cfgs }, + { .compatible = "qcom,dsi-phy-28nm-hpm-fam-b", + .data = &dsi_phy_28nm_hpm_famb_cfgs }, { .compatible = "qcom,dsi-phy-28nm-lp", .data = &dsi_phy_28nm_lp_cfgs }, #endif diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h index c4069ce6afe6..24b294ed3059 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h @@ -40,6 +40,7 @@ struct msm_dsi_phy_cfg { }; extern const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_cfgs; +extern const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_famb_cfgs; extern const struct msm_dsi_phy_cfg dsi_phy_28nm_lp_cfgs; extern const struct msm_dsi_phy_cfg dsi_phy_20nm_cfgs; extern const struct msm_dsi_phy_cfg dsi_phy_28nm_8960_cfgs; diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c index b3f678f6c2aa..66506ea86dd6 100644 --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy_28nm.c @@ -142,6 +142,24 @@ const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_cfgs = { .num_dsi_phy = 2, }; +const struct msm_dsi_phy_cfg dsi_phy_28nm_hpm_famb_cfgs = { + .type = MSM_DSI_PHY_28NM_HPM, + .src_pll_truthtable = { {true, true}, {false, true} }, + .reg_cfg = { + .num = 1, + .regs = { + {"vddio", 100000, 100}, + }, + }, + .ops = { + .enable = dsi_28nm_phy_enable, + .disable = dsi_28nm_phy_disable, + .init = msm_dsi_phy_init_common, + }, + .io_start = { 0x1a94400, 0x1a96400 }, + .num_dsi_phy = 2, +}; + const struct msm_dsi_phy_cfg dsi_phy_28nm_lp_cfgs = { .type = MSM_DSI_PHY_28NM_LP, .src_pll_truthtable = { {true, true}, {true, true} }, From patchwork Thu Oct 31 10:44:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11220895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F0A5913 for ; Thu, 31 Oct 2019 10:44:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1D1A2173E for ; Thu, 31 Oct 2019 10:44:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CHPNCazf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbfJaKoQ (ORCPT ); Thu, 31 Oct 2019 06:44:16 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42878 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727074AbfJaKoQ (ORCPT ); Thu, 31 Oct 2019 06:44:16 -0400 Received: by mail-wr1-f65.google.com with SMTP id a15so5655045wrf.9 for ; Thu, 31 Oct 2019 03:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A61m3u12oKMYzHTcbcOV5T5oBURDYn0JpKjZ9AFEq8Q=; b=CHPNCazfEYq7wKypwLSmtIQYejllhGhcc5ukmAGRLvp8A3ZzB7tTN0FFVfuE/3IX9a woZM7nHqopnw0yQW34jMu0BrJ64+J7+ZOAZ76mcoKnJrHn25diQyx5uAVvgQO/fAx0rp O939uxFJcp6s4vQu3VgVKIWDjCYZUXYse9U2zZIzh8Ymel3IrRPLRv1uC32TmrTi4Y8p 9JJjrosUpXkHCRj6HV8odcf95sLdD5ShTHbDvclgyFnbBvNAbgzyKYDZoH2KS9GxczE6 IHqioUXyVxty4OYnbslEdt9/Pqe1Aots5k1u8Ca4IsDRdthHYpTj9m99fWXjPE3pzz2U An4Q== 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=A61m3u12oKMYzHTcbcOV5T5oBURDYn0JpKjZ9AFEq8Q=; b=uj0XBFoCEkbUpz2vQtX/Ge7PTKxURFPVgcOW83bCPXC+AfNeVJVomS+o6vHq1d2VN+ HnU5B5XW5VcGWmlftDJx8G6wvNCaEnYjmMkYLCsSfHr4Evw1dJoqhig5o6u7iCfS9+DQ ef0ptUUANpj4j3rrJFujSiomlZTHHS2dfi9SpcNikpfzsfB8b6ZnKSwlp3ZW1nUoE5nj EGKstBfdIWOFJ5tfcCa0h7oOcAmuzjDGjeHTt4s0C40ntE/vV7ejQr97dzJlH0mFlDHd uVtB5kcd3vYxsKU8d2GKPJtUAoxOi9cslcWhMqB9ZnIABZoAzukB2hktDzttVTmRrYpT jOPg== X-Gm-Message-State: APjAAAXFIhnE8D7ZCwdENEIpoTWzEekEv3BRZ4yFQY2qm20z7PL74qEa 4wDm7XqhDq5aksONSLN8qyhzpePUL0w= X-Google-Smtp-Source: APXvYqwgV7N/8acv9uSD5DCqYy73YyUOoG7pEZ5Ul7G02SbyDFbzKHeu0KIBlrX37UUT/5wybg70Sw== X-Received: by 2002:a5d:574d:: with SMTP id q13mr3663556wrw.263.1572518653849; Thu, 31 Oct 2019 03:44:13 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([93.51.16.173]) by smtp.gmail.com with ESMTPSA id q25sm4141389wra.3.2019.10.31.03.44.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 03:44:13 -0700 (PDT) From: kholk11@gmail.com To: linux-arm-msm@vger.kernel.org Cc: kholk11@gmail.com, marijns95@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, jonathan@marek.ca, bjorn.andersson@linaro.org, georgi.djakov@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 5/7] dt-bindings: msm/dsi: Add 28nm PLL for family B compatible Date: Thu, 31 Oct 2019 11:44:00 +0100 Message-Id: <20191031104402.31813-6-kholk11@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191031104402.31813-1-kholk11@gmail.com> References: <20191031104402.31813-1-kholk11@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: AngeloGioacchino Del Regno On family B SoCs, the 28nm PLL has a different iospace address and that required a new compatible in the driver. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring --- Documentation/devicetree/bindings/display/msm/dsi.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/msm/dsi.txt b/Documentation/devicetree/bindings/display/msm/dsi.txt index af95586c898f..d3ba9ee22f38 100644 --- a/Documentation/devicetree/bindings/display/msm/dsi.txt +++ b/Documentation/devicetree/bindings/display/msm/dsi.txt @@ -83,6 +83,7 @@ DSI PHY: Required properties: - compatible: Could be the following * "qcom,dsi-phy-28nm-hpm" + * "qcom,dsi-phy-28nm-hpm-fam-b" * "qcom,dsi-phy-28nm-lp" * "qcom,dsi-phy-20nm" * "qcom,dsi-phy-28nm-8960" From patchwork Thu Oct 31 10:44:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11220897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F39C1668 for ; Thu, 31 Oct 2019 10:44:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28FD521835 for ; Thu, 31 Oct 2019 10:44:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="niL3U2vK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbfJaKoQ (ORCPT ); Thu, 31 Oct 2019 06:44:16 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38077 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727265AbfJaKoQ (ORCPT ); Thu, 31 Oct 2019 06:44:16 -0400 Received: by mail-wr1-f68.google.com with SMTP id v9so5673742wrq.5 for ; Thu, 31 Oct 2019 03:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e5McPQ27o3b2k3AkmZCezEVbDePR7P5Jqw8CpztVvKw=; b=niL3U2vKEJO7RBQ+ImKWRyuR/qZTGddCZAOuKbd+7egeMdBsdMTBwuQlx7yyB9vdub zHP28MUtdZySPVBUMQlltnjMQIaIHfJg7kvSXSh/LEsaWfbtNZVI2PjepUT4rc3hlJgY NEYWjuxyhElnGrH4tvf7k9Db9AXf11PmBHswr6zHcpACLKg/z1rusGlUcoxHvySltgM0 kZDyq64WVEj9dHTt1qs07LKKlWP9rrtApchBjaOj+NefQBFoR1FcoV8lCcl/lCpv4/ER GpwwUkDlOMo2tiZpCOoiiCBCusb31YN9BHlYm5EGwIUO+PkftqlDbWIKzTQdGtr7RKLK tCJw== 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=e5McPQ27o3b2k3AkmZCezEVbDePR7P5Jqw8CpztVvKw=; b=lVQoeP+LzYIrzEoNXm7ZCxNMN/v9nvPddXVHOW2jgaP38qyPtT36Uh41gf9kK6GDJc 3Ru5BRD3mjFEe01pZzNjTilfwb5ZeC++Ab9xkimtesQYM24QbPjSAyild0NDmbme2tE4 DqcxI15ggoTHy/FcJIFRVUDdLSvE0e3B1lNp6Od2svSjrdHzvjyTfQmU1SZRw6EekCYb S57J+31bszcfqvwKs+krM/sgDlsbriyOrh460GEYNAQm/NXpx9dj+ufVr60pzEYOb3Dy xiETIXaaiZ1C7AjuljzZa8OkelWte/fJXKI6zPmzN6NI2kJvcNUItKBeb+NpFigRUDSW g8VA== X-Gm-Message-State: APjAAAWgKN6G0amtA3hooyImlf8yQfxKCZ5wD0SUMX28gz2tQ4h9ka0X Kw+xw4rDg99SV//Qt8x2CbccmmWLxeI= X-Google-Smtp-Source: APXvYqzNAMGJgqUeP+OuGJei/BXUJvxFdtY3GYAf5ZvYMfZ2dVnow3NFPqGhq06eUZsP4LzuqAGayA== X-Received: by 2002:adf:fe12:: with SMTP id n18mr5127533wrr.114.1572518654866; Thu, 31 Oct 2019 03:44:14 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([93.51.16.173]) by smtp.gmail.com with ESMTPSA id q25sm4141389wra.3.2019.10.31.03.44.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 03:44:14 -0700 (PDT) From: kholk11@gmail.com To: linux-arm-msm@vger.kernel.org Cc: kholk11@gmail.com, marijns95@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, jonathan@marek.ca, bjorn.andersson@linaro.org, georgi.djakov@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 6/7] drm/msm/dsi: Add configuration for 8x76 Date: Thu, 31 Oct 2019 11:44:01 +0100 Message-Id: <20191031104402.31813-7-kholk11@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191031104402.31813-1-kholk11@gmail.com> References: <20191031104402.31813-1-kholk11@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: AngeloGioacchino Del Regno MSM8976, MSM8976 and APQ variants have DSI version 3:10040002 (DSI 6G V1.4.2), featuring two DSIs. They need three clocks (mdp_core, iface, bus), one GDSC and two vregs, VDDA at 1.2V and VDDIO at 1.8V. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 22 ++++++++++++++++++++++ drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 + 2 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index e74dc8cc904b..86ad3fdf207d 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -66,6 +66,26 @@ static const struct msm_dsi_config msm8916_dsi_cfg = { .num_dsi = 1, }; +static const char * const dsi_8976_bus_clk_names[] = { + "mdp_core", "iface", "bus", +}; + +static const struct msm_dsi_config msm8976_dsi_cfg = { + .io_offset = DSI_6G_REG_SHIFT, + .reg_cfg = { + .num = 3, + .regs = { + {"gdsc", -1, -1}, + {"vdda", 100000, 100}, /* 1.2 V */ + {"vddio", 100000, 100}, /* 1.8 V */ + }, + }, + .bus_clk_names = dsi_8976_bus_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), + .io_start = { 0x1a94000, 0x1a96000 }, + .num_dsi = 2, +}; + static const struct msm_dsi_config msm8994_dsi_cfg = { .io_offset = DSI_6G_REG_SHIFT, .reg_cfg = { @@ -197,6 +217,8 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = { &msm8916_dsi_cfg, &msm_dsi_6g_host_ops}, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_4_1, &msm8996_dsi_cfg, &msm_dsi_6g_host_ops}, + {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V1_4_2, + &msm8976_dsi_cfg, &msm_dsi_6g_host_ops}, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_2_0, &msm8998_dsi_cfg, &msm_dsi_6g_v2_host_ops}, {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_2_1, diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index e2b7a7dfbe49..50a37ceb6a25 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -17,6 +17,7 @@ #define MSM_DSI_6G_VER_MINOR_V1_3 0x10030000 #define MSM_DSI_6G_VER_MINOR_V1_3_1 0x10030001 #define MSM_DSI_6G_VER_MINOR_V1_4_1 0x10040001 +#define MSM_DSI_6G_VER_MINOR_V1_4_2 0x10040002 #define MSM_DSI_6G_VER_MINOR_V2_2_0 0x20000000 #define MSM_DSI_6G_VER_MINOR_V2_2_1 0x20020001 From patchwork Thu Oct 31 10:44:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 11220899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8917515AB for ; Thu, 31 Oct 2019 10:44:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54560208C0 for ; Thu, 31 Oct 2019 10:44:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JwSm0nQY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726864AbfJaKoU (ORCPT ); Thu, 31 Oct 2019 06:44:20 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46249 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727265AbfJaKoT (ORCPT ); Thu, 31 Oct 2019 06:44:19 -0400 Received: by mail-wr1-f67.google.com with SMTP id n15so5627908wrw.13 for ; Thu, 31 Oct 2019 03:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M60UiEhUmmNWU8RgBGE4zx++F2XO1/RbSWEAXRbbk3s=; b=JwSm0nQYOhWEqmv0HXC2IrlBHHkn9Cu6PpGseYmcyKW6gSi7AinI9Wgz02hxkSbx73 YVJD9yEH0f8/5WXMoUytmMA3CM2NKQkApbVCeW9b7ofsismcBzPZ17pG0+MB/4nSHtzy IJ+xFsZpABlj79nQCwRfWKIpZSvt1u7aRcrwBf3pEXb61ORL/sKkTJa8IatSiVY7JW7L +0cu2PCGC1IyNzOYnSxILsfGl26QK9sqlIHia8qAmG/6a+Ogxu33zaqsk4l3UAtH3LVN b8EHnjlqimMYxNoCQmlX2f8vOzqslJJQsNqhOGDionnMUvUeyoF09t6pyv9J6vqrZ00z t+Eg== 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=M60UiEhUmmNWU8RgBGE4zx++F2XO1/RbSWEAXRbbk3s=; b=IuCrBVzXdYwsK4v+OgLyCIniAEIcsppcGvNGHxi36JiAEFDz0cUEe4l8NRJckJonet AziwnBDR0VoKWrQ+K7HD4H7On/RRjXnqJeVuRwzg/Lx3d0n4IcOHbXJ4XeWMhTH6H7by JAbleHZMzf940ORErbduzVOkxPZ9FHO5dJEmmSdH7HyRNKZ3TwzwJmjLNKwcuFE3Zvii kIGvIaH/8xAnTB60dLESXG1cFlcbSc+xnh30vyJ7S5ASeeIwaemwfgbHUX1FC9hCv9G6 NBhMV36qBJVipG1jlunsEfVB239BoWGgPx/iWt5qPt954VxRDxqAeurwIjXqqMYBm6mT kTtw== X-Gm-Message-State: APjAAAUPnzW4bFvQut8zNncm8nXmGOEHX62vql9bayKIjL6QPrCxgPc1 GRj0+9U+KqIipAaZGG/L4GQTBx8R7ns= X-Google-Smtp-Source: APXvYqwDteIDzKxvuXwHeKYZ+t5RDvepRUcPppCo19Lxh5ISq8LLiUmTvMXp6JXaUJofjvqgCUKe/Q== X-Received: by 2002:adf:e903:: with SMTP id f3mr5124513wrm.121.1572518655958; Thu, 31 Oct 2019 03:44:15 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu ([93.51.16.173]) by smtp.gmail.com with ESMTPSA id q25sm4141389wra.3.2019.10.31.03.44.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 03:44:15 -0700 (PDT) From: kholk11@gmail.com To: linux-arm-msm@vger.kernel.org Cc: kholk11@gmail.com, marijns95@gmail.com, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, jonathan@marek.ca, bjorn.andersson@linaro.org, georgi.djakov@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 7/7] drm/msm/adreno: Add support for Adreno 510 GPU Date: Thu, 31 Oct 2019 11:44:02 +0100 Message-Id: <20191031104402.31813-8-kholk11@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191031104402.31813-1-kholk11@gmail.com> References: <20191031104402.31813-1-kholk11@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: AngeloGioacchino Del Regno The Adreno 510 GPU is a stripped version of the Adreno 5xx, found in low-end SoCs like 8x56 and 8x76, which has 256K of GMEM, with no GPMU nor ZAP. Also, since the Adreno 5xx part of this driver seems to be developed with high-end Adreno GPUs in mind, and since this is a lower end one, add a comment making clear which GPUs which support is not implemented yet is not using the GPMU related hw init code, so that future developers will not go crazy with that. By the way, the lower end Adreno GPUs with no GPMU are: A505/A506/A510 (usually no ZAP firmware) A508/A509/A512 (usually with ZAP firmware) Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 73 +++++++++++++++++----- drivers/gpu/drm/msm/adreno/a5xx_power.c | 7 +++ drivers/gpu/drm/msm/adreno/adreno_device.c | 15 +++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 5 ++ 4 files changed, 86 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 7fdc9e2bcaac..b02e2042547f 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -353,6 +353,9 @@ static int a5xx_me_init(struct msm_gpu *gpu) * 2D mode 3 draw */ OUT_RING(ring, 0x0000000B); + } else if (adreno_is_a510(adreno_gpu)) { + /* Workaround for token and syncs */ + OUT_RING(ring, 0x00000001); } else { /* No workarounds enabled */ OUT_RING(ring, 0x00000000); @@ -568,15 +571,24 @@ static int a5xx_hw_init(struct msm_gpu *gpu) 0x00100000 + adreno_gpu->gmem - 1); gpu_write(gpu, REG_A5XX_UCHE_GMEM_RANGE_MAX_HI, 0x00000000); - gpu_write(gpu, REG_A5XX_CP_MEQ_THRESHOLDS, 0x40); - if (adreno_is_a530(adreno_gpu)) - gpu_write(gpu, REG_A5XX_CP_MERCIU_SIZE, 0x40); - if (adreno_is_a540(adreno_gpu)) - gpu_write(gpu, REG_A5XX_CP_MERCIU_SIZE, 0x400); - gpu_write(gpu, REG_A5XX_CP_ROQ_THRESHOLDS_2, 0x80000060); - gpu_write(gpu, REG_A5XX_CP_ROQ_THRESHOLDS_1, 0x40201B16); - - gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL, (0x400 << 11 | 0x300 << 22)); + if (adreno_is_a510(adreno_gpu)) { + gpu_write(gpu, REG_A5XX_CP_MEQ_THRESHOLDS, 0x20); + gpu_write(gpu, REG_A5XX_CP_MERCIU_SIZE, 0x20); + gpu_write(gpu, REG_A5XX_CP_ROQ_THRESHOLDS_2, 0x40000030); + gpu_write(gpu, REG_A5XX_CP_ROQ_THRESHOLDS_1, 0x20100D0A); + gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL, + (0x200 << 11 | 0x200 << 22)); + } else { + gpu_write(gpu, REG_A5XX_CP_MEQ_THRESHOLDS, 0x40); + if (adreno_is_a530(adreno_gpu)) + gpu_write(gpu, REG_A5XX_CP_MERCIU_SIZE, 0x40); + if (adreno_is_a540(adreno_gpu)) + gpu_write(gpu, REG_A5XX_CP_MERCIU_SIZE, 0x400); + gpu_write(gpu, REG_A5XX_CP_ROQ_THRESHOLDS_2, 0x80000060); + gpu_write(gpu, REG_A5XX_CP_ROQ_THRESHOLDS_1, 0x40201B16); + gpu_write(gpu, REG_A5XX_PC_DBG_ECO_CNTL, + (0x400 << 11 | 0x300 << 22)); + } if (adreno_gpu->info->quirks & ADRENO_QUIRK_TWO_PASS_USE_WFI) gpu_rmw(gpu, REG_A5XX_PC_DBG_ECO_CNTL, 0, (1 << 8)); @@ -589,6 +601,19 @@ static int a5xx_hw_init(struct msm_gpu *gpu) /* Enable ME/PFP split notification */ gpu_write(gpu, REG_A5XX_RBBM_AHB_CNTL1, 0xA6FFFFFF); + /* + * In A5x, CCU can send context_done event of a particular context to + * UCHE which ultimately reaches CP even when there is valid + * transaction of that context inside CCU. This can let CP to program + * config registers, which will make the "valid transaction" inside + * CCU to be interpreted differently. This can cause gpu fault. This + * bug is fixed in latest A510 revision. To enable this bug fix - + * bit[11] of RB_DBG_ECO_CNTL need to be set to 0, default is 1 + * (disable). For older A510 version this bit is unused. + */ + if (adreno_is_a510(adreno_gpu)) + gpu_rmw(gpu, REG_A5XX_RB_DBG_ECO_CNTL, (1 << 11), 0); + /* Enable HWCG */ a5xx_set_hwcg(gpu, true); @@ -635,7 +660,7 @@ static int a5xx_hw_init(struct msm_gpu *gpu) /* UCHE */ gpu_write(gpu, REG_A5XX_CP_PROTECT(16), ADRENO_PROTECT_RW(0xE80, 16)); - if (adreno_is_a530(adreno_gpu)) + if (adreno_is_a530(adreno_gpu) || adreno_is_a510(adreno_gpu)) gpu_write(gpu, REG_A5XX_CP_PROTECT(17), ADRENO_PROTECT_RW(0x10000, 0x8000)); @@ -679,7 +704,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu) a5xx_preempt_hw_init(gpu); - a5xx_gpmu_ucode_init(gpu); + if (!adreno_is_a510(adreno_gpu)) + a5xx_gpmu_ucode_init(gpu); ret = a5xx_ucode_init(gpu); if (ret) @@ -712,7 +738,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu) } /* - * Try to load a zap shader into the secure world. If successful + * If the chip that we are using does support loading one, then + * try to load a zap shader into the secure world. If successful * we can use the CP to switch out of secure mode. If not then we * have no resource but to try to switch ourselves out manually. If we * guessed wrong then access to the RBBM_SECVID_TRUST_CNTL register will @@ -1066,6 +1093,7 @@ static void a5xx_dump(struct msm_gpu *gpu) static int a5xx_pm_resume(struct msm_gpu *gpu) { + struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); int ret; /* Turn on the core power */ @@ -1073,6 +1101,15 @@ static int a5xx_pm_resume(struct msm_gpu *gpu) if (ret) return ret; + if (adreno_is_a510(adreno_gpu)) { + /* Halt the sp_input_clk at HM level */ + gpu_write(gpu, REG_A5XX_RBBM_CLOCK_CNTL, 0x00000055); + a5xx_set_hwcg(gpu, true); + /* Turn on sp_input_clk at HM level */ + gpu_rmw(gpu, REG_A5XX_RBBM_CLOCK_CNTL, 0xff, 0); + return 0; + } + /* Turn the RBCCU domain first to limit the chances of voltage droop */ gpu_write(gpu, REG_A5XX_GPMU_RBCCU_POWER_CNTL, 0x778000); @@ -1101,9 +1138,17 @@ static int a5xx_pm_resume(struct msm_gpu *gpu) static int a5xx_pm_suspend(struct msm_gpu *gpu) { + struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); + u32 mask = 0xf; + + /* A510 has 3 XIN ports in VBIF */ + if (adreno_is_a510(adreno_gpu)) + mask = 0x7; + /* Clear the VBIF pipe before shutting down */ - gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, 0xF); - spin_until((gpu_read(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL1) & 0xF) == 0xF); + gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, mask); + spin_until((gpu_read(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL1) & + mask) == mask); gpu_write(gpu, REG_A5XX_VBIF_XIN_HALT_CTRL0, 0); diff --git a/drivers/gpu/drm/msm/adreno/a5xx_power.c b/drivers/gpu/drm/msm/adreno/a5xx_power.c index a3a06db675ba..321a8061fd32 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_power.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_power.c @@ -297,6 +297,10 @@ int a5xx_power_init(struct msm_gpu *gpu) struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); int ret; + /* Not all A5xx chips have a GPMU */ + if (adreno_is_a510(adreno_gpu)) + return 0; + /* Set up the limits management */ if (adreno_is_a530(adreno_gpu)) a530_lm_setup(gpu); @@ -326,6 +330,9 @@ void a5xx_gpmu_ucode_init(struct msm_gpu *gpu) unsigned int *data, *ptr, *cmds; unsigned int cmds_size; + if (adreno_is_a510(adreno_gpu)) + return; + if (a5xx_gpu->gpmu_bo) return; diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index 0888e0df660d..fbbdf86504f5 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -114,6 +114,21 @@ static const struct adreno_info gpulist[] = { .gmem = (SZ_1M + SZ_512K), .inactive_period = DRM_MSM_INACTIVE_PERIOD, .init = a4xx_gpu_init, + }, { + .rev = ADRENO_REV(5, 1, 0, ANY_ID), + .revn = 510, + .name = "A510", + .fw = { + [ADRENO_FW_PM4] = "a530_pm4.fw", + [ADRENO_FW_PFP] = "a530_pfp.fw", + }, + .gmem = SZ_256K, + /* + * Increase inactive period to 250 to avoid bouncing + * the GDSC which appears to make it grumpy + */ + .inactive_period = 250, + .init = a5xx_gpu_init, }, { .rev = ADRENO_REV(5, 3, 0, 2), .revn = 530, diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index d225a8a92e58..e71a7570ef72 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -212,6 +212,11 @@ static inline int adreno_is_a430(struct adreno_gpu *gpu) return gpu->revn == 430; } +static inline int adreno_is_a510(struct adreno_gpu *gpu) +{ + return gpu->revn == 510; +} + static inline int adreno_is_a530(struct adreno_gpu *gpu) { return gpu->revn == 530;