From nobody Wed Dec 24 21:32:28 2025 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58227664C0 for ; Tue, 23 Jan 2024 16:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706026182; cv=none; b=lWmtwBqCtODbQukLEXHY+kmZe1UYGJAN39dF2mTPc/t6olUvcwaIMc/QzR4SqSZcNjy8ncUF4NoGJ307EswhTR+Xzy0j8F6D2Dlvon/tkyn9Gh28tpMACi9elFpIRfx/Tw5IgRTS7vybH6UEwK2Xi2MHdd+UztV8blnrL4YZ7eY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706026182; c=relaxed/simple; bh=iV75UO6ZkEr2mjAImDePxKGuDa0DKz++I8BI+1ZKjGI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=AWY2w5L5KjkAD+qY7h/A8kVpBJNoYrUkOQEXGI1kkQRDKsj4nKKucWVaOSblT9HdabmkafoU3bubum6t6gEvItkSBabYhO0HiQyAe0HeUOS22pTJi8Vysp6VgzuzvnPllTxd4p63HzlgmaDD5waJqC6928GqJVNROOrUz6q4v0E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=8devices.com; spf=pass smtp.mailfrom=8devices.com; dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com header.b=iaXj0LPS; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=8devices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=8devices.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com header.b="iaXj0LPS" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-50f11e3ba3aso6400985e87.1 for ; Tue, 23 Jan 2024 08:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=8devices.com; s=8devices; t=1706026178; x=1706630978; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=TCsEp2lpUC7FkoNHc/fEc8WeD5OX/0nFFUd/EH7Tzfk=; b=iaXj0LPSvSZv3hnx3l8dkrQ7+dH0ZqxjL3uhsxUTXmEtZ3ojAufz45Piqv8Nmcude4 i7tEoFCoLaN5t6b0JJyLKNSAQ0EjqHe/fc2HFB4CA8VmVSqbgAqTVa/0vSq2qHAsjXOZ S+2RWUS/SZEYRGBCHdsqPkQdQjedl6NO4/B8bo9Fo3dhoAKIWW4n6q9fOtFB5WhDjFBd hPeDqSuoOV7WRkXy13g9hzVWrbZpGz2ZplvinzjrZND8U4hCMbms95Y4VMOe7BRyrYjj GTkwXt4GyOzygvw3WI4gMNmfCXwN4fLcawVH05gPVj5CEDuRBnDLsSzzC53jgc722ocv pjiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706026178; x=1706630978; h=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=TCsEp2lpUC7FkoNHc/fEc8WeD5OX/0nFFUd/EH7Tzfk=; b=l/NLuQC2OwSF5T2i7QzTbAtGTBvymyuhSVMVhVgykkrVjaqq+70VP9eF8PubfxOupT 7r/aaopWqen/wMzGJu6wI+7AKn8MWFw7CpnEmXgh2n42UWv9jLRrtu0OGzPYM0PMbIVg mWn5wZvlN2B/i6++0iYQmjy8JEk1R5X1Hju07gtjcMqEsVZ8UCqLuSU7uvG2J3jslKmm GigR8ZuajBTM/PSdR+w6eskyORxuELloy6WJTjjMyeMlkblSBggirxptk9r8UQnnNqQ/ uHcUZVYUTrBQuaYuckx4nu9WCI/DMmrYMfMRyI89GIsAunLVGy0/WaA645fIauiesGV+ ZBJQ== X-Gm-Message-State: AOJu0YzdAfQFTlSswws9XUQnBbUmBlqf1m98Acq7gVQPaddkQ/qqJa/a OzmzMoGvGXn4EQd+sOg7Y1CiZik6qCX1QcrSxbrIIRMgop6cupKtwaQYeVqjtNw= X-Google-Smtp-Source: AGHT+IGnnNSe1moGqxiwEYHIJKv7pqXFqRebOu3b3bLqL4dAFLPA+RPMl1SlBpFXalVBh4JuDpd0Hw== X-Received: by 2002:a05:6512:402:b0:510:56e:f56c with SMTP id u2-20020a056512040200b00510056ef56cmr674541lfk.31.1706026178547; Tue, 23 Jan 2024 08:09:38 -0800 (PST) Received: from mantas-MS-7994.8devices.com ([84.15.37.222]) by smtp.gmail.com with ESMTPSA id q20-20020a0565123a9400b0050e7be886d9sm2336950lfu.56.2024.01.23.08.09.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2024 08:09:38 -0800 (PST) From: Mantas Pucka To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Dmitry Baryshkov Cc: Mantas Pucka , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018 Date: Tue, 23 Jan 2024 18:09:19 +0200 Message-Id: <1706026160-17520-2-git-send-email-mantas@8devices.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1706026160-17520-1-git-send-email-mantas@8devices.com> References: <1706026160-17520-1-git-send-email-mantas@8devices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration") introduced register offsets to the driver but for ipq8074/ipq6018 they do not match what was in the old style device tree. Example from old ipq6018.dtsi: <0x00078200 0x130>, /* Tx */ <0x00078400 0x200>, /* Rx */ <0x00078800 0x1f8>, /* PCS */ <0x00078600 0x044>; /* PCS misc */ which would translate to: {.., .pcs =3D 0x800, .pcs_misc =3D 0x600, .tx =3D 0x200, .rx =3D 0x400 } but was translated to: {.., .pcs =3D 0x600, .tx =3D 0x200, .rx =3D 0x400 } So split usb_offsets and fix USB initialization for IPQ8074 and IPQ6018. Tested only on IPQ6018 Fixes: 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration") Signed-off-by: Mantas Pucka Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm= /phy-qcom-qmp-usb.c index 243cc2b9a0fb..05b4c0e67896 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -1556,6 +1556,14 @@ static const char * const qmp_phy_vreg_l[] =3D { "vdda-phy", "vdda-pll", }; =20 +static const struct qmp_usb_offsets qmp_usb_offsets_ipq8074 =3D { + .serdes =3D 0, + .pcs =3D 0x800, + .pcs_misc =3D 0x600, + .tx =3D 0x200, + .rx =3D 0x400, +}; + static const struct qmp_usb_offsets qmp_usb_offsets_ipq9574 =3D { .serdes =3D 0, .pcs =3D 0x800, @@ -1616,7 +1624,7 @@ static const struct qmp_usb_offsets qmp_usb_offsets_v= 7 =3D { static const struct qmp_phy_cfg ipq8074_usb3phy_cfg =3D { .lanes =3D 1, =20 - .offsets =3D &qmp_usb_offsets_v3, + .offsets =3D &qmp_usb_offsets_ipq8074, =20 .serdes_tbl =3D ipq8074_usb3_serdes_tbl, .serdes_tbl_num =3D ARRAY_SIZE(ipq8074_usb3_serdes_tbl), --=20 2.7.4 From nobody Wed Dec 24 21:32:28 2025 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0822466B29 for ; Tue, 23 Jan 2024 16:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706026186; cv=none; b=inXHJ08AfMyPIaq2C8O8UuUqcNW6L84e1rFBj56GKXZtxBpwHKG/N6jTAQ+kXXXv88naBo72H3s2lKhoUX5JENUjTY3KqFKHDPwNwLUxkdcq6mB8B/BsU3iAZx5X0SRb50q+PO/JXfY8cXiPBmNrLvXqAndXnyDrSueXatqX69Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706026186; c=relaxed/simple; bh=3kUIcHMZp9ESusmAFQXmdY4T9ktzKZmqQiYsfpE2vKE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=ppfUZl9H7OqpdjeKRSC9meSoga3lBr9ZLV3DSiqd6IlWutrdl7XRRSrCvwN2mroa30UCkoKQKn1efXltCsUYP4ubxXwfCaAUOX8G+KlfU9PJ3RGlKSAtsHQIO9WSG6KvITycGJ33+J/21xW/7JVKJDBgV5McK2LnZpmuIGmUAmk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=8devices.com; spf=pass smtp.mailfrom=8devices.com; dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com header.b=askbaJZJ; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=8devices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=8devices.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com header.b="askbaJZJ" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-50e741123acso5295929e87.0 for ; Tue, 23 Jan 2024 08:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=8devices.com; s=8devices; t=1706026183; x=1706630983; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=9aeZ9T+ieCTjHLP9T+AlBqZqFSYlGNv4TaAS0kSX4XE=; b=askbaJZJl8eLH+SG4IGtvx2/Mc1OHptftXBj/5S7ugFVaxO8dtnrtwOSrhS0o/Rn6e cCuhvvDSGVcyTTGmu8rLkvVRytjQiYnEu3V8Pm6h7tUUq7TBozdYY108uQtQbie6T/PL CZFoKVAxh+1qaRF06NfvznmQixtPQPOF6bneY3WEvDrbOsQPOHJBXHwWWmZmUrodtcaT hYr1EYyIIViPVvzIZ595TrbHwabh4GIPYWAunw4xExOMCUyFbnEyc15ZdJK/Uwx4lsp9 XvjNJkkAs6Vvg3PNNRot5pKNgqNC+eokeZiThA2o8M4ZrpmtTobI+1LT8ol5N9yCOdLU 1Vsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706026183; x=1706630983; h=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=9aeZ9T+ieCTjHLP9T+AlBqZqFSYlGNv4TaAS0kSX4XE=; b=ALpyrSId1RrFrdfGUtkP3O0i04N4y1u67VBfeY7/hRoKtUBq5+Ynt+2+3FfPIOUF3A lEJwbw/Sb4MUr5C/tmwDMteUGhrZHGooGJiLxeuxb9h8fs8p76GZd7pJFlSgubItfs0C OSmIXxtSRNoecBCitdPDt2XMamhU43QIb4EDo7Ebh00Wamr+T4XroOQ+OUZys2AaBf+s S2SwLcWbllv2vWYB0H1UXM1q3H2rUIJKiommKvIJY6uEGfsPls00OGbFfodFL4WNXSvS tIwMWg/24Fz6RvhLbgxgjWWoeBFo4xIh/EhFTsq557gdEmkP5xBV/H410JKpVHCaJovX NppQ== X-Gm-Message-State: AOJu0YzfVggnTDsH44dEx/2B52kFKowMNGAD7tj6Zg1yCWNhYIHFdJkl j+Lkqv5uJOOqo/pJmklnEElkM8eKO/wEdgRhHQYtSlI4eYdgvn0BtYk1FHi091/+VYt+4VBkSnH FF4E= X-Google-Smtp-Source: AGHT+IGFvyHOYbubVCuNY4+CxwTD27nCRHbuPg5Mi/FdVx2PZLy5oltclL6DN3yH53ibrsQ5Gwo47g== X-Received: by 2002:a05:6512:a90:b0:50e:a9da:7b2b with SMTP id m16-20020a0565120a9000b0050ea9da7b2bmr3401307lfu.94.1706026183207; Tue, 23 Jan 2024 08:09:43 -0800 (PST) Received: from mantas-MS-7994.8devices.com ([84.15.37.222]) by smtp.gmail.com with ESMTPSA id q20-20020a0565123a9400b0050e7be886d9sm2336950lfu.56.2024.01.23.08.09.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2024 08:09:42 -0800 (PST) From: Mantas Pucka To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Baruch Siach Cc: Mantas Pucka , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018 Date: Tue, 23 Jan 2024 18:09:20 +0200 Message-Id: <1706026160-17520-3-git-send-email-mantas@8devices.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1706026160-17520-1-git-send-email-mantas@8devices.com> References: <1706026160-17520-1-git-send-email-mantas@8devices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 23fd679249df ("phy: qcom-qmp: add USB3 PHY support for IPQ6018") noted that IPQ6018 init is identical to IPQ8074. Yet downstream uses separate serdes init sequence for IPQ6018. Since already existing IPQ9574 serdes init sequence is identical, just reuse it and fix failing USB3 mode in IPQ6018. Fixes: 23fd679249df ("phy: qcom-qmp: add USB3 PHY support for IPQ6018") Signed-off-by: Mantas Pucka Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm= /phy-qcom-qmp-usb.c index 05b4c0e67896..6621246e4ddf 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -1621,6 +1621,24 @@ static const struct qmp_usb_offsets qmp_usb_offsets_= v7 =3D { .rx =3D 0x1000, }; =20 +static const struct qmp_phy_cfg ipq6018_usb3phy_cfg =3D { + .lanes =3D 1, + + .offsets =3D &qmp_usb_offsets_ipq8074, + + .serdes_tbl =3D ipq9574_usb3_serdes_tbl, + .serdes_tbl_num =3D ARRAY_SIZE(ipq9574_usb3_serdes_tbl), + .tx_tbl =3D msm8996_usb3_tx_tbl, + .tx_tbl_num =3D ARRAY_SIZE(msm8996_usb3_tx_tbl), + .rx_tbl =3D ipq8074_usb3_rx_tbl, + .rx_tbl_num =3D ARRAY_SIZE(ipq8074_usb3_rx_tbl), + .pcs_tbl =3D ipq8074_usb3_pcs_tbl, + .pcs_tbl_num =3D ARRAY_SIZE(ipq8074_usb3_pcs_tbl), + .vreg_list =3D qmp_phy_vreg_l, + .num_vregs =3D ARRAY_SIZE(qmp_phy_vreg_l), + .regs =3D qmp_v3_usb3phy_regs_layout, +}; + static const struct qmp_phy_cfg ipq8074_usb3phy_cfg =3D { .lanes =3D 1, =20 @@ -2571,7 +2589,7 @@ static int qmp_usb_probe(struct platform_device *pdev) static const struct of_device_id qmp_usb_of_match_table[] =3D { { .compatible =3D "qcom,ipq6018-qmp-usb3-phy", - .data =3D &ipq8074_usb3phy_cfg, + .data =3D &ipq6018_usb3phy_cfg, }, { .compatible =3D "qcom,ipq8074-qmp-usb3-phy", .data =3D &ipq8074_usb3phy_cfg, --=20 2.7.4