From patchwork Wed Nov 22 10:55:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13464596 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 C93CBC61D9B for ; Wed, 22 Nov 2023 10:56:06 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4Ee4ac+MSTGyMjhmmQDnHU8owBxezTcQBLHYdsbYqW8=; b=HBN75PJMX6QOW2 N8WUV36joFpWkmiy9bSf5rjeXWXYcxKZM0dknOepPc2Aa4Zh45xSEIRSzkqXGBGrQOc9A12067wss VunysoVa44EaPs599O+VorTzrzrD8gh0cr3i0YRdJ/OoBmf3MJFxFDanDjkY7b98/E2TjSaBcF6VO v3w01VQfoeWrJLdKsQkBE8v5HSGYYVnvG01TjDiTNbQDo7fYHTvVzE+KO4Ii5RiAL/2MlrA2orRXt 8DiJHPUEvj0jS2RamJdVJ+4Nbpfj+Fs/CNgobnMw/BQiY/s0j4a954Db6PAcINRzEgS6KzHY5pMoT MkZRwnw+Xuw70yK+PU6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5ktq-001UcT-1m; Wed, 22 Nov 2023 10:56:06 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5ktm-001Uau-1s for linux-phy@lists.infradead.org; Wed, 22 Nov 2023 10:56:03 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a0064353af8so142236966b.0 for ; Wed, 22 Nov 2023 02:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700650560; x=1701255360; darn=lists.infradead.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=AR9DGP+JQhiURa6YNx5zsQUGn7vxejxt9rphdfb6FU8=; b=ZfZKTTvdzkD3rMS9eIdbjOrWmYjq0UDlLD6cQqJ7LSFY4uX/OQ/wdQwWodbQvwQRBJ xUNkyAYdBW+WBJjlIYxTAzWmQus9EhZRSxIsFmtgskdA2/kiC9D0RD8lwHOvsKwhs6GD r1FUMnwlDJBy5sYU59IrwQ2JadnjNd6/BYh3AYT38ZSn8AEppILt9kyWFh8L4+MZEPsw b4rGugonp0XSZWwBLT+2QJ5hStbPueMqXzlHDbJc6Qn0+Fk/RwXIqe6PcdODM341KXNj c4fkR3hbPjS0l0oJ+vhjJ6z+BeupdJu8fo7Vbkdkrzmh7Ogi140dL0eUjVToSRtI0PsS fVUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700650560; x=1701255360; 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=AR9DGP+JQhiURa6YNx5zsQUGn7vxejxt9rphdfb6FU8=; b=AYOzq6+646DvVhOOU1PutZJ6Telu3P98XtSibr1w6gm0I2KGQIYxmTsUY0ZbjtqAun lD6C3kIiDevbW9/qRXQtq1+FBLub97s9t7s6ssbjtlDDI6WGtumRYau2Hzr+3Lc3XCRM s1iWLwuRLrf6vTlLPVJ6pkigeptqkze5hQvLhpVdgliU0l0pVVRhTdJqjGKqiycYVDeC 2REifpf6Sqm1k4vKDA20cPxZ+f6xfZfARupgAz7XDpr3Fwkg0zOZQfqlfocskJdsdIxv VSWq5I64KoEqLU1wL4hKGAumB43WKl8snQXDCMN4yg9bYdR2AcjTb3Xu177eokSR0oZ7 t33g== X-Gm-Message-State: AOJu0YxeKXewVMsYMrEg6iLMe6Znp9uZz4YG+HNHCoZYi3zXEqWdVNhs xzxWPpXmzTMec6RAh1au/rSnojh1XqstIn8IhHw= X-Google-Smtp-Source: AGHT+IGpQSUEpRgFT+zeuN4EN0klhOh19aiZ62ImloREVKOoIKKapIpDoBnxp/k4d9cWnYmHR0/Fcg== X-Received: by 2002:a17:906:da01:b0:9a9:f042:deb9 with SMTP id fi1-20020a170906da0100b009a9f042deb9mr1620474ejb.19.1700650560453; Wed, 22 Nov 2023 02:56:00 -0800 (PST) Received: from [127.0.1.1] ([86.123.99.122]) by smtp.gmail.com with ESMTPSA id mf3-20020a170906cb8300b009f28db2b702sm6423557ejb.209.2023.11.22.02.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 02:56:00 -0800 (PST) From: Abel Vesa Date: Wed, 22 Nov 2023 12:55:48 +0200 Subject: [PATCH 1/2] dt-bindings: phy: qcom-edp: Add X1E80100 PHY compatibles MIME-Version: 1.0 Message-Id: <20231122-phy-qualcomm-edp-x1e80100-v1-1-a9938990edb3@linaro.org> References: <20231122-phy-qualcomm-edp-x1e80100-v1-0-a9938990edb3@linaro.org> In-Reply-To: <20231122-phy-qualcomm-edp-x1e80100-v1-0-a9938990edb3@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Abhinav Kumar Cc: 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.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=766; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=47x4DceRm3tCQ84A+H24YQKTKXLsUy4vs1DvIZFUxYo=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBlXd47jtfoUWWWq1bSqU5Il/tnuIoOdQpW46XIB ejEpLcuctSJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZV3eOwAKCRAbX0TJAJUV VjfFEACOweqBEkv+85EBXxiL/6SI2rTG89ykNUyuIxr/hAg7E8yEfgJQNU+DFBDZrbP4NsbgRQr GDwgrFa3N2TkZSq/XJxsZ535oofKqv30jeGqLGEDd4lEctQKR58ey0OUBreHNxm4imBIgOo1O4P PIAzNgkhwTvbIKTcWzxKaolAwctveJRGAW9ivxIP2I6aOv7AqPnKDzqa+7X+69t2A9dLn5xHKGs LEKTHQJi593z5YY/aPOirGjuoUH+Cb+/ScS/iDfdIPz7756NWP+4RvZFK5D7veybgrf3x9WurMx jbKQLGPL4Jm2Iu8/lGQfc/8eapOXzt5t0FEJdFhr6r9Ct4wuGxv5SC07F6hXgXlSb0Q984DgEA4 sbQzAPWVycUoG/bpnSmwE1m/aJ5WpiAhLjoNvvE9zO+Hzcr5dXCe+WpuXiS0cZaaebwBN7xYKAq Er7BFU+IsuEe1BVm32KNZ2IEgf0SwcB8Qy7CqP7UwNZ86bDZTr5LKkaR1OJyDuR2ntNhX4sezlu 7iQy3zr6NKkvhH+BGZlDsOD2PJnAM4yeDSSJobyeBY+/T9C34/oyNrHz5O26fL61bfKQ7DA5aSm Hvnyc74+Yl+E2eCrL5Ai6uXx5GZrdTGcavIRaznNSNXZgbrYvknQxoz6sw+5LbXV6KgZMuCdcss Yfc2gvdMo9RqZ9g== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231122_025602_615034_6D7B1BD6 X-CRM114-Status: UNSURE ( 7.81 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The Qualcomm X1E80100 platform has both eDP and DP PHYs, add compatibles for these. Signed-off-by: Abel Vesa Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml index 6566353f1a02..190f61c1d0f9 100644 --- a/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,edp-phy.yaml @@ -21,6 +21,8 @@ properties: - qcom,sc8180x-edp-phy - qcom,sc8280xp-dp-phy - qcom,sc8280xp-edp-phy + - qcom,x1e80100-dp-phy + - qcom,x1e80100-edp-phy reg: items: From patchwork Wed Nov 22 10:55:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13464597 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 21875C61D9C for ; Wed, 22 Nov 2023 10:56:08 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SiGrKJXEGBVpuFy+4WGduD5Mw0LxVC0X2wLRGdTuR3w=; b=qEqV85aixvHeLF 9gr5XILtaWGPrsEd0TQYQfAKYeXSE9RV8luEH2cz0qDVTuWJL5jZn2gjwov9R2Tim3cUHrOMbdul/ Eqs3htyEBU/GdvVmL8ja/FfdCWlD0cnQh4AhjOggY3GcVYXOle7+1Eum6+HMtAfZCgcwMIqOTg7cu 3zVy9RSwWElpWHltXompltu5Zoq4dvtJTeqFoGz6TW3sA5v6k/n9w/66212FrOFgYm84pzwbhuOhO iQsBE1WyrgwDkiEPVkLL4HjZ9S9IPG11aOwFV8KZ3Tou5UqWpd+ge3geEz/DcG++mOgHd02pDo6h4 N0UTB5NXqVKmebG7sjDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5ktr-001Ucx-2o; Wed, 22 Nov 2023 10:56:07 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5kto-001Ub7-0f for linux-phy@lists.infradead.org; Wed, 22 Nov 2023 10:56:06 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9fd0059a967so139032466b.1 for ; Wed, 22 Nov 2023 02:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700650562; x=1701255362; darn=lists.infradead.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=l8v79Ra7yNmy/zYFfkwbdCIxwjcgjrpT8Dlidgl8zj0=; b=TeqHGZIK7Icqh92BlyGJCOyrpfE9L37MMAtKOKcV2lDLvh4TXd8nfHjpquRqLbABJp YPuvcuBpfl0n/4tn8OyVBhSNVJH1ySHfkxKZZ15YevHIcMB++RrqdzYjXiU/nRktIOGO vhpe0Apq4/SNICtUGqGd8XDrSx0qYPj69PmUk0q5aA7o6vj/+jELhpUOADJaAY73xHzP EzFtj3S8EeDqmSTQOY+5AXb2fCcqU0WaX3XTY6oeGwN/sPzH04l+vNmxbT8gMdvf+X07 1nwc6dtqKQ4YGgpUHQ/rJ9CNhXNnc4UWv+v0MCWX0ixcxtsqeAzPGRqY3YVsppZvRBVJ VxTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700650562; x=1701255362; 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=l8v79Ra7yNmy/zYFfkwbdCIxwjcgjrpT8Dlidgl8zj0=; b=m6ZM2NEEV2UzQ1OetvBYzG6wzbP5Q4Tdc08DFaFqR0GPnclBksaT+XL4j0rjXcL8/m EZQy2j+PwuMRv8MU96mKLWTV+jSzuaxC0qGudH+W4dche//klXYWlaNxJZrZfxirQ/yG GEh821L6zSzQjOdTaj/eCewEPm1ENqrNe3yq13r3IQfCGpoIroAijQk95J/3tB+BRLUR vu4D5UFzNwAwnXJex+EmsYDF3vZov0H+lhwDp2y4KA6QC4LOKHo6q9XJta8NzM6BWmcJ EjlvFpuEUyZYH+Rw7qm194+VS67t2JKRG30ZEYg08pz3oH6klzbPEwGfxrBB6uSzQKta JGvw== X-Gm-Message-State: AOJu0Yzt3knOX0xUDphe81SnnlOkTzBNYCeYlldIojkOAlMtVvc9cSR4 d+GdW75wXNiCZB2U1rG13lGLdA== X-Google-Smtp-Source: AGHT+IH/sPOmWIUic5UgiinTGkozW9ZSszQrI0Cw0BWB9rKtzpSRBnMVe3cR+88uU///kG4NC8Nrjg== X-Received: by 2002:a17:906:28d:b0:9ae:659f:4d2f with SMTP id 13-20020a170906028d00b009ae659f4d2fmr1385228ejf.26.1700650561969; Wed, 22 Nov 2023 02:56:01 -0800 (PST) Received: from [127.0.1.1] ([86.123.99.122]) by smtp.gmail.com with ESMTPSA id mf3-20020a170906cb8300b009f28db2b702sm6423557ejb.209.2023.11.22.02.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 02:56:01 -0800 (PST) From: Abel Vesa Date: Wed, 22 Nov 2023 12:55:49 +0200 Subject: [PATCH 2/2] phy: qcom: edp: Add X1E80100 eDP and DP PHYs MIME-Version: 1.0 Message-Id: <20231122-phy-qualcomm-edp-x1e80100-v1-2-a9938990edb3@linaro.org> References: <20231122-phy-qualcomm-edp-x1e80100-v1-0-a9938990edb3@linaro.org> In-Reply-To: <20231122-phy-qualcomm-edp-x1e80100-v1-0-a9938990edb3@linaro.org> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Abhinav Kumar Cc: 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.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=18444; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=4YKbDtZQj3SgbS35Bun/mHMEGFn9U/6lt6EhrBBnQXc=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBlXd48t8DQXYXx9bRMWIiawcBiZKo4U4qtXSRiv FEoHgidtaOJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZV3ePAAKCRAbX0TJAJUV VoeGD/48JqTTxvCjYqRYnioUvjxe4YZc1T3PaPeRy2RRgzUOdsV1JyvEan6EfUUBtPon4LBo1Bn 3pDlxAOm2ERngGBILoi/CsBtj7qVo1XcUVJ4nCZHIq80XnFnYUXo1hG8O6hp/7HdL7zxEcvth7S 9gmu/rKwsMJp0BIT4kGjHPhzZB7kluEOYNWxBs+IbOnRkdvz0flGc/KeqGPTRxUjjWW4WDpDaDZ PxSbz6uAz6fS3do+bThsDvrs76rEKiiPeAPMdURFuFHz21k/0JgKT/s+h2BeDDRrSLv3WPGazep gefT96VCjvetR+YgHWyf2epWIW4XSMuOCyUojjrCAoWa9IcWT72wbznLZkAF5HRrOHyNOH/JS2v cPHZUEg/6Uv5tGKIKa5ZK4Mx5lrfFQV5rnCKLnU+lkA2MjmdhSVUOC/rh2ZDp4gMPbpg6GJRdBN CHlBG/qKaOEf8Lu2QSFYm1PAjk+vYtaCQY7kfXkr3cCV6Xe1dt4UDrD1WLr08fqHw0HA44qAIvT GD/RuaLJwwoWV3jlJ/EnCXkRJp5NYffLHKkU/TH6Qh0cIBuiZsGYw4xa1ar3kNB9zr3+AE5nvbS TinSm565e4DmZiTiWHZ06ez3tVGKGoNbtGFEQvxwT18LNXF7shV+NIQW4ZNwWUP8JXdfH09+hJN jz+/LWunEe9VcwA== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231122_025604_249912_46C6C087 X-CRM114-Status: GOOD ( 15.36 ) 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The Qualcomm X1E80100 platform has a number of eDP and DP PHY instances, add support for these. Co-developed-by: Abhinav Kumar Signed-off-by: Abhinav Kumar Signed-off-by: Abel Vesa --- drivers/phy/qualcomm/phy-qcom-edp.c | 305 +++++++++++++++++++++++++++--------- 1 file changed, 231 insertions(+), 74 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c index 8e5078304646..9eca9a8f8824 100644 --- a/drivers/phy/qualcomm/phy-qcom-edp.c +++ b/drivers/phy/qualcomm/phy-qcom-edp.c @@ -23,6 +23,9 @@ #include "phy-qcom-qmp.h" +#define QSERDES_V4 0 +#define QSERDES_V6 1 + /* EDP_PHY registers */ #define DP_PHY_CFG 0x0010 #define DP_PHY_CFG_1 0x0014 @@ -70,6 +73,7 @@ struct qcom_edp_cfg { bool is_dp; + int qserdes_version; /* DP PHY swing and pre_emphasis tables */ const u8 (*swing_hbr_rbr)[4][4]; @@ -94,7 +98,7 @@ struct qcom_edp { struct phy_configure_opts_dp dp_opts; - struct clk_bulk_data clks[2]; + struct clk_bulk_data clks[3]; struct regulator_bulk_data supplies[2]; }; @@ -126,8 +130,18 @@ static const u8 dp_pre_emp_hbr2_hbr3[4][4] = { { 0x04, 0xff, 0xff, 0xff } }; -static const struct qcom_edp_cfg dp_phy_cfg = { +static const struct qcom_edp_cfg dp_v4_phy_cfg = { .is_dp = true, + .qserdes_version = QSERDES_V4, + .swing_hbr_rbr = &dp_swing_hbr_rbr, + .swing_hbr3_hbr2 = &dp_swing_hbr2_hbr3, + .pre_emphasis_hbr_rbr = &dp_pre_emp_hbr_rbr, + .pre_emphasis_hbr3_hbr2 = &dp_pre_emp_hbr2_hbr3, +}; + +static const struct qcom_edp_cfg dp_v6_phy_cfg = { + .is_dp = true, + .qserdes_version = QSERDES_V6, .swing_hbr_rbr = &dp_swing_hbr_rbr, .swing_hbr3_hbr2 = &dp_swing_hbr2_hbr3, .pre_emphasis_hbr_rbr = &dp_pre_emp_hbr_rbr, @@ -162,8 +176,18 @@ static const u8 edp_pre_emp_hbr2_hbr3[4][4] = { { 0x00, 0xff, 0xff, 0xff } }; -static const struct qcom_edp_cfg edp_phy_cfg = { +static const struct qcom_edp_cfg edp_v4_phy_cfg = { + .is_dp = false, + .qserdes_version = QSERDES_V4, + .swing_hbr_rbr = &edp_swing_hbr_rbr, + .swing_hbr3_hbr2 = &edp_swing_hbr2_hbr3, + .pre_emphasis_hbr_rbr = &edp_pre_emp_hbr_rbr, + .pre_emphasis_hbr3_hbr2 = &edp_pre_emp_hbr2_hbr3, +}; + +static const struct qcom_edp_cfg edp_v6_phy_cfg = { .is_dp = false, + .qserdes_version = QSERDES_V6, .swing_hbr_rbr = &edp_swing_hbr_rbr, .swing_hbr3_hbr2 = &edp_swing_hbr2_hbr3, .pre_emphasis_hbr_rbr = &edp_pre_emp_hbr_rbr, @@ -190,7 +214,10 @@ static int qcom_edp_phy_init(struct phy *phy) edp->edp + DP_PHY_PD_CTL); /* Turn on BIAS current for PHY/PLL */ - writel(0x17, edp->pll + QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN); + if (cfg->qserdes_version == QSERDES_V4) + writel(0x17, edp->pll + QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN); + else if (cfg->qserdes_version == QSERDES_V6) + writel(0x1f, edp->pll + QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN); writel(DP_PHY_PD_CTL_PSR_PWRDN, edp->edp + DP_PHY_PD_CTL); msleep(20); @@ -205,6 +232,8 @@ static int qcom_edp_phy_init(struct phy *phy) else cfg8 = 0x37; + cfg8 = 0x37; + writel(0xfc, edp->edp + DP_PHY_MODE); writel(0x00, edp->edp + DP_PHY_AUX_CFG0); @@ -261,7 +290,10 @@ static int qcom_edp_set_voltages(struct qcom_edp *edp, const struct phy_configur if (swing == 0xff || emph == 0xff) return -EINVAL; - ldo_config = (cfg && cfg->is_dp) ? 0x1 : 0x0; + if (cfg->qserdes_version == QSERDES_V4) + ldo_config = (cfg && cfg->is_dp) ? 0x1 : 0x0; + else if (cfg->qserdes_version == QSERDES_V6) + ldo_config |= 0x91; writel(ldo_config, edp->tx0 + TXn_LDO_CONFIG); writel(swing, edp->tx0 + TXn_TX_DRV_LVL); @@ -291,6 +323,7 @@ static int qcom_edp_phy_configure(struct phy *phy, union phy_configure_opts *opt static int qcom_edp_configure_ssc(const struct qcom_edp *edp) { const struct phy_configure_opts_dp *dp_opts = &edp->dp_opts; + const struct qcom_edp_cfg *cfg = edp->cfg; u32 step1; u32 step2; @@ -298,13 +331,24 @@ static int qcom_edp_configure_ssc(const struct qcom_edp *edp) case 1620: case 2700: case 8100: - step1 = 0x45; - step2 = 0x06; + if (cfg->qserdes_version == QSERDES_V4) { + step1 = 0x45; + step2 = 0x06; + } else if (cfg->qserdes_version == QSERDES_V6) { + step1 = 0x92; + step2 = 0x01; + } break; case 5400: - step1 = 0x5c; - step2 = 0x08; + if (cfg->qserdes_version == QSERDES_V4) { + step1 = 0x5c; + step2 = 0x08; + } else if (cfg->qserdes_version == QSERDES_V6) { + step1 = 0x18; + step2 = 0x02; + } + break; default: @@ -312,12 +356,21 @@ static int qcom_edp_configure_ssc(const struct qcom_edp *edp) return -EINVAL; } - writel(0x01, edp->pll + QSERDES_V4_COM_SSC_EN_CENTER); - writel(0x00, edp->pll + QSERDES_V4_COM_SSC_ADJ_PER1); - writel(0x36, edp->pll + QSERDES_V4_COM_SSC_PER1); - writel(0x01, edp->pll + QSERDES_V4_COM_SSC_PER2); - writel(step1, edp->pll + QSERDES_V4_COM_SSC_STEP_SIZE1_MODE0); - writel(step2, edp->pll + QSERDES_V4_COM_SSC_STEP_SIZE2_MODE0); + if (cfg->qserdes_version == QSERDES_V4) { + writel(0x01, edp->pll + QSERDES_V4_COM_SSC_EN_CENTER); + writel(0x00, edp->pll + QSERDES_V4_COM_SSC_ADJ_PER1); + writel(0x36, edp->pll + QSERDES_V4_COM_SSC_PER1); + writel(0x01, edp->pll + QSERDES_V4_COM_SSC_PER2); + writel(step1, edp->pll + QSERDES_V4_COM_SSC_STEP_SIZE1_MODE0); + writel(step2, edp->pll + QSERDES_V4_COM_SSC_STEP_SIZE2_MODE0); + } else if (cfg->qserdes_version == QSERDES_V6) { + writel(0x01, edp->pll + QSERDES_V6_COM_SSC_EN_CENTER); + writel(0x00, edp->pll + QSERDES_V6_COM_SSC_ADJ_PER1); + writel(0x6b, edp->pll + QSERDES_V6_COM_SSC_PER1); + writel(0x02, edp->pll + QSERDES_V6_COM_SSC_PER2); + writel(step1, edp->pll + QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0); + writel(step2, edp->pll + QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0); + } return 0; } @@ -325,48 +378,99 @@ static int qcom_edp_configure_ssc(const struct qcom_edp *edp) static int qcom_edp_configure_pll(const struct qcom_edp *edp) { const struct phy_configure_opts_dp *dp_opts = &edp->dp_opts; + const struct qcom_edp_cfg *cfg = edp->cfg; u32 div_frac_start2_mode0; u32 div_frac_start3_mode0; u32 dec_start_mode0; u32 lock_cmp1_mode0; u32 lock_cmp2_mode0; + u32 code1_mode0; + u32 code2_mode0; u32 hsclk_sel; switch (dp_opts->link_rate) { case 1620: hsclk_sel = 0x5; - dec_start_mode0 = 0x69; - div_frac_start2_mode0 = 0x80; - div_frac_start3_mode0 = 0x07; - lock_cmp1_mode0 = 0x6f; - lock_cmp2_mode0 = 0x08; + + if (cfg->qserdes_version == QSERDES_V4) { + dec_start_mode0 = 0x69; + div_frac_start2_mode0 = 0x80; + div_frac_start3_mode0 = 0x07; + lock_cmp1_mode0 = 0x6f; + lock_cmp2_mode0 = 0x08; + } else if (cfg->qserdes_version == QSERDES_V6) { + dec_start_mode0 = 0x34; + div_frac_start2_mode0 = 0xc0; + div_frac_start3_mode0 = 0x0b; + lock_cmp1_mode0 = 0x37; + lock_cmp2_mode0 = 0x04; + code1_mode0 = 0x71; + code2_mode0 = 0x0C; + } + break; case 2700: hsclk_sel = 0x3; - dec_start_mode0 = 0x69; - div_frac_start2_mode0 = 0x80; - div_frac_start3_mode0 = 0x07; - lock_cmp1_mode0 = 0x0f; - lock_cmp2_mode0 = 0x0e; + + if (cfg->qserdes_version == QSERDES_V4) { + dec_start_mode0 = 0x69; + div_frac_start2_mode0 = 0x80; + div_frac_start3_mode0 = 0x07; + lock_cmp1_mode0 = 0x0f; + lock_cmp2_mode0 = 0x0e; + } else if (cfg->qserdes_version == QSERDES_V6) { + dec_start_mode0 = 0x34; + div_frac_start2_mode0 = 0xc0; + div_frac_start3_mode0 = 0x0b; + lock_cmp1_mode0 = 0x07; + lock_cmp2_mode0 = 0x07; + code1_mode0 = 0x71; + code2_mode0 = 0x0C; + } + break; case 5400: hsclk_sel = 0x1; - dec_start_mode0 = 0x8c; - div_frac_start2_mode0 = 0x00; - div_frac_start3_mode0 = 0x0a; - lock_cmp1_mode0 = 0x1f; - lock_cmp2_mode0 = 0x1c; + + if (cfg->qserdes_version == QSERDES_V4) { + dec_start_mode0 = 0x8c; + div_frac_start2_mode0 = 0x00; + div_frac_start3_mode0 = 0x0a; + lock_cmp1_mode0 = 0x1f; + lock_cmp2_mode0 = 0x1c; + } else if (cfg->qserdes_version == QSERDES_V6) { + dec_start_mode0 = 0x46; + div_frac_start2_mode0 = 0x00; + div_frac_start3_mode0 = 0x05; + lock_cmp1_mode0 = 0x0f; + lock_cmp2_mode0 = 0x0e; + code1_mode0 = 0x97; + code2_mode0 = 0x10; + } + break; case 8100: hsclk_sel = 0x0; - dec_start_mode0 = 0x69; - div_frac_start2_mode0 = 0x80; - div_frac_start3_mode0 = 0x07; - lock_cmp1_mode0 = 0x2f; - lock_cmp2_mode0 = 0x2a; + + if (cfg->qserdes_version == QSERDES_V4) { + dec_start_mode0 = 0x69; + div_frac_start2_mode0 = 0x80; + div_frac_start3_mode0 = 0x07; + lock_cmp1_mode0 = 0x2f; + lock_cmp2_mode0 = 0x2a; + } else if (cfg->qserdes_version == QSERDES_V6) { + dec_start_mode0 = 0x34; + div_frac_start2_mode0 = 0xc0; + div_frac_start3_mode0 = 0x0b; + lock_cmp1_mode0 = 0x17; + lock_cmp2_mode0 = 0x15; + code1_mode0 = 0x71; + code2_mode0 = 0x0C; + } + break; default: @@ -374,36 +478,70 @@ static int qcom_edp_configure_pll(const struct qcom_edp *edp) return -EINVAL; } - writel(0x01, edp->pll + QSERDES_V4_COM_SVS_MODE_CLK_SEL); - writel(0x0b, edp->pll + QSERDES_V4_COM_SYSCLK_EN_SEL); - writel(0x02, edp->pll + QSERDES_V4_COM_SYS_CLK_CTRL); - writel(0x0c, edp->pll + QSERDES_V4_COM_CLK_ENABLE1); - writel(0x06, edp->pll + QSERDES_V4_COM_SYSCLK_BUF_ENABLE); - writel(0x30, edp->pll + QSERDES_V4_COM_CLK_SELECT); - writel(hsclk_sel, edp->pll + QSERDES_V4_COM_HSCLK_SEL); - writel(0x0f, edp->pll + QSERDES_V4_COM_PLL_IVCO); - writel(0x08, edp->pll + QSERDES_V4_COM_LOCK_CMP_EN); - writel(0x36, edp->pll + QSERDES_V4_COM_PLL_CCTRL_MODE0); - writel(0x16, edp->pll + QSERDES_V4_COM_PLL_RCTRL_MODE0); - writel(0x06, edp->pll + QSERDES_V4_COM_CP_CTRL_MODE0); - writel(dec_start_mode0, edp->pll + QSERDES_V4_COM_DEC_START_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_DIV_FRAC_START1_MODE0); - writel(div_frac_start2_mode0, edp->pll + QSERDES_V4_COM_DIV_FRAC_START2_MODE0); - writel(div_frac_start3_mode0, edp->pll + QSERDES_V4_COM_DIV_FRAC_START3_MODE0); - writel(0x02, edp->pll + QSERDES_V4_COM_CMN_CONFIG); - writel(0x3f, edp->pll + QSERDES_V4_COM_INTEGLOOP_GAIN0_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_INTEGLOOP_GAIN1_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_VCO_TUNE_MAP); - writel(lock_cmp1_mode0, edp->pll + QSERDES_V4_COM_LOCK_CMP1_MODE0); - writel(lock_cmp2_mode0, edp->pll + QSERDES_V4_COM_LOCK_CMP2_MODE0); - - writel(0x0a, edp->pll + QSERDES_V4_COM_BG_TIMER); - writel(0x14, edp->pll + QSERDES_V4_COM_CORECLK_DIV_MODE0); - writel(0x00, edp->pll + QSERDES_V4_COM_VCO_TUNE_CTRL); - writel(0x17, edp->pll + QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN); - writel(0x0f, edp->pll + QSERDES_V4_COM_CORE_CLK_EN); - writel(0xa0, edp->pll + QSERDES_V4_COM_VCO_TUNE1_MODE0); - writel(0x03, edp->pll + QSERDES_V4_COM_VCO_TUNE2_MODE0); + if (cfg->qserdes_version == QSERDES_V4) { + writel(0x01, edp->pll + QSERDES_V4_COM_SVS_MODE_CLK_SEL); + writel(0x0b, edp->pll + QSERDES_V4_COM_SYSCLK_EN_SEL); + writel(0x02, edp->pll + QSERDES_V4_COM_SYS_CLK_CTRL); + writel(0x0c, edp->pll + QSERDES_V4_COM_CLK_ENABLE1); + writel(0x06, edp->pll + QSERDES_V4_COM_SYSCLK_BUF_ENABLE); + writel(0x30, edp->pll + QSERDES_V4_COM_CLK_SELECT); + writel(hsclk_sel, edp->pll + QSERDES_V4_COM_HSCLK_SEL); + writel(0x0f, edp->pll + QSERDES_V4_COM_PLL_IVCO); + writel(0x08, edp->pll + QSERDES_V4_COM_LOCK_CMP_EN); + writel(0x36, edp->pll + QSERDES_V4_COM_PLL_CCTRL_MODE0); + writel(0x16, edp->pll + QSERDES_V4_COM_PLL_RCTRL_MODE0); + writel(0x06, edp->pll + QSERDES_V4_COM_CP_CTRL_MODE0); + writel(dec_start_mode0, edp->pll + QSERDES_V4_COM_DEC_START_MODE0); + writel(0x00, edp->pll + QSERDES_V4_COM_DIV_FRAC_START1_MODE0); + writel(div_frac_start2_mode0, edp->pll + QSERDES_V4_COM_DIV_FRAC_START2_MODE0); + writel(div_frac_start3_mode0, edp->pll + QSERDES_V4_COM_DIV_FRAC_START3_MODE0); + writel(0x02, edp->pll + QSERDES_V4_COM_CMN_CONFIG); + writel(0x3f, edp->pll + QSERDES_V4_COM_INTEGLOOP_GAIN0_MODE0); + writel(0x00, edp->pll + QSERDES_V4_COM_INTEGLOOP_GAIN1_MODE0); + writel(0x00, edp->pll + QSERDES_V4_COM_VCO_TUNE_MAP); + writel(lock_cmp1_mode0, edp->pll + QSERDES_V4_COM_LOCK_CMP1_MODE0); + writel(lock_cmp2_mode0, edp->pll + QSERDES_V4_COM_LOCK_CMP2_MODE0); + + writel(0x0a, edp->pll + QSERDES_V4_COM_BG_TIMER); + writel(0x14, edp->pll + QSERDES_V4_COM_CORECLK_DIV_MODE0); + writel(0x00, edp->pll + QSERDES_V4_COM_VCO_TUNE_CTRL); + writel(0x17, edp->pll + QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN); + writel(0x0f, edp->pll + QSERDES_V4_COM_CORE_CLK_EN); + writel(0xa0, edp->pll + QSERDES_V4_COM_VCO_TUNE1_MODE0); + writel(0x03, edp->pll + QSERDES_V4_COM_VCO_TUNE2_MODE0); + } else if (cfg->qserdes_version == QSERDES_V6) { + writel(0x01, edp->pll + QSERDES_V6_COM_SVS_MODE_CLK_SEL); + writel(0x0b, edp->pll + QSERDES_V6_COM_SYSCLK_EN_SEL); + writel(0x02, edp->pll + QSERDES_V6_COM_SYS_CLK_CTRL); + writel(0x0c, edp->pll + QSERDES_V6_COM_CLK_ENABLE1); + writel(0x06, edp->pll + QSERDES_V6_COM_SYSCLK_BUF_ENABLE); + writel(0x30, edp->pll + QSERDES_V6_COM_CLK_SELECT); + writel(hsclk_sel, edp->pll + QSERDES_V6_COM_HSCLK_SEL_1); + writel(0x07, edp->pll + QSERDES_V6_COM_PLL_IVCO); + writel(0x08, edp->pll + QSERDES_V6_COM_LOCK_CMP_EN); + writel(0x36, edp->pll + QSERDES_V6_COM_PLL_CCTRL_MODE0); + writel(0x16, edp->pll + QSERDES_V6_COM_PLL_RCTRL_MODE0); + writel(0x6, edp->pll + QSERDES_V6_COM_CP_CTRL_MODE0); + writel(dec_start_mode0, edp->pll + QSERDES_V6_COM_DEC_START_MODE0); + writel(0x00, edp->pll + QSERDES_V6_COM_DIV_FRAC_START1_MODE0); + writel(div_frac_start2_mode0, edp->pll + QSERDES_V6_COM_DIV_FRAC_START2_MODE0); + writel(div_frac_start3_mode0, edp->pll + QSERDES_V6_COM_DIV_FRAC_START3_MODE0); + writel(0x12, edp->pll + QSERDES_V6_COM_CMN_CONFIG_1); + writel(0x3f, edp->pll + QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE0); + writel(0x00, edp->pll + QSERDES_V6_COM_INTEGLOOP_GAIN1_MODE0); + writel(0x00, edp->pll + QSERDES_V6_COM_VCO_TUNE_MAP); + writel(lock_cmp1_mode0, edp->pll + QSERDES_V6_COM_LOCK_CMP1_MODE0); + writel(lock_cmp2_mode0, edp->pll + QSERDES_V6_COM_LOCK_CMP2_MODE0); + + writel(0x0a, edp->pll + QSERDES_V6_COM_BG_TIMER); + writel(0x14, edp->pll + QSERDES_V6_COM_PLL_CORE_CLK_DIV_MODE0); + writel(0x00, edp->pll + QSERDES_V6_COM_VCO_TUNE_CTRL); + writel(0x17, edp->pll + QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN); + writel(0x0f, edp->pll + QSERDES_V6_COM_CORE_CLK_EN); + + writel(code1_mode0, edp->pll + QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE0); + writel(code2_mode0, edp->pll + QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE2_MODE0); + } return 0; } @@ -462,13 +600,21 @@ static int qcom_edp_phy_power_on(struct phy *phy) edp->edp + DP_PHY_PD_CTL); writel(0xfc, edp->edp + DP_PHY_MODE); - timeout = readl_poll_timeout(edp->pll + QSERDES_V4_COM_CMN_STATUS, - val, val & BIT(7), 5, 200); + if (cfg->qserdes_version == QSERDES_V4) { + timeout = readl_poll_timeout(edp->pll + QSERDES_V4_COM_CMN_STATUS, + val, val & BIT(7), 5, 200); + } else if (cfg->qserdes_version == QSERDES_V6) { + timeout = readl_poll_timeout(edp->pll + QSERDES_V6_COM_CMN_STATUS, + val, val & BIT(7), 5, 200); + } if (timeout) return timeout; - ldo_config = (cfg && cfg->is_dp) ? 0x1 : 0x0; + if (cfg->qserdes_version == QSERDES_V4) + ldo_config = (cfg && cfg->is_dp) ? 0x1 : 0x0; + else if (cfg->qserdes_version == QSERDES_V6) + ldo_config |= 0x91; writel(ldo_config, edp->tx0 + TXn_LDO_CONFIG); writel(ldo_config, edp->tx1 + TXn_LDO_CONFIG); @@ -512,10 +658,18 @@ static int qcom_edp_phy_power_on(struct phy *phy) writel(0x01, edp->edp + DP_PHY_CFG); writel(0x09, edp->edp + DP_PHY_CFG); - writel(0x20, edp->pll + QSERDES_V4_COM_RESETSM_CNTRL); + if (cfg->qserdes_version == QSERDES_V4) { + writel(0x20, edp->pll + QSERDES_V4_COM_RESETSM_CNTRL); + + timeout = readl_poll_timeout(edp->pll + QSERDES_V4_COM_C_READY_STATUS, + val, val & BIT(0), 500, 10000); + } else if (cfg->qserdes_version == QSERDES_V6) { + writel(0x20, edp->pll + QSERDES_V6_COM_RESETSM_CNTRL); + + timeout = readl_poll_timeout(edp->pll + QSERDES_V6_COM_C_READY_STATUS, + val, val & BIT(0), 500, 10000); + } - timeout = readl_poll_timeout(edp->pll + QSERDES_V4_COM_C_READY_STATUS, - val, val & BIT(0), 500, 10000); if (timeout) return timeout; @@ -744,7 +898,6 @@ static int qcom_edp_clks_register(struct qcom_edp *edp, struct device_node *np) data = devm_kzalloc(edp->dev, struct_size(data, hws, 2), GFP_KERNEL); if (!data) return -ENOMEM; - data->num = 2; snprintf(name, sizeof(name), "%s::link_clk", dev_name(edp->dev)); init.ops = &qcom_edp_dp_link_clk_ops; @@ -764,6 +917,7 @@ static int qcom_edp_clks_register(struct qcom_edp *edp, struct device_node *np) data->hws[0] = &edp->dp_link_hw; data->hws[1] = &edp->dp_pixel_hw; + data->num = 2; return devm_of_clk_add_hw_provider(edp->dev, of_clk_hw_onecell_get, data); } @@ -806,6 +960,7 @@ static int qcom_edp_phy_probe(struct platform_device *pdev) edp->supplies[0].supply = "vdda-phy"; edp->supplies[1].supply = "vdda-pll"; + edp->clks[2].id = "tcsr"; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(edp->supplies), edp->supplies); if (ret) return ret; @@ -841,8 +996,10 @@ static int qcom_edp_phy_probe(struct platform_device *pdev) static const struct of_device_id qcom_edp_phy_match_table[] = { { .compatible = "qcom,sc7280-edp-phy" }, { .compatible = "qcom,sc8180x-edp-phy" }, - { .compatible = "qcom,sc8280xp-dp-phy", .data = &dp_phy_cfg }, - { .compatible = "qcom,sc8280xp-edp-phy", .data = &edp_phy_cfg }, + { .compatible = "qcom,sc8280xp-dp-phy", .data = &dp_v4_phy_cfg }, + { .compatible = "qcom,sc8280xp-edp-phy", .data = &edp_v4_phy_cfg }, + { .compatible = "qcom,x1e80100-dp-phy", .data = &dp_v6_phy_cfg }, + { .compatible = "qcom,x1e80100-edp-phy", .data = &edp_v6_phy_cfg }, { } }; MODULE_DEVICE_TABLE(of, qcom_edp_phy_match_table);