Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4726023imm; Fri, 18 May 2018 09:37:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrvebnYnVNuHTP2UimP6urRm/YdzPLocRTH6WtHQQ8w55UGcFdQ4s1coPGGDwp5cHkwnKnd X-Received: by 2002:a17:902:5481:: with SMTP id e1-v6mr10095057pli.137.1526661434127; Fri, 18 May 2018 09:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526661434; cv=none; d=google.com; s=arc-20160816; b=h8qg83P/NQ+NWsjmEAica7oiVOCzMIsTPbAccLLOB+bhpFz33mV8zmr2EDn/1dhzgs urohBbKJdAzK8h/dDQdy/bED1g0kf/ovyjp7LqwUYHmwgjkSD1xM3d3/cJeKVfoF8QtP pQjxWtHWea6ZFqbyGuKrgD7rmtxyMrnwqJLCpssNruD3HKjd75pt3d8aZJytLhTHs1g6 recveTDp1w5/hoeFR9z53kaYlRBtyl/tT/5V5l04OsVgAoCCi7z7zA6G8CKHeBjlkvkg 8FU+Y+h6ih87CIOpX/YlbGL+/NjTAZSfiH3tR8f/nJhEDtI2OahO+S7S53T56lFpl9bv xFHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1yRLsFzB4ladzTy3tLUtciOG+qiWHU4PUuoVzE/Oeok=; b=fZKe555WV0y2Fu1AxvJ5cgxd81kt1ULFzvQ0urH6Ao8uGZVHAeBw6PX4RAvFgGJWDm VnhTj8akOSGmCjwcfp+i9bgL74la03fY8Z2IUpdQhgm1PUoiGU7yCxLG5CVBb2ht83YM TP7KxbYCrUKkI51OskJ5NS5Drw48+d+Ya3Z1ZOnQC17Ovhi2pc+m9T51A7ilmHCu1t27 8knaxvKy/+QaonPdNj1HIZKbqGyjx2AZuU0O3VrbZ8lex5ceN0Mi40BLunIgt0SDtuIZ trGBNujdgDtiV2wLfgIywk1Y7fujajZ268Nvc2zZksXHShEsfs0GD8wGt3by13C3d2il /BpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3-v6si7533796pld.116.2018.05.18.09.36.59; Fri, 18 May 2018 09:37:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752291AbeERQgC (ORCPT + 99 others); Fri, 18 May 2018 12:36:02 -0400 Received: from gloria.sntech.de ([95.129.55.99]:40854 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271AbeERQf7 (ORCPT ); Fri, 18 May 2018 12:35:59 -0400 Received: from p5b127731.dip0.t-ipconnect.de ([91.18.119.49] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fJiMA-00056O-Cj; Fri, 18 May 2018 18:35:50 +0200 From: Heiko Stuebner To: Sean Paul Cc: Brian Norris , hl , devicetree@vger.kernel.org, David Airlie , Enric Balletbo Serra , Doug Anderson , Jani Nikula , Linux Kernel , "open list:ARM/Rockchip SoC..." , Rob Herring , dri-devel@lists.freedesktop.org, Chris Zhong , Daniel Vetter , linux-arm-kernel@lists.infradead.org, Kishon Vijay Abraham I Subject: Re: [PATCH v5 4/4] drm/rockchip: support dp training outside dp firmware Date: Fri, 18 May 2018 18:35:49 +0200 Message-ID: <5918781.MvJIhHKAbg@phil> In-Reply-To: <20180518153656.GK3373@art_vandelay> References: <1526548680-2552-1-git-send-email-hl@rock-chips.com> <11928313.3EhRqhFFHB@phil> <20180518153656.GK3373@art_vandelay> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Freitag, 18. Mai 2018, 17:36:56 CEST schrieb Sean Paul: > On Fri, May 18, 2018 at 10:52:17AM +0200, Heiko Stuebner wrote: > > Am Freitag, 18. Mai 2018, 03:45:46 CEST schrieb Brian Norris: > > > On Thu, May 17, 2018 at 6:41 PM, hl wrote: > > > > On Thursday, May 17, 2018 09:51 PM, Sean Paul wrote: > > > >> On Thu, May 17, 2018 at 05:18:00PM +0800, Lin Huang wrote: > > > >>> DP firmware uses fixed phy config values to do training, but some > > > >>> boards need to adjust these values to fit for their unique hardware > > > >>> design. So get phy config values from dts and use software link training > > > >>> instead of relying on firmware, if software training fail, keep firmware > > > >>> training as a fallback if sw training fails. > > > >>> > > > >>> Signed-off-by: Chris Zhong > > > >>> Signed-off-by: Lin Huang > > > >>> --- > > > >>> Changes in v2: > > > >>> - update patch following Enric suggest > > > >>> Changes in v3: > > > >>> - use variable fw_training instead sw_training_success > > > >>> - base on DP SPCE, if training fail use lower link rate to retry training > > > >>> Changes in v4: > > > >>> - improve cdn_dp_get_lower_link_rate() and cdn_dp_software_train_link() follow Sean suggest > > > >>> Changes in v5: > > > >>> - fix some whitespcae issue > > > >>> > > > >>> drivers/gpu/drm/rockchip/Makefile | 3 +- > > > >>> drivers/gpu/drm/rockchip/cdn-dp-core.c | 24 +- > > > >>> drivers/gpu/drm/rockchip/cdn-dp-core.h | 2 + > > > >>> drivers/gpu/drm/rockchip/cdn-dp-link-training.c | 420 ++++++++++++++++++++++++ > > > >>> drivers/gpu/drm/rockchip/cdn-dp-reg.c | 31 +- > > > >>> drivers/gpu/drm/rockchip/cdn-dp-reg.h | 38 ++- > > > >>> 6 files changed, 505 insertions(+), 13 deletions(-) > > > >>> create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-link-training.c > > > >>> > > > ... > > > >>> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-link-training.c b/drivers/gpu/drm/rockchip/cdn-dp-link-training.c > > > >>> new file mode 100644 > > > >>> index 0000000..73c3290 > > > >>> --- /dev/null > > > >>> +++ b/drivers/gpu/drm/rockchip/cdn-dp-link-training.c > > > >>> @@ -0,0 +1,420 @@ > > > >>> +// SPDX-License-Identifier: GPL-2.0 > > > >>> +/* > > > >>> + * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd > > > >>> + * Author: Chris Zhong > > > >>> + */ > > > >>> + > > > >>> +#include > > > >>> +#include > > > >>> +#include > > > >>> +#include > > > >>> + > > > >>> +#include "cdn-dp-core.h" > > > >>> +#include "cdn-dp-reg.h" > > > >>> + > > > >>> +static void cdn_dp_set_signal_levels(struct cdn_dp_device *dp) > > > >>> +{ > > > >>> + struct cdn_dp_port *port = dp->port[dp->active_port]; > > > >>> + struct rockchip_typec_phy *tcphy = phy_get_drvdata(port->phy); > > > >> > > > >> You ignored Brian's comment on the previous patch: > > > >> This is still antithetical to the PHY framework; you're assuming that > > > >> this is a particular type of PHY here. > > > >> > > > >> FWIW, the mediatek drm driver also assumes a certain PHY type. A quick grep of > > > >> drivers/ shows that the only other non-phy/ driver using this function > > > >> (pinctrl-tegra-xusb.c) also casts it. > > > >> > > > >> Sean > > > > > > > > Thanks Sean, except phy framework have new API to handle it, i have not > > > > idea how to do it in a better way. > > > > > > Well, if Mediatek can do it for their MIPI and HDMI, then maybe we just do it... > > > > I'd think so too. This is in Rockchip-specific code so it will always be > > possible to easily get the soc-type and thus phy-type, if that combination > > really changes down the road. > > > > So in the absence of a better solution, and with prior art, > > Reviewed-by: Sean Paul > > > We just need some eyes on the dt and phy changes in this set. Heiko, can you > help out with that? done, but both the binding + phy changes should also get Acks from Rob (dt) and Kishon (phy). Especially as the binding change is a bit more than a new simple property. Heiko