From patchwork Mon Aug 28 15:23:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Thierry X-Patchwork-Id: 13368110 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A18FC83F12 for ; Mon, 28 Aug 2023 15:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbjH1PZL (ORCPT ); Mon, 28 Aug 2023 11:25:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232242AbjH1PY7 (ORCPT ); Mon, 28 Aug 2023 11:24:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E45F125 for ; Mon, 28 Aug 2023 08:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693236251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XgaN+BG8AUFu2JQlp/lnBJIk6IikRZnClAJ7+Cn21e8=; b=DHUV5WJx1OT1mF/nqvySdV4wMXgd0VyOOO23MlF2Pnb2loYSHTndVZlheb1lPFF7Azmly9 ayt4jlegmgRCDUPpZM0sOn4aVQtxKHJJwCvx+cdE80AEZEy3ZIUAw//Yf+JEsQmJI2XJxn iCRDsWIuSXYjhQJT9uf/XfrS6MG3PL0= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-7Ud0N6TjPru6qxrZ8xDRyQ-1; Mon, 28 Aug 2023 11:24:09 -0400 X-MC-Unique: 7Ud0N6TjPru6qxrZ8xDRyQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-64bf507a8d4so42904836d6.0 for ; Mon, 28 Aug 2023 08:24:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693236249; x=1693841049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XgaN+BG8AUFu2JQlp/lnBJIk6IikRZnClAJ7+Cn21e8=; b=iBPjrLlaUs+9f7dBI/uH5Fr1nIO9jkdXHKmmJ4+9Sh52N6azXHAzaqIDZ7fEdijKX3 YGga1SZ3+tbPSo7GSJ8NFkLPLQ/Vw4Two0z4oA1/dy7QmL/uggprtuG7DHFvFgV2RLsb 8ohT8QVHmkqhbpKypPGTkBhAWFcoVZpnUPtH3+ZWdDYxhqXrq78VMFE8sBkM+Q8m71Bj 3+K46kJna+iGlKSzNCD5+cMlq/VJPskR2Z5SmpXT0vvrDMxMaEEEppwgA6k8ipcY49Ye 4OOP+z41oS7cCrA/EOOgHwRtWYU0fmesSOg+MKvhFqrDoEzM1ASED8bppIq0VD5lz4mq BjTg== X-Gm-Message-State: AOJu0Yzj/aOBYee8JDH497GK2iDBG6ATgA/NyCqmc2TWt4ltqKkHwRh8 pUqpx3Z5pp8IXK42aVLt1aMqEOd/aVgnlqR38IlLmt2Ehaddo2tklAH4CB21ju2AMZlHlsEjqwf TjZJc+f33OQ5ArY0mWPkIxtb+Pg== X-Received: by 2002:a0c:b24e:0:b0:64f:7a11:b06c with SMTP id k14-20020a0cb24e000000b0064f7a11b06cmr9033467qve.43.1693236249539; Mon, 28 Aug 2023 08:24:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5N0ACrbO6gr/QzkKRUkb3dyF6Q8NXiLtE6V7eutxzNLjqvtNUAH39N2ZcM5lHQY7myuavYQ== X-Received: by 2002:a0c:b24e:0:b0:64f:7a11:b06c with SMTP id k14-20020a0cb24e000000b0064f7a11b06cmr9033452qve.43.1693236249329; Mon, 28 Aug 2023 08:24:09 -0700 (PDT) Received: from fedora.redhat.com ([107.171.218.122]) by smtp.gmail.com with ESMTPSA id m9-20020a0cf189000000b0063fbfbde4adsm2632860qvl.129.2023.08.28.08.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 08:24:08 -0700 (PDT) From: Adrien Thierry To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Dmitry Baryshkov Cc: Adrien Thierry , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH v2 1/2] phy: qcom-qmp-usb: initialize PCS_USB registers Date: Mon, 28 Aug 2023 11:23:50 -0400 Message-ID: <20230828152353.16529-2-athierry@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828152353.16529-1-athierry@redhat.com> References: <20230828152353.16529-1-athierry@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Currently, PCS_USB registers that have their initialization data in a pcs_usb_tbl table are never initialized. Fix that. Fixes: fc64623637da ("phy: qcom-qmp-combo,usb: add support for separate PCS_USB region") Signed-off-by: Adrien Thierry Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c index 466f0a56c82e..f9cb60f12575 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -2233,6 +2233,7 @@ static int qmp_usb_power_on(struct phy *phy) void __iomem *tx = qmp->tx; void __iomem *rx = qmp->rx; void __iomem *pcs = qmp->pcs; + void __iomem *pcs_usb = qmp->pcs_usb; void __iomem *status; unsigned int val; int ret; @@ -2256,6 +2257,9 @@ static int qmp_usb_power_on(struct phy *phy) qmp_usb_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num); + if (pcs_usb) + qmp_usb_configure(pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num); + if (cfg->has_pwrdn_delay) usleep_range(10, 20); From patchwork Mon Aug 28 15:23:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Thierry X-Patchwork-Id: 13368109 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A9EAC83F15 for ; Mon, 28 Aug 2023 15:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230014AbjH1PZJ (ORCPT ); Mon, 28 Aug 2023 11:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbjH1PY7 (ORCPT ); Mon, 28 Aug 2023 11:24:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0F29124 for ; Mon, 28 Aug 2023 08:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693236253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gGjsmz9FeJn7Lh+gqCn/qI6bNBonhQitpcnm9Wxk4NA=; b=gFg1MCZgcQUtt3w30s6bz213nrjG8qKyjX5KihvmDf6/sahdiT4hEKTH3QfT5zxMaUgTnz /MKmIGCOVCc+BwI0RI6oQBd5Xqw4LJgu1+ORx2/GvbELpxLGG3GvTidw7JrPhbtCr6uN2H DpJ2SzWjbolUacK1Kr+p+6doXR+pq9A= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-EXavMO98PS26kDXG_v5s0g-1; Mon, 28 Aug 2023 11:24:12 -0400 X-MC-Unique: EXavMO98PS26kDXG_v5s0g-1 Received: by mail-ua1-f69.google.com with SMTP id a1e0cc1a2514c-7a01ecba96fso1148203241.3 for ; Mon, 28 Aug 2023 08:24:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693236251; x=1693841051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gGjsmz9FeJn7Lh+gqCn/qI6bNBonhQitpcnm9Wxk4NA=; b=g476zQTRmZtAQWZtXw/lGq2r1RxNoeo6iJUeMZkcvTpJWnSZfsuGfqiNBbuNrXpmpK xdu7ZxiDL3DKPuJEcutzoloLSmEpB0i5pI9ARekpulUV6BUClkxPibNbfLdTb2giSL1S RNNCXswg4v41HB3kXMOLk3HlqXSB+1f6JG8SAXILrclhrTXYTJAkBM9M3sdMTTZOLNyj pvYdn/Pyjta75qsif3G5sqnWuj9Mp23NI2UEe98J6qWQVXXjDdf0xMGooM59VeWCfn1k Zx2b79xJrsjaFCKM3yDlbEvZCRJkisXUZNHDkGrsl/X0sr6X3gTv5pycieG2mmgDE9D9 nBkg== X-Gm-Message-State: AOJu0Yy6aHU/mOqvGLu2C0ZVYkKgQ6VuLOmvlzKXuHyUIaoZZVLNUoPr yqaFrc5ftjDIHuqMQJZufLAAj8790aiWHUMSoqQrJcJdVuWalqNfnE0jJc61bdcMXf3hRXOaiVy 0zid/UgejEb128pXqRXnfGcqUrA== X-Received: by 2002:a05:6102:3c98:b0:44e:b30a:c0da with SMTP id c24-20020a0561023c9800b0044eb30ac0damr6369700vsv.26.1693236251537; Mon, 28 Aug 2023 08:24:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE46nl2H5ijjpTxL1zWNSiHKrFxpuLVW0280mawb3vUShdNvbLQaBwNDj8vgMWZdlwimMCEzQ== X-Received: by 2002:a05:6102:3c98:b0:44e:b30a:c0da with SMTP id c24-20020a0561023c9800b0044eb30ac0damr6369680vsv.26.1693236251267; Mon, 28 Aug 2023 08:24:11 -0700 (PDT) Received: from fedora.redhat.com ([107.171.218.122]) by smtp.gmail.com with ESMTPSA id m9-20020a0cf189000000b0063fbfbde4adsm2632860qvl.129.2023.08.28.08.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 08:24:10 -0700 (PDT) From: Adrien Thierry To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Shazad Hussain , Dmitry Baryshkov Cc: Adrien Thierry , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH v2 2/2] phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p Date: Mon, 28 Aug 2023 11:23:51 -0400 Message-ID: <20230828152353.16529-3-athierry@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230828152353.16529-1-athierry@redhat.com> References: <20230828152353.16529-1-athierry@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org For sc8280xp and sa8775p, PCS and PCS_USB initialization data is described in the same table, thus the pcs_usb offset is not being applied during initialization of PCS_USB registers. Fix this by adding the appropriate pcs_usb_tbl tables. Fixes: 8bd2d6e11c99 ("phy: qcom-qmp: Add SA8775P USB3 UNI phy") Fixes: c0c7769cdae2 ("phy: qcom-qmp: Add SC8280XP USB3 UNI phy") Reviewed-by: Dmitry Baryshkov Signed-off-by: Adrien Thierry --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c index f9cb60f12575..575329004b90 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -1480,8 +1480,6 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03), QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa), QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13), @@ -1490,6 +1488,11 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; +static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_usb_tbl[] = { + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), +}; + static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG1, 0xc4), QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG2, 0x89), @@ -1499,9 +1502,6 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03), QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa), QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), - QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f), QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13), @@ -1510,6 +1510,12 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; +static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_usb_tbl[] = { + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f), +}; + struct qmp_usb_offsets { u16 serdes; u16 pcs; @@ -1788,6 +1794,8 @@ static const struct qmp_phy_cfg sa8775p_usb3_uniphy_cfg = { .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl), .pcs_tbl = sa8775p_usb3_uniphy_pcs_tbl, .pcs_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl), + .pcs_usb_tbl = sa8775p_usb3_uniphy_pcs_usb_tbl, + .pcs_usb_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_usb_tbl), .clk_list = qmp_v4_phy_clk_l, .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), .reset_list = qcm2290_usb3phy_reset_l, @@ -1833,6 +1841,8 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl), .pcs_tbl = sc8280xp_usb3_uniphy_pcs_tbl, .pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_tbl), + .pcs_usb_tbl = sc8280xp_usb3_uniphy_pcs_usb_tbl, + .pcs_usb_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_usb_tbl), .clk_list = qmp_v4_phy_clk_l, .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), .reset_list = qcm2290_usb3phy_reset_l,