Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1339618pxj; Sat, 29 May 2021 10:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6VCbeVg+XvVaFVOTYBJ1PF044d9iLsettYp43ES2nH+NTNKM7MoYfgvT5QRorssi1MbnU X-Received: by 2002:a17:907:2d0d:: with SMTP id gs13mr14897772ejc.266.1622308406602; Sat, 29 May 2021 10:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622308406; cv=none; d=google.com; s=arc-20160816; b=RqzrO1TmgojP4VjHcmBIQLu9kZXtLyH+Umoy/Oq8MJRVu9CdmrGac7+Xg76cdNs9kc PKbubnv6n2gDym8EYM52dX1bfaCj+CSohkjBBUo8kXHgaf/ekC1gyX9YBBn8z3FJeuPf /jddHE41KQPawW8UJIWXXrqVTBIOTiS6WhFvGBVhVyBC8e7H+H1+BX/0udh+KKGeQnA4 fuzkOip1iPGVPQcZVjRC2Xm10Q7KOrJXAIFBHeZrW7/twMQMyBEuY8beGShy0O3Zm3xN PoNQMQaz6g4ZcD9jhHtzKcIKrMp3JUEjaGehkJEULLB35QQyF373PdfdSj0PWlsxLGpM RBJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7bkqiEyd8a086aPYUR6burYJWQhu6f4gu/LbVHZNwfc=; b=I+e/DFsZkHSXHg/zlDyCLF8u7s/eM6pNYr9mB73iAjPQQT9edgUN7BRFHSNuc3ZWcV 2Y0gAzWFLLE48JHZljolBLKpe0u84KtZukTrhtqofJy3A/gYZTYt6ZnKqm4rboXtFBiI hnONWZ8tPKqBMUqE5zMOYI1/Axq9DMoE4Omi8opag9FTR15FPprdBJ2Ar8Yadc0OvigM MUpiLOT3ntUnVJ1BTff6q+/3JwEsEZHM4RqTkFpJ72A3b3/efkFIXMdJw7ogsE6xar+W RlzJPXjtnfpgmXT1llJk0z6sjBwaPHNEr4zRv+86fELkYwXG++wdD+Ry5XlPwCu9g7Y3 Dtbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C9VvtCnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si8199946ejw.475.2021.05.29.10.13.04; Sat, 29 May 2021 10:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C9VvtCnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbhE2RLe (ORCPT + 99 others); Sat, 29 May 2021 13:11:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbhE2RLe (ORCPT ); Sat, 29 May 2021 13:11:34 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BDF1C061574 for ; Sat, 29 May 2021 10:09:57 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id n3-20020a9d74030000b029035e65d0a0b8so6648988otk.9 for ; Sat, 29 May 2021 10:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7bkqiEyd8a086aPYUR6burYJWQhu6f4gu/LbVHZNwfc=; b=C9VvtCnGiiOfz68z7IKruRS5sWRRuWsoEtCw0Lj/ixm059lRUVLiuKzLsSXzkAAMRe uJ4eaXZ5ZqCIUZMubTp1qf/rZb5tpIkjxmsnS7tLfO59Fn8o/94r1fyb0WJtEqQsjCxT 1x5mVlcx0c/wo4Er+O3GECknABerGiMOSPaC2Ss2cz6QWQsFW9ctGtN73p/7e7rW8CIM a6Wp7sbZvVM//6YYSZ2E27qGU/Sb6X4c6SdHLxk8OrzAmJ6/8C6PAaQv44KqEDwMuGCc 7waL7JHrqvRhB4EoVETXwMB52MOROf/ivAGpO1LZwgGGbTVsgmIhKrjzYueuwgTAh/6G kCPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7bkqiEyd8a086aPYUR6burYJWQhu6f4gu/LbVHZNwfc=; b=WCMCbF6SexutfjcWtDOhzEDoKZDICWa4lef+3CjndBNXgWdAs3IJjhfF0Oc6hNI+v9 eRHRE3JBtYUGyJjSb9raa3tXj3KPswN8CQ1gRRYogDTdkDoiX8fNOo8F6xISP69fLiRs hpUZCxfz8aJlwpApmN/Mo/80ebf0Cpdawd8ULe+uhFl7iiFZ2O/ydp250UHLzm0JX1MR oyjYIkpQVqx2ymrCgwSlswJ46/E6tpd2oE0lJ7mHBV+PtanVRVes617yvobAE/VQuBab FPOAgO6G5aPI+JnatKPpreeSDNC8gNQ9KAn2/zEKwOjphbcYQ5aPJjGwXiG80eU4w06y BLeA== X-Gm-Message-State: AOAM533qx3TrFXb/hbvC7IgE3XU13yAUgy3A1rEIJFD6RSmjHHp9izd3 HsQQA+azseSVbF3P6nDr4hvk+w== X-Received: by 2002:a9d:6645:: with SMTP id q5mr11181131otm.80.1622308196402; Sat, 29 May 2021 10:09:56 -0700 (PDT) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id d19sm1827454oop.26.2021.05.29.10.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 May 2021 10:09:55 -0700 (PDT) Date: Sat, 29 May 2021 12:09:53 -0500 From: Bjorn Andersson To: abhinavk@codeaurora.org Cc: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Stephen Boyd , sbillaka@codeaurora.org, Tanmay Shah , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Dmitry Baryshkov , freedreno@lists.freedesktop.org, Chandan Uddaraju Subject: Re: [Freedreno] [PATCH 4/4] drm/msm/dp: Add support for SC8180x eDP Message-ID: References: <20210511042043.592802-1-bjorn.andersson@linaro.org> <20210511042043.592802-5-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 28 May 18:40 CDT 2021, abhinavk@codeaurora.org wrote: > On 2021-05-10 21:20, Bjorn Andersson wrote: > > The eDP controller found in SC8180x is at large compatible with the > > current implementation, but has its register blocks at slightly > > different offsets. > > > > Add the compatible and the new register layout. > > > I am not able to completely recall the history of why in the DP bindings > we added DP register base as a big hunk and let catalog handle the submodule > offsets. > > I guess earlier that made sense because DP sub-block offsets were fixed. > But if we plan to re-use the DP driver for eDP as well like this series, > then maybe it might be > better if this comes from device tree like the earlier version was planning > to > > https://patchwork.kernel.org/project/dri-devel/patch/0101016ec6ddf446-e87ab1ce-5cbf-40a0-a0bb-cd0151cd577a-000000@us-west-2.amazonses.com/ > > > +- reg: Base address and length of DP hardware's memory > mapped regions. > +- cell-index: Specifies the controller instance. > +- reg-names: A list of strings that name the list of regs. > + "dp_ahb" - DP controller memory region. > + "dp_aux" - DP AUX memory region. > + "dp_link" - DP link layer memory region. > + "dp_p0" - DP pixel clock domain memory region. > + "dp_phy" - DP PHY memory region. > + "dp_ln_tx0" - USB3 DP PHY combo TX-0 lane memory region. > + "dp_ln_tx1" - USB3 DP PHY combo TX-1 lane memory region. > > Now there is more reason to separate the sub-module offsets like > ahb/aux/link/p0 I like it, will rewrite the patch accordingly. Regards, Bjorn > > Signed-off-by: Bjorn Andersson > > --- > > drivers/gpu/drm/msm/dp/dp_display.c | 1 + > > drivers/gpu/drm/msm/dp/dp_parser.c | 28 ++++++++++++++++++++-------- > > 2 files changed, 21 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c > > b/drivers/gpu/drm/msm/dp/dp_display.c > > index d1319b58e901..0be03bdc882c 100644 > > --- a/drivers/gpu/drm/msm/dp/dp_display.c > > +++ b/drivers/gpu/drm/msm/dp/dp_display.c > > @@ -121,6 +121,7 @@ struct dp_display_private { > > > > static const struct of_device_id dp_dt_match[] = { > > {.compatible = "qcom,sc7180-dp"}, > > + { .compatible = "qcom,sc8180x-edp" }, > > {} > > }; > > > > diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c > > b/drivers/gpu/drm/msm/dp/dp_parser.c > > index 51ec85b4803b..47cf18bba4b2 100644 > > --- a/drivers/gpu/drm/msm/dp/dp_parser.c > > +++ b/drivers/gpu/drm/msm/dp/dp_parser.c > > @@ -251,6 +251,7 @@ static int dp_parser_clock(struct dp_parser *parser) > > static int dp_parser_parse(struct dp_parser *parser) > > { > > struct dss_io_data *io = &parser->io.dp_controller; > > + struct device *dev = &parser->pdev->dev; > > int rc = 0; > > > > if (!parser) { > > @@ -276,14 +277,25 @@ static int dp_parser_parse(struct dp_parser > > *parser) > > */ > > parser->regulator_cfg = &sdm845_dp_reg_cfg; > > > > - io->ahb = io->base + 0x0; > > - io->ahb_len = 0x200; > > - io->aux = io->base + 0x200; > > - io->aux_len = 0x200; > > - io->link = io->base + 0x400; > > - io->link_len = 0x600; > > - io->p0 = io->base + 0x1000; > > - io->p0_len = 0x400; > > + if (of_device_is_compatible(dev->of_node, "qcom,sc8180x-edp")) { > > + io->ahb = io->base + 0x0; > > + io->ahb_len = 0x200; > > + io->aux = io->base + 0x200; > > + io->aux_len = 0x200; > > + io->link = io->base + 0x400; > > + io->link_len = 0x600; > > + io->p0 = io->base + 0xa00; > > + io->p0_len = 0x400; > > + } else { > > + io->ahb = io->base + 0x0; > > + io->ahb_len = 0x200; > > + io->aux = io->base + 0x200; > > + io->aux_len = 0x200; > > + io->link = io->base + 0x400; > > + io->link_len = 0x600; > > + io->p0 = io->base + 0x1000; > > + io->p0_len = 0x400; > > + } > > > > return 0; > > }