From patchwork Thu Jun 15 12:13:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13281193 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 100C9EB64D9 for ; Thu, 15 Jun 2023 12:15:38 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=GPgW9ZfLuE63khakZ/WIYnqZ20V60G2W/Pn5Qrv790w=; b=pm6FBGZi4GIPYm 7fEzkOxPsl4HXmYgggIv4VkfN5WYUnPc2KnKvtnAkgW0k1yewCvqHiwuJ6qJC8a9cZJYwhmhG8yOe OtEnTRH3BgJhPUkKguUJDCxUyt51OFJA3notNsP+fheyJTvLdeIGdIS+WWQQxfS54kAmQwTlqziWe wwxhKoCryxnITutrniZ4Rzm+LvpN1JLueyBslb46ISy2xsYxxiPQR1yCwr5PZWKvO7DuJZEGUkeU0 FkRO5/SoIKwE2TTAq/F+MPjGhzqZmaMmzWjWbHT6Hi4nq5dYxPuO7WXaadiDPBVWE5U69A13xLsmg YYGbDtPcusZLk0/dSImA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9ls6-00EoxO-29; Thu, 15 Jun 2023 12:14:38 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9ls4-00EovJ-1l for linux-arm-kernel@lists.infradead.org; Thu, 15 Jun 2023 12:14:37 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f738f579ceso15602415e9.3 for ; Thu, 15 Jun 2023 05:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686831272; x=1689423272; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7ggxw8AJ4x4mujGVS6874wxSJqrcpmQspYJe004iAEM=; b=lM1if9k9keg0vDzbKt1AKO0xkJkVeN+rZ6FMpLcVodcQ7Jp8vDPzt9qq2+wP7YFcc7 bQVrDiBsAinWN9P34UwWTJg5iSBMMEjgJYGCA1XQtPe3+/pT/pdbQl5x3ASa98cL/k4e L14/0sxIsK22vdCpIO97wFnmnCsZ2H+xmdRQfQxCPz/zUr2EduyFrzoELJIEXRN4p7Hr ApJH2FGz1TJQL0wGEykuYItgdGHK0fnBXCcS1lurpuqaVIHIClIIbeAYA3xWON+kJNSx 6lY6wy4nz+cUSJmoBDwJbbGshHu4HchtugP3Tn3EhAr2KWSJMTyE3qWXYQaoAqtPV3g0 mPMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686831272; x=1689423272; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7ggxw8AJ4x4mujGVS6874wxSJqrcpmQspYJe004iAEM=; b=jb8zwpg9+L5dwEdeuOG+mbRSyL4kQ/ZZep8PQPaiUoNwpU9Cq8+6ywiSWXJTT8MN1n ZlBIfn+uM083gieuOPTI1IUBNCMfBb71HvHAvOtZ4C9h/mzVQqwUSu4U0v6ELFCc6mGd 24qwLGg5mA4W8SiEd+tSkWEm9SXOJJqG2ginbjstDg45+OfKNpmKuEVn1skR8QkyWgU5 j8OXrUzuvzrr/ntpF1SDDv3CcZe5Wy17PAX3BL1AeeNsGs2muLSfGSfM+01+eCBNCocm V4JDZ0EH6W1PG8pNvHKJ5iR6u7B9zIrTmo24y05wxuixLH5TkVQydqQ9ICF3aJIKO0S0 e67g== X-Gm-Message-State: AC+VfDwrNkdBT4vlqGhRxOq8+0GlPo8uZJy1HvwBbNBNJsYjI8h1NT0/ 3qbXmaJRXGx30mJFK+M8tnwY1g== X-Google-Smtp-Source: ACHHUZ7+XHyQdkqyLOC/Dq+xUto1NKb5LQTqrupqa4BwTtzl1CCPc5GAJrjuw1I7+bALM5I6JonbMg== X-Received: by 2002:a1c:4b13:0:b0:3f7:f264:3edc with SMTP id y19-20020a1c4b13000000b003f7f2643edcmr12461441wma.14.1686831272107; Thu, 15 Jun 2023 05:14:32 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:2ad4:65a7:d9f3:a64e]) by smtp.gmail.com with ESMTPSA id k17-20020a5d4291000000b003047ea78b42sm20918012wrq.43.2023.06.15.05.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 05:14:31 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Bhupesh Sharma , Andy Gross , Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kishon Vijay Abraham I , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Bartosz Golaszewski Subject: [PATCH v2 00/23] arm64: qcom: sa8775p-ride: enable the first ethernet port Date: Thu, 15 Jun 2023 14:13:56 +0200 Message-Id: <20230615121419.175862-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230615_051436_598264_DA5A8418 X-CRM114-Status: GOOD ( 18.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski There are three ethernet ports on sa8775p-ride. This series contains changes required to enable one of the two 1Gb ports (the third one is 10Gb). We need to add a new driver for the internal SerDes PHY, introduce several extensions to the MAC driver (while at it: tweak coding style a bit etc.) and finally add the relevant DT nodes. v1 -> v2: - move the phy-supply property from the MAC driver over to the SerDes PHY driver - rework the SerDes PHY driver to work with the correct ordering of phy operations (init -> power_on -> set_speed) - change the serdes_phy node label to serdes0 to be in line with other DT sources and make it ready for the second PHY instance - dropped the status property from the example in SerDes PHY's DT bindings and moved properties around - reworked the fourth clock in the ethqos driver: it's handled the same whether it's called rgmii or phyaux - other minor tweaks - use 0x0 consistently in DT - squash dwmac and ethqos-specific bindings changes - collected tags Bartosz Golaszewski (23): phy: qualcomm: fix indentation in Makefile dt-bindings: phy: describe the Qualcomm SGMII PHY phy: qcom: add the SGMII SerDes PHY driver arm64: defconfig: enable the SerDes PHY for Qualcomm DWMAC net: stmmac: dwmac-qcom-ethqos: shrink clock code with devres net: stmmac: dwmac-qcom-ethqos: rename a label in probe() net: stmmac: dwmac-qcom-ethqos: tweak the order of local variables net: stmmac: dwmac-qcom-ethqos: use a helper variable for &pdev->dev net: stmmac: dwmac-qcom-ethqos: add missing include net: stmmac: dwmac-qcom-ethqos: add a newline between headers net: stmmac: dwmac-qcom-ethqos: remove stray space net: stmmac: dwmac-qcom-ethqos: add support for the optional serdes phy net: stmmac: dwmac-qcom-ethqos: add support for the phyaux clock net: stmmac: dwmac-qcom-ethqos: prepare the driver for more PHY modes net: stmmac: dwmac-qcom-ethqos: add support for SGMII net: stmmac: add new switch to struct plat_stmmacenet_data dt-bindings: net: qcom,ethqos: add description for sa8775p net: stmmac: dwmac-qcom-ethqos: add support for emac4 on sa8775p platforms arm64: dts: qcom: sa8775p: add the SGMII PHY node arm64: dts: qcom: sa8775p: add the first 1Gb ethernet interface arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY arm64: dts: qcom: sa8775p-ride: add pin functions for ethernet0 arm64: dts: qcom: sa8775p-ride: enable ethernet0 .../devicetree/bindings/net/qcom,ethqos.yaml | 12 +- .../devicetree/bindings/net/snps,dwmac.yaml | 3 + .../phy/qcom,sa8775p-dwmac-sgmii-phy.yaml | 55 +++ arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 109 +++++ arch/arm64/boot/dts/qcom/sa8775p.dtsi | 42 ++ arch/arm64/configs/defconfig | 1 + .../stmicro/stmmac/dwmac-qcom-ethqos.c | 284 ++++++++--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- drivers/phy/qualcomm/Kconfig | 9 + drivers/phy/qualcomm/Makefile | 3 +- drivers/phy/qualcomm/phy-qcom-sgmii-eth.c | 451 ++++++++++++++++++ include/linux/stmmac.h | 1 + 12 files changed, 895 insertions(+), 77 deletions(-) create mode 100644 Documentation/devicetree/bindings/phy/qcom,sa8775p-dwmac-sgmii-phy.yaml create mode 100644 drivers/phy/qualcomm/phy-qcom-sgmii-eth.c