From patchwork Wed Aug 23 17:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Thierry X-Patchwork-Id: 13363001 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 2A687C3DA66 for ; Wed, 23 Aug 2023 17:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237758AbjHWRNh (ORCPT ); Wed, 23 Aug 2023 13:13:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237756AbjHWRNh (ORCPT ); Wed, 23 Aug 2023 13:13:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CF82E67 for ; Wed, 23 Aug 2023 10:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692810768; 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=qp4RdEnnTC5xvkWmLF44PstbcAOtN7ar952PgUn8Uto=; b=aHBbqt11n1044LpFFxbvY7OEHOCV+0hl8RA+CgtbfoWcrWPTVod0hCS3Vm0mh8TfnlY5+M Xtk6zOAinlzd9SQRoaWih2tHpkpk1BweBNMlkA50cejj4zGc6AbNKmSYY2ZpmMLHiNB2YA tj4X7iY1Qdka+a4B6f1H8sVuUEWZ7G0= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-H4XXwvJJM96aVgRoapAm1Q-1; Wed, 23 Aug 2023 13:12:46 -0400 X-MC-Unique: H4XXwvJJM96aVgRoapAm1Q-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-63cd1ea05d7so572656d6.0 for ; Wed, 23 Aug 2023 10:12:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692810766; x=1693415566; 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=qp4RdEnnTC5xvkWmLF44PstbcAOtN7ar952PgUn8Uto=; b=i6KNb2iJ/uQy6Q5ORfHIhN3Aw2jNXPlTYvlRSpwMcizwc5jVMVoqSRShIhRU26S7L1 fnT/E6cGbwGzoaeLJq5GcdMfeY9HW2cYWMNSA3dDsbGyQdWHjtnh/ZZWXFuytdJ5gjPn wGyy7wiYQHzRxkcc8JAUp42J8cK6WofaxMJaK3URDLV9LmNPNl7M7giKk7jzlx3ETVzb g3YayzcXKFDaQxjshQYplK4r1IYRY3rcZK7iNBKJmClwKlxwwFBWTRjlzmXB+vA34iYe avR04h9rQyKpfxAYTP3GP7S+TdPv9VZDdCzJZRpv0cdClELnuPC7lJKS2DS2bLx9nzi8 643Q== X-Gm-Message-State: AOJu0Yx12EnqOlppRqbKr/glBMrA8Q6Meh3g7sam51n1lX+2Gx26Q7kn D+2S3/xrOEyhn8lyNwSnufiW0IxhT0cAwo+0c2mRi1tubVywnRyy5QR1PBRhq7xRffzDbD83HWY 87mm5ss8ceG57jV6MbyTqwicAIw== X-Received: by 2002:a05:620a:4411:b0:76c:b7f0:2bc9 with SMTP id v17-20020a05620a441100b0076cb7f02bc9mr16526204qkp.16.1692810766076; Wed, 23 Aug 2023 10:12:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFijETF/QBal13dY4JCxSoiAz5Wdp9YfPUCZRSIbi8XM8ZuXXa9y7nQNuulElzOsLHKe1tZXA== X-Received: by 2002:a05:620a:4411:b0:76c:b7f0:2bc9 with SMTP id v17-20020a05620a441100b0076cb7f02bc9mr16526189qkp.16.1692810765863; Wed, 23 Aug 2023 10:12:45 -0700 (PDT) Received: from fedora.redhat.com ([107.171.218.122]) by smtp.gmail.com with ESMTPSA id x26-20020ae9f81a000000b0076ca9f79e1fsm4056361qkh.46.2023.08.23.10.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 10:12:45 -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 1/2] phy: qcom-qmp-usb: initialize PCS_USB registers Date: Wed, 23 Aug 2023 13:12:04 -0400 Message-ID: <20230823171208.18382-2-athierry@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823171208.18382-1-athierry@redhat.com> References: <20230823171208.18382-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 --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c index 466f0a56c82e..ccbe64f7897e 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 ?: qmp->pcs; void __iomem *status; unsigned int val; int ret; @@ -2255,6 +2256,7 @@ static int qmp_usb_power_on(struct phy *phy) } qmp_usb_configure(pcs, cfg->pcs_tbl, cfg->pcs_tbl_num); + 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 Wed Aug 23 17:12:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Thierry X-Patchwork-Id: 13363000 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 20C65C3DA66 for ; Wed, 23 Aug 2023 17:13:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237755AbjHWRNd (ORCPT ); Wed, 23 Aug 2023 13:13:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231433AbjHWRNd (ORCPT ); Wed, 23 Aug 2023 13:13:33 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 162CAE6A for ; Wed, 23 Aug 2023 10:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692810769; 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=6LDqnjupdSmL9k9YHJrhlv07uaJlqH7GpMG15CT+bhs=; b=YcBJi+Rvcnby4uvX3ztwijkXAs5imc0iGRJvTNnMK+hB6rHdnlBf+ou8uG8iV7e9TwyIyj yPUXJ0UQalx9EDNAAA4Ln5spbjc3GjzeXYkrcfW1Ics08z/qWOAXSDNDyYOaAaoOz+QlG7 btqITRhViQST1EyU2N4lL2IsagYuKGY= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-344-UYJT3oMVM1mO9nfYwmF4xw-1; Wed, 23 Aug 2023 13:12:48 -0400 X-MC-Unique: UYJT3oMVM1mO9nfYwmF4xw-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-76d882c4906so748266385a.0 for ; Wed, 23 Aug 2023 10:12:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692810767; x=1693415567; 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=6LDqnjupdSmL9k9YHJrhlv07uaJlqH7GpMG15CT+bhs=; b=ear7LpLfjRPpq/RMHqfJqXPd/Qp9T+7L2F6FSOu9UNNwp16lfoP0yJgaa8/u+kQRsS 0EBi5Kn3sPYzd6kyEJOdibNJdrlaLJsLPlEbmKOADBE2zkGd7ha9zIQ6EZZPuEACez9o AATvs50VWkh4U9zq46FGZJmD2MFh4xTfo8GJsfItvmqV0tP2ZgWtHuJnaUb1HYIrWehh k2j/RpiXvFVqG3Ju1yyEc8diKEvZlBjUN2s/PZEVY0F+H+qgK6yvhcabQjZLt8k5QKr5 GqmhiaUyrRPEUDoUxlr4cf+wOKM5PB3omJu+uzZFFbFCKFkrSXhlbepNZHX3rv9ky3d3 q8dw== X-Gm-Message-State: AOJu0YxdOC8XRd+0x5/E2MUuzXedZJ1rFbx0VBjvVqZH/jbBC3WJOBAz VhHfYTr4Fd+pjFV9XPdeNG5vGQbzJVGk/XbwhAuEruwQg3a3nfzURfy8WKNQgli2arVZCgGF9ii NT4Fprj657JTla5tY2MRYU2f28w== X-Received: by 2002:a05:620a:248d:b0:76d:966d:b30e with SMTP id i13-20020a05620a248d00b0076d966db30emr19079966qkn.6.1692810767554; Wed, 23 Aug 2023 10:12:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGITbTZgj/QdmC+MzL1ZvWT2VW6zR43X5aoHcFP2MOnAHhyFKzG61G3sIFIkZ0sbhWznHuGPQ== X-Received: by 2002:a05:620a:248d:b0:76d:966d:b30e with SMTP id i13-20020a05620a248d00b0076d966db30emr19079942qkn.6.1692810767343; Wed, 23 Aug 2023 10:12:47 -0700 (PDT) Received: from fedora.redhat.com ([107.171.218.122]) by smtp.gmail.com with ESMTPSA id x26-20020ae9f81a000000b0076ca9f79e1fsm4056361qkh.46.2023.08.23.10.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 10:12:46 -0700 (PDT) From: Adrien Thierry To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Dmitry Baryshkov , Shazad Hussain Cc: Adrien Thierry , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org Subject: [PATCH 2/2] phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p Date: Wed, 23 Aug 2023 13:12:05 -0400 Message-ID: <20230823171208.18382-3-athierry@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823171208.18382-1-athierry@redhat.com> References: <20230823171208.18382-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") Signed-off-by: Adrien Thierry Reviewed-by: Dmitry Baryshkov --- 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 ccbe64f7897e..22bcf11494d5 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,