Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp553133lqh; Fri, 31 May 2024 09:09:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUShEMCaUZD8dUBrBW3/4r+Fy+IJAeU6g8G42zV/H2FO1fNt/fKlZ6cyAkw5H0lQlPk/HhSZRPcIOfyf3m2FPbpOEm/5OEl09yF2vmocw== X-Google-Smtp-Source: AGHT+IF7DQPaFtYrZyrURXtz3eiFben2bQZH5xOMwgRPXsIsFBBOEDHfH15vZYQPzDOgyw6sbZHo X-Received: by 2002:a05:6808:394c:b0:3c9:95e2:b080 with SMTP id 5614622812f47-3d1e34a14admr1930182b6e.25.1717171748268; Fri, 31 May 2024 09:09:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717171748; cv=pass; d=google.com; s=arc-20160816; b=OmpPFDOHYKNDedOHPqQJsnpQMtS5VqgoP0+d8tctcDJktn1WI1A5bxAOpfY6iewsSG BUDVsdROK8hf2QGRF2PPaOlKg+v0RFZxOSCK6e0afWa0BH1o+UAt33sqTO1eW/wwvhvl bVvgxYzUWhQ08zfuv87sxpHeoRTxV3yCc+XmW0lvb/0OI/Fa73qfDznGM6zaO6oxHW53 xSgNTVoX7+8NDcK8F2LPwBpby19gkXh9mbxdRaMGdgtrFR9NyyV4gyHZuJFRiU8XU4zl x+sGNpT05mzmM/En3XVZ4PxhQmwv6Zz8hDscVlnWT+6OPk9MPdQkwMdj7YfQP6662u03 WTWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=G6//FEP7cApjoaJ6/xp+H/xK3TdzcTfbzf8Zzgf+lsQ=; fh=pfWerD+J42lobA1SMkXo0NASa9JUQ0Dw6Vm6yjw+76U=; b=nVR08vzelH04Iyz5rKKNWuO5lmza3DionN5rTpmNYwDefeDrKSbyzvkDk4AwWaPfvI HEQWBnFKAy0In7ZH9JeoE00qFddy0elFsRJwRU3cZnRlpwx6iVs0F93E+4jP8b4nM/Q3 3utiFATHr6nk8wpl41jn09w4gMqlNU2pOspx9oYFLsmcgQ41oPWawyeBesuNsn5Q897Z RVolbCqG3ohHU+bUhr42+NOGqvpAZzmG/d6jkpkVPVH1IINx2GQB2HeGkbKLIME5MrXz lf8qhdylReHB242YThDgIrNHdlQ0XHa96l4DxG6qfn8zc1p4TGDEnx5gcpfgVaBUqkuC Ke8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MN3R1Dn0; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-197112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197112-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 71dfb90a1353d-4eafedbcff5si439375e0c.54.2024.05.31.09.09.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 09:09:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MN3R1Dn0; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-197112-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197112-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 822DB1C239B0 for ; Fri, 31 May 2024 16:07:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43D9B172BA2; Fri, 31 May 2024 16:07:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MN3R1Dn0" Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 69B2915884F for ; Fri, 31 May 2024 16:06:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717171620; cv=none; b=Qi55sxpp5zikGzsCxNDdSh5tPi+XVZHp8OHMEWOzHuxvM3FXjMtQma/WZzBR7lryOSLXuZshjb51AyGrYys3QOeQ2eGfr82hsigFb6DPf+TLMdqsnPjS3+D6megFmwVmWhSrTLhx1QUU/fHYAKTGld0WO28teYqtUTLAu4e65UQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717171620; c=relaxed/simple; bh=JJsL5OqAlyz9O2TqvokIzCODnIdsn9g7a8asMj9Q3QI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UUGR3ZXzfL2wFCR2h3gv5tMFiEMn4OUzsZtlfkNwLE/wdTbO7g2G+FPBWDrmGxToawo3eG4d5VritK6Eh/5EW9wn5vowVcw5msoQ4EZQ4ugluZtVDd2Qcxn8CVDHS2/KALJlIi/2O+U8oqR079UPvjdg85XceBm7f9uQmdczJNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MN3R1Dn0; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-52b80e5688aso2705297e87.0 for ; Fri, 31 May 2024 09:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717171616; x=1717776416; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=G6//FEP7cApjoaJ6/xp+H/xK3TdzcTfbzf8Zzgf+lsQ=; b=MN3R1Dn0Gr1L3oL4fjeCZf/wywVvKejzscUp5F6pHfdlRnMqj+O+bE6GbLoZ83WzB8 m3l3vWMoQMElyRpGL/hhfboItniYwAKBq3MWugu9BHvCIMRRdoB1W/Eol20pRpcQquL+ 4+1UnWKHj1CBGBtB+2P3EOGSH2836pg6QPz+pYhyIjzDr8zoDIYLOY/fwc6b+UCLlWmn ui1C752OT6hDcrlPzIKX0v1DJ/Y/b8Oyu5A6dLn0ECaEeOETfcql4VSfQ4lc/naeSA4p fyqNW/PGa7qaSVNjr3kBcs8p1Nuzr6JW7JvkuCSKuJ03z1vKlGG19Pcikg9kryUccO0p MKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717171616; x=1717776416; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G6//FEP7cApjoaJ6/xp+H/xK3TdzcTfbzf8Zzgf+lsQ=; b=n4o/Dn4fosBXJ2ZjGuxUwFcz4XXn3gZ2y1dv/10wJiYTBCVQBjTqfNg+tNAHKr22vb cZCc80rdE8nNPssOz0LeK78LOwP9s52lepCzGWiMQjj98YfGw3P3fHDZgseZfAiANKp+ Um8wWGrhlZv5aeNJtbSDihXCep4vmP5UJF3cRJNcyO08yXfMxeBqTAJPXm4mqCgid4FU qrq0ulrVENQU6yuNm50jFaBvU2TDeoHzXe2S6w5/TrlyhzIyy+OwELnlIdlEiWS/rc7d 3w7Uy5YJn6IwvLkKLXjt3jqJlIYPEA1jLRiwsos6fSDk3KzJds7cuatmfHu1A+oAZ+wf SvsQ== X-Forwarded-Encrypted: i=1; AJvYcCUxE/mYh2Aqp4acN8EF5QHPHRDEbycbHatYyJJLjHWlJhBRCQCd95qvmFBLEyH5sdbLjEU0+W0AImDUTKaZTohzxl+aJP2yxhHM6xld X-Gm-Message-State: AOJu0YzQ+wj/kUm5EwuMXfpSXnx548TCQ+qNbGJbN5e2wVVXK8EG1t/j u1tH5o5wrKitCFhbjWduAXthc1mJVKoXVq4hn+UOOIBl9Ud5qeaiwgVVvGTvZIaIaAc2y7xMoLV j X-Received: by 2002:a19:7501:0:b0:52a:7d01:84cd with SMTP id 2adb3069b0e04-52b89563555mr2122032e87.30.1717171616398; Fri, 31 May 2024 09:06:56 -0700 (PDT) Received: from [127.0.1.1] ([188.27.161.69]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67e73fc1b3sm100802566b.74.2024.05.31.09.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 09:06:55 -0700 (PDT) From: Abel Vesa Date: Fri, 31 May 2024 19:06:45 +0300 Subject: [PATCH 2/2] phy: qcom: qmp-pcie: Add X1E80100 Gen4 4-lane mode support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240531-x1e80100-phy-add-gen4x4-v1-2-5c841dae7850@linaro.org> References: <20240531-x1e80100-phy-add-gen4x4-v1-0-5c841dae7850@linaro.org> In-Reply-To: <20240531-x1e80100-phy-add-gen4x4-v1-0-5c841dae7850@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Johan Hovold , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Abel Vesa X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3148; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=JJsL5OqAlyz9O2TqvokIzCODnIdsn9g7a8asMj9Q3QI=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBmWfWbZ+v0JzeD+G1ezXOkdmTUgYe7zkYCZUaJp AT4TPNHSUGJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZln1mwAKCRAbX0TJAJUV Vl4JEACZlz6/FX72IPvoBV2KhG9rc7UqNay9v/AWlqtoOrFjkUGKYrtfWDzoLf3V72U2WR4b6Ae GgtBzkEufTBZgAzbfmRTCt9E1VT621Pu6y3hn7OMCrntVyvFtKfVETkJjEjx4AJwLIakN/AU4pU +JBmRNMQO/+ICih7/FEZFAF0u1rvMSs5ET+DBA6Jt15xr/iUKysZ8iRBNgKoWnKcjP1fyhW8sJG 1c6DJt5A3h92cxz8nCDaPWX3f1JXlirD7VtvB3YsAo4fJOJQERAi080O5OelHN3sWK85GKQ9CnK vSIxq3pzAY8ncjabYrsnUWv+Cci6GNYl0r//kHSX2tMNyAIYoYBrkjxnEF1uyh7SKCfyU9ydEoY Ekih3Td7WE1OZjVnQoNXaLSDPTud+530/R1cqUs0DcYfyEDU0G7brmDhlkr9ay3bzRd8eLQp1HT u8ozVsQNXsXBJAkNHJXmEanYl0HX7DTn1oddemGnycsRiff/5Bgxowm2G6SX2LqbbJCMpbdibHb dZvzTtHB/ng8d3BysFfcyeL+wakfNnt8Zzn7hVd1wJ85A9Uqdv+uot1siNWybEwqMCxgrsyV+xI fTjL1qevRegswKsItjvnFuOSb1cEYyvkKrQFIaD+iVnfAivE9OK9iO+vz0HTdQXD8eb1Z9q9WZA jKpObCZO6iOhRig== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE The PCIe 6th instance from X1E80100 can be used in both 4-lane mode or 2-lane mode. Add the configuration and compatible for the 4-lane mode. Signed-off-by: Abel Vesa --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 6c796723c8f5..4e0b28da69a7 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -1028,6 +1028,10 @@ static const struct qmp_phy_init_tbl x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V6_LN_SHRD_RX_MARG_COARSE_THRESH6_RATE3, 0x1f), }; +static const struct qmp_phy_init_tbl x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl[] = { + QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN, 0x1c), +}; + static const struct qmp_phy_init_tbl x1e80100_qmp_gen4x2_pcie_tx_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V6_20_TX_RES_CODE_LANE_OFFSET_TX, 0x1d), QMP_PHY_INIT_CFG(QSERDES_V6_20_TX_RES_CODE_LANE_OFFSET_RX, 0x03), @@ -3342,6 +3346,41 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x2_pciephy_cfg = { .ln_shrd = x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl, .ln_shrd_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl), }, + + .reset_list = sdm845_pciephy_reset_l, + .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l), + .vreg_list = sm8550_qmp_phy_vreg_l, + .num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l), + .regs = pciephy_v6_regs_layout, + + .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, + .phy_status = PHYSTATUS_4_20, + .has_nocsr_reset = true, +}; + +static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = { + .lanes = 4, + + .offsets = &qmp_pcie_offsets_v6_20, + + .tbls = { + .serdes = x1e80100_qmp_gen4x2_pcie_serdes_tbl, + .serdes_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_serdes_tbl), + .tx = x1e80100_qmp_gen4x2_pcie_tx_tbl, + .tx_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_tx_tbl), + .rx = x1e80100_qmp_gen4x2_pcie_rx_tbl, + .rx_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_rx_tbl), + .pcs = x1e80100_qmp_gen4x2_pcie_pcs_tbl, + .pcs_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_pcs_tbl), + .pcs_misc = x1e80100_qmp_gen4x2_pcie_pcs_misc_tbl, + .pcs_misc_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_pcs_misc_tbl), + .ln_shrd = x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl, + .ln_shrd_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl), + }, + + .serdes_4ln_tbl = x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl, + .serdes_4ln_num = ARRAY_SIZE(x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl), + .reset_list = sdm845_pciephy_reset_l, .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l), .vreg_list = sm8550_qmp_phy_vreg_l, @@ -4108,6 +4147,9 @@ static const struct of_device_id qmp_pcie_of_match_table[] = { }, { .compatible = "qcom,x1e80100-qmp-gen4x2-pcie-phy", .data = &x1e80100_qmp_gen4x2_pciephy_cfg, + }, { + .compatible = "qcom,x1e80100-qmp-gen4x4-pcie-phy", + .data = &x1e80100_qmp_gen4x4_pciephy_cfg, }, { }, }; -- 2.34.1