From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 274EBC25B50 for ; Mon, 23 Jan 2023 09:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kmmd6J/TLTjVKU2loxfZMLRwhyDI/Vaa6aCCyiEzBXY=; b=M16QZdbWPtMnu7 L3K/T4vE4c585CWadFrUd2eYNBsi7TC8NiyNhLXYifz/MlqeJBGZC+z4Xy2cNQwWXhYwTfIaHXIE1 wlGjt9IBPBfNJ/KIIHAWAx42bRheiJvR5ixSIwGjF60eRTcZc7Rg3Z6pV7HpJ5zKgc49pELzuQqbZ vU+yZT9keax4f/iq20N5boklvXQo+BsHZdD/RYlHFExRVHglUAg2ttm+T12vrRaKl8PolBylaAlVs LUdLJ2CRTmeHv6Ut6oStw70DdLw4SsbQ6fSbobZIThip7/PFdCt7GFoWqWScWFlzckP9qDSl33WwV 3fh4XYg4RS9s+9Tpi8QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJtMI-00GYl4-Db; Mon, 23 Jan 2023 09:43:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJtM5-00GYfj-3w for linux-phy@lists.infradead.org; Mon, 23 Jan 2023 09:43:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5291E60DF6; Mon, 23 Jan 2023 09:43:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADD88C433D2; Mon, 23 Jan 2023 09:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674466987; bh=zqDlD4UopnwoyaNHYVa7uoZaLDHyVvELIS4k830a3tE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cQck51QSo8S3o8L0jiTiWU/KpeSoiVyZcK+f7dn56i9J8+qhqem70UnLO8vXJSPPS MOdxE5M0Wd/Ptvrkhv7VfpzcMxs9Lm6UJ7bGVyI1jII0C9XM2eTgZ9Qs6IoJ0khLcn c2/+3OctjRN9iQWnGfLZyQuUgoNMXcfLZOr5m5ts86o8deD5axtsAD8mqCgrqWXdD7 xQCVXHedeCqIqYv089jZIu6gFkfITQ7YI0v/h6OczP74sRn2v+YaU1UnBhlHncT7M0 N6BKpWRzW/5y3pcD4QfnmVSuR/jFHHmtZEKF2zZvIbHBxppNrd+R8HLPByyzH/8BMY 3qrAU6OFlJF+Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pJtM0-0000GF-SP; Mon, 23 Jan 2023 10:43:04 +0100 Date: Mon, 23 Jan 2023 10:43:04 +0100 From: Johan Hovold To: Luca Weiss Cc: Dmitry Baryshkov , Vinod Koul , linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] phy: qcom-qmp-combo: Add config for SM6350 Message-ID: References: <20221130081430.67831-1-luca.weiss@fairphone.com> <20221130081430.67831-2-luca.weiss@fairphone.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_014309_286070_C674842C X-CRM114-Status: GOOD ( 42.52 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Fri, Jan 20, 2023 at 03:13:46PM +0100, Luca Weiss wrote: > On Fri Jan 13, 2023 at 2:01 PM CET, Dmitry Baryshkov wrote: > > On Fri, 13 Jan 2023 at 14:44, Luca Weiss wrote: > > > > > > Hi Dmitry, > > > > > > On Thu Jan 12, 2023 at 8:33 PM CET, Dmitry Baryshkov wrote: > > > > On 12/01/2023 19:50, Vinod Koul wrote: > > > > > On 28-12-22, 15:17, Johan Hovold wrote: > > > > >> Luca, Vinod, > > > > >> > > > > >> On Wed, Nov 30, 2022 at 09:14:28AM +0100, Luca Weiss wrote: > > > > >>> Add the tables and config for the combo phy found on SM6350. > > > > >>> > > > > >>> Signed-off-by: Luca Weiss > > > > >>> --- > > > > >>> Changes since v2: > > > > >>> * Drop dp_txa/dp_txb changes, not required > > > > >>> * Fix dp_dp_phy offset > > > > >>> > > > > >>> drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 126 ++++++++++++++++++++++ > > > > >>> 1 file changed, 126 insertions(+) > > > > >>> > > > > >>> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c > > > > >>> index 77052c66cf70..6ac0c68269dc 100644 > > > > >>> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c > > > > >>> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c > > > > >> > > > > >>> @@ -975,6 +1039,19 @@ static const char * const sc7180_usb3phy_reset_l[] = { > > > > >>> "phy", > > > > >>> }; > > > > >>> > > > > >>> +static const struct qmp_combo_offsets qmp_combo_offsets_v3 = { > > > > >>> + .com = 0x0000, > > > > >>> + .txa = 0x1200, > > > > >>> + .rxa = 0x1400, > > > > >>> + .txb = 0x1600, > > > > >>> + .rxb = 0x1800, > > > > >>> + .usb3_serdes = 0x1000, > > > > >>> + .usb3_pcs_misc = 0x1a00, > > > > >>> + .usb3_pcs = 0x1c00, > > > > >>> + .dp_serdes = 0x1000, > > > > >> > > > > >> I would have expected this to be 0x2000 as that's what the older > > > > >> platforms have been using for the dp serdes table so far. Without access > > > > >> to any documentation it's hard to tell whether everyone's just been > > > > >> cargo-culting all along or if there's actually something there at offset > > > > >> 0x2000. > > > > > > > > usb3_serdes is 0x1000, so dp_serdes equal to 0x1000 is definitely an typo. > > > > > > > > Judging from the downstream dtsi, the DP PHY starts at offset 0x2000. So > > > > dp_serdes is equal to 0x2000, dp_phy = 0x2a00, ln_tx1 = 0x2200, ln_tx2 = > > > > 0x2600. > > > > > > Can you share how you got to the 0x2000 offset? You can see my > > > (potentially wrong) reasoning for 0x1000 a few messages ago[0]. > > > > > > The only 0x2000-something I could find now while looking at it again is > > > "#define USB3_DP_PHY_DP_DP_PHY_PD_CTL 0x2a18" which becomes > > > USB3_DP_DP_PHY_PD_CTL in the driver but this is seemingly not used at > > > all in my msm-4.19 tree. > > > > Quite simple: see [1]. DP_PLL is at +0x2000 > > > > [1] https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/heads/android-msm-bramble-4.19-android11-qpr1/qcom/lagoon-sde-pll.dtsi#27 > > I still disagree from what I see. > > E.g. this part of the dp_serdes init table in mainline: > > static const struct qmp_phy_init_tbl qmp_v3_dp_serdes_tbl_rbr[] = { > QMP_PHY_INIT_CFG(QSERDES_V3_COM_HSCLK_SEL, 0x0c), > > With this one: > #define QSERDES_V3_COM_HSCLK_SEL 0x13c > > To write this config qmp->dp_serdes gets used which is set at: > qmp->dp_serdes = base + offs->dp_serdes; > > So if offs->dp_serdes is 0x2000, this write will go to 0x213c. > > If we go back to msm-4.19 downstream the equivalent define is > #define USB3_DP_QSERDES_COM_HSCLK_SEL 0x113c > > So there we are at offset 0x1000. And this define is used in > qcom,qmp-phy-init-seq which I already went to in detail in a previous > email in this thread. >From what I've heard, the PHY driver in the vendor kernel only deals with the USB part of the PHY, while some display driver accesses the DP part directly. So the fact that the Qualcomm USB PHY driver init sequences don't seem to use the DP regions (apart from that USB3_DP_PHY_DP_DP_PHY_PD_CTL register) is to be expected. IIRC the v3 layout was also used by the SoC for which DP support was first implemented. Presumably, the separate USB and DP regions do exist and you should include them also for SM6350 even if you can't test it currently. We'll convert the older platforms over to use the new binding scheme soon and then we'd need this anyway. And if it turns out later that this was all bogus, at least we only need to fix the driver (and not worry about dts backward compatibility as we had to with the old style bindings). Johan -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy