From mboxrd@z Thu Jan 1 00:00:00 1970 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 84DE6C44501 for ; Mon, 29 Jun 2026 11:29:26 +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=Up/133f23Nw2LsqGM/vTOvaapnzb8Qd4aJWnMODGgeU=; b=AoLsV8KHvp5VRj CnTFhMyFPsBvzlWcUPm7IqVpMg6gaT0LGCX0bXJd9gIS+mtUd/yVuqeRoBBmEq/Anc7p2EnpsD/Cr OK8y5R2KAe4Zq/7QLp20tmW5ESWoWPXQPHpLEEu9GmjGqxokaKDwDb54KwRNZ7nWtZzThlQeUfLDK hhaQf7e40KepmErAJacX+r9m1/rhv/jDgBGqF5pOjXFR19WGuzTUtHUPAean2lKIHoogEAuvxxmc1 SXkGdeg6DW1wx11aEn69mDSlYH5FOJaPRQ14o24Re7Ghi/X3FkTcjdByINm75FNpnU5WGwg3U3zEt hNW/VMLtDRLAGvFyeeew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1weAB1-0000000ERNu-0XiP; Mon, 29 Jun 2026 11:29:23 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1weAAy-0000000ERIN-0grP for linux-amlogic@lists.infradead.org; Mon, 29 Jun 2026 11:29:21 +0000 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65TATAnC2627980 for ; Mon, 29 Jun 2026 11:29:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Dn94XK/gkhjzkpHhKvvDz8xdTIbBqtXbB1tLNjGugAw=; b=Ms2BaOrtjy68olMU 9yzq/lDEX4r8PwDMooV7VA2KCYk48UdCtbvyeB/qVKf5W+nEZgqMZNZD7CdKlO8b qI/VIpchRv4Sxz0fsfb0YfpiS9vCosefN3p2bHk1aUvDct9EJhpJlDSGq1BNAzUq U4WLMagIK+rnXuBHVddkLTjhcpVoWB4W5kGQBT/yivJQvZw2Ca1xfB6yINtMjEaS UBxLkG3j7dCu9hMR2K5gUfPpXjnJmfXAO4p/Qb2u3Zg5dyiv6cqhKPwmbjmsVmP8 05IDLn9ATb8wFW3rxnCspX6gxrLvFLxhS+Rh/aZqS3FJ8q7DNACY51ZwMRvR1d7o URGHRQ== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f3nbgrmmn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 29 Jun 2026 11:29:19 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-92b2ccd7971so596183185a.0 for ; Mon, 29 Jun 2026 04:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782732558; x=1783337358; 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=Dn94XK/gkhjzkpHhKvvDz8xdTIbBqtXbB1tLNjGugAw=; b=Lli/GzHU1Uy4cQlblX7ONmF+/hcoSkivN7XjoDxp8awNMc4oB208IUeqSLIWisqKa8 oW23ujb/ddKHWIymaeD0ZN4jsu1pxbkLeHMVzEG7LqSzK8ozFj6UmOT8orwCeua37ow0 m5I2n3W98uQocqSoDCXwjoKdpSEYpbvYNOlCj80nJ2bZ38zpL0d8qU/yI9KzcaX31wVr kOYRMezzxw79kU/8ZpsnX6Fx5cKFgU2D4Kf1MmWUvrAozrIiDIe956lQT6vHPDNSbOjR euJE0439zQceolsrgwcbXxm96fqFYnN+49G0DKy7yuOXoma5OUX/5UaaYxmvDYbUpGjk Sv1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782732558; x=1783337358; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Dn94XK/gkhjzkpHhKvvDz8xdTIbBqtXbB1tLNjGugAw=; b=gebggqg0wZJpcJN5PtsRWymflX1riyd/e0rk4h2RWw8ulwW7vpJ+lQDG8V9L60HnrL sJdQOhf6nD634GksMLfPHWfajpldb7qmwPoZUaOB6WktMn60LrgWEib3A+BATMYZ1jAY Z9H+9zxDtRkrhJc19BOWzJkYMwxnsjDS/JUyRPlPeFFxkndbLlO3AMS0cF+nAKBIT6nx yaEmLCEMLR/DZ6mq+BMRXg+1m+UKFd2hrWPOTVsbzIU0JsJ9KZulkjof6LlAoV0YlPiT vr6Yawe0y7hGo9eGfBroDdFW5nM5qzraZG/3f3y3FKOHqbq/j08NcMJlPkGqqO11XDtz ZfWQ== X-Forwarded-Encrypted: i=1; AFNElJ/9kGDBQCV9IYfXxoyVR1cOFdSln4xDA+hqOQc19oIOazZDhnhNdM2WAEcAE4gwVKs4thf4flORGpLgk0/c@lists.infradead.org X-Gm-Message-State: AOJu0YyAhgv3pqzVMYeDA5KYGYiXofWdmzr2KcNh7SYDeamli0UhGRlO R5yIWJAMZ2oywZKuVqp3pPgj9eC3UD7LNUf0lYHOuCpJm+psUFpQqVLnjzjeMdNVrG8biS9l4mW SNFUbjnflug9eaKahOjCz2mQL/BeY8KqQPXVjhs2etuoVfILIfvug6NB9WsArL6D3fF6VdT4YCg == X-Gm-Gg: AfdE7clN2BfDRD9g0OKuOsK593G9xxCiUpGuf5367Oiil8AslC0GMdp0pRoljSCYq48 anqR95Xn5lZeARIVaR8EJjNozUYj6j/rUSPrcdYyUHnjqskTQmWuAcRYQ9aU7BBztLp+eG9kTP5 LDOU1NrnRl2lQGvdpi93MVxceHqiOFemAmFvfQgYzv+j+mcNekR0Bc0yFXcyBUvEhBsO8cYTz8N 1qF3YrqsApkrLggE/vhs4eRKTQOLVIYzePQqIfLiFz4l4RZKk64KjBCQxOORGA6X0lPKG8M6j8G arjaAJWCMLsEHpXYJCIoOiVQmC33uE12ooSgvkdz3SuYnnuqrcG9/L6TQCAoxf+OD3TT6L0Hpeq 06l6o73BA+3FgD2ZFnmhy8jUIrcm29p8vfWI2+SHp X-Received: by 2002:a05:620a:4056:b0:915:8f76:8005 with SMTP id af79cd13be357-9293cadf811mr2614011685a.47.1782732558499; Mon, 29 Jun 2026 04:29:18 -0700 (PDT) X-Received: by 2002:a05:620a:4056:b0:915:8f76:8005 with SMTP id af79cd13be357-9293cadf811mr2614004385a.47.1782732557882; Mon, 29 Jun 2026 04:29:17 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:4640:d76a:6126:9b65]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-46d86960983sm41936351f8f.4.2026.06.29.04.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2026 04:29:17 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 29 Jun 2026 13:28:48 +0200 Subject: [PATCH net-next v11 2/7] phy: qcom: add the SGMII SerDes PHY driver for SCMI systems MIME-Version: 1.0 Message-Id: <20260629-qcom-sa8255p-emac-v11-2-1b7fb95b51f9@oss.qualcomm.com> References: <20260629-qcom-sa8255p-emac-v11-0-1b7fb95b51f9@oss.qualcomm.com> In-Reply-To: <20260629-qcom-sa8255p-emac-v11-0-1b7fb95b51f9@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Vinod Koul , Giuseppe Cavallaro , Chen-Yu Tsai , Jernej Skrabec , Neil Armstrong , Kevin Hilman , Jerome Brunet , Shawn Guo , Fabio Estevam , Jan Petrous , s32@nxp.com, Mohd Ayaan Anwar , Romain Gantois , Geert Uytterhoeven , Magnus Damm , Maxime Ripard , Christophe Roullier , Bartosz Golaszewski , Radu Rendec Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Drew Fustini , linux-sunxi@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-mips@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, sophgo@lists.linux.dev, linux-riscv@lists.infradead.org, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6713; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=WJjrPTVJEHMSIv6hVMo9hI0jASipWSJTfNP46iEy4PE=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBqQlb+g2w9Y9bz3nnFuqU3U87XMNnUPjRO5CRNW CsioPTs5WiJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCakJW/gAKCRAFnS7L/zaE w2VzD/9KzrrA2R5Gsx+IYq48eCMrXk2oU6WPyOrCaaNDh9wDXUSCqq0kRbyG0bnzoDziRnrLqmu iHuDsOBS/mSwfy97bnk5OwxqiU34NmnDB26nHA6RZuDthlVPSt+ceQ4mCkZWA94QqY2x5Lisd/y UAiz737p9FXjK109dSf/f0r6WMOPMVMVhgOi7wD1ioQ0VeYMfSg+4Bv1ReJOX9qE6xtRPXpgXiZ 8Amfc8vt6kb200UKU33ypDHLvCyMHBYb4WEZAiiqeFOmjtg0aAeLISOjIAzclnRYXpvIFdB93oN xDW3vDh9xVkoQA3kS0+mVOw9m4aBRYTNGSKX6aRn4kJIDS4w1YmNH5RT0Y+mPXdvp9WDP9g9yu/ 8g0KBPLOGrJPr6OXdOvSH+SthKxgnLjDmPQ6Xp7QmaaYE/tlkgWuaDEGUsIEbKtUE8VsKMp8QKN wMcYWmay3EQD96ue5Ysdw/p/wycaej37PrQjiBnxLYnrhObjWtrKj8h1FBn+Z/H/UwLut7O73o6 GgaztSVgp3mr/1zLuKi6VHMFdxQ1PjiTcAR5/g3UgO8tpro/mGcpoRwRLBrYIYNlNgh+u6LdTOk R/NoTzr/QTkTnKop9WSYNVScVySdl6G/+pPDdJjyvSjqSLqwPTTl6SpLY5gJzGBOtzizTRh0Rku U4xAY6/UIUgV0TQ== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-ORIG-GUID: 8ONldPzPAZxUGW9mkHxosagaOgUQGXL9 X-Authority-Analysis: v=2.4 cv=Z4Hc2nRA c=1 sm=1 tr=0 ts=6a42570f cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=3JCFraiX-5spO6125rwA:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjI5MDA5NCBTYWx0ZWRfX8RH2mTI5gipK BfbhUqYIsx8GIa6ph/1PXX+P7gaZLby1IVBYSg4nkbj1kMHNNumHON7Mgksb3UmjXGqr5dInnF/ +72JIfCv8Y9exeHnQR28jKI38KC0T3k= X-Proofpoint-GUID: 8ONldPzPAZxUGW9mkHxosagaOgUQGXL9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjI5MDA5NCBTYWx0ZWRfX181LlymzQxVt u7b5YQEeYDjHnRnaH6/jjVrUp2GdTzZIiU/Qh1rnHMUO+pV4D1kOTdIizcPNQ8RY+CSLRe9TwHT D4ehQ8Ajue4H523R23Fhc907GOV4xZDRk4495B+CZAi/nZUgJRFjWVcCqEsl+IojSMcfuDFR7mB ATHN1EHGLNAx0DJgyXU491HQqT7qKb4TiS+XmrBLN+eYLYAG6RSmw34/AP/dTdpKKq29bU5qY5n 31AUqRHiXj+ItihebJkkCMnvp3cc/Nkl8m3z1RFRR1PDPJaUH5abvdUXDqfe6LHDLY2FFh196my xDChVbVNZL0rcqbiyZs1yCFc+8mPD8j6tH3foTViDVe1NWfpn9LBgDhihZSsgNK6RS2bmnfaqax aX6pTZVKFC1+OtsEzXIHomSRRnKJRIN5OUdld7ZKusQtkjaCo3rvTlPFqHR47Qg8uKBvZ+dQrvm Bm+ByS2XklDdMyPFTkw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-29_03,2026-06-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 phishscore=0 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606290094 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260629_042920_360645_2203A26B X-CRM114-Status: GOOD ( 21.87 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Implement support for the firmware-managed SGMII/SerDes PHY present on Qualcomm platforms. Do this as a separate driver from the HLOS-managed variant as they don't share almost any code. Signed-off-by: Bartosz Golaszewski --- drivers/phy/qualcomm/Kconfig | 10 ++ drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c | 161 +++++++++++++++++++++++++ 3 files changed, 172 insertions(+) diff --git a/drivers/phy/qualcomm/Kconfig b/drivers/phy/qualcomm/Kconfig index 60a0ead127fa9f08749e1bc686e15cc5eb341c28..bd7d3fe411d7f3ea333e9e32e54f926a3bdead01 100644 --- a/drivers/phy/qualcomm/Kconfig +++ b/drivers/phy/qualcomm/Kconfig @@ -232,3 +232,13 @@ config PHY_QCOM_SGMII_ETH help Enable this to support the internal SerDes/SGMII PHY on various Qualcomm chipsets. + +config PHY_QCOM_SGMII_ETH_SCMI + tristate "Qualcomm DWMAC SGMII SerDes/PHY driver (firmware managed)" + depends on OF && (ARCH_QCOM || COMPILE_TEST) + select GENERIC_PHY + select PM_GENERIC_DOMAINS + help + Enable this to support the internal SerDes/SGMII PHY on Qualcomm + chipsets where the SerDes hardware (clocks and registers) is owned + by the firmware. diff --git a/drivers/phy/qualcomm/Makefile b/drivers/phy/qualcomm/Makefile index b71a6a0bed3f1489b1d07664ecd728f1db145986..032e582f2e1af96687484ce28aaba0c2ef73e754 100644 --- a/drivers/phy/qualcomm/Makefile +++ b/drivers/phy/qualcomm/Makefile @@ -25,3 +25,4 @@ obj-$(CONFIG_PHY_QCOM_USB_SS) += phy-qcom-usb-ss.o obj-$(CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2)+= phy-qcom-snps-femto-v2.o obj-$(CONFIG_PHY_QCOM_IPQ806X_USB) += phy-qcom-ipq806x-usb.o obj-$(CONFIG_PHY_QCOM_SGMII_ETH) += phy-qcom-sgmii-eth.o +obj-$(CONFIG_PHY_QCOM_SGMII_ETH_SCMI) += phy-qcom-sgmii-eth-scmi.o diff --git a/drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c b/drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c new file mode 100644 index 0000000000000000000000000000000000000000..8ee62189556fe4ff0d8aa2f8b105175e08000b7c --- /dev/null +++ b/drivers/phy/qualcomm/phy-qcom-sgmii-eth-scmi.c @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + * + * Firmware-managed variant of the Qualcomm DWMAC SGMII SerDes/PHY driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct qcom_dwmac_sgmii_phy_scmi { + unsigned int perf_state; +}; + +static int qcom_dwmac_sgmii_phy_scmi_power_on(struct phy *phy) +{ + struct qcom_dwmac_sgmii_phy_scmi *priv = phy_get_drvdata(phy); + struct device *dev = phy->dev.parent; + int ret; + + ret = pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + ret = dev_pm_genpd_set_performance_state(dev, priv->perf_state); + if (ret) { + pm_runtime_put(dev); + return ret; + } + + usleep_range(5000, 10000); + + return 0; +} + +static int qcom_dwmac_sgmii_phy_scmi_power_off(struct phy *phy) +{ + struct device *dev = phy->dev.parent; + + dev_pm_genpd_set_performance_state(dev, 0); + pm_runtime_put(dev); + + return 0; +} + +static int qcom_dwmac_sgmii_phy_scmi_validate(struct phy *phy, enum phy_mode mode, + int submode, + union phy_configure_opts *opts) +{ + if (mode != PHY_MODE_ETHERNET) + return -EINVAL; + + switch (submode) { + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_1000BASEX: + case PHY_INTERFACE_MODE_2500BASEX: + return 0; + default: + return -EINVAL; + } +} + +static int qcom_dwmac_sgmii_phy_scmi_set_mode(struct phy *phy, enum phy_mode mode, + int submode) +{ + struct qcom_dwmac_sgmii_phy_scmi *priv = phy_get_drvdata(phy); + int ret; + + ret = qcom_dwmac_sgmii_phy_scmi_validate(phy, mode, submode, NULL); + if (ret) + return ret; + + priv->perf_state = (submode == PHY_INTERFACE_MODE_2500BASEX) ? + SPEED_2500 : SPEED_1000; + + return 0; +} + +static const struct phy_ops qcom_dwmac_sgmii_phy_scmi_ops = { + .power_on = qcom_dwmac_sgmii_phy_scmi_power_on, + .power_off = qcom_dwmac_sgmii_phy_scmi_power_off, + .set_mode = qcom_dwmac_sgmii_phy_scmi_set_mode, + .validate = qcom_dwmac_sgmii_phy_scmi_validate, + .owner = THIS_MODULE, +}; + +static void qcom_dwmac_sgmii_phy_scmi_runtime_disable(void *data) +{ + struct device *dev = data; + + pm_runtime_disable(dev); +} + +static int qcom_dwmac_sgmii_phy_scmi_probe(struct platform_device *pdev) +{ + struct qcom_dwmac_sgmii_phy_scmi *priv; + struct device *dev = &pdev->dev; + struct phy_provider *provider; + struct phy *phy; + int ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->perf_state = SPEED_1000; + + /* + * Enable runtime PM on the provider before creating the PHY so that the + * PHY core enables runtime PM on the PHY device too. The single SCMI + * power domain has already been attached to this device by the driver + * core, so runtime PM votes propagate to firmware through the genpd + * device link. No register or clock access is done here - firmware owns + * the SerDes. + */ + pm_runtime_enable(dev); + + ret = devm_add_action_or_reset(dev, qcom_dwmac_sgmii_phy_scmi_runtime_disable, dev); + if (ret) + return ret; + + phy = devm_phy_create(dev, NULL, &qcom_dwmac_sgmii_phy_scmi_ops); + if (IS_ERR(phy)) + return dev_err_probe(dev, PTR_ERR(phy), "failed to create the phy\n"); + + phy_set_drvdata(phy, priv); + + provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(provider)) + return dev_err_probe(dev, PTR_ERR(provider), + "failed to register the PHY provider\n"); + + return 0; +} + +static const struct of_device_id qcom_dwmac_sgmii_phy_scmi_of_match[] = { + { .compatible = "qcom,sa8255p-dwmac-sgmii-phy" }, + { } +}; +MODULE_DEVICE_TABLE(of, qcom_dwmac_sgmii_phy_scmi_of_match); + +static struct platform_driver qcom_dwmac_sgmii_phy_scmi_driver = { + .probe = qcom_dwmac_sgmii_phy_scmi_probe, + .driver = { + .name = "qcom-dwmac-sgmii-phy-scmi", + .of_match_table = qcom_dwmac_sgmii_phy_scmi_of_match, + }, +}; +module_platform_driver(qcom_dwmac_sgmii_phy_scmi_driver); + +MODULE_DESCRIPTION("Qualcomm DWMAC SGMII PHY driver (firmware managed)"); +MODULE_AUTHOR("Bartosz Golaszewski "); +MODULE_LICENSE("GPL"); -- 2.47.3 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic