Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4659352imm; Fri, 18 May 2018 08:37:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoudlhY52nrWgPAUmJ21BxbUyj+Ck9v76VtWKIG79KEoXR3NYQZW/iR8YVw5JScrCmrQf4A X-Received: by 2002:a65:4306:: with SMTP id j6-v6mr7947582pgq.341.1526657860137; Fri, 18 May 2018 08:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526657860; cv=none; d=google.com; s=arc-20160816; b=u8CVAECSxcPwEzAE3fg5edUgWcNIlRYKQF063UQmUwvATfB+0+anxEEOGSNfwDAXTn xrqA7TC1HWLkh+ptGmaULq0T1WPjjmfgMMVv9F/koEhurKCckNcWkKNJv/htzvwoOAXS yW2SITMsyKdlWU9BCzs7fbAQnm/0a10vCHGktSqEvritcSAO+kLCz7WHqh7uYzZHJTAb eqdtIZq2+NvpUr1BEGlGzn2dd4Vc7DBzXnrVyL1QwQ7IT0++GSfZh/MY156cE4AkNyaH rgvxdI6Xqiwxb84Qe1D5KIyL5ok0MUer3db1w7ylX6C++w93b/KUPaMOBW4kXwWlLnfv 0pgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ChTq6w6rWT9tpC+jsHWH7vidM2J6ZWsei2luJFo+1k8=; b=AsZox0j/0ETdyljEcgbHy6TS2jtzxtFtQHbrEMTOZ8+/GHj+8puBHj+b2mCPtSAupx BOkJxWw9hLNfwo+UIE9SCMGH4jVBRkTup5vyrnjC/fPjkOLx8/xbhRjMfYm3S3OmSvda 4LjYNoTsUVAJ7hd29080OH0HhzJ9UaMYxiGWTxpXs+pzODNVgN2nEp+x8KSS9+AriTh7 MHo8JrHQwCOH6c+EJsFp7qegBSDWO4AyWUJD1hn22DHFfKQkWuB9vu1tynXByhuhK23q bytZaaak9f63AAegKNG4QFcnOJNhdPVji3IE2nc+ZcajpVgAklkpsKlBS6mO7zpNczsa ETZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CWEXVvec; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si7309016plk.112.2018.05.18.08.37.25; Fri, 18 May 2018 08:37:40 -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; dkim=pass header.i=@chromium.org header.s=google header.b=CWEXVvec; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752230AbeERPhA (ORCPT + 99 others); Fri, 18 May 2018 11:37:00 -0400 Received: from mail-yb0-f196.google.com ([209.85.213.196]:34549 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbeERPg6 (ORCPT ); Fri, 18 May 2018 11:36:58 -0400 Received: by mail-yb0-f196.google.com with SMTP id i1-v6so2835083ybe.1 for ; Fri, 18 May 2018 08:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ChTq6w6rWT9tpC+jsHWH7vidM2J6ZWsei2luJFo+1k8=; b=CWEXVvec4CCu0CAdSIlAF6gLzvstS8CutDARaNM9KLkVQ2whmfAstvu3n6f95Sbszd 5v+W+Kz5+FupDacq6thTnqQPsbJmP0okH3+QzggfTi+Vwks1gU9A7ZXrTeLK9x4FoufO ZfL0a58s54SKEzXoppSw9qUFP9u5zayAjQpWI= 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:user-agent; bh=ChTq6w6rWT9tpC+jsHWH7vidM2J6ZWsei2luJFo+1k8=; b=TjpphiGoQPDhFXrc2ogyU7gx7Xj241J+7ZJPlaSTlSkaymvI/qVsMN0aNcjoY+HIS9 HhSUusQh3TKXtMOiayhw22wjfBHjoRlkzbTDrY71PPmZ8fHtHmCfJY+H959QJE0oX/vs yD218nlnO3YYOknYzZNTUhbOkvmNvUoYWHbAcv2HHm4Z6VQrGJNXJkVcDmjGr3zZMkLR GXduDhy0ekIHLrNuFsZh29n4rNwBsII+Ka1LWxS4YFof+n2xwDTORvKr2tkkvlCu5BGU 2+ofFVujoPS+kowKC1QI+SSE7FKEQgP/pge3mithYJK265MpbbkudPBWxGvmdWF2F99M 8eHg== X-Gm-Message-State: ALKqPwfZH55Ssm2eKzgKPzUkcMhLLD9cHCg0mlmWPT32V/6vQGNp2EnW EkzM+Ng4fydXhs8sH1XOyrAdUA== X-Received: by 2002:a25:5cc6:: with SMTP id q189-v6mr5701389ybb.242.1526657817877; Fri, 18 May 2018 08:36:57 -0700 (PDT) Received: from localhost ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id y84-v6sm3090576ywg.5.2018.05.18.08.36.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 08:36:57 -0700 (PDT) Date: Fri, 18 May 2018 11:36:56 -0400 From: Sean Paul To: Heiko Stuebner Cc: Brian Norris , hl , Sean Paul , 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 Message-ID: <20180518153656.GK3373@art_vandelay> References: <1526548680-2552-1-git-send-email-hl@rock-chips.com> <11928313.3EhRqhFFHB@phil> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11928313.3EhRqhFFHB@phil> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Sean > > Heiko > > -- Sean Paul, Software Engineer, Google / Chromium OS