From patchwork Mon Jun 12 09:23:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106400 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2469137vqr; Mon, 12 Jun 2023 02:56:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6APFYwyNgjlEvjh+p3IMNCu7XF+bTnBo6C1sHhAwpHdI7HHQK6It3S0nVhqAl8dqI0emAn X-Received: by 2002:a17:907:9686:b0:978:acec:36ab with SMTP id hd6-20020a170907968600b00978acec36abmr9595487ejc.35.1686563761797; Mon, 12 Jun 2023 02:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563761; cv=none; d=google.com; s=arc-20160816; b=h6mEJzUSWoMXsejW99s6gTJKkPY4SrsDkdf5GkYqbAtWxv5KHrJdCYC6kEEMN5Ihj7 4SIsN7WTu09LC6S01jExuBMZUNOJdnEmYPMlGlGMoamnGA0Fw33JeCPFo7+dwFGVaMeY yqgkASPSRZmrzOS7W3fBMoCtHSBgbj9uCW7JorpApbLJ0hIeWgrZdDpnE182Itqiuh2o MObAZ7wNE0K4ELN4jGmIBBb+M+ZQQYxx/eB4/Y7G9JJui83VzzACCxcaJBgDXgTm+aSI 1SV+bVV0z7cOP3O/zHT+eg6azNRoJZrV3zFGezjyV2Q0do1xoq0CiLxC9PuyBNqOEZzM hjkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F1RtgufzwN5zkIc6lOIXx9j+jgAzsHOFWAyMRveQqLo=; b=MbvSXHQPSivrUHykMJsBTLAm7KDfP/E9Ul9fqxl8nIM4kani6KUJQV8+bQZBG6dKFH YjrCIP6jzfYt3aWMfBVkfg+8sbqejjSrDH8dfnOOk9/plY3ja+f4leOIYWOyaoySKSvg hyXd3WWNjqZyKPP5V/WHwoxKruo0waophpgKUaAZwPUNd49IB8gzN+sBju8phZhyvMbG 2tM9Fyr8CfIIVQ3dV9/jsYiHGLnktJNig7kU69vL1+ocaevG+SNlvb6Emo46rrtCfIPU nTrk3CH5hfyGJFZUVjL6T4flP3nFKA2hn8vyUEQ4bvXaOHnf/v368Lcn2EbnkcwZ+3sQ /iOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=jxFUBvkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a170906840b00b0094f34d90a75si5199864ejx.437.2023.06.12.02.55.37; Mon, 12 Jun 2023 02:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=jxFUBvkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233668AbjFLJaX (ORCPT + 99 others); Mon, 12 Jun 2023 05:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233172AbjFLJ3h (ORCPT ); Mon, 12 Jun 2023 05:29:37 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 685D41B3 for ; Mon, 12 Jun 2023 02:24:28 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f738f579ceso29730165e9.3 for ; Mon, 12 Jun 2023 02:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561867; x=1689153867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F1RtgufzwN5zkIc6lOIXx9j+jgAzsHOFWAyMRveQqLo=; b=jxFUBvkZ4Lg20XupS3NzkHFqhu8SEtVVfcnXOO+b6K6/t0uzorkTHwYRDrMhd2dJIU tdhzK6iKF6+sYaQwrNwnE3nbalQyEeuelBYndZA4Zlh1ic3fnVO7sRut7VoIEBGZqyTT j7X7mK1z0w+BQ2GjWcZZVMaxzDmSNJFStDd6l63u1LsPuVC+IR1W1QtTzlOsR9JLI+Vp /C2z7U/al+XLw+5ktMrKm6sW96aoMXXs83R5MH7rwPztSggbFtGmzEURIWOz4sSzPa4R 7fu5lNM2p2uS5s2x+WETMW9u7Bl5Y9cMoLBsyEonGg0j/q1FpAfYpaSsN/KMSudrABVj RkUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561867; x=1689153867; h=content-transfer-encoding:mime-version: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=F1RtgufzwN5zkIc6lOIXx9j+jgAzsHOFWAyMRveQqLo=; b=l9SxPKasxh3c5DpNRM/k2EYBQe+m+Zjp1imCXDPP/ayx30zxA6vsKRaoBWJ8HN8EIY 8ze+cNXhkHA2KEKKJ0rhN6SHl5D0aIQrlKd+F+iPPH2hqy5i5UU0JHTtU3b+xduFU8Xl Qo39XBATPkhd5no8LJM0FoRYeWv6GlOb+scflScOHYgt+93I93oHhVSqzV9fstDj5skY A1SMvmHIuGXsgeoKW10OxTvmnohOf+8LCS1gC/RjZKJeJy+g2+qBILaeol7Kg7RXcvUZ 2v7Ax1pKA7r7l2gcVg8PuHicBJ85LrfB78MXNOw449Ac4BNyVycVAyCxAEGkvO4Uh6v8 1E5Q== X-Gm-Message-State: AC+VfDwWrD8kt7+/iTEN07FViJLXu8PnmMQERfvxOoOyWtnIO+h7/SKa StVH+gO5IjysCyaHIlIlaaN5VA== X-Received: by 2002:a1c:4b13:0:b0:3f7:f264:3edc with SMTP id y19-20020a1c4b13000000b003f7f2643edcmr5877256wma.14.1686561866564; Mon, 12 Jun 2023 02:24:26 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:25 -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 01/26] phy: qualcomm: fix indentation in Makefile Date: Mon, 12 Jun 2023 11:23:30 +0200 Message-Id: <20230612092355.87937-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768490283383498976?= X-GMAIL-MSGID: =?utf-8?q?1768490283383498976?= From: Bartosz Golaszewski Align all entries in Makefile. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- drivers/phy/qualcomm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/qualcomm/Makefile b/drivers/phy/qualcomm/Makefile index de3dc9ccf067..5fb33628566b 100644 --- a/drivers/phy/qualcomm/Makefile +++ b/drivers/phy/qualcomm/Makefile @@ -20,4 +20,4 @@ obj-$(CONFIG_PHY_QCOM_USB_HSIC) += phy-qcom-usb-hsic.o obj-$(CONFIG_PHY_QCOM_USB_HS_28NM) += phy-qcom-usb-hs-28nm.o 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_IPQ806X_USB) += phy-qcom-ipq806x-usb.o From patchwork Mon Jun 12 09:23:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460518vqr; Mon, 12 Jun 2023 02:33:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4J+SRb4lQ4awJAu/77NLfhAsSP5FHAqYNUTfyuOilNpMBiDObTkiSNEul8L6eKl7G/iWF4 X-Received: by 2002:a17:907:2ce1:b0:977:abac:9635 with SMTP id hz1-20020a1709072ce100b00977abac9635mr10630977ejc.20.1686562435999; Mon, 12 Jun 2023 02:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562435; cv=none; d=google.com; s=arc-20160816; b=auQmYk4VH++aFrI1pZER3htfnukmqXuF4GUs2hIucP0Dl71f2GvpwsbvncRnSJqS3J 7zAKmR7Don1xrnCFs68cfQ4FZCjibTdSZcnjJfg8QRKiYCwj5i0IZCAv9JqtodH6pKZ/ +s7rOE/NlrXwo4D6KL0+iPuhMBQBkpS8fIejGlUJRU9K/hsL3WpkOmqizNJdf3wF3XYQ 6ecYGt4hyx7d2uvzClqv2meh8+mxIt2wEt6diJP4r4XEowgF6RTEa7iZ9BExrEoz9O75 24HSoEl8g4EbaWnZsKjuSs2ToezeFjctJ1sldVNaqsIe5QTJXC5/9TczAeQZlelsUQQw oPJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8Mia4wdvtEWv/Mc70nqXVtPO13y7zNqSpwQ13vNSfLE=; b=bSMfl/p5DuEf36OVQGWDwZYMB/e7s5n8TRtQdzl2LlIqgEmxNy3vWq7P3BxASrrIqZ N3RAXTnERE2CXQ37NAXDQDrkUMP6nE34eQtWdwA7vKJmrUk0KAoxtoywILQZOB6ERF8r tdR6VW2i7dmVHqnqt/jRi1lVANNfiFclrjdvQBhVBdRsyMR4YPvUFYTzsvECA2xX0aKD cxtslvMGeM9edyVXH8UinRbqwQsSIjZ2ADLhupchT1gPgmfutEIF/a1vW30Ok/6gwe4G NLvFT1RKvpxmig0SgB2ZXFMXaqv8yePh4sThDUQ0WbjeQH+KfBaYCSgWNfBoIjet+tZb 0rsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=W7uLoIKX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi1-20020a170906da0100b009746023de30si5036070ejb.458.2023.06.12.02.33.28; Mon, 12 Jun 2023 02:33:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=W7uLoIKX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234439AbjFLJa0 (ORCPT + 99 others); Mon, 12 Jun 2023 05:30:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233717AbjFLJ3j (ORCPT ); Mon, 12 Jun 2023 05:29:39 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1A26E4C for ; Mon, 12 Jun 2023 02:24:29 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f122ff663eso4643731e87.2 for ; Mon, 12 Jun 2023 02:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561868; x=1689153868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Mia4wdvtEWv/Mc70nqXVtPO13y7zNqSpwQ13vNSfLE=; b=W7uLoIKXS7PAmiTERywWDbaMLHABZeojjIbT0BpPdVw/szDoWSLAhsDjiDhXxl4o0B N+mM9elzSP3JqtAq5iBMalhVzDLZAT3pgGrA4YH0qnHkzC5chXAFtZOuI8iB8RtRWpUk qOX25KL/ZPJsjCHVNrK5xFzMKBouPr39wPrNCJ/B1IYO0a5h4wx7RMpAIK3l/E/UnFKe dz6B6SoSKkxozrS8aYGNXN9zhyKDjdGgp5mZXmbuaHnXa5w2D/IMPaqTthkKHu/a1eea vPl6cgK054K85I0UCom0Hd9nIDiLDaTWrOXGQNcrNBsVHaU55BET5lMHbubFFmbZ6tzN s+SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561868; x=1689153868; h=content-transfer-encoding:mime-version: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=8Mia4wdvtEWv/Mc70nqXVtPO13y7zNqSpwQ13vNSfLE=; b=FUHdDxJMHpz+zmS36BE77yjY7UTspxrl6ksrxEZYmt2gkGa80AaW0j2OB0ZROEk5+x 0oFM0E+c8dnirwCkDpF769uHBqzoPJjVlT071jNdrIUyaKhJkFcuKAIQKDfzmsDOqAmp uxkQpJSBjfK+fLrbiSjww1B413EV/ti27rlp87Jmkh85koJmrxzYPagyvD7ve2vcaKxA J4CsNsVzrAwGQlCabi+7NfbtjkklPnKSwmDJYlqwTYi+/yW76KXrwrp5kvN7Xgp0B9RQ BKhEgPuwSGW/gGwIbMQwXttmlMfIz/bZJmSdUIuaAMnhJmznfOPA+uPaKfEOj0CmATeZ B/5g== X-Gm-Message-State: AC+VfDzN/MTm/SOScJP9qeeraO594SWJPvNvkttqAs2U2HUTVLUczNja ZzsFhrI7seRCpXrsQL5s9ixh6enPHcPPBWNgW4w= X-Received: by 2002:ac2:464d:0:b0:4f4:c972:981f with SMTP id s13-20020ac2464d000000b004f4c972981fmr4212236lfo.54.1686561868039; Mon, 12 Jun 2023 02:24:28 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:27 -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 02/26] dt-bindings: phy: describe the Qualcomm SGMII PHY Date: Mon, 12 Jun 2023 11:23:31 +0200 Message-Id: <20230612092355.87937-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488892958412681?= X-GMAIL-MSGID: =?utf-8?q?1768488892958412681?= From: Bartosz Golaszewski Describe the SGMII/SerDes PHY present on the sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski --- .../phy/qcom,sa8775p-dwmac-sgmii-phy.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/qcom,sa8775p-dwmac-sgmii-phy.yaml diff --git a/Documentation/devicetree/bindings/phy/qcom,sa8775p-dwmac-sgmii-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sa8775p-dwmac-sgmii-phy.yaml new file mode 100644 index 000000000000..ba8d2bee1563 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/qcom,sa8775p-dwmac-sgmii-phy.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/qcom,sa8775p-dwmac-sgmii-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SerDes/SGMII ethernet PHY controller + +maintainers: + - Bartosz Golaszewski + +description: + The SerDes PHY sits between the MAC and the external PHY and provides + separate Rx Tx lines. + +properties: + compatible: + const: qcom,sa8775p-dwmac-sgmii-phy + + reg: + items: + - description: serdes + + clocks: + maxItems: 1 + + clock-names: + const: sgmi_ref + + "#phy-cells": + const: 0 + +additionalProperties: false + +required: + - compatible + - reg + - "#phy-cells" + - clocks + - clock-names + +examples: + - | + #include + serdes_phy: phy@8901000 { + compatible = "qcom,sa8775p-dwmac-sgmii-phy"; + reg = <0x08901000 0xe10>; + clocks = <&gcc GCC_SGMI_CLKREF_EN>; + clock-names = "sgmi_ref"; + #phy-cells = <0>; + status = "disabled"; + }; From patchwork Mon Jun 12 09:23:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460520vqr; Mon, 12 Jun 2023 02:33:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6g9EZu8Uj7iEsJ70bqATDastVwfatLHr2YHu6BKGv9/QiJ+fMCYGPn7ft1Ivv/xlt6EZtl X-Received: by 2002:a17:907:7da3:b0:97d:cda7:f097 with SMTP id oz35-20020a1709077da300b0097dcda7f097mr6279194ejc.75.1686562436417; Mon, 12 Jun 2023 02:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562436; cv=none; d=google.com; s=arc-20160816; b=QO6LOaS5kjUuvdBQVPbP1uUZgR2uQw55sSTk6Y2EO8+IvZr4EDamwSLhXl8QVr22+l qfd4zB1/JZFeqnHKxyxoGy13bR8lIlxI+7LqQl697i/OyVsE1HKGg5RIYH1yHrIXYkX+ s/MppdAjIMbHD9OVVgz1VNg1od/bDoOoaC74m8ptCPswJUaY1JJmG+MmQa+kLVl9/9xP 45KNT9nRZ/7AiPFKOXfKeoVcgdSWnA1cQRjSegns0qvrUJ+10+/XCVsiDNNYi12lx6kU sN8VaTLVG8LQuieDaJZxvIkpBPZiXGQa+AMRB+yN8Mbuaz4ht2MxaS8OM1D7tJXN6MwH fItg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E2Q9u8nL2MctzBi0bIbdVww9XI393qnIbj9hxLOi3Yc=; b=E3Y4or+6zjogx5PrZbb31zsHbBzBQ0VpI9vcBXL4LALAi7XF6uv2NcQY1TkAP4Qg7d waLGKNtTR0gGSrDKToT+ANCQnWCFMt8q3Zmbxbp3SgX7sT/edNapD87+YHxwksK7Y25p E3knlTpE3eS3I18/F74QFwd9iAXICKTwr3xnKRRXqPzRnhaiby9xqNs5pepc7aMbxN+t JVT4kTkLDiMabn09aOrJCP9yxQ33wQD0QTDrYkQoOqHIzheV6IV9Se5LJy91dpj3hRyn o5fWM6OV1O4cPBXgY1WTVND/DHZ0MkDRfFCqT5AW+ocXueU2X1bXfA7PeFTuY5FZ2kOk HUmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=YqGBg5Xu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a170906d10e00b0097563f61d97si4971397ejz.830.2023.06.12.02.33.29; Mon, 12 Jun 2023 02:33:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=YqGBg5Xu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234672AbjFLJa3 (ORCPT + 99 others); Mon, 12 Jun 2023 05:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbjFLJ3k (ORCPT ); Mon, 12 Jun 2023 05:29:40 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF07A1B4 for ; Mon, 12 Jun 2023 02:24:30 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f6e1393f13so29830125e9.0 for ; Mon, 12 Jun 2023 02:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561869; x=1689153869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E2Q9u8nL2MctzBi0bIbdVww9XI393qnIbj9hxLOi3Yc=; b=YqGBg5XuLWiS2RlwLB4NV3xSgXE2hRiq7NBwm5OyzaaQVK/mXNE/YlJV9ZLPByWU+q Moji+ZB5Oh3Cqv+PfmZuxiftwIlrvkg+W4pSbH/PxJNtcYqGF+RMhekQFoyv5kVBnB4Q zxfhwYb4mK7qpypVJCU9fBcwx0kQfiLBz5aW1lAbDLYg+jCZdFHNUFdn0CMG6AxXT1SP zj0AnDbdscKe6kVJ4Jiz7RGtj0Me9ClkFbRa3to9uKd/Ju2K4ZyEl7eCcGG6R5i/g32R jOPHZtO9SW34Sfy7+Z6gx30m9o/UqHRqoMW3HoX08cuMr5kVGgLO5TCJxWJ7iJGm2rj8 BAng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561869; x=1689153869; h=content-transfer-encoding:mime-version: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=E2Q9u8nL2MctzBi0bIbdVww9XI393qnIbj9hxLOi3Yc=; b=XYSCIzw6xpvogOQgeS6H4WFds3fhPQTFI4UMOfaM7kEqQxEjXg36c2tpX+OIGyG2BP Oo50z7XHNz8kdwEeIGo+0ESNWy05a37Q9fNTj/pia/4cIOzcOXALDEvl20CRjStFVTFX 75Lm9TUMIQGvF0zFcH0Mhd/ZkOjlxFSHWSE2+PV7KwsNenynRElZeyh7zt4mwyfAZLxY 5ulqwgsUaGd0TctUhNex2GtEKC2O5vkQ7RDzRJvnb/jbGPTWRiyWdrOxLgdXI02D4/Ig Ph5pJbZlPcIXZ5qeYAItG3Y/CpUJcauYAKgFde68GhT9JattQH7zFUC7Lilol1V8P6k5 j5kw== X-Gm-Message-State: AC+VfDyoDtnFxaQRoEFi9Z0F3ZVGoPbUvnaC/gUHEQM3fdNeGHKRBGIw CFkw2M8MhUBkuX/KQ+fcyfDR/g== X-Received: by 2002:a05:600c:aca:b0:3f7:fa21:f66 with SMTP id c10-20020a05600c0aca00b003f7fa210f66mr6133978wmr.26.1686561869424; Mon, 12 Jun 2023 02:24:29 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:28 -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 03/26] phy: qcom: add the SGMII SerDes PHY driver Date: Mon, 12 Jun 2023 11:23:32 +0200 Message-Id: <20230612092355.87937-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488893415548381?= X-GMAIL-MSGID: =?utf-8?q?1768488893415548381?= From: Bartosz Golaszewski Implement support for the SGMII/SerDes PHY present on various Qualcomm platforms. Signed-off-by: Bartosz Golaszewski --- drivers/phy/qualcomm/Kconfig | 9 + drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/phy-qcom-sgmii-eth.c | 446 ++++++++++++++++++++++ 3 files changed, 456 insertions(+) create mode 100644 drivers/phy/qualcomm/phy-qcom-sgmii-eth.c diff --git a/drivers/phy/qualcomm/Kconfig b/drivers/phy/qualcomm/Kconfig index 67a45d95250d..97ca5952e34e 100644 --- a/drivers/phy/qualcomm/Kconfig +++ b/drivers/phy/qualcomm/Kconfig @@ -188,3 +188,12 @@ config PHY_QCOM_IPQ806X_USB This option enables support for the Synopsis PHYs present inside the Qualcomm USB3.0 DWC3 controller on ipq806x SoC. This driver supports both HS and SS PHY controllers. + +config PHY_QCOM_SGMII_ETH + tristate "Qualcomm DWMAC SGMII SerDes/PHY driver" + depends on OF && (ARCH_QCOM || COMPILE_TEST) + depends on HAS_IOMEM + select GENERIC_PHY + help + Enable this to support the internal SerDes/SGMII PHY on various + Qualcomm chipsets. diff --git a/drivers/phy/qualcomm/Makefile b/drivers/phy/qualcomm/Makefile index 5fb33628566b..b030858e0f8d 100644 --- a/drivers/phy/qualcomm/Makefile +++ b/drivers/phy/qualcomm/Makefile @@ -21,3 +21,4 @@ obj-$(CONFIG_PHY_QCOM_USB_HS_28NM) += phy-qcom-usb-hs-28nm.o 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 diff --git a/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c b/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c new file mode 100644 index 000000000000..c9f0324a987c --- /dev/null +++ b/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c @@ -0,0 +1,446 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2023, Linaro Limited + */ + +#include +#include +#include +#include +#include +#include +#include + +#define QSERDES_QMP_PLL 0x0 +#define QSERDES_COM_BIN_VCOCAL_CMP_CODE1_MODE0 (QSERDES_QMP_PLL + 0x1ac) +#define QSERDES_COM_BIN_VCOCAL_CMP_CODE2_MODE0 (QSERDES_QMP_PLL + 0x1b0) +#define QSERDES_COM_BIN_VCOCAL_HSCLK_SEL (QSERDES_QMP_PLL + 0x1bc) +#define QSERDES_COM_CORE_CLK_EN (QSERDES_QMP_PLL + 0x174) +#define QSERDES_COM_CORECLK_DIV_MODE0 (QSERDES_QMP_PLL + 0x168) +#define QSERDES_COM_CP_CTRL_MODE0 (QSERDES_QMP_PLL + 0x74) +#define QSERDES_COM_DEC_START_MODE0 (QSERDES_QMP_PLL + 0xbc) +#define QSERDES_COM_DIV_FRAC_START1_MODE0 (QSERDES_QMP_PLL + 0xcc) +#define QSERDES_COM_DIV_FRAC_START2_MODE0 (QSERDES_QMP_PLL + 0xd0) +#define QSERDES_COM_DIV_FRAC_START3_MODE0 (QSERDES_QMP_PLL + 0xd4) +#define QSERDES_COM_HSCLK_HS_SWITCH_SEL (QSERDES_QMP_PLL + 0x15c) +#define QSERDES_COM_HSCLK_SEL (QSERDES_QMP_PLL + 0x158) +#define QSERDES_COM_LOCK_CMP1_MODE0 (QSERDES_QMP_PLL + 0xac) +#define QSERDES_COM_LOCK_CMP2_MODE0 (QSERDES_QMP_PLL + 0xb0) +#define QSERDES_COM_PLL_CCTRL_MODE0 (QSERDES_QMP_PLL + 0x84) +#define QSERDES_COM_PLL_IVCO (QSERDES_QMP_PLL + 0x58) +#define QSERDES_COM_PLL_RCTRL_MODE0 (QSERDES_QMP_PLL + 0x7c) +#define QSERDES_COM_SYSCLK_EN_SEL (QSERDES_QMP_PLL + 0x94) +#define QSERDES_COM_VCO_TUNE1_MODE0 (QSERDES_QMP_PLL + 0x110) +#define QSERDES_COM_VCO_TUNE2_MODE0 (QSERDES_QMP_PLL + 0x114) +#define QSERDES_COM_VCO_TUNE_INITVAL2 (QSERDES_QMP_PLL + 0x124) +#define QSERDES_COM_C_READY_STATUS (QSERDES_QMP_PLL + 0x178) +#define QSERDES_COM_CMN_STATUS (QSERDES_QMP_PLL + 0x140) + +#define QSERDES_RX 0x600 +#define QSERDES_RX_UCDR_FO_GAIN (QSERDES_RX + 0x8) +#define QSERDES_RX_UCDR_SO_GAIN (QSERDES_RX + 0x14) +#define QSERDES_RX_UCDR_FASTLOCK_FO_GAIN (QSERDES_RX + 0x30) +#define QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE (QSERDES_RX + 0x34) +#define QSERDES_RX_UCDR_FASTLOCK_COUNT_LOW (QSERDES_RX + 0x3c) +#define QSERDES_RX_UCDR_FASTLOCK_COUNT_HIGH (QSERDES_RX + 0x40) +#define QSERDES_RX_UCDR_PI_CONTROLS (QSERDES_RX + 0x44) +#define QSERDES_RX_UCDR_PI_CTRL2 (QSERDES_RX + 0x48) +#define QSERDES_RX_RX_TERM_BW (QSERDES_RX + 0x80) +#define QSERDES_RX_VGA_CAL_CNTRL2 (QSERDES_RX + 0xd8) +#define QSERDES_RX_GM_CAL (QSERDES_RX + 0xdc) +#define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL1 (QSERDES_RX + 0xe8) +#define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL2 (QSERDES_RX + 0xec) +#define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL3 (QSERDES_RX + 0xf0) +#define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4 (QSERDES_RX + 0xf4) +#define QSERDES_RX_RX_IDAC_TSETTLE_LOW (QSERDES_RX + 0xf8) +#define QSERDES_RX_RX_IDAC_TSETTLE_HIGH (QSERDES_RX + 0xfc) +#define QSERDES_RX_RX_IDAC_MEASURE_TIME (QSERDES_RX + 0x100) +#define QSERDES_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1 (QSERDES_RX + 0x110) +#define QSERDES_RX_RX_OFFSET_ADAPTOR_CNTRL2 (QSERDES_RX + 0x114) +#define QSERDES_RX_SIGDET_CNTRL (QSERDES_RX + 0x11c) +#define QSERDES_RX_SIGDET_DEGLITCH_CNTRL (QSERDES_RX + 0x124) +#define QSERDES_RX_RX_BAND (QSERDES_RX + 0x128) +#define QSERDES_RX_RX_MODE_00_LOW (QSERDES_RX + 0x15c) +#define QSERDES_RX_RX_MODE_00_HIGH (QSERDES_RX + 0x160) +#define QSERDES_RX_RX_MODE_00_HIGH2 (QSERDES_RX + 0x164) +#define QSERDES_RX_RX_MODE_00_HIGH3 (QSERDES_RX + 0x168) +#define QSERDES_RX_RX_MODE_00_HIGH4 (QSERDES_RX + 0x16c) +#define QSERDES_RX_RX_MODE_01_LOW (QSERDES_RX + 0x170) +#define QSERDES_RX_RX_MODE_01_HIGH (QSERDES_RX + 0x174) +#define QSERDES_RX_RX_MODE_01_HIGH2 (QSERDES_RX + 0x178) +#define QSERDES_RX_RX_MODE_01_HIGH3 (QSERDES_RX + 0x17c) +#define QSERDES_RX_RX_MODE_01_HIGH4 (QSERDES_RX + 0x180) +#define QSERDES_RX_RX_MODE_10_LOW (QSERDES_RX + 0x184) +#define QSERDES_RX_RX_MODE_10_HIGH (QSERDES_RX + 0x188) +#define QSERDES_RX_RX_MODE_10_HIGH2 (QSERDES_RX + 0x18c) +#define QSERDES_RX_RX_MODE_10_HIGH3 (QSERDES_RX + 0x190) +#define QSERDES_RX_RX_MODE_10_HIGH4 (QSERDES_RX + 0x194) +#define QSERDES_RX_DCC_CTRL1 (QSERDES_RX + 0x1a8) + +#define QSERDES_TX 0x400 +#define QSERDES_TX_TX_BAND (QSERDES_TX + 0x24) +#define QSERDES_TX_SLEW_CNTL (QSERDES_TX + 0x28) +#define QSERDES_TX_RES_CODE_LANE_OFFSET_TX (QSERDES_TX + 0x3c) +#define QSERDES_TX_RES_CODE_LANE_OFFSET_RX (QSERDES_TX + 0x40) +#define QSERDES_TX_LANE_MODE_1 (QSERDES_TX + 0x84) +#define QSERDES_TX_LANE_MODE_3 (QSERDES_TX + 0x8c) +#define QSERDES_TX_RCV_DETECT_LVL_2 (QSERDES_TX + 0xa4) +#define QSERDES_TX_TRAN_DRVR_EMP_EN (QSERDES_TX + 0xc0) + +#define QSERDES_PCS 0xC00 +#define QSERDES_PCS_PHY_START (QSERDES_PCS + 0x0) +#define QSERDES_PCS_POWER_DOWN_CONTROL (QSERDES_PCS + 0x4) +#define QSERDES_PCS_SW_RESET (QSERDES_PCS + 0x8) +#define QSERDES_PCS_LINE_RESET_TIME (QSERDES_PCS + 0xc) +#define QSERDES_PCS_TX_LARGE_AMP_DRV_LVL (QSERDES_PCS + 0x20) +#define QSERDES_PCS_TX_SMALL_AMP_DRV_LVL (QSERDES_PCS + 0x28) +#define QSERDES_PCS_TX_MID_TERM_CTRL1 (QSERDES_PCS + 0xd8) +#define QSERDES_PCS_TX_MID_TERM_CTRL2 (QSERDES_PCS + 0xdc) +#define QSERDES_PCS_SGMII_MISC_CTRL8 (QSERDES_PCS + 0x118) +#define QSERDES_PCS_PCS_READY_STATUS (QSERDES_PCS + 0x94) + +#define QSERDES_COM_C_READY BIT(0) +#define QSERDES_PCS_READY BIT(0) +#define QSERDES_PCS_SGMIIPHY_READY BIT(7) +#define QSERDES_COM_C_PLL_LOCKED BIT(1) + +struct qcom_dwmac_sgmii_phy_data { + struct regmap *regmap; + int speed; +}; + +static void qcom_dwmac_sgmii_phy_init_1g(struct regmap *regmap) +{ + regmap_write(regmap, QSERDES_PCS_SW_RESET, 0x01); + regmap_write(regmap, QSERDES_PCS_POWER_DOWN_CONTROL, 0x01); + + regmap_write(regmap, QSERDES_COM_PLL_IVCO, 0x0F); + regmap_write(regmap, QSERDES_COM_CP_CTRL_MODE0, 0x06); + regmap_write(regmap, QSERDES_COM_PLL_RCTRL_MODE0, 0x16); + regmap_write(regmap, QSERDES_COM_PLL_CCTRL_MODE0, 0x36); + regmap_write(regmap, QSERDES_COM_SYSCLK_EN_SEL, 0x1A); + regmap_write(regmap, QSERDES_COM_LOCK_CMP1_MODE0, 0x0A); + regmap_write(regmap, QSERDES_COM_LOCK_CMP2_MODE0, 0x1A); + regmap_write(regmap, QSERDES_COM_DEC_START_MODE0, 0x82); + regmap_write(regmap, QSERDES_COM_DIV_FRAC_START1_MODE0, 0x55); + regmap_write(regmap, QSERDES_COM_DIV_FRAC_START2_MODE0, 0x55); + regmap_write(regmap, QSERDES_COM_DIV_FRAC_START3_MODE0, 0x03); + regmap_write(regmap, QSERDES_COM_VCO_TUNE1_MODE0, 0x24); + + regmap_write(regmap, QSERDES_COM_VCO_TUNE2_MODE0, 0x02); + regmap_write(regmap, QSERDES_COM_VCO_TUNE_INITVAL2, 0x00); + regmap_write(regmap, QSERDES_COM_HSCLK_SEL, 0x04); + regmap_write(regmap, QSERDES_COM_HSCLK_HS_SWITCH_SEL, 0x00); + regmap_write(regmap, QSERDES_COM_CORECLK_DIV_MODE0, 0x0A); + regmap_write(regmap, QSERDES_COM_CORE_CLK_EN, 0x00); + regmap_write(regmap, QSERDES_COM_BIN_VCOCAL_CMP_CODE1_MODE0, 0xB9); + regmap_write(regmap, QSERDES_COM_BIN_VCOCAL_CMP_CODE2_MODE0, 0x1E); + regmap_write(regmap, QSERDES_COM_BIN_VCOCAL_HSCLK_SEL, 0x11); + + regmap_write(regmap, QSERDES_TX_TX_BAND, 0x05); + regmap_write(regmap, QSERDES_TX_SLEW_CNTL, 0x0A); + regmap_write(regmap, QSERDES_TX_RES_CODE_LANE_OFFSET_TX, 0x09); + regmap_write(regmap, QSERDES_TX_RES_CODE_LANE_OFFSET_RX, 0x09); + regmap_write(regmap, QSERDES_TX_LANE_MODE_1, 0x05); + regmap_write(regmap, QSERDES_TX_LANE_MODE_3, 0x00); + regmap_write(regmap, QSERDES_TX_RCV_DETECT_LVL_2, 0x12); + regmap_write(regmap, QSERDES_TX_TRAN_DRVR_EMP_EN, 0x0C); + + regmap_write(regmap, QSERDES_RX_UCDR_FO_GAIN, 0x0A); + regmap_write(regmap, QSERDES_RX_UCDR_SO_GAIN, 0x06); + regmap_write(regmap, QSERDES_RX_UCDR_FASTLOCK_FO_GAIN, 0x0A); + regmap_write(regmap, QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x7F); + regmap_write(regmap, QSERDES_RX_UCDR_FASTLOCK_COUNT_LOW, 0x00); + regmap_write(regmap, QSERDES_RX_UCDR_FASTLOCK_COUNT_HIGH, 0x01); + regmap_write(regmap, QSERDES_RX_UCDR_PI_CONTROLS, 0x81); + regmap_write(regmap, QSERDES_RX_UCDR_PI_CTRL2, 0x80); + regmap_write(regmap, QSERDES_RX_RX_TERM_BW, 0x04); + regmap_write(regmap, QSERDES_RX_VGA_CAL_CNTRL2, 0x08); + regmap_write(regmap, QSERDES_RX_GM_CAL, 0x0F); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL1, 0x04); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL2, 0x00); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL3, 0x4A); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4, 0x0A); + regmap_write(regmap, QSERDES_RX_RX_IDAC_TSETTLE_LOW, 0x80); + regmap_write(regmap, QSERDES_RX_RX_IDAC_TSETTLE_HIGH, 0x01); + regmap_write(regmap, QSERDES_RX_RX_IDAC_MEASURE_TIME, 0x20); + regmap_write(regmap, QSERDES_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1, 0x17); + regmap_write(regmap, QSERDES_RX_RX_OFFSET_ADAPTOR_CNTRL2, 0x00); + regmap_write(regmap, QSERDES_RX_SIGDET_CNTRL, 0x0F); + regmap_write(regmap, QSERDES_RX_SIGDET_DEGLITCH_CNTRL, 0x1E); + regmap_write(regmap, QSERDES_RX_RX_BAND, 0x05); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_LOW, 0xE0); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH2, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH3, 0x09); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH4, 0xB1); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_LOW, 0xE0); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH2, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH3, 0x09); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH4, 0xB1); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_LOW, 0xE0); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH2, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH3, 0x3B); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH4, 0xB7); + regmap_write(regmap, QSERDES_RX_DCC_CTRL1, 0x0C); + + regmap_write(regmap, QSERDES_PCS_LINE_RESET_TIME, 0x0C); + regmap_write(regmap, QSERDES_PCS_TX_LARGE_AMP_DRV_LVL, 0x1F); + regmap_write(regmap, QSERDES_PCS_TX_SMALL_AMP_DRV_LVL, 0x03); + regmap_write(regmap, QSERDES_PCS_TX_MID_TERM_CTRL1, 0x83); + regmap_write(regmap, QSERDES_PCS_TX_MID_TERM_CTRL2, 0x08); + regmap_write(regmap, QSERDES_PCS_SGMII_MISC_CTRL8, 0x0C); + regmap_write(regmap, QSERDES_PCS_SW_RESET, 0x00); + + regmap_write(regmap, QSERDES_PCS_PHY_START, 0x01); +} + +static void qcom_dwmac_sgmii_phy_init_2p5g(struct regmap *regmap) +{ + regmap_write(regmap, QSERDES_PCS_SW_RESET, 0x01); + regmap_write(regmap, QSERDES_PCS_POWER_DOWN_CONTROL, 0x01); + + regmap_write(regmap, QSERDES_COM_PLL_IVCO, 0x0F); + regmap_write(regmap, QSERDES_COM_CP_CTRL_MODE0, 0x06); + regmap_write(regmap, QSERDES_COM_PLL_RCTRL_MODE0, 0x16); + regmap_write(regmap, QSERDES_COM_PLL_CCTRL_MODE0, 0x36); + regmap_write(regmap, QSERDES_COM_SYSCLK_EN_SEL, 0x1A); + regmap_write(regmap, QSERDES_COM_LOCK_CMP1_MODE0, 0x1A); + regmap_write(regmap, QSERDES_COM_LOCK_CMP2_MODE0, 0x41); + regmap_write(regmap, QSERDES_COM_DEC_START_MODE0, 0x7A); + regmap_write(regmap, QSERDES_COM_DIV_FRAC_START1_MODE0, 0x00); + regmap_write(regmap, QSERDES_COM_DIV_FRAC_START2_MODE0, 0x20); + regmap_write(regmap, QSERDES_COM_DIV_FRAC_START3_MODE0, 0x01); + regmap_write(regmap, QSERDES_COM_VCO_TUNE1_MODE0, 0xA1); + + regmap_write(regmap, QSERDES_COM_VCO_TUNE2_MODE0, 0x02); + regmap_write(regmap, QSERDES_COM_VCO_TUNE_INITVAL2, 0x00); + regmap_write(regmap, QSERDES_COM_HSCLK_SEL, 0x03); + regmap_write(regmap, QSERDES_COM_HSCLK_HS_SWITCH_SEL, 0x00); + regmap_write(regmap, QSERDES_COM_CORECLK_DIV_MODE0, 0x05); + regmap_write(regmap, QSERDES_COM_CORE_CLK_EN, 0x00); + regmap_write(regmap, QSERDES_COM_BIN_VCOCAL_CMP_CODE1_MODE0, 0xCD); + regmap_write(regmap, QSERDES_COM_BIN_VCOCAL_CMP_CODE2_MODE0, 0x1C); + regmap_write(regmap, QSERDES_COM_BIN_VCOCAL_HSCLK_SEL, 0x11); + + regmap_write(regmap, QSERDES_TX_TX_BAND, 0x04); + regmap_write(regmap, QSERDES_TX_SLEW_CNTL, 0x0A); + regmap_write(regmap, QSERDES_TX_RES_CODE_LANE_OFFSET_TX, 0x09); + regmap_write(regmap, QSERDES_TX_RES_CODE_LANE_OFFSET_RX, 0x02); + regmap_write(regmap, QSERDES_TX_LANE_MODE_1, 0x05); + regmap_write(regmap, QSERDES_TX_LANE_MODE_3, 0x00); + regmap_write(regmap, QSERDES_TX_RCV_DETECT_LVL_2, 0x12); + regmap_write(regmap, QSERDES_TX_TRAN_DRVR_EMP_EN, 0x0C); + + regmap_write(regmap, QSERDES_RX_UCDR_FO_GAIN, 0x0A); + regmap_write(regmap, QSERDES_RX_UCDR_SO_GAIN, 0x06); + regmap_write(regmap, QSERDES_RX_UCDR_FASTLOCK_FO_GAIN, 0x0A); + regmap_write(regmap, QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x7F); + regmap_write(regmap, QSERDES_RX_UCDR_FASTLOCK_COUNT_LOW, 0x00); + regmap_write(regmap, QSERDES_RX_UCDR_FASTLOCK_COUNT_HIGH, 0x01); + regmap_write(regmap, QSERDES_RX_UCDR_PI_CONTROLS, 0x81); + regmap_write(regmap, QSERDES_RX_UCDR_PI_CTRL2, 0x80); + regmap_write(regmap, QSERDES_RX_RX_TERM_BW, 0x00); + regmap_write(regmap, QSERDES_RX_VGA_CAL_CNTRL2, 0x08); + regmap_write(regmap, QSERDES_RX_GM_CAL, 0x0F); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL1, 0x04); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL2, 0x00); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL3, 0x4A); + regmap_write(regmap, QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4, 0x0A); + regmap_write(regmap, QSERDES_RX_RX_IDAC_TSETTLE_LOW, 0x80); + regmap_write(regmap, QSERDES_RX_RX_IDAC_TSETTLE_HIGH, 0x01); + regmap_write(regmap, QSERDES_RX_RX_IDAC_MEASURE_TIME, 0x20); + regmap_write(regmap, QSERDES_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1, 0x17); + regmap_write(regmap, QSERDES_RX_RX_OFFSET_ADAPTOR_CNTRL2, 0x00); + regmap_write(regmap, QSERDES_RX_SIGDET_CNTRL, 0x0F); + regmap_write(regmap, QSERDES_RX_SIGDET_DEGLITCH_CNTRL, 0x1E); + regmap_write(regmap, QSERDES_RX_RX_BAND, 0x18); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_LOW, 0x18); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH2, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH3, 0x0C); + regmap_write(regmap, QSERDES_RX_RX_MODE_00_HIGH4, 0xB8); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_LOW, 0xE0); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH2, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH3, 0x09); + regmap_write(regmap, QSERDES_RX_RX_MODE_01_HIGH4, 0xB1); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_LOW, 0xE0); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH2, 0xC8); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH3, 0x3B); + regmap_write(regmap, QSERDES_RX_RX_MODE_10_HIGH4, 0xB7); + regmap_write(regmap, QSERDES_RX_DCC_CTRL1, 0x0C); + + regmap_write(regmap, QSERDES_PCS_LINE_RESET_TIME, 0x0C); + regmap_write(regmap, QSERDES_PCS_TX_LARGE_AMP_DRV_LVL, 0x1F); + regmap_write(regmap, QSERDES_PCS_TX_SMALL_AMP_DRV_LVL, 0x03); + regmap_write(regmap, QSERDES_PCS_TX_MID_TERM_CTRL1, 0x83); + regmap_write(regmap, QSERDES_PCS_TX_MID_TERM_CTRL2, 0x08); + regmap_write(regmap, QSERDES_PCS_SGMII_MISC_CTRL8, 0x8C); + regmap_write(regmap, QSERDES_PCS_SW_RESET, 0x00); + + regmap_write(regmap, QSERDES_PCS_PHY_START, 0x01); +} + +static inline int +qcom_dwmac_sgmii_phy_poll_status(struct regmap *regmap, unsigned int reg, + unsigned int bit) +{ + unsigned int val; + + return regmap_read_poll_timeout(regmap, reg, val, + val & bit, 1500, 750000); +} + +static int qcom_dwmac_sgmii_phy_init(struct phy *phy) +{ + struct qcom_dwmac_sgmii_phy_data *data = phy_get_drvdata(phy); + struct device *dev = phy->dev.parent; + + switch (data->speed) { + case SPEED_10: + case SPEED_100: + case SPEED_1000: + qcom_dwmac_sgmii_phy_init_1g(data->regmap); + break; + case SPEED_2500: + qcom_dwmac_sgmii_phy_init_2p5g(data->regmap); + break; + } + + if (qcom_dwmac_sgmii_phy_poll_status(data->regmap, + QSERDES_COM_C_READY_STATUS, + QSERDES_COM_C_READY)) { + dev_err(dev, "QSERDES_COM_C_READY_STATUS timedout"); + return -ETIMEDOUT; + } + + if (qcom_dwmac_sgmii_phy_poll_status(data->regmap, + QSERDES_PCS_PCS_READY_STATUS, + QSERDES_PCS_READY)) { + dev_err(dev, "PCS_READY timedout"); + return -ETIMEDOUT; + } + + if (qcom_dwmac_sgmii_phy_poll_status(data->regmap, + QSERDES_PCS_PCS_READY_STATUS, + QSERDES_PCS_SGMIIPHY_READY)) { + dev_err(dev, "SGMIIPHY_READY timedout"); + return -ETIMEDOUT; + } + + if (qcom_dwmac_sgmii_phy_poll_status(data->regmap, + QSERDES_COM_CMN_STATUS, + QSERDES_COM_C_PLL_LOCKED)) { + dev_err(dev, "PLL Lock Status timedout"); + return -ETIMEDOUT; + } + + return 0; +} + +static int qcom_dwmac_sgmii_phy_exit(struct phy *phy) +{ + struct qcom_dwmac_sgmii_phy_data *data = phy_get_drvdata(phy); + + regmap_write(data->regmap, QSERDES_PCS_TX_MID_TERM_CTRL2, 0x08); + regmap_write(data->regmap, QSERDES_PCS_SW_RESET, 0x01); + udelay(100); + regmap_write(data->regmap, QSERDES_PCS_SW_RESET, 0x00); + regmap_write(data->regmap, QSERDES_PCS_PHY_START, 0x01); + + return 0; +} + +static int qcom_dwmac_sgmii_phy_set_speed(struct phy *phy, int speed) +{ + struct qcom_dwmac_sgmii_phy_data *data = phy_get_drvdata(phy); + + if (speed != data->speed) + data->speed = speed; + + return 0; +} + +static int qcom_dwmac_sgmii_phy_calibrate(struct phy *phy) +{ + return qcom_dwmac_sgmii_phy_init(phy); +} + +static const struct phy_ops qcom_dwmac_sgmii_phy_ops = { + .init = qcom_dwmac_sgmii_phy_init, + .exit = qcom_dwmac_sgmii_phy_exit, + .set_speed = qcom_dwmac_sgmii_phy_set_speed, + .calibrate = qcom_dwmac_sgmii_phy_calibrate, + .owner = THIS_MODULE, +}; + +static const struct regmap_config qcom_dwmac_sgmii_phy_regmap_cfg = { + .reg_bits = 32, + .val_bits = 32, + .reg_stride = 4, + .use_relaxed_mmio = true, + .disable_locking = true, +}; + +static int qcom_dwmac_sgmii_phy_probe(struct platform_device *pdev) +{ + struct qcom_dwmac_sgmii_phy_data *data; + struct device *dev = &pdev->dev; + struct phy_provider *provider; + struct clk *refclk; + void __iomem *base; + struct phy *phy; + + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + data->regmap = devm_regmap_init_mmio(dev, base, + &qcom_dwmac_sgmii_phy_regmap_cfg); + if (IS_ERR(data->regmap)) + return PTR_ERR(data->regmap); + + phy = devm_phy_create(dev, NULL, &qcom_dwmac_sgmii_phy_ops); + if (IS_ERR(phy)) + return PTR_ERR(phy); + + refclk = devm_clk_get_enabled(dev, "sgmi_ref"); + if (IS_ERR(refclk)) + return PTR_ERR(refclk); + + provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + if (IS_ERR(provider)) + return PTR_ERR(provider); + + phy_set_drvdata(phy, data); + platform_set_drvdata(pdev, data); + + return 0; +} + +static const struct of_device_id qcom_dwmac_sgmii_phy_of_match[] = { + { .compatible = "qcom,sa8775p-dwmac-sgmii-phy" }, + { }, +}; +MODULE_DEVICE_TABLE(of, qcom_dwmac_sgmii_phy_of_match); + +static struct platform_driver qcom_dwmac_sgmii_phy_driver = { + .probe = qcom_dwmac_sgmii_phy_probe, + .driver = { + .name = "qcom-dwmac-sgmii-phy", + .of_match_table = qcom_dwmac_sgmii_phy_of_match, + } +}; + +module_platform_driver(qcom_dwmac_sgmii_phy_driver); + +MODULE_DESCRIPTION("Qualcomm DWMAC SGMII PHY driver"); +MODULE_LICENSE("GPL"); From patchwork Mon Jun 12 09:23:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106368 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460535vqr; Mon, 12 Jun 2023 02:33:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zE+snEJK2YhfDgoJui98PjB7HpgXCYVEUsKdn7PwRTWW102QwHRZHFNgELHTFm2riOgcd X-Received: by 2002:a17:906:dac6:b0:96a:3f29:40d9 with SMTP id xi6-20020a170906dac600b0096a3f2940d9mr9028414ejb.25.1686562438351; Mon, 12 Jun 2023 02:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562438; cv=none; d=google.com; s=arc-20160816; b=rDk+apOYLlfUWzlMzt/Ukla6YKUMMWy7agZAxpVGMXI+MpxjY7461aksHvv+xsEZix h4K/NED7+V5SOz23sSwnY5sk6xWSv0O0Q7dl5J+xoYC/jfDamDeAwupMW3PbcR40Irt+ zBuxnpmdqtYnbDHkLSp2bdwKkfHjg82lSBVLyLUd6l1/7GxgZtgXqFtw8wpHl8SY2RFe cvZ/jVjvLcJDB913+c3utEjyklMBlHEGN3wsbs0ui9DWif4yfszPKpDOACC6zeP9ZtYb 0uAV+qIOEbP96sTYXq5eCRe0bvNSePpD6Hy6kMDy25acp/4r+J0X0LorOJIdUhF7kIOQ Jtwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=su4Ml188NZQl7/ApV7N4YWW8KD5ToBDayqEyMhucvL0=; b=iA8L46hMHcZ5sutyT/+4DCmeeOriW1Yj1odAMrVjyj/0KYpBmMoUq1xYckWsKfmkyS VbMFEAGsw6RSfeGV5ToUIxKWIbafiS5L19T7RnrMuQNTfdqbnSjXtZoZNv4ZzT7ZEc7n gvFuIOGXwAH6Kb/eij4p7Vfqapif6LLXrurFnb7rrQ6jRJDjWJj0309CL1wgqq3cZS+D WeKRNLxek8dofML8nGzVIDFe9N3vtGy6BtDcTCijAji5IaB0nVymhso6Dyp7tz2YaP7c WU+gH69Hc7sH48HuzmWRrhQvj/ijeEv+zzqZEyTxRBIToVu1VgEv5hEJQPuRkZQ+vdc0 yGTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=wTReWTES; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a17090608c300b00974bd4b5e1asi1436374eje.108.2023.06.12.02.33.31; Mon, 12 Jun 2023 02:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=wTReWTES; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234118AbjFLJae (ORCPT + 99 others); Mon, 12 Jun 2023 05:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233692AbjFLJ3l (ORCPT ); Mon, 12 Jun 2023 05:29:41 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10F3E60 for ; Mon, 12 Jun 2023 02:24:32 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f642a24555so4797686e87.3 for ; Mon, 12 Jun 2023 02:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561871; x=1689153871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=su4Ml188NZQl7/ApV7N4YWW8KD5ToBDayqEyMhucvL0=; b=wTReWTESrXF8MQdnFv0BcbECvhA5k1jp/UpUNoz5an+amSVMTnDq4zSy8OhgF+QIHP VxqnfBT6c8Gc9esMda2ao0ri3AX9tE/Rej1L2iPODh3z23iryd54EdmTxXf8Akqd40iz UUREr/Vua1XefWoHpGHQw9UxoR0Aktnkb6PKHg6zaQXmUGDFO6+IDX5d1DXhwizay6wi Sd3rbsJxq7tmZEsN+gMmSOGdFdNh6xTDJfT5ymd+QoUGgf0D1fTFl1R9WITy+EMgUGVI c3WesnH2AJ3Dw4o2uhkFqpDxTeAZJc1xoHaxEpGONEJDz97NZzhNi6uUAzStEDQHePL+ Mdaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561871; x=1689153871; h=content-transfer-encoding:mime-version: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=su4Ml188NZQl7/ApV7N4YWW8KD5ToBDayqEyMhucvL0=; b=AHy1F9qTyl6S6dLwLk3DPVr8ybowo2uDJNQwE9lwYdVkvPH70g0FAhTiDcv2tRHruL 5egf7MYUULqwEYIsKI8gHRowtjJvVg8dF69ChmCa/BuS4y2gTkAB85co7eKnotu3E1oh q8T2xlOSeZW9fBgfq3iJKeP7eudh7B/5nhmrY+BJqCoOTAcA4ynrdXvwGxrCFdyruu8b U85sfafrn1S9VwRrCK34FCnINrHCKFy6A7ZrCRTVJwv6ucUNOPpmAsOoZSp3mNqsyVSL dre9MEnVO+PVKuhtSIsBuo2b6gAYD3I8HKYDRg9zShbGU+seGbXvIc790iddk0rm5vK1 Z+Ng== X-Gm-Message-State: AC+VfDyC2ISF5obye+5K/w48UFHLSPk0W4CmwcmPNLpIZFXhMqwQVLXx +gMyD67VG2aXQzbegruF2ipTJw== X-Received: by 2002:a19:6601:0:b0:4f6:5bf2:63bc with SMTP id a1-20020a196601000000b004f65bf263bcmr3203042lfc.3.1686561871076; Mon, 12 Jun 2023 02:24:31 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:30 -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 , Arnd Bergmann , Will Deacon , Catalin Marinas , Maxime Coquelin Subject: [PATCH 04/26] arm64: defconfig: enable the SerDes PHY for Qualcomm DWMAC Date: Mon, 12 Jun 2023 11:23:33 +0200 Message-Id: <20230612092355.87937-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488895252698263?= X-GMAIL-MSGID: =?utf-8?q?1768488895252698263?= From: Bartosz Golaszewski Enable the SGMII/SerDes PHY driver. This module is required to enable ethernet on sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 8d850be05835..f62c96fd4335 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1367,6 +1367,7 @@ CONFIG_PHY_QCOM_USB_HS=m CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=m CONFIG_PHY_QCOM_USB_HS_28NM=m CONFIG_PHY_QCOM_USB_SS=m +CONFIG_PHY_QCOM_SGMII_ETH=m CONFIG_PHY_R8A779F0_ETHERNET_SERDES=y CONFIG_PHY_RCAR_GEN3_PCIE=y CONFIG_PHY_RCAR_GEN3_USB2=y From patchwork Mon Jun 12 09:23:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460429vqr; Mon, 12 Jun 2023 02:33:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40GtpoKIHc1wc2OPydIb1a+zIv4fJE5/hrXqdKS3RQT6Y6MzkaiFKqbSthRlvQnbrsod59 X-Received: by 2002:a17:903:11c3:b0:1b0:61dc:db67 with SMTP id q3-20020a17090311c300b001b061dcdb67mr6477761plh.30.1686562425437; Mon, 12 Jun 2023 02:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562425; cv=none; d=google.com; s=arc-20160816; b=nRFAr93BYqvlGb/nbJAMoaKP/ClR0qBy9SOlJxeCs/ROBEeraaGaDv7qBLHvXjaMnC MY7eKVvhq63VE1lfTJ8b6+MahYgd/i80ko3BoKYf9RF2bfO8yJix02lRvtRw2YuIQXmB mKqsYN8oQtxq0bydA2fXBobLd7GNV9SYac/jADpaqcE1w1kHP44Tlf5po83TIHAtzLKe cNiU7vJLVve+htOsKUbGrUsxs6/xDgf606eu6EF8im+PWUqAsSTpnYyHgYde9WKyxsfs 00aB3BWDOaXtiR8u265MWfVmvPS7obZ9b0ubeEDDO9nOcybPvtDvOxEUU5Mf7INB0eqp +Qkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nw89zfIb59CUkEP5Ai7VazKbf1+XGop4tAXeykv2kzc=; b=XCIVuzcdEomEE7r9tQ5/BXTLaMr2tdTFwaJoOP/SKB9/67NZOpCKVh8cpkjEA8aWDA jnEyruqJppkji45VPZlRgJ11KEcHgaFgQQPCg2Gd3i9PEar/SCXVV/LJJIa/er7siONL dFzRAwveHVUhsU5T64IzFnNCyDgtYvA0NaakYvqvFkC7asfDFrBg/hnofmv43zY0q4IY hqtpwIi34biG7dVE/lDPAB9aV906Ui2pXbbbfBuvJPn4c4kKIyvRvmBeztQboN9z037L ToApTEJo06BcPHZW9eeny0gmRwdEH/yVDTgiRPlm1ZNVmTEmpbP/MfibnEgpmUZTPdpF 3SIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=HRwjTwYe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a170902cf4600b001aad291018fsi6665943plg.350.2023.06.12.02.33.31; Mon, 12 Jun 2023 02:33:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=HRwjTwYe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234858AbjFLJal (ORCPT + 99 others); Mon, 12 Jun 2023 05:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbjFLJ3p (ORCPT ); Mon, 12 Jun 2023 05:29:45 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D218EE62 for ; Mon, 12 Jun 2023 02:24:34 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f6dfc4dffaso29771115e9.0 for ; Mon, 12 Jun 2023 02:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561873; x=1689153873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nw89zfIb59CUkEP5Ai7VazKbf1+XGop4tAXeykv2kzc=; b=HRwjTwYewLxWQA+IGypwGPKaQrnA/Wdf9eY6XI4irbPBTq5zqp+2jE6iNjFNtIYokW 2oIEi8K0Q2UE5Z4nrTuXXwlFdZVRdWBaBE7cy60Qy7h/+cwcRoMnGmDUebo+KXdoZpJL krYZKDOSyXAb2+9dK0/JnM/iDhOCDkbgaUG0trEr0awFRqhl55hQSXimZWLdwG1iVSKJ UWqoodIwJxKQa+GGye9WeMzU9XFxA9B8lZIsyeuOVvLx55vIwvivdM9BhrKky0GucXSe 3MeQ54jO/tnJl3G9RxNYKxVxEscpNh+t3vjVw/fQoj8SrecH7Q9NLffXL5EiKFZp2QiB d36A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561873; x=1689153873; h=content-transfer-encoding:mime-version: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=nw89zfIb59CUkEP5Ai7VazKbf1+XGop4tAXeykv2kzc=; b=P/ox+93fdd/2Mfv09tSMZ9tIeTM4qzpjY+Y4g4cwKglyTFDB/iT8xFLVjVpzV3pP5+ UE+gAi2DZAoxNVXAA/f7sA3jWeajBgQxPlMjcPwN/aLyiquP87nmpk18xUKet9F4Fm/f T6mX8dPf5C0B2l9qA+I68rjkp14GH0ym+h/d/znajv7U1giJG95P7vVyUZFKE6I+IxMV UUyv0Vx5RILLZjBcyTH8F4oTEp4pJ5c22Aqb9F2ull/8a/W5KBSOt4ty0zbFIG6RDLQH hIFpmfyW0VGp2pD6fiPcIRBfCyBKRaz4xqo9ZiIt8U6wEo4ilke7LNi8cUhyDhyK2a7I IukQ== X-Gm-Message-State: AC+VfDxZQy7Vc3cgMGttyyQlQHzfwEU96x5XERKQWD8j5hD4SM+ebZsC MRkO2J2UEBlz7FAz0Gclj+IuPA== X-Received: by 2002:a7b:c347:0:b0:3f7:e7d5:6123 with SMTP id l7-20020a7bc347000000b003f7e7d56123mr5820770wmj.41.1686561873262; Mon, 12 Jun 2023 02:24:33 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:32 -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 05/26] net: stmmac: dwmac-qcom-ethqos: shrink clock code with devres Date: Mon, 12 Jun 2023 11:23:34 +0200 Message-Id: <20230612092355.87937-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488881980139571?= X-GMAIL-MSGID: =?utf-8?q?1768488881980139571?= From: Bartosz Golaszewski We can use a devm action to completely drop the remove callback and use stmmac_pltfr_remove() directly for remove. We can also drop one of the goto labels. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- .../stmicro/stmmac/dwmac-qcom-ethqos.c | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index c801838fae2a..2da0738eed24 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -586,6 +586,11 @@ static int ethqos_clks_config(void *priv, bool enabled) return ret; } +static void ethqos_clks_disable(void *data) +{ + ethqos_clks_config(data, false); +} + static int qcom_ethqos_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; @@ -636,6 +641,10 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (ret) goto err_mem; + ret = devm_add_action_or_reset(&pdev->dev, ethqos_clks_disable, ethqos); + if (ret) + goto err_mem; + ethqos->speed = SPEED_1000; ethqos_update_rgmii_clk(ethqos, SPEED_1000); ethqos_set_func_clk_en(ethqos); @@ -653,27 +662,16 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) - goto err_clk; + goto err_mem; return ret; -err_clk: - ethqos_clks_config(ethqos, false); - err_mem: stmmac_remove_config_dt(pdev, plat_dat); return ret; } -static void qcom_ethqos_remove(struct platform_device *pdev) -{ - struct qcom_ethqos *ethqos = get_stmmac_bsp_priv(&pdev->dev); - - stmmac_pltfr_remove(pdev); - ethqos_clks_config(ethqos, false); -} - static const struct of_device_id qcom_ethqos_match[] = { { .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data}, { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data}, @@ -684,7 +682,7 @@ MODULE_DEVICE_TABLE(of, qcom_ethqos_match); static struct platform_driver qcom_ethqos_driver = { .probe = qcom_ethqos_probe, - .remove_new = qcom_ethqos_remove, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "qcom-ethqos", .pm = &stmmac_pltfr_pm_ops, From patchwork Mon Jun 12 09:23:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460341vqr; Mon, 12 Jun 2023 02:33:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7MBiYTuAzHP6vq2c8O47Vxf1s9CiA+4Fh9mFAi8ZPVXme86cRU7K3r9Jrtj8EMpvtTYU7x X-Received: by 2002:a17:90b:3785:b0:25b:fbdc:dd8 with SMTP id mz5-20020a17090b378500b0025bfbdc0dd8mr388356pjb.24.1686562414652; Mon, 12 Jun 2023 02:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562414; cv=none; d=google.com; s=arc-20160816; b=FFtsxvOvD9lthh6ilq+27GSKGAV65M5KygTFS/Aa4MhluHXTbOpYUgRT2Sl/8lznGD BCQmUNM6Kv9eq/zJzmMGDyzisDoXQE6q+Gx+k/5Xr0KlmqmmMFTrhzAyL0jB6cUStTJ4 I0BlSg35m8CvOC7dShDLtV0MPOrdLDcaFQ/G2OvfcHEZlShrlNhEnuujR7tprDuFbPld qIKtxvWtogaNGMD8VWTZtZPFRSsvEsDvCRi0XK8U0f7Q8C0JgdyznHcLSRftIYrf6MtP T5ta0SQJ68QP32l0u7qoG/RKXL8AK8Lb78Z08SyjmBjCWUYUvZVE1Vy5qsa+vDsWXSqW bCFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IGA9dmnWHTO9MZBMILRr3rONKWHes12eMbHxxU5rYjo=; b=JBv7RlDjPH74n36WhAQ5Apt5vU4PDGr0y05EvuwpT5ON8xufUCEv50W3uehJnPpnbN NbOJT9gJEDFtRrwhjjawJ2hDI/I5i0rDOQ1rP/wIh31jOxGp3ss5fp1qdJj302eOTf7t sH8HPfTlp9TYz3qdVe0DFNLslGizvhDl1RbajbWLr+uqRfrSqEWj36Ch8Utj1rPCy0j4 n9kmdgsy0T05nNMcBFe8nJiTTYQJy21ckN3BuNgprPAs5DZS2ri8MMpEuuIFIrh0iRai V/MXUd3+V+1dlZF+do8znf0wB2B8HNaGqKoXjZq9VYaMrLe20bkcYtRrAofLSFx37S5b wB3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="VJH/Eqnp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 24-20020a631258000000b0051b37c000dcsi2970966pgs.81.2023.06.12.02.33.21; Mon, 12 Jun 2023 02:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="VJH/Eqnp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbjFLJap (ORCPT + 99 others); Mon, 12 Jun 2023 05:30:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbjFLJ3q (ORCPT ); Mon, 12 Jun 2023 05:29:46 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BD59E7E for ; Mon, 12 Jun 2023 02:24:36 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f6d7abe934so27873085e9.2 for ; Mon, 12 Jun 2023 02:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561875; x=1689153875; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IGA9dmnWHTO9MZBMILRr3rONKWHes12eMbHxxU5rYjo=; b=VJH/EqnpVIY9A4wdvuanh+zRJFMHoqtN9KlHUE4TXf8pfiMb7wFsH2Rj+361K8lWVj iK7LWDPTaXeD0dwIS2hHMT1FGQVyG7CkfGyoZjPt3BdhoFANevsCA4Mo5a8ppPcQhgdp SP9IO3RNxz+n007apXXHJ9NyObniN2jtUwd+h0QRHR2Bm+AD+4TYdaz+x15cqvuNjqJK +/B9tZ8/5bhK+Bt/im5KT0ddam05HuhL9bBrYeCt+Ua0bWcnkwuK/2cTvUpJFUP7Np4F TVwOCy8t2WTgdeXbdqUP2tULpIEZK61tC7Mi6OK+2RsGopFURjr79xtR0s8fMNOjKYNi Hzog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561875; x=1689153875; h=content-transfer-encoding:mime-version: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=IGA9dmnWHTO9MZBMILRr3rONKWHes12eMbHxxU5rYjo=; b=C/Yddj5iK8fTEgTs2AW4Ne3dehzdZThYF5h2ekT5HJ0/OMovBOPFJIeSnX04gCpyjO c/Q9LlvrdKXMfQ2HcQ1xWrdRE2trm0ky1Cc+x/2VxXTzCdevdkKum+nKuys2/MPrLYlS Ovw8XpMcndmM0DJiJfriYiS5spfHwrT8RynrKnJlwincSDMRsPhtyVHf7fYzm3SdsE+R fc3HbnJPRDpXDMGPEZM9Vc/KoVXYjbKfVb6GKPnH0y2csx6r5L6ubPcUXLeaakx4nveU xDCAeYT8GN52CNPFwfhx6Z+1tqoWPTp2S3Fz76VIwoZ1743Qb27VCdH0/56oKoY/Gw3H TMMw== X-Gm-Message-State: AC+VfDzRRkkqOjLTwwuAb7mcFI0J+5YaEycMxFAy9stK8gYIsKNzQ541 mvIYnjlDQQGYrLPnAaitMcE80Q== X-Received: by 2002:a1c:f718:0:b0:3f7:3526:d96f with SMTP id v24-20020a1cf718000000b003f73526d96fmr5606394wmh.27.1686561874950; Mon, 12 Jun 2023 02:24:34 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:34 -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 06/26] net: stmmac: dwmac-qcom-ethqos: rename a label in probe() Date: Mon, 12 Jun 2023 11:23:35 +0200 Message-Id: <20230612092355.87937-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488870775534389?= X-GMAIL-MSGID: =?utf-8?q?1768488870775534389?= From: Bartosz Golaszewski The err_mem label's name is unclear. It actually should be reached on any error after stmmac_probe_config_dt() succeeds. Name it after the cleanup action that needs to be called before exiting. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 2da0738eed24..16e856861558 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -615,14 +615,14 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos = devm_kzalloc(&pdev->dev, sizeof(*ethqos), GFP_KERNEL); if (!ethqos) { ret = -ENOMEM; - goto err_mem; + goto out_config_dt; } ethqos->pdev = pdev; ethqos->rgmii_base = devm_platform_ioremap_resource_byname(pdev, "rgmii"); if (IS_ERR(ethqos->rgmii_base)) { ret = PTR_ERR(ethqos->rgmii_base); - goto err_mem; + goto out_config_dt; } data = of_device_get_match_data(&pdev->dev); @@ -634,16 +634,16 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii"); if (IS_ERR(ethqos->rgmii_clk)) { ret = PTR_ERR(ethqos->rgmii_clk); - goto err_mem; + goto out_config_dt; } ret = ethqos_clks_config(ethqos, true); if (ret) - goto err_mem; + goto out_config_dt; ret = devm_add_action_or_reset(&pdev->dev, ethqos_clks_disable, ethqos); if (ret) - goto err_mem; + goto out_config_dt; ethqos->speed = SPEED_1000; ethqos_update_rgmii_clk(ethqos, SPEED_1000); @@ -662,11 +662,11 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) - goto err_mem; + goto out_config_dt; return ret; -err_mem: +out_config_dt: stmmac_remove_config_dt(pdev, plat_dat); return ret; From patchwork Mon Jun 12 09:23:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106399 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2469101vqr; Mon, 12 Jun 2023 02:55:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xmDXFmfWv2xpAzSF+dhZ1iAihU46jKXQKYLtxjI9W8V/4RZ1cQOuPCFzHB4O4QqoqM2Zt X-Received: by 2002:a17:907:934a:b0:978:90cc:bf73 with SMTP id bv10-20020a170907934a00b0097890ccbf73mr8497314ejc.48.1686563755961; Mon, 12 Jun 2023 02:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563755; cv=none; d=google.com; s=arc-20160816; b=XZ/fV4Um1yjaqf63jMM0MfVfuhRcOn9loU2HCGX1PXFQCM1V5RkzN/z/kkKGOrmvr6 vMKb3IROJr8yzBZYWAOrZoQNtYDeZAPavfr8OQtvxt6EwcZVdhXbNmfbCMsJTetOgWrt abNCz2jwMbMiprjmJJvSClEdUzM53bwRXBVnnC3+jfZQRTkpAeE9c2n2siz7m9CV+sHv soZSC6E6hUcoeOfhyr4k1E2hsRvmM7bNHnmbqwfyMMPaHENBDi13e75AYg2sPVeC/4Qe d6QV099K6h3nXpFWFZeb1rlDaUpr2SwnYoYvJ5dByM7Hn48FDqUFtVx9Oi1SPeNw35oN TdEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=olcveT5UP1VtPiAz7clK/JVsOLfG7BcQJiP17zTmSVg=; b=K4hFlsW46jn4AWnrhihYSFikDVOBysxgvXqUE3VSI35+g+ZsLUckeqICjgkNs80irV QO4Gamydr5qZPt+HKAk5SbHgkBBSedkJQV1kQUM+BMfumkUqwfT7CIGUJM+CpX1cks4+ IcdEb7pEIo360w4QC/Ng+rebX/8n0fNHvF4SDpM79aCFnNze55lgXpbcbnuy2qDfHdy1 59qscrwk72dIMIL35rW6w7x8DX8ejJX32VFwGlkvpo1JQT7ir9W20gn7AN9UyS/SgLJX 6hNDeVaNXUrOMjOXX18m7ACtagJNeCXtO9tjSoM0SEHlPkmNFPvdx9DZO8asm2JC9yDV qB1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=5L8AZQCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e24-20020a056402089800b00516b1a6b60fsi5681758edy.159.2023.06.12.02.55.32; Mon, 12 Jun 2023 02:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=5L8AZQCE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231560AbjFLJax (ORCPT + 99 others); Mon, 12 Jun 2023 05:30:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234673AbjFLJ3s (ORCPT ); Mon, 12 Jun 2023 05:29:48 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4AF31BC1 for ; Mon, 12 Jun 2023 02:24:37 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f619c2ba18so4495217e87.1 for ; Mon, 12 Jun 2023 02:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561876; x=1689153876; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=olcveT5UP1VtPiAz7clK/JVsOLfG7BcQJiP17zTmSVg=; b=5L8AZQCENa6wk25Wk1x41BvLjZPoG7GaKW7WRgHBzPesHTu+JxqbkF4slD2rDK4+2a 1MeffqJGHvG1Mxz2eOg0xmGDid0CWmHPp2RYxaiXDvuGxNiM6tMcLy8i+GoDCIo5SR6X aAwisPKSBZLSLwHuiroOnFmweOMUjutIYsUVNpCVuAWxEVLZ5TQjz8recM1V34U1oLh5 i05JqSQiuiZiodJ2P141uneoMY9uf8Qpu2jau4D8v4dmqHKYo/vC+S7uysmfwNgzJWuO m/KfLrmuOcZnsTJJgPkluArQZGR6EJS/Pnymu9rNxuJpBTox48p4hro1Y6B5LKKCQsRo YJ8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561876; x=1689153876; h=content-transfer-encoding:mime-version: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=olcveT5UP1VtPiAz7clK/JVsOLfG7BcQJiP17zTmSVg=; b=CNAVDwyj2qNXRSp/kY6PgC6p3y7gX0gbB6bldjz+tPBkXSXLbPbMwzfE5yVg6szn8+ gGkhKJlqEaYvMc5Tevvy4vem4x2g5sCjhY4GloZRaz8JCgu7KxjZZEhkkcZiUR+JrjuV PzyAUOIXq2I2A68IkBa+NefeaNvyNXVWybFdjNlucH1B8apzE394/vlkxDUJo/Qri9UB ELRT9gSIx6Mrlrism9cblVaM7zGcML4xlP5OJFeAQwF7cmYCaZxa7VJ0HNx22r5jcXLx nC25vXamZDHhullfOCk9hfOe4RPMb0/jzqJTPgjZJyjIKOjqozq5hxaQMTw5JU+HAO/2 iBjg== X-Gm-Message-State: AC+VfDxcuiVB2tZ7r1Zxyrb7GECz+qGIjhgbLYWN5CIr2m6N8MBlW4Me R2zcWgJmCtOfsIqVT+N2A1DTvg== X-Received: by 2002:ac2:5b1c:0:b0:4f3:af46:1941 with SMTP id v28-20020ac25b1c000000b004f3af461941mr3498469lfn.34.1686561876266; Mon, 12 Jun 2023 02:24:36 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:35 -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 07/26] net: stmmac: dwmac-qcom-ethqos: tweak the order of local variables Date: Mon, 12 Jun 2023 11:23:36 +0200 Message-Id: <20230612092355.87937-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768490276891544849?= X-GMAIL-MSGID: =?utf-8?q?1768490276891544849?= From: Bartosz Golaszewski Make sure we follow the reverse-xmas tree convention. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 16e856861558..28d2514a8795 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -594,9 +594,9 @@ static void ethqos_clks_disable(void *data) static int qcom_ethqos_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; + const struct ethqos_emac_driver_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; - const struct ethqos_emac_driver_data *data; struct qcom_ethqos *ethqos; int ret; From patchwork Mon Jun 12 09:23:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106389 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2467292vqr; Mon, 12 Jun 2023 02:51:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Dp9twrc1wXdMubicy73dS8pLcVn0WJJqjCm65+iPa1pVDkWTmTRK3hzdWSdIgO5l9fw25 X-Received: by 2002:a05:6a20:e616:b0:10a:a0e1:96fa with SMTP id my22-20020a056a20e61600b0010aa0e196famr8791360pzb.22.1686563463783; Mon, 12 Jun 2023 02:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563463; cv=none; d=google.com; s=arc-20160816; b=xb9EPVMrlL85c52ttlNjw0lWa3HBUkXETfA9jdpzPCU+Zs+uBl5HHiKEbhTKZ6CmXv MMyJaItIO7Z1m0rinW0LPcyHhUStvhFV8hBrH8W2ej2luELyRJwq0Vpf4SG3Y3QLKgfY 0mW0NyuqnmWJ5IXa45BtaFmI7b5uBhBPCofYPmFtB3bNu4Zp3lOxHWvcjTQPyBrY7KE0 Ib1CjZDzkjV/TbuwJzoqsDoFsAheGiIuF2h3RapxAHIuxS7uySPMda3825SCutL4xklj RJZDrEN87SeeRF4VSLd4EDq9kQ63puZGkTHOwXBTkAaqGkm3C2uvskOiHuqkFFUE95LS AkMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dcof+ioLKEeKphF7CJyWNZmTAfrhrHTZK64Fi/9bNaI=; b=gCTgbzitZMiL57HgWe15ZP/kTBpFtvrimNwvKpqSys4ixarxhibjYNq2PBdf0LzZAt LeqbJP0R58hkoQbNToyPsh1U3pSNf1+h09Gq5IwjzFzJmAzK8xPVRVamcdla4ph8wJE8 OvyayYAPcpWLZzyUd7OxeQixDQiAwO2bHnJofoa2uyCG2yCcoE/rZgCeQCyf6kvR+jc9 CiT18cneU3jWeYqt0Oyvtv36trth1PYy+ZrB6OO+DXeRRuZjnUpOXOlIc3m63tYh/OmA X8iN1NNYv7vYJWkpBTvpHowYw+6vpQMAfzwn10ZK1ByiaW9nifgTNPOZ5i/ZzM9vYEJo OAdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Dg7TMce7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v71-20020a63894a000000b005443ff97149si3640803pgd.331.2023.06.12.02.50.51; Mon, 12 Jun 2023 02:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Dg7TMce7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234848AbjFLJbD (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234867AbjFLJ3u (ORCPT ); Mon, 12 Jun 2023 05:29:50 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06CB31BF0 for ; Mon, 12 Jun 2023 02:24:39 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f81b449357so7729625e9.0 for ; Mon, 12 Jun 2023 02:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561877; x=1689153877; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dcof+ioLKEeKphF7CJyWNZmTAfrhrHTZK64Fi/9bNaI=; b=Dg7TMce7jAT0NsV+wlnPsos/ZyuSZyDJqhpW/BBbn9Ka1QrBfiXgqZTaar1M9RU4L5 b0/hgLiiaAe+rn1FdxEy7/FLD6PjGJPKwsHiJSy5XLR3CKoVPnRnJftTuKbyjwSHEqLa vYL/OpcY7rEXgXARYIo14jlZxUfWbR5CSWwZ2xL269j3cAoqSSCCVXtt98PBVs1f4AJ/ WnZL1Ba1NhJH1alP0S8Hg7FklHXutu80MK1fcTSL92Zz3DE2NQ32qzBIV2acbD0o0xYE 3+X7E2SPeEjQYMX4NknRZkL9zF6/7Pvv9gsYdvH8L+GpnsUcew18D7WL5UTxSRjX2aJi /ABw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561877; x=1689153877; h=content-transfer-encoding:mime-version: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=dcof+ioLKEeKphF7CJyWNZmTAfrhrHTZK64Fi/9bNaI=; b=ZFeCEJPzjkzYQCtBFrX42kIZdOxCcwcMTfFrBFp/0164L1drTRoP5xWKnGBKX8UH8m UQqTM7jhQ3i/fM09FD+JC/tRG8RSvZvH7mbFGQhfujjoqN1d2qkOGZPh/e6a2wQvbPKX RGCLrrotW/R2naUbNsw7Lw6JNKqC0apKeV1TZU1oU0wksj6UncbicxOZpxDQxnrIaJLV M5PMfL+cc4AmHKDX8YzGg9cN6LQtbh0Km0NO7JUy9e0n2ac88BXGFHzJYVHOjlsuwTRv NLaXDjcXMo295xGrwUhipL0Trh2kKR0+fT8oIF+bFEf8MVKhBbD7ebObtk+nclGlE+rO zkYg== X-Gm-Message-State: AC+VfDz8wKJTLslfnAeUFwhzZeU0fLfrxTi/BSBxIxcOM5N8NGaQJhzu MSF1CfQ3RMeeU0DdcoBaBearMw== X-Received: by 2002:a05:600c:aca:b0:3f7:f614:9970 with SMTP id c10-20020a05600c0aca00b003f7f6149970mr6683496wmr.34.1686561877559; Mon, 12 Jun 2023 02:24:37 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:37 -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 08/26] net: stmmac: dwmac-qcom-ethqos: use a helper variable for &pdev->dev Date: Mon, 12 Jun 2023 11:23:37 +0200 Message-Id: <20230612092355.87937-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489970584478530?= X-GMAIL-MSGID: =?utf-8?q?1768489970584478530?= From: Bartosz Golaszewski Shrink code and avoid line breaks by using a helper variable for &pdev->dev. Signed-off-by: Bartosz Golaszewski --- .../stmicro/stmmac/dwmac-qcom-ethqos.c | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 28d2514a8795..e19d142630d3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -123,25 +123,26 @@ static void rgmii_updatel(struct qcom_ethqos *ethqos, static void rgmii_dump(void *priv) { struct qcom_ethqos *ethqos = priv; + struct device *dev = ðqos->pdev->dev; - dev_dbg(ðqos->pdev->dev, "Rgmii register dump\n"); - dev_dbg(ðqos->pdev->dev, "RGMII_IO_MACRO_CONFIG: %x\n", + dev_dbg(dev, "Rgmii register dump\n"); + dev_dbg(dev, "RGMII_IO_MACRO_CONFIG: %x\n", rgmii_readl(ethqos, RGMII_IO_MACRO_CONFIG)); - dev_dbg(ðqos->pdev->dev, "SDCC_HC_REG_DLL_CONFIG: %x\n", + dev_dbg(dev, "SDCC_HC_REG_DLL_CONFIG: %x\n", rgmii_readl(ethqos, SDCC_HC_REG_DLL_CONFIG)); - dev_dbg(ðqos->pdev->dev, "SDCC_HC_REG_DDR_CONFIG: %x\n", + dev_dbg(dev, "SDCC_HC_REG_DDR_CONFIG: %x\n", rgmii_readl(ethqos, SDCC_HC_REG_DDR_CONFIG)); - dev_dbg(ðqos->pdev->dev, "SDCC_HC_REG_DLL_CONFIG2: %x\n", + dev_dbg(dev, "SDCC_HC_REG_DLL_CONFIG2: %x\n", rgmii_readl(ethqos, SDCC_HC_REG_DLL_CONFIG2)); - dev_dbg(ðqos->pdev->dev, "SDC4_STATUS: %x\n", + dev_dbg(dev, "SDC4_STATUS: %x\n", rgmii_readl(ethqos, SDC4_STATUS)); - dev_dbg(ðqos->pdev->dev, "SDCC_USR_CTL: %x\n", + dev_dbg(dev, "SDCC_USR_CTL: %x\n", rgmii_readl(ethqos, SDCC_USR_CTL)); - dev_dbg(ðqos->pdev->dev, "RGMII_IO_MACRO_CONFIG2: %x\n", + dev_dbg(dev, "RGMII_IO_MACRO_CONFIG2: %x\n", rgmii_readl(ethqos, RGMII_IO_MACRO_CONFIG2)); - dev_dbg(ðqos->pdev->dev, "RGMII_IO_MACRO_DEBUG1: %x\n", + dev_dbg(dev, "RGMII_IO_MACRO_DEBUG1: %x\n", rgmii_readl(ethqos, RGMII_IO_MACRO_DEBUG1)); - dev_dbg(ðqos->pdev->dev, "EMAC_SYSTEM_LOW_POWER_DEBUG: %x\n", + dev_dbg(dev, "EMAC_SYSTEM_LOW_POWER_DEBUG: %x\n", rgmii_readl(ethqos, EMAC_SYSTEM_LOW_POWER_DEBUG)); } @@ -242,6 +243,7 @@ static const struct ethqos_emac_driver_data emac_v3_0_0_data = { static int ethqos_dll_configure(struct qcom_ethqos *ethqos) { + struct device *dev = ðqos->pdev->dev; unsigned int val; int retry = 1000; @@ -279,7 +281,7 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) retry--; } while (retry > 0); if (!retry) - dev_err(ðqos->pdev->dev, "Clear CK_OUT_EN timedout\n"); + dev_err(dev, "Clear CK_OUT_EN timedout\n"); /* Set CK_OUT_EN */ rgmii_updatel(ethqos, SDCC_DLL_CONFIG_CK_OUT_EN, @@ -296,7 +298,7 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) retry--; } while (retry > 0); if (!retry) - dev_err(ðqos->pdev->dev, "Set CK_OUT_EN timedout\n"); + dev_err(dev, "Set CK_OUT_EN timedout\n"); /* Set DDR_CAL_EN */ rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_DDR_CAL_EN, @@ -322,12 +324,13 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) { + struct device *dev = ðqos->pdev->dev; int phase_shift; int phy_mode; int loopback; /* Determine if the PHY adds a 2 ns TX delay or the MAC handles it */ - phy_mode = device_get_phy_mode(ðqos->pdev->dev); + phy_mode = device_get_phy_mode(dev); if (phy_mode == PHY_INTERFACE_MODE_RGMII_ID || phy_mode == PHY_INTERFACE_MODE_RGMII_TXID) phase_shift = 0; @@ -468,7 +471,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) loopback, RGMII_IO_MACRO_CONFIG); break; default: - dev_err(ðqos->pdev->dev, + dev_err(dev, "Invalid speed %d\n", ethqos->speed); return -EINVAL; } @@ -478,6 +481,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) static int ethqos_configure(struct qcom_ethqos *ethqos) { + struct device *dev = ðqos->pdev->dev; volatile unsigned int dll_lock; unsigned int i, retry = 1000; @@ -540,8 +544,7 @@ static int ethqos_configure(struct qcom_ethqos *ethqos) retry--; } while (retry > 0); if (!retry) - dev_err(ðqos->pdev->dev, - "Timeout while waiting for DLL lock\n"); + dev_err(dev, "Timeout while waiting for DLL lock\n"); } if (ethqos->speed == SPEED_1000) @@ -597,6 +600,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) const struct ethqos_emac_driver_data *data; struct plat_stmmacenet_data *plat_dat; struct stmmac_resources stmmac_res; + struct device *dev = &pdev->dev; struct qcom_ethqos *ethqos; int ret; @@ -606,13 +610,13 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac); if (IS_ERR(plat_dat)) { - dev_err(&pdev->dev, "dt configuration failed\n"); + dev_err(dev, "dt configuration failed\n"); return PTR_ERR(plat_dat); } plat_dat->clks_config = ethqos_clks_config; - ethqos = devm_kzalloc(&pdev->dev, sizeof(*ethqos), GFP_KERNEL); + ethqos = devm_kzalloc(dev, sizeof(*ethqos), GFP_KERNEL); if (!ethqos) { ret = -ENOMEM; goto out_config_dt; @@ -625,13 +629,13 @@ static int qcom_ethqos_probe(struct platform_device *pdev) goto out_config_dt; } - data = of_device_get_match_data(&pdev->dev); + data = of_device_get_match_data(dev); ethqos->por = data->por; ethqos->num_por = data->num_por; ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en; ethqos->has_emac3 = data->has_emac3; - ethqos->rgmii_clk = devm_clk_get(&pdev->dev, "rgmii"); + ethqos->rgmii_clk = devm_clk_get(dev, "rgmii"); if (IS_ERR(ethqos->rgmii_clk)) { ret = PTR_ERR(ethqos->rgmii_clk); goto out_config_dt; @@ -641,7 +645,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (ret) goto out_config_dt; - ret = devm_add_action_or_reset(&pdev->dev, ethqos_clks_disable, ethqos); + ret = devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); if (ret) goto out_config_dt; @@ -660,7 +664,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) plat_dat->rx_clk_runs_in_lpi = 1; - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); + ret = stmmac_dvr_probe(dev, plat_dat, &stmmac_res); if (ret) goto out_config_dt; From patchwork Mon Jun 12 09:23:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2466922vqr; Mon, 12 Jun 2023 02:50:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4JuxprfsAM3uIRyesOz/JYf5vy43pnnWo9E5zUUonbOFcuG+92H5sDJnz04MbBPXlBcPSn X-Received: by 2002:a92:c806:0:b0:33b:f0a0:8dea with SMTP id v6-20020a92c806000000b0033bf0a08deamr6479801iln.26.1686563405376; Mon, 12 Jun 2023 02:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563405; cv=none; d=google.com; s=arc-20160816; b=gLH5eRoAgJ43IT7eIKvZ8zLWo2YSXarT444Yy0bSb7Bi6r4ftUkDbEVXp6cLtjazSf ay/IZDGv09lq2CIwBWNs+UTB2tgDpWIsSKY5qMUE5I8bbpPy7zeWa1Uhv/aO0tXQE/bx 2Xq/PbEKMP3jGfUXtVnUe17MaaPRDiNM9b6MNb75UwMm8spUNbcJ9KEybZaSAQbthUO0 AY+9jdBE8imDpxtPtDLEotAVByOIZuNwqhsAnB+PHeEOFvC2J62MatPV1MhMSNDF6B06 qO9+eYwj0k6j9D6oJ/gHMcjWQultT5wONroz5cohmCdeFOV406WigS2HnWj5NcA2wGjN a19Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9517L+m6kHVlackMfaxSN+CNphejP2hqUH4D90m9Olw=; b=eUxiKiXCUK45ZWxTNcy+rBKGeuQBGwTavqUUMw6bcKBQ5S2jS9Tg1OQPpz3x+TU0j6 4VjgBqaMEcC2XOL/1KMsVMuK37EHoSywKYSYx3iEPtLpG6s2JNcuDLSRJ/eX0W6S6TCL 5HGKazX5aYShemyZ+8ML4CpX698TUWOpsSGG7KHv68UTxGCrLt5BgaP7kiXsK0Md0sMn 2i9DIayTHY9JzI866f2niWVnIDaTm3qewnl1PAmdlk7x0+FClHFlFPte2ATE5wo3hrpB DlZOWDMCimsVd5ps9A1M5po9R+9y63ZBtvBOPOpMQezvCWqXr7QiEzeT2og+WkFNmoA8 +xhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=niV8zcJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t3-20020a63b703000000b00543eeb76c52si6654748pgf.756.2023.06.12.02.49.53; Mon, 12 Jun 2023 02:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=niV8zcJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234901AbjFLJbI (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbjFLJ3u (ORCPT ); Mon, 12 Jun 2023 05:29:50 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97CB81FDE for ; Mon, 12 Jun 2023 02:24:40 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f6e1393f13so29832035e9.0 for ; Mon, 12 Jun 2023 02:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561879; x=1689153879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9517L+m6kHVlackMfaxSN+CNphejP2hqUH4D90m9Olw=; b=niV8zcJpx+FM/U+qoIxdAubWZD03pWCf8LOroYc/q2tXxGMobXAhRDTkiRBScpbEha nmxGS6K4K+sMXcJWCBnsRrq2MLQI+me1BzhofFvIbxfFBqtqVfBnlU9NnJ+S/3YdL81N /pMUKBNVFHGFG4pB4KMmO0Tm3YSZ/mtio9kHJMTOzA12sEv0MYYTtbBZ0g1XISkS4YXu HIpSDd0gsNCx9eAULp0cL5z0caPJYHrM67slR1Ji1AyGcoXvSRtRttHMVkb6nWUiHY1I 3Vr6JmgkhnmHSgmjDaKJSXOBVvR+k1fRIz9MfUkxMIHyJffKzIcI+Zs0Ptrp3HHe31Zi 31rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561879; x=1689153879; h=content-transfer-encoding:mime-version: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=9517L+m6kHVlackMfaxSN+CNphejP2hqUH4D90m9Olw=; b=bTY4vNOMa/5Zt0lWihQUP/YGO66litqjcZCEg68dSi2XE1iGoygeCoXYAoWNIaGo5K jFWskrAbRhx6DEsXwAAytUyxnAvRtF4vX3TnpBIzcNAvXKwc6VIc6TKcEdVbYiywgwDf k9CLNYFXps7muE2AblBE38f32Cn0f8+WEy+KeXhHGx2QUKAsVROE+lH1i9srtfkh4Bwv bKUyFhCDA3h1d6fzZFJxwHzq6DVp4achVi0on/C/spO0/72kpKwp2Hzkyzo5p44B+vRU O3okT6LpoMfCMYjK8uX9/SxCPtgIFmll9gQHUS6FjoNRVhXCO9Xw4ZeDow8VdzhV5I5t 5Cyg== X-Gm-Message-State: AC+VfDwaVMQyuN1CLnsa2F9YCcrfyWz2DL7wg9/sJug7csrrQ+SaMpZ2 rpHqieZsU1oQ3+5wgR0bmN6yZg== X-Received: by 2002:a7b:c84c:0:b0:3f7:33cf:707b with SMTP id c12-20020a7bc84c000000b003f733cf707bmr6349917wml.1.1686561879026; Mon, 12 Jun 2023 02:24:39 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:38 -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 09/26] net: stmmac: dwmac-qcom-ethqos: add missing include Date: Mon, 12 Jun 2023 11:23:38 +0200 Message-Id: <20230612092355.87937-10-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489909481410076?= X-GMAIL-MSGID: =?utf-8?q?1768489909481410076?= From: Bartosz Golaszewski device_get_phy_mode() is declared in linux/property.h but this header is not included. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index e19d142630d3..ecb94e5388c7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "stmmac.h" #include "stmmac_platform.h" From patchwork Mon Jun 12 09:23:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460773vqr; Mon, 12 Jun 2023 02:34:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7g6tRc0pLyij0dR0yEXal28AYYkcVJR6e0/4T6ZqHvmYCtgXjvHTBuMsPrrR3L6yqOA5fa X-Received: by 2002:a17:907:25c8:b0:978:4d7c:1db9 with SMTP id ae8-20020a17090725c800b009784d7c1db9mr8933383ejc.39.1686562464672; Mon, 12 Jun 2023 02:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562464; cv=none; d=google.com; s=arc-20160816; b=PNZI81J4E+wGmkbIw7kyQameGbl7bz1Kg0Skp5lNcIhvz58+8tggHY0CawqWBeIxlY 18hpAR5v5U9GTLi0VNQqJTEaOfYfe+/kKYxWPOv9MMFjvkuVxYantmG8+5DoAXQxpQ6e fnGCgYTKFqL/DY5gB+eVA8Nhi/RvL+YLKIADWoDwfVqsSUJKQJlSq5CQElADkvNfj2d2 DAUE+iMiJpFVT+XoZm8dDJH5HhHWZVDYxOvYNKca0kXhjLcUochpIqdYvksJ65iFF1O6 1oN00ARGajBgL41/QPviybnjTuVYh/RijL+1MwRp92VqS6J3jhTBZg6IbZNcQe758ScQ LwtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x6Qql4lmrRc6orjCzbHdO+X/jI0p6UbXCT7w4xaPn70=; b=ge1K9m5VcxZVRmZ1OBGW0E1tK5RKLVayb0uqauWjqMZtMCuUNkyMX1NevqecEhpvYK 4aPYzL68xjr4IICh/bjpdMWAn2liGWSDbZMFvOmP3jxsgUtBOSfTtrKuFFlOZyx/n6XN T0bGGB+WUORsPK1N4K/jeDMB+QC9HU3nOsStqfQMsoH+kcsEUsGPxTCXV2hfukGXKFQf BbZ7EFbVjMKiselQ03+3r033vwexowNuLPGyZH5qwmZ0qMKEwOE4AGC4z4Q6k/o3w5yr BR9/Ya9ah/kjAG4a+tZbxmSHgs4SgbFqLYBNvEZjgniWxDo4ROinuEth0qy2/b23B7bM ozAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=r3C+LN0I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020a170906398400b00977ebf6b906si5077627eje.887.2023.06.12.02.33.56; Mon, 12 Jun 2023 02:34:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=r3C+LN0I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234941AbjFLJbU (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234926AbjFLJ3w (ORCPT ); Mon, 12 Jun 2023 05:29:52 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF9C19AF for ; Mon, 12 Jun 2023 02:24:41 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f7378a74faso29363165e9.0 for ; Mon, 12 Jun 2023 02:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561880; x=1689153880; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x6Qql4lmrRc6orjCzbHdO+X/jI0p6UbXCT7w4xaPn70=; b=r3C+LN0I7FtVIMevczG2G4gXnrbL8tV0VWh6EO722HqR8GSaE0sIdbfNRfxVxFLZ5B KBIgDCk8KbY3A1fU3rbQm5hg/qG9fiu/Qh5osa9r5C1dsQA0Xew8j5mZNyLKuBNimXuJ 6e0x0WmGekpMepRjwxkoNwMoSWLpFysA/e7TXwQ9HxvqKKEmDAkTMxo6WGY5DU3VlT33 NHaWsB9EL8reOpnI+0F5kohXV0fYBfz9i83cHE6asArFI1iLJgt+h16f1Yd5ENreccvG guXlbNPG/FuHocWDWvE5pg2eRqhyFAu+oxb9QULwsW/TV/ONDHrPilSk3mWzsETb+yPC RCfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561880; x=1689153880; h=content-transfer-encoding:mime-version: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=x6Qql4lmrRc6orjCzbHdO+X/jI0p6UbXCT7w4xaPn70=; b=AaNMGUun+HMDM91EDcwR24j8LwKocLNbxBsMFXHMHEAowRbiUyKIapDiMcSHZzZMh1 BFmQy3i8FcLnF/Ju80tKLINlAkLZaGQSzrqgXBVcEm5pHS1XJGk/AIQvEbmdPI8ZfI0w QOEyA5e1A2VfsPgfnVYBzHIZAby7zBhXMSJ6/4x/onCiTLPZsWqeI64GrNaM8iCuqAyc 1s1HJA0b6QG6HZp2/fQN7qTRgxJHUzidbFz1Su9K2ILtDGtoYCaNZnqgznvKciBIY+ga BQcby9GfzEOqv7V0yzGqA5CMwC3vQ+5pHsc7jyWt6ejoLTFao2VHYxXHXehyX8hBkKOt INfA== X-Gm-Message-State: AC+VfDympvrDdbz3J6qPE4yBVM+CbqJI4tK5dD7XRUwvfb4i9kbCQiMq GOg63Zs8Y82Hiug+CUcJfmmFkQ== X-Received: by 2002:a1c:7c19:0:b0:3f5:ff24:27de with SMTP id x25-20020a1c7c19000000b003f5ff2427demr5380405wmc.32.1686561880266; Mon, 12 Jun 2023 02:24:40 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:39 -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 10/26] net: stmmac: dwmac-qcom-ethqos: add a newline between headers Date: Mon, 12 Jun 2023 11:23:39 +0200 Message-Id: <20230612092355.87937-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488922875320089?= X-GMAIL-MSGID: =?utf-8?q?1768488922875320089?= From: Bartosz Golaszewski Typically we use a newline between global and local headers so add it here as well. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index ecb94e5388c7..5b56abacbf6b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -7,6 +7,7 @@ #include #include #include + #include "stmmac.h" #include "stmmac_platform.h" From patchwork Mon Jun 12 09:23:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106370 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460785vqr; Mon, 12 Jun 2023 02:34:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7X6LQw1YSHdRyyYAEMSo1dxqN4HAbvBPfKzQDHir1Mh68h4CN6VFltGhBTCwde/FMEOdus X-Received: by 2002:a17:906:9c84:b0:973:c070:1b5f with SMTP id fj4-20020a1709069c8400b00973c0701b5fmr9487996ejc.44.1686562466052; Mon, 12 Jun 2023 02:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562466; cv=none; d=google.com; s=arc-20160816; b=OynO0K3NGHEUUEaixqOQSFrlbCk8Mw7K+rSX7pt4LJEffPmGYOcXYpibLQKiEmE0Pp y0vV60VIZcviImByAyYzUnnxfS9UMHoAXownZEOQxVAA9rx7ubnqvP+OQ+pwv1SpGldx TyYLt2g8UQs1cSmTmMVw57ogycP+xeDG5JxOOsqK7+CqoSIOz5Iof3GfunFJlSu20ssQ 87yC2p6yYtmjGTPSgUX+cRFAOW2RIWZJ+FD/BfbypZmP5/7iqbOSIj1N0qMXKSw3nWeC XPO7zhkMExY6CxNR2JHhvVbFFHuoMT/Wf5zfhaRT+mVuMrMqN3pfanlsEnyT2INryfmd rWlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zNG+hKxvwpveqfTw49rcUFiC9HYNGdqxVXCMwf/CgoQ=; b=YLRbbBUgudBu4gfWIpRRS1sK/N6shPqGu0z7njkAbMM6/E3iR7wVOIC6y6oKR3P3yv LYA/lEXo/MIwLRhRCZC3A4QJgtf/hUc8MlckEoUaFCqyRQULN2p3WaM5tuRErQp/AzCT i+9o7dn4A+riRAv75UTjWRN+K2JpbttCjiM2D9m7PjorAPhGKGKnYon3ZqIkuto5NKbm 0zkYDgIovb8SPz+m6XRuhorqNKUAD/QLsQEpTZ0/Ezn96IP/bTlGXsArdOsZ17/c+QPH G2CHeDHadxlfWDFYsJ1VWSXj8DrqDoCtzik79/FPF+5hgyEkuF2/oq4TNuYaCyfXMNw7 aumg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Sjg97FxE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a1709062c4c00b0097104874bfesi5212274ejh.259.2023.06.12.02.33.58; Mon, 12 Jun 2023 02:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Sjg97FxE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233308AbjFLJb0 (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbjFLJaC (ORCPT ); Mon, 12 Jun 2023 05:30:02 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A39912717 for ; Mon, 12 Jun 2023 02:24:43 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f6e4554453so29316175e9.3 for ; Mon, 12 Jun 2023 02:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561882; x=1689153882; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zNG+hKxvwpveqfTw49rcUFiC9HYNGdqxVXCMwf/CgoQ=; b=Sjg97FxEsWi1+NhQKvwlVEh51XvKpb7L8qjO3eSPmnCp+RHYjPs6m0g4elcX7e4Gmk q3U1vLjkmrqHZnROyBs/n7xJkk00XMII9dTC69A/BMsdgUAKh6CQ1iVENWho3ieFJxOn kpyrUeEyJN+JmDe79C2O+6cXxwvHb2t7vltcUEEX9l5t3wSl7DONd9L87ujMUkqnmc3f QLazLkrv1GDOV/9vOl0n3uQDl7CvHNk+dcol5Iwbbh8SCOOuXpQsG0n4CHEkKYj0lKtl KjhlWUbdcnrDvJneJ/NH/roITps7vNV+XakPuvBg42ntql0DPxtDl5zempMyWZOl9HON Bzzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561882; x=1689153882; h=content-transfer-encoding:mime-version: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=zNG+hKxvwpveqfTw49rcUFiC9HYNGdqxVXCMwf/CgoQ=; b=JXb51bHR0SUFE5qKOkmDl1YxDCEr7G/IwzVWlTx2nD7IR6kmDPPbBdVweYgtQCik7v DRccZYDPDtH14JILNIa3Ed2Rz7N+ZjTfpxVy9dwmV5w15Oj9sFQcUQlq+qQ/nCdkYL0Q PtQmMBZuBSweJ2gO5Arpf3eZJbNmiMYyJgDmneoattREHalG5MSQlZ0Vl/KSt0Yv3xbe 3v2sx0lJCkJRQLtkqXp5UNGul0fc4zQj0/MZOJnqBmEbNzQvKWMAkoPH3a+6XedEW5kB KVx1p0AsG3EjjES7OlLb7b5LoJpTlRx/wEyjMpjY4Af2p/P5Ocai94RxeCW+fNk5PT2t sfXg== X-Gm-Message-State: AC+VfDwo6HEIwX8j7BDLPZ9Op/SYLiYxjKFbSnRIg2REzipWnfoL+ASO lO/8mjMC5jbBc8y7KvQ1TF+Xyw== X-Received: by 2002:a1c:4c0c:0:b0:3f7:3699:c294 with SMTP id z12-20020a1c4c0c000000b003f73699c294mr5458505wmf.29.1686561882035; Mon, 12 Jun 2023 02:24:42 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:41 -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 11/26] net: stmmac: dwmac-qcom-ethqos: remove stray space Date: Mon, 12 Jun 2023 11:23:40 +0200 Message-Id: <20230612092355.87937-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488924527867225?= X-GMAIL-MSGID: =?utf-8?q?1768488924527867225?= From: Bartosz Golaszewski There's an unnecessary space in the rgmii_updatel() function, remove it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 5b56abacbf6b..8ed05f29fe8b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -117,7 +117,7 @@ static void rgmii_updatel(struct qcom_ethqos *ethqos, { unsigned int temp; - temp = rgmii_readl(ethqos, offset); + temp = rgmii_readl(ethqos, offset); temp = (temp & ~(mask)) | val; rgmii_writel(ethqos, temp, offset); } From patchwork Mon Jun 12 09:23:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106371 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460820vqr; Mon, 12 Jun 2023 02:34:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ez/NllNSKKqFB6Ax/k2t0GUjdf05UeGawngu0ms8J2loJ7Nmziv+X3f7SkaTD05uwmu7u X-Received: by 2002:a05:6402:47:b0:514:a244:2915 with SMTP id f7-20020a056402004700b00514a2442915mr4640935edu.1.1686562469354; Mon, 12 Jun 2023 02:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562469; cv=none; d=google.com; s=arc-20160816; b=pzpKlwoqULWZqMW+SkHEnPw0EgsxltJrAtNvdmO6SaZ5NU3dBDyyUNjkaSPIQjlM70 J2VSVAq14tRGhQRRv4tmIGA/s6QizNS651e0JIfvxCvN5pAZLYYMKwlNuVkzjMwTK00H 8DrqAh5XL7KHbT4s1M+i2fGJeSXMRL+jg6rbXw7PYYR7CJR9DGE59lTH105DXJ4XNAyk un52fB2u5m43CAQZ1mtE4g8y2nmK1eHi2vdfAzlh6Z1SZ7MRJdNxsKcnbEh0giGrBvfY G6WOL+buu01mIlRerD90utL30c8ZJFXwoWxNBSZ9z9tZWv9RNgFbnCYTvhYRSvI5WhEW ZkFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vPRfCIFPGTjCNzA0zoFKpFOOb+gMs8UR4lDCHzO+xYc=; b=W8ag3+LPoQyKSWfo1ZN1XxUGBiZ2deTF7SLW1XKPE1sN605BmbPpSN+qhQf4GNcy3c rOf7LdmuFxr6loMKD2dwXmNrxuylZOvRvE6TbtnUCcNbCJJibrsgXKyehkE+DOK2aZ1i hwMH/gSM59XsmKdLDemXZsS31bIHx0Fk68P8gpgKq2yVs2eR2iEkgTkhNbedLAG3SkRE VpAqz2sLP3u0ablFum7EER72JDfTRV+onuXqidcl8kTlkAGNz5NpPtWRHBA6TT2NGNLn WPfwOy6O3EBLIrPLM63MI6Zqxs+7pmKk2C/fMP7clj5eUsAu9Vnqhu9O4vu/dm0LnBjf giBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="xa/KP+P3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d24-20020a05640208d800b00517b896543fsi1313170edz.5.2023.06.12.02.34.00; Mon, 12 Jun 2023 02:34:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="xa/KP+P3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234982AbjFLJbb (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231418AbjFLJaJ (ORCPT ); Mon, 12 Jun 2023 05:30:09 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 364112D6B for ; Mon, 12 Jun 2023 02:24:45 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f6da07ff00so42335425e9.3 for ; Mon, 12 Jun 2023 02:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561883; x=1689153883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vPRfCIFPGTjCNzA0zoFKpFOOb+gMs8UR4lDCHzO+xYc=; b=xa/KP+P3Zmb/Lx0rhjT625N/dGumpGheBG+7/5CCXii82aEzcv1iLt1h7b44GlBij0 D69l/6p4rjUdxNuvv/cvLZvHn6LCZm5b3JrLPXHj7p3U/LdTzrLNEekwGLW+o/T3Y7aZ PeA1InA/KpeS9gTUHK67bs/3jEHLYjmrGL/D3/LQL4a+X1W/99lxl7CpRiBP6Cao9d8W MapJdFYF+LaJ4BhaIG7KSINuHv2DSeFfbEJfMxN5B2p6E6YIw+XTSAD89BS2IkXdOKDL SNaJGeGp8r5a1A5BXHv/89caBDdrOXOqcQSApiSY4sXvIb3Ff2SpnXkGnciwuNxFwNbP NU0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561883; x=1689153883; h=content-transfer-encoding:mime-version: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=vPRfCIFPGTjCNzA0zoFKpFOOb+gMs8UR4lDCHzO+xYc=; b=iw8TVIKcsqBBZXBZiRrYAmY06yuRYlDvH8MNvVpTWcSKWzSCZc55bFuqlLWqGKXS8d tZaWoyb/3cWRGniGqmAxSo+Seat+K9kUg7g3OprqMl6offYHfN9FJ5VfDL3d+/7HxPIS Ib/pSg+xYW1bOMaquyiTK6gNlAXdeIbDAObR5nNip96IIs5aasC4ZK97zi+nXWGZVVHx NDn85md8P+Z7bLC44islrUoY78MqDsu/+RuSfjFW1MMuHTCZX6TRkLPMTVrF3fJP6ZYA C3PE0US9oeh3NQrN+W+nuUkVN5URVs6MNx8Bk7bLYRzmQ9G78ZD/vJS1iATZGwobNBTf nDIQ== X-Gm-Message-State: AC+VfDzmCP46BP/bozg77wK2JuXzBrxhINLfVWT7kkwMP1h3aNCyUc7O C79WjVV00y9iwlMnkiAZ0NL/uA== X-Received: by 2002:a05:600c:214:b0:3f7:3a31:847f with SMTP id 20-20020a05600c021400b003f73a31847fmr6720889wmi.31.1686561883574; Mon, 12 Jun 2023 02:24:43 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:43 -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 12/26] net: stmmac: dwmac-qcom-ethqos: add support for the optional serdes phy Date: Mon, 12 Jun 2023 11:23:41 +0200 Message-Id: <20230612092355.87937-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488927810610885?= X-GMAIL-MSGID: =?utf-8?q?1768488927810610885?= From: Bartosz Golaszewski On sa8775p platforms, there's a SGMII SerDes PHY between the MAC and external PHY that we need to enable and configure. Signed-off-by: Bartosz Golaszewski --- .../stmicro/stmmac/dwmac-qcom-ethqos.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 8ed05f29fe8b..3438b6229351 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "stmmac.h" @@ -93,6 +94,7 @@ struct qcom_ethqos { unsigned int rgmii_clk_rate; struct clk *rgmii_clk; + struct phy *serdes_phy; unsigned int speed; const struct ethqos_emac_por *por; @@ -566,6 +568,30 @@ static void ethqos_fix_mac_speed(void *priv, unsigned int speed) ethqos_configure(ethqos); } +static int qcom_ethqos_serdes_powerup(struct net_device *ndev, void *priv) +{ + struct qcom_ethqos *ethqos = priv; + int ret; + + ret = phy_set_speed(ethqos->serdes_phy, ethqos->speed); + if (ret) + return ret; + + ret = phy_init(ethqos->serdes_phy); + if (ret) + return ret; + + return phy_power_on(ethqos->serdes_phy); +} + +static void qcom_ethqos_serdes_powerdown(struct net_device *ndev, void *priv) +{ + struct qcom_ethqos *ethqos = priv; + + phy_power_off(ethqos->serdes_phy); + phy_exit(ethqos->serdes_phy); +} + static int ethqos_clks_config(void *priv, bool enabled) { struct qcom_ethqos *ethqos = priv; @@ -651,6 +677,12 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (ret) goto out_config_dt; + ethqos->serdes_phy = devm_phy_optional_get(dev, "serdes"); + if (IS_ERR(ethqos->serdes_phy)) { + ret = PTR_ERR(ethqos->serdes_phy); + goto out_config_dt; + } + ethqos->speed = SPEED_1000; ethqos_update_rgmii_clk(ethqos, SPEED_1000); ethqos_set_func_clk_en(ethqos); @@ -666,6 +698,11 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) plat_dat->rx_clk_runs_in_lpi = 1; + if (ethqos->serdes_phy) { + plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; + plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown; + } + ret = stmmac_dvr_probe(dev, plat_dat, &stmmac_res); if (ret) goto out_config_dt; From patchwork Mon Jun 12 09:23:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106373 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460858vqr; Mon, 12 Jun 2023 02:34:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BC6SPhnjjZ5xp1DRUmVaeRARMF7A2kABSadJVW08XQZcMrXNnh0+h7NfU7uZ0TsLBHYme X-Received: by 2002:a17:907:96ac:b0:97d:9b73:690b with SMTP id hd44-20020a17090796ac00b0097d9b73690bmr8054848ejc.59.1686562472232; Mon, 12 Jun 2023 02:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562472; cv=none; d=google.com; s=arc-20160816; b=E0U3CioBYeiW8elJWqaJTJw8LfK1eBcPb7fFLF5ilqZ8WRa+0mkgOJTYNxhW9jWDTi iyjbvT+zAZ111+e8ED3hA4ZB7Hm1UfPZQYNxtp30KOB3GJNuY0fs1ZRLqBhLBc126R/v rCEAKwHc+96QuYo98NaLuvKhVwBaZB8pe2QdvZf0yxCncVA9x5SjDN6eFz859esFLUaK LEcy3x7ApyI41dQ1+CdEZ7pkz/4j5kbdclZ8Oiw/cS+tdvFnxjEgCFqCuAkNrOhIptb+ 4ZwYVgwQFxj7jH5tcC2wZHalD57Tz5RXZAVOtFfwQReRHA0g0nlhhHLsgxuFENkN0P2k BDdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0jrHnz846sKSAurRWEc8dAdWpKHrp05uQC5lgmZ9ncs=; b=ivyp/1WtYGHXJH29F/ftjsNOBCp5Or2w1ovmcLu8e25LYZ1q1UMr+KtDIR9dCSZYCh V8bUMuW+brcPEXo2BKQX4hHn8M5l7L/OQx7HN+DndABud2XEphA4PrYmRMP6c3jtzBXS x63HMe1PmNHJYQmKWaI1CfNu2ZnRV2XEuo1DV9nLQ+vLrU3MWFv9rpgChBYV8GNHQq0a 5Iln/CFr1UuEDAv7EkQ3cPr1CCGwx63gUOyre/BiAgnHRd3toYiUVp5tRqlcoiHDk6TI oFIjtHDIQbUy2S2N9EgWtpjY1Z+5a8h+V+VHrHg72Ag1dmkm4NKIZrn/5TGPYRvx1mfi dpnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Wv5XrDDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qc1-20020a170906d8a100b00974610ab887si5108881ejb.275.2023.06.12.02.34.03; Mon, 12 Jun 2023 02:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Wv5XrDDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234987AbjFLJbh (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232246AbjFLJaO (ORCPT ); Mon, 12 Jun 2023 05:30:14 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C9CC30DB for ; Mon, 12 Jun 2023 02:24:47 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f62b512fe2so4904744e87.1 for ; Mon, 12 Jun 2023 02:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561885; x=1689153885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0jrHnz846sKSAurRWEc8dAdWpKHrp05uQC5lgmZ9ncs=; b=Wv5XrDDvy4LtM5L7MWCbVK9pWAo3LoUNOvZQEasGmTIxOi38BcIRca8Fde80aXxOwM aXfV6t3++WM8D2t43nXQPbThzdlcHTowM1+1hywltCEBkdLNk5WIBKbHdgnFrbTu6NN6 G7hD3xTxSxdg2OJyJhkZKd/bIlY8HQYl9S3d+OKQOv7jN/dCgI9Jja2/dN9fpneUfi06 MbuoGh0EvHikS8mSs/EC9zdBr5OUOZtHEXtCxm4XNW8D1WYAC2ZSXNjfDklDyA/HF1uk rv1AHJwKXY2AlZUFovyBCJwKKAz5+/DTFFMP1V3lPGCXMSQIXrZnHCpFQWA4YSRq5Alp 0QbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561885; x=1689153885; h=content-transfer-encoding:mime-version: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=0jrHnz846sKSAurRWEc8dAdWpKHrp05uQC5lgmZ9ncs=; b=a+Fz+0Wv9ny5F5lJS3memlZjK/yVAlHIiBjh+6+9tc5/WTQ1p0QjunxHA65Sxf7L8n j9CE/1AGeZWwrD7vTEwtUoILK3ToahcpxNbGJNPElpSsh3/rb2DQwXm9hI4WT7+srM+I wqRnCHmOm/BPLtzB41XlKrOIL2mD53Oi0wI1vKIkbokbBNI41PSyo3jt0klSKOsGDu7L 5qUyx/AbNW2DvUPUgX0JUCEhQrFj3jhis4qhQkMF29atrg4LL7DghMxMpsI2gfpyzvLY 7/nYG8+647c16Qk2F4WFabXhpCWeHihlMma48op80x/mfIbTWFcecFFdYrCG73tavhx4 Wrww== X-Gm-Message-State: AC+VfDwMxPWEqhCOsiFg6i/RhBxvw5MDdhWWrZswtrQGmcgWyBspWRE3 fHCiWiH1frDCTHS9FOVgt0/ECQ== X-Received: by 2002:a19:6706:0:b0:4f4:2b83:f4a3 with SMTP id b6-20020a196706000000b004f42b83f4a3mr3564114lfc.51.1686561885364; Mon, 12 Jun 2023 02:24:45 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:44 -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 13/26] net: stmmac: dwmac-qcom-ethqos: make the rgmii clock optional Date: Mon, 12 Jun 2023 11:23:42 +0200 Message-Id: <20230612092355.87937-14-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488930650463171?= X-GMAIL-MSGID: =?utf-8?q?1768488930650463171?= From: Bartosz Golaszewski On sa8775p there's no RGMII clock so make it optional in the driver. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 3438b6229351..252dca400071 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -663,7 +663,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en; ethqos->has_emac3 = data->has_emac3; - ethqos->rgmii_clk = devm_clk_get(dev, "rgmii"); + ethqos->rgmii_clk = devm_clk_get_optional(dev, "rgmii"); if (IS_ERR(ethqos->rgmii_clk)) { ret = PTR_ERR(ethqos->rgmii_clk); goto out_config_dt; From patchwork Mon Jun 12 09:23:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2468192vqr; Mon, 12 Jun 2023 02:53:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ScRRPMnuFn779uqk93DTDGzAfnP4ambQ7d5Lm314Zh1K9nX4ottnB/v9No85Cggn95q+5 X-Received: by 2002:a17:907:360c:b0:96a:48ed:531d with SMTP id bk12-20020a170907360c00b0096a48ed531dmr9768019ejc.27.1686563595039; Mon, 12 Jun 2023 02:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563595; cv=none; d=google.com; s=arc-20160816; b=qOyzzP+8t7PErWu0pXUVk3lG5fnozYOQO5tLPaaQtpxWbnGCPcHq8slZup/pFG0Rju WkcKYiHFbBP7eu/ZYg4nRU+e49URxQE/xPIlACzhXT3SdaR/wIMdDJzIp6wwF2E1iRxV c/Uj7PUeUI1UT2uCo+HWjYyhEJhBYJ4WkeN1/Nzx4GGKng8U32YdVS0xyg6aqF3EQx6A hwCiAuKO/hNJW1pIyW+x8jCBy/qtjxJTgzvZAq2DFGvhL6wtU0QMpuM1VktnSeT8Niv3 gXwU/Y6E+DYJaQkpVQdoDB6fvSRmmxW87xKjb/leV89SbA/u1e0vY2OmIyEiKW8xVb6f AynQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c3HXmWBI5xLrWbOkueODzJ5MVGSA4Kc5TK/lazRH0B0=; b=CiI8OO9VdA1vINdivJv10UkINKh1j/zO89gYhgeqv+w++ozXuw94CiJUWekeQvM5Y4 8tUksmlPCqiDVP8nSRH4EUbhHjLj9f47Z7B1Ug610WUV7Zu+4B8yrmtGFPLl8HSVnmu0 L9Q0/bvTihwLdCdmR/7QdE8dGiElLfvYK4+nFcUGJXqVFDlBWLks5bclYUlOYpTrxOUL GqgFxsW2sNbgBRLKQJd0fsSR0ERYYx43tuEDT4SXiamtcLvVMQ5Fyx9xu9qRgJnIOXXp pvYqDXc5IMs8FTIpldKupBu3MPkrqnTfOyhfiA6qn/Gp7nYQRZoxBrGcksEuTYbuJpLu 9AKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=kzgUUkMC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a1709067c4d00b0097476fd3444si5463252ejp.240.2023.06.12.02.52.50; Mon, 12 Jun 2023 02:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=kzgUUkMC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235011AbjFLJbs (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232521AbjFLJaR (ORCPT ); Mon, 12 Jun 2023 05:30:17 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A4FD30E8 for ; Mon, 12 Jun 2023 02:24:48 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f649db9b25so4696572e87.0 for ; Mon, 12 Jun 2023 02:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561886; x=1689153886; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c3HXmWBI5xLrWbOkueODzJ5MVGSA4Kc5TK/lazRH0B0=; b=kzgUUkMC5jsWR5xW0+ANRcf2btdakfoFVSpYBSE9CikTfQlpt+AqLN7zdBbZJFtLme xv5/N8+XHKqeOLiYheLN/vH4zRYHi9T6pytx/a+feZ6Ar+vvWiN0Eku+dctJjFBED96f y6dlmLfFclU/1M8/Dkh0s6PVP4tPSxlThdgfNA1wtRmX3AYoPWL+galeUX+z96THhp9l eoKOC7/6cBKs8NL0f/gd6xfgLidEidiAmfGdioadvL+hjOWjmHTAkyP/TtqA63cg+m8E 1Ro1pxSPqRZ/FZLWuM9+n+8mX+utAr5AZu5GwTebLop+/HDkLST5jFVWE05M/IewJtwh TSsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561886; x=1689153886; h=content-transfer-encoding:mime-version: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=c3HXmWBI5xLrWbOkueODzJ5MVGSA4Kc5TK/lazRH0B0=; b=MVY6mjYG2pknek2aSR6phdvRmhA26Cve3l8hzQEFnby3gYgM1A7igHZoQeosy558VV Le5LylVEt4NueXi7+DmjcCbfkFFaKaJ1FN6tupV14pzGyD5fgZDKQtbmniVBdyuo6xP/ k5PpoxgAlaRDyQFego9uSHQPB2gUgHGlxclsAipIKIUyI5IVb7vsMI0G0i2zY+/J0aXV ZHVLdk2QDqWJjgvZnjRchIH+mlBeIVatAPa6aP1mzyRCj5hUtImXQ1CJPC0dwxWBgb9B dqL2Eu0UI8tUc0jHcRs/yfxBCGeEySj2P3AasB3qxZGdTkuE+O1KUzFCx+8KEDCZIS/t Mr4g== X-Gm-Message-State: AC+VfDwY+wNRLjWEOPpuUNsSCR5Cel2kxg5vQitv2Z+K+aOegg4Cqf/1 zqpD6xO5UcRBL3QffL8k+FgBOw== X-Received: by 2002:a05:6512:615:b0:4f2:5d38:2c37 with SMTP id b21-20020a056512061500b004f25d382c37mr3795687lfe.15.1686561886665; Mon, 12 Jun 2023 02:24:46 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:46 -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 14/26] net: stmmac: dwmac-qcom-ethqos: add optional phyaux clock Date: Mon, 12 Jun 2023 11:23:43 +0200 Message-Id: <20230612092355.87937-15-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768490108401465954?= X-GMAIL-MSGID: =?utf-8?q?1768490108401465954?= From: Bartosz Golaszewski On sa8775p we don't use the RGMII clock but have an additional PHYAUX clock so add support for it to the driver. Signed-off-by: Bartosz Golaszewski --- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 252dca400071..2f6b9b419601 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -94,6 +94,7 @@ struct qcom_ethqos { unsigned int rgmii_clk_rate; struct clk *rgmii_clk; + struct clk *phyaux_clk; struct phy *serdes_phy; unsigned int speed; @@ -604,6 +605,13 @@ static int ethqos_clks_config(void *priv, bool enabled) return ret; } + ret = clk_prepare_enable(ethqos->phyaux_clk); + if (ret) { + clk_disable_unprepare(ethqos->rgmii_clk); + dev_err(ðqos->pdev->dev, "phyaux enable failed\n"); + return ret; + } + /* Enable functional clock to prevent DMA reset to timeout due * to lacking PHY clock after the hardware block has been power * cycled. The actual configuration will be adjusted once @@ -611,6 +619,7 @@ static int ethqos_clks_config(void *priv, bool enabled) */ ethqos_set_func_clk_en(ethqos); } else { + clk_disable_unprepare(ethqos->phyaux_clk); clk_disable_unprepare(ethqos->rgmii_clk); } @@ -669,6 +678,12 @@ static int qcom_ethqos_probe(struct platform_device *pdev) goto out_config_dt; } + ethqos->phyaux_clk = devm_clk_get_optional(dev, "phyaux"); + if (IS_ERR(ethqos->phyaux_clk)) { + ret = PTR_ERR(ethqos->phyaux_clk); + goto out_config_dt; + } + ret = ethqos_clks_config(ethqos, true); if (ret) goto out_config_dt; From patchwork Mon Jun 12 09:23:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2460846vqr; Mon, 12 Jun 2023 02:34:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4mm6yBzoLrI+4NoipKhKnaDWuCkuFBZxOxss0iJmRc90dPoU7uzv2dJr6FsAfRCxgRoD5V X-Received: by 2002:a05:6a20:6a27:b0:117:428d:f983 with SMTP id p39-20020a056a206a2700b00117428df983mr12170102pzk.1.1686562470982; Mon, 12 Jun 2023 02:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562470; cv=none; d=google.com; s=arc-20160816; b=e/0r/9kvTFESTBbwFqq+1SAXHvUFSC1bCjd1ohtcQcv8pZ1xLcsmEIMe/W7StoUn1X mUQDz0KSYvTdE3MmNr8Z/38MhD21fOXY5mL31p/4QXHITpuSBgbDuKaW/9Pj9SM68u5C aBwWrSlW0/QnY5cfZIGw3fsSpfq4dcjiC1CFy+CrAeK5bxNN35A922rvi3ionaMdG0fA 4AWcMHKzfhI5Gkyh3j5QPnU7Q3U6uOID0csgtfTbAGaf9oO++g7wFvBkJ9bW9hWxMCUm 2HM90wnGRU7ghqdjUeSmVXw95cYnWn9960pZZtL/xgczwXN5/wu9dVIgvY+RSL2rAQtz APUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cjVXwVFp50u0PUxr/5pPlG4sgNjLclV10ezIygBZf1w=; b=jmvRk+KxQVqXgatqC8x4th2aqxRfiacP0rT7L7KQ7BKsYIWlVkuiG4WU9W6vHK8w5R aqZ/3ZFL9XNlh7Q9akRUH/nx92bMYzCvXecV3JQL8L0zr30lFhTZCeqc3pB2RXjHpwcx 82hT3X/c87CiucGtnXGcldrHIL5zHY+ljwksyVAuSSpEUaD8x/YArwUMJuTdbkzTYeUr 1jyOTivngXtuXagpGWRh2W5FTODs4XV2LxlglrjUXpp+dnuCsOmnNrSx7zx+qf35czAh oY3GxsFm67uffcCHWlieMYsoL6iJqno6hNTmB9z7XvsmfjpYTfUwC8IARJIe/lebqix4 3HAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=2LxLhnK7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b00512fab9493dsi6644104pge.740.2023.06.12.02.34.19; Mon, 12 Jun 2023 02:34:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=2LxLhnK7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233015AbjFLJby (ORCPT + 99 others); Mon, 12 Jun 2023 05:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbjFLJaS (ORCPT ); Mon, 12 Jun 2023 05:30:18 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7413C3580 for ; Mon, 12 Jun 2023 02:24:49 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f7353993cbso29796885e9.0 for ; Mon, 12 Jun 2023 02:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561888; x=1689153888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cjVXwVFp50u0PUxr/5pPlG4sgNjLclV10ezIygBZf1w=; b=2LxLhnK7e46mui8dhof9QAMYFAXj+RyNY51koDXFIyUq+oeAgfB5Yunm2wkRuj1JMn kZaCwUavQC6RW+LqMlWJwEmkbL8jYXkjd+0ANuO3gB4RfugPiO63GVGDem2oaXmUGXY6 eAlLWzfGQJsrYyk6s/qe+xejpzIL2oEbCV4biO8JIzCtGSZlK2U1RNqppXvdTzoPFYj1 3uySIa1BuTRWIipEsHrVcQc4yvQ9rYYM8rlnBgv7OYXKE2GKN9SYzVWyi+JBty3FKAs6 AGFFcXEHyxxr14wTLOjNholiBRGWtf+J2xMsFuYww1sG2cHVlfE8DjukIKEYzRH+nuip 3ZBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561888; x=1689153888; h=content-transfer-encoding:mime-version: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=cjVXwVFp50u0PUxr/5pPlG4sgNjLclV10ezIygBZf1w=; b=WUqqrd0H53M2CVjv3MOsUdHjYY0ROTLA/I+RdjvztT/ZWpaeSfQEtqjpMCOu/4fkJT mkZ3qRjdHL9T+/uUZUWXZPUoeLaxzvJonndUZSGlM2effnjn6+x2S2X7LH5/M88v3Och iHAYUi2gp9AobD/YVW+f3QkHGcTw0qMZNRrzf0RLG2GpmXpvoEPtNq5tMErUIHg/nFdY ePRrQvrqTfRpB2s2wzJMJG4pR+fwhlrxDg0Ur4MF61gwN2CVoHYcL053uBSNN2fjd1a+ 2BF78FIf0j6UyDuF6Kn3CU0Tsja5SlCDauc28QLGZ1yk8yW33yyg8HafhWZkmUgr3OjG LbTg== X-Gm-Message-State: AC+VfDwUCq8FcoRqmP/vylYctpbj0HEGNhm5eMpoqksxuFHbB/Lif1/R 8/AvM3ywg7w+YmarFrgRKR36OA== X-Received: by 2002:a05:600c:880f:b0:3f7:148b:c310 with SMTP id gy15-20020a05600c880f00b003f7148bc310mr8862440wmb.13.1686561888007; Mon, 12 Jun 2023 02:24:48 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:47 -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 15/26] net: stmmac: dwmac-qcom-ethqos: add support for the optional phy-supply Date: Mon, 12 Jun 2023 11:23:44 +0200 Message-Id: <20230612092355.87937-16-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488930003369296?= X-GMAIL-MSGID: =?utf-8?q?1768488930003369296?= From: Bartosz Golaszewski On sa8775p-ride we need to enable the power supply for the external PHY. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 2f6b9b419601..21f329d2f7eb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "stmmac.h" #include "stmmac_platform.h" @@ -692,6 +693,10 @@ static int qcom_ethqos_probe(struct platform_device *pdev) if (ret) goto out_config_dt; + ret = devm_regulator_get_enable_optional(dev, "phy"); + if (ret < 0 && ret != -ENODEV) + goto out_config_dt; + ethqos->serdes_phy = devm_phy_optional_get(dev, "serdes"); if (IS_ERR(ethqos->serdes_phy)) { ret = PTR_ERR(ethqos->serdes_phy); From patchwork Mon Jun 12 09:23:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2467293vqr; Mon, 12 Jun 2023 02:51:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HgVlZ6HHp4DliEKlDm7JiLhAjILWpVztjgFuv/hjDyRfLzkrGOR02dOPRxFgYnvI2kXua X-Received: by 2002:a17:902:c946:b0:1b3:c62d:71b7 with SMTP id i6-20020a170902c94600b001b3c62d71b7mr3733325pla.18.1686563463869; Mon, 12 Jun 2023 02:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563463; cv=none; d=google.com; s=arc-20160816; b=p072GCdUBYSvIkS4bWkyUsvsrwLmsueg5+9QP/0xtzla6ilLprSmkwhPJ+fG96kDuc gzUuweMPI7G94W0YIwqYmN1cn0Ju0vFnnLjmHMiHuCqZu4yt/uH4HGI/q0FMsgAYIplD 1L7+R8+Xt+wAkiOUPZZMIwVlOD9EccHel8oRlkrhhxjQibQ5w7kryq7WX/tNnCDioKM/ AN/D6jJ9vnFm+AVWdvsg55WL0MhPgAWZr6uNbpxOn2ehsvX+fTBswccpmscMa1nHUO1d zxaBA3PNLRQJxfX3Y6cfKVjWXqIMqnYFQYKjakREBKT2K1jjjaZ7eFpTu8yWJemVL59F IG6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WtiGUP9ra+nN5+GqOB+XAIPugwOoW0PwoEeYaWXDQls=; b=QZ8q8zYCkJk9PBPCEOnKlNhv05YL1LKLVmk5LaD8LrtWf+EkeMmiPDFO7EYOHApdow Uizw32sxQg6tOy3bTd9VDciy6NmPVLe3tJGLEEkiR176UsBKvmCmhQkvHNrV0syIjpl4 oxxbXInfrK2TdLzlRUTHlS3xK98mMGtDVku1B/mhsrPiL/rknFDFyXwhgK9WvNGN9wW/ G1f0jMEmMgeqbtGpnqYLhIFhyMKEWXFkKFcgGX6IzBr3PNQHsVBOvZjN9pXkHEv3djJf SGJ21dJ+7APRFPCyDhiYFCQmogNhJstJMjVV9WGFneQZ3L+HGia/OmRDsKTGJTXviPYR wTkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=ewW4ilPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a170902cecf00b001a4f005d59dsi6969303plg.389.2023.06.12.02.50.51; Mon, 12 Jun 2023 02:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=ewW4ilPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbjFLJcF (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232955AbjFLJaV (ORCPT ); Mon, 12 Jun 2023 05:30:21 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B0104EC2 for ; Mon, 12 Jun 2023 02:24:51 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f6dfc4e01fso41423125e9.0 for ; Mon, 12 Jun 2023 02:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561889; x=1689153889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WtiGUP9ra+nN5+GqOB+XAIPugwOoW0PwoEeYaWXDQls=; b=ewW4ilPWNv7194ancCa8h4Y2nB9YHWmOOTZiAPChRO1LOfZRRdXY/Q3X6OjGm5QyED tzZCF5qaleZ00eF4KQLSjPLPk0TNPsnKTOsx1fxBzPooOeCLgmEZO5nQjr7l6tFLgkGG 1LOt8o7G8ubTSO0VPXoauA3uLBTwM2nytfqbwwophk78EeKKzwtErTWeIxU2wLFl7y2j KwWADOmvCOeU5Rm1K6AjUUnsQsZ/qLncaNkUlaE3uC/dgn61R0oY2Htjc0phFZVhW6va P1mlE2HiQxyKUAfTNmtu+HrwE7ov3+pP2vTpYOFzD2ppmg7FNeZ+c8ipUBfuQsficczr 85+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561889; x=1689153889; h=content-transfer-encoding:mime-version: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=WtiGUP9ra+nN5+GqOB+XAIPugwOoW0PwoEeYaWXDQls=; b=fpDaWPnF4fKaD8uAxmerm7+SWSyqplCpbxN3sRXdAZz5XejkGwbcCRLhCSM0vW656R Kik3KWCfQAaQRIvE4UuLySoKGTdvkcMa7fv+Kj2OSNOUfL6EN+Q1McUP1XDt5Yyk14Vg j09hHAFtRMghMz2K0Uy6o99CGpWG5FiyxepCAQStU/9G80KGbo4aHa3Si+UmGh2SGyt1 v3SstQjg9sONihLEQ08VDzH9u/WdYrKGFuYjGi7HOwT2GEXi0k5zV+ofOHxH8gHy5QqE S6SbX7xe63G2oBvDuNC5WkYb1HZY0kwMjebRZfM5ZuTz9iYVlNQvf1UjjzfbIbVGET+M QmgA== X-Gm-Message-State: AC+VfDyVXI9F12V5YrqsKNxDA+dP8WMMMrfGUE9Q63VSc93MlBGfM4Yp VNq4QDFg9W+i1cvV6Jsc1FNH8Q== X-Received: by 2002:a05:600c:2204:b0:3f7:35a9:dfdf with SMTP id z4-20020a05600c220400b003f735a9dfdfmr6517067wml.24.1686561889654; Mon, 12 Jun 2023 02:24:49 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:48 -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 16/26] net: stmmac: dwmac-qcom-ethqos: prepare the driver for more PHY modes Date: Mon, 12 Jun 2023 11:23:45 +0200 Message-Id: <20230612092355.87937-17-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489970593791148?= X-GMAIL-MSGID: =?utf-8?q?1768489970593791148?= From: Bartosz Golaszewski In preparation for supporting SGMII, let's make the code a bit more generic. Add a new callback for MAC configuration so that we can assign a different variant of it in the future. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney --- .../stmicro/stmmac/dwmac-qcom-ethqos.c | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 21f329d2f7eb..2f96f2c11278 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -92,12 +92,14 @@ struct ethqos_emac_driver_data { struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; + int (*configure_func)(struct qcom_ethqos *ethqos); unsigned int rgmii_clk_rate; struct clk *rgmii_clk; struct clk *phyaux_clk; struct phy *serdes_phy; unsigned int speed; + int phy_mode; const struct ethqos_emac_por *por; unsigned int num_por; @@ -332,13 +334,11 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) { struct device *dev = ðqos->pdev->dev; int phase_shift; - int phy_mode; int loopback; /* Determine if the PHY adds a 2 ns TX delay or the MAC handles it */ - phy_mode = device_get_phy_mode(dev); - if (phy_mode == PHY_INTERFACE_MODE_RGMII_ID || - phy_mode == PHY_INTERFACE_MODE_RGMII_TXID) + if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID || + ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_TXID) phase_shift = 0; else phase_shift = RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN; @@ -485,7 +485,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) return 0; } -static int ethqos_configure(struct qcom_ethqos *ethqos) +static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos) { struct device *dev = ðqos->pdev->dev; volatile unsigned int dll_lock; @@ -561,6 +561,11 @@ static int ethqos_configure(struct qcom_ethqos *ethqos) return 0; } +static int ethqos_configure(struct qcom_ethqos *ethqos) +{ + return ethqos->configure_func(ethqos); +} + static void ethqos_fix_mac_speed(void *priv, unsigned int speed) { struct qcom_ethqos *ethqos = priv; @@ -660,6 +665,22 @@ static int qcom_ethqos_probe(struct platform_device *pdev) goto out_config_dt; } + ethqos->phy_mode = device_get_phy_mode(dev); + switch (ethqos->phy_mode) { + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: + ethqos->configure_func = ethqos_configure_rgmii; + break; + case -ENODEV: + ret = -ENODEV; + goto out_config_dt; + default: + ret = -EINVAL; + goto out_config_dt; + } + ethqos->pdev = pdev; ethqos->rgmii_base = devm_platform_ioremap_resource_byname(pdev, "rgmii"); if (IS_ERR(ethqos->rgmii_base)) { From patchwork Mon Jun 12 09:23:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106385 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2466919vqr; Mon, 12 Jun 2023 02:50:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5MWXjJl92NM52TWFrZKVFJMCMl66/duJqfh/taLrSQtkFmzWUUyWgW2BgRE3hm1uZXODJZ X-Received: by 2002:a05:6a20:8f07:b0:10d:1213:432a with SMTP id b7-20020a056a208f0700b0010d1213432amr10630404pzk.33.1686563405051; Mon, 12 Jun 2023 02:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563405; cv=none; d=google.com; s=arc-20160816; b=mZavByuB2kMTXgmXvHh9h+vc3ouQwyURaRTtoOdPkm8igOb8GHcP3JdPW9NQZDtmKz qd4SFPtHYp2AYJkTCZH69GO9sJKfiT3c8gnGtuuyD7EbdwADRrncbsQfGQ3eEp4vCjRa oSC/dc5BaHrH12FChsq7bklNr3X1tVYpcjsh7E85J4FnmLOpGKaFBa1ZFhz4OzYFN6bo RIQ4rq6Q+RpvornLKkIkXlIUMxqdJnJTwQiBe2T2krnB3/pWFyjXVw6EVCmhJl3lBsig LqEH2wUe1UYWofDp02I2DMkdTxWm8YiKN+U84ApYtA1qQLxcVnZYObkQeGAaqhiTC7v8 +3kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Gu6Hj8PYw+w5Smr4EMXMmc+WADcALPo6VlL++XAkFkQ=; b=ehEOGR6FVHi3VHFrLZ8sFJqXWbwrixq8y7qHzKHlnTAf087IkjF3JoBQH59Yh8ALN/ ZN/1hp0yo9680T1X3iWCeAYqyA9Smd9gpaiGGYtdj7Dfw8S4S+aRvZIqJEQmYEppSzYd suZ0/NvVy8K60IpMoq35QJhOQq92Bjh4vvoivZ49b/YxNQYXcrB5u79zWblmuRL+lZ7+ SwsPyvigR6GS5qhq9qSNOd+bFTLsEhGQgvmxtuU0ADythDftm6vfNGTSp15naYgjIhbk jyYwFlbQZ7E8RJyuAMS3ylmJ7ObzeHCWevLW8r89UitnMuL9bs4HZcf3gs3TBWzEDtIU MAsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=KgztPCwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020aa79990000000b0064d62222c46si6644943pfh.121.2023.06.12.02.49.53; Mon, 12 Jun 2023 02:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=KgztPCwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235065AbjFLJcQ (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234786AbjFLJac (ORCPT ); Mon, 12 Jun 2023 05:30:32 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D38B04EC5 for ; Mon, 12 Jun 2023 02:24:52 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f64fb05a8aso4792336e87.0 for ; Mon, 12 Jun 2023 02:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561891; x=1689153891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gu6Hj8PYw+w5Smr4EMXMmc+WADcALPo6VlL++XAkFkQ=; b=KgztPCwzL7tQDDy797REtkk6bu9zfPBV1CItjq2k4V9QtMfVqe7RQDCXQ+XLPJ+Tnu as8pYDlZiiycSsvjx0FeTP5FWiqBhfePAPUFcTmRWIbqULZz4GzxMxSYa6wh8l/ZdnX8 19eJideh6H6lNdJyPVL8ku4IHc43sCPTWCXZwSYq9N9lKCdNc1tcn/DsRUUbRH4jkopC 4m3O+6XeduNEMSUdeIrKAAqOR2554WPPuGg8oI5fw2O+aNCrNLvyIgTVYq+T3am/k4Ak GtUlY9r08SUm7vHfrQ4KlyXcElHqGru24EzP2b4Dg5v4sIQkXWI9ZdASbzNYVUtZhgM6 Y07g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561891; x=1689153891; h=content-transfer-encoding:mime-version: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=Gu6Hj8PYw+w5Smr4EMXMmc+WADcALPo6VlL++XAkFkQ=; b=QQuUDLE6nuRFk36J7txZ/esZ9JvwbxEkM9HujbkvSL4/TNBVizT+7ccB2aetnhHUcO CiPyCALy/rJ1TPyu1YID45BMBxU2v1fsWdzQRLQnT42dIbyui13l50Myj7fM8gxiqCGp 5ZDMC0bze567+ZY6ns1Z4EqHSCa7QOqW5CG+2bIK9mxtI7BNDg+BYXWKkpd+NN4UL+1N xWqR7GBWWZN/62erdy6L6vF0EccrhtCQjVVrcNpkQyRncE+ev7zyOfRhDPnM+yvXBa8I Fz1jClDgZ4KX6FsjGw5mBsWsB2V2EamuxNfmBCq3PxLWtE5FDw9DXYowxGSFr9lFe26S XRcw== X-Gm-Message-State: AC+VfDw11ebUr66DakQ4VrmaFl5mj3daJb6uE3IFrhYmnz6S+Q5MY8bn ZTEH6D/6BdB8wg0r1XoU36m2iA== X-Received: by 2002:ac2:5b11:0:b0:4f3:b32d:f739 with SMTP id v17-20020ac25b11000000b004f3b32df739mr4457643lfn.19.1686561891077; Mon, 12 Jun 2023 02:24:51 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:50 -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 17/26] net: stmmac: dwmac-qcom-ethqos: add support for SGMII Date: Mon, 12 Jun 2023 11:23:46 +0200 Message-Id: <20230612092355.87937-18-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489909144369341?= X-GMAIL-MSGID: =?utf-8?q?1768489909144369341?= From: Bartosz Golaszewski On sa8775p the MAC is connected to the external PHY over SGMII so add support for it to the driver. Signed-off-by: Bartosz Golaszewski --- .../stmicro/stmmac/dwmac-qcom-ethqos.c | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 2f96f2c11278..247e3888cca0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -76,6 +76,10 @@ #define RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL BIT(6) #define RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN BIT(5) +/* MAC_CTRL_REG bits */ +#define ETHQOS_MAC_CTRL_SPEED_MODE BIT(14) +#define ETHQOS_MAC_CTRL_PORT_SEL BIT(15) + struct ethqos_emac_por { unsigned int offset; unsigned int value; @@ -92,6 +96,7 @@ struct ethqos_emac_driver_data { struct qcom_ethqos { struct platform_device *pdev; void __iomem *rgmii_base; + void __iomem *mac_base; int (*configure_func)(struct qcom_ethqos *ethqos); unsigned int rgmii_clk_rate; @@ -561,6 +566,33 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos) return 0; } +static int ethqos_configure_sgmii(struct qcom_ethqos *ethqos) +{ + int val; + + val = readl(ethqos->mac_base + MAC_CTRL_REG); + + switch (ethqos->speed) { + case SPEED_1000: + val &= ~ETHQOS_MAC_CTRL_PORT_SEL; + rgmii_updatel(ethqos, RGMII_CONFIG2_RGMII_CLK_SEL_CFG, + RGMII_CONFIG2_RGMII_CLK_SEL_CFG, + RGMII_IO_MACRO_CONFIG2); + break; + case SPEED_100: + val |= ETHQOS_MAC_CTRL_PORT_SEL | ETHQOS_MAC_CTRL_SPEED_MODE; + break; + case SPEED_10: + val |= ETHQOS_MAC_CTRL_PORT_SEL; + val &= ~ETHQOS_MAC_CTRL_SPEED_MODE; + break; + } + + writel(val, ethqos->mac_base + MAC_CTRL_REG); + + return val; +} + static int ethqos_configure(struct qcom_ethqos *ethqos) { return ethqos->configure_func(ethqos); @@ -673,6 +705,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev) case PHY_INTERFACE_MODE_RGMII_TXID: ethqos->configure_func = ethqos_configure_rgmii; break; + case PHY_INTERFACE_MODE_SGMII: + ethqos->configure_func = ethqos_configure_sgmii; + break; case -ENODEV: ret = -ENODEV; goto out_config_dt; @@ -688,6 +723,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) goto out_config_dt; } + ethqos->mac_base = stmmac_res.addr; + data = of_device_get_match_data(dev); ethqos->por = data->por; ethqos->num_por = data->num_por; From patchwork Mon Jun 12 09:23:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2468305vqr; Mon, 12 Jun 2023 02:53:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IUMc3qRRPV1iIFTeznG2AIM5+z1XCK4POtCgvQnhbzMmGejpaNzOHnUkJZghwiV+WG0PS X-Received: by 2002:a17:906:ef07:b0:96f:7b4a:2904 with SMTP id f7-20020a170906ef0700b0096f7b4a2904mr9321250ejs.3.1686563620120; Mon, 12 Jun 2023 02:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563620; cv=none; d=google.com; s=arc-20160816; b=Ag9FaxIXfj7/ZYCv9yeXnJacjYdLWVfK1q/wLrFReNIpChYRY+PBXKBN32NXEZwcd8 tu24cAPMQWa5wDMTLAx/h16HfJERZ1Wh4zolxg6sCFcm/ENVNZGdZVicMOildUi2VAZv fKQdNfoYEGaiBNXImj1QpePxUs0AHDD53vXsrewP8hEGGnnCc2OATd1I2YDMoMe6GzTd Kk+zShzEn9rA6VVPwMOjmrDLbl98lTrSgDFuwztwxFGLOtp3diyBC8xAK5eh6WZKahE9 nYpGyib2G00jckKKq6iAVn5RU/weDSMY3fWA2N4quaE01bAdV2nRWmRKtAV1MUtbrJTV SjSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HRB5rCUQICPP4KdYl/nzNPsexRgByDiqLi2dGSM6LQs=; b=JXJ+y5M3fuQMQv/RLhY13pIPF3TaMBS8Rz1rDR8g15yzBUtY8qHhdQzMmvpfgfmvFy s3lrXq99EMopsBOqd3bAzbKHHp0enwfU4r7pjg2rw6m2g8LQpfwrZ9C0lSvmbmCAyhc9 QVvzrjXh+pt98PaiFyg1f9NgtXhL3Vict/zHCJocuQN3hHaUo5BZm3yPBPaKXm2SO0mt ea6dHK7MF5zt17iK5ekbgWuaEbwQWOqVRRmDolFnyCD6+kE+V8niZ7U+5TblZYSX7u+O n3/brd73bzsENc8Q6LpEQn0X72SI3W83LqfPWvfIws5o9sDTRGVdC4USQIszMj/s2jXs Tn2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=wki9pfOT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a1709061d0200b009745df166d8si1949313ejh.340.2023.06.12.02.53.16; Mon, 12 Jun 2023 02:53:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=wki9pfOT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235101AbjFLJcT (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234821AbjFLJac (ORCPT ); Mon, 12 Jun 2023 05:30:32 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11E5B35B1 for ; Mon, 12 Jun 2023 02:24:54 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f63006b4e3so4777088e87.1 for ; Mon, 12 Jun 2023 02:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561892; x=1689153892; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HRB5rCUQICPP4KdYl/nzNPsexRgByDiqLi2dGSM6LQs=; b=wki9pfOT5Rxd5I9FVQ1tRg38zuoF06hGoB1Obw/n5Dat40yAA3EhR9Z0NsWmcyoRqW vQyNN2w2lHRcUgiG1L332CkRuWKahCVsNNsrZv5eNwW8gCsYqzw1Thzr5uyHZFzdU2L4 R7UVTsB1Dp1LYr35Igwj8+TEs389mw3klOojuK2W5JThLmNPLnC3tMYuuLyJ3Gp6zCG/ qEcP61vcWik5dCgYIOPqXuug1GJFZUuqfw8tCK6B4Pkjc+BH8zPcoLzziPa8F0Qnz+ca ViB763l7KUgMeerwWnhj0R3xgWRs8nSt3qCvm/3rh1uZ+miXI5BfQi7gRLCTXh6Ux3Ff c3wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561892; x=1689153892; h=content-transfer-encoding:mime-version: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=HRB5rCUQICPP4KdYl/nzNPsexRgByDiqLi2dGSM6LQs=; b=PVq7tVwfe8a+PormfdOAEZznYYGN2s99ePAGJhlbGFDMrma516Jruw3gqbC3O9IC24 S4wLaEA5lpLBcJcxH/GZZrMZ1RG0kBn1wxxeA5SIWT8xavacqYfmRAcfKk7sHik4qQAp MoBgjIL9MPXxUfkWtaWxaoaBeg3EYhEd3nwhXPSC9YxYNNkCOe4lfRhOXE6mXctiz8Vs i9YrDlls5t7TyaXhr5ETey4xMJ3BVW27b0bmTu6KHvIKM64PQmiQEHY3HUPBdcoTt7Rh uyvomhxTvD/aHSM/4uM5RQlpM8cHVSXtFG9UCt9LX3XqhsGj9p2TtBxn56/6dZKBp874 Rj8A== X-Gm-Message-State: AC+VfDz9iBkeJTvDu8yBIebr6IS7qyaQfiQ4Zc+wOyV8S2L62C02mvu6 pyHi7O1B8j952X4OQmF035NE/w== X-Received: by 2002:a05:6512:2e2:b0:4f6:2233:6d27 with SMTP id m2-20020a05651202e200b004f622336d27mr3519648lfq.31.1686561892365; Mon, 12 Jun 2023 02:24:52 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:51 -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 18/26] net: stmmac: add new switch to struct plat_stmmacenet_data Date: Mon, 12 Jun 2023 11:23:47 +0200 Message-Id: <20230612092355.87937-19-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768490134320919482?= X-GMAIL-MSGID: =?utf-8?q?1768490134320919482?= From: Bartosz Golaszewski On some platforms, the PCS can be integrated in the MAC so the driver will not see any PCS link activity. Add a switch that allows the platform drivers to let the core code know. Signed-off-by: Bartosz Golaszewski Reviewed-by: Jose Abreu --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- include/linux/stmmac.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index fa07b0d50b46..fdcf1684487c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5793,7 +5793,7 @@ static void stmmac_common_interrupt(struct stmmac_priv *priv) } /* PCS link status */ - if (priv->hw->pcs) { + if (priv->hw->pcs && !priv->plat->has_integrated_pcs) { if (priv->xstats.pcs_link) netif_carrier_on(priv->dev); else diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 225751a8fd8e..06090538fe2d 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -293,5 +293,6 @@ struct plat_stmmacenet_data { bool sph_disable; bool serdes_up_after_phy_linkup; const struct dwmac4_addrs *dwmac4_addrs; + bool has_integrated_pcs; }; #endif From patchwork Mon Jun 12 09:23:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2468701vqr; Mon, 12 Jun 2023 02:54:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wk5kRP3mwgTKUPytzFKCU9r0cQWzws7BVnegtvMKPFjgk5g5CQIFe2udtMKHV0HwrFZZN X-Received: by 2002:a17:902:e5cc:b0:1b1:e863:9e77 with SMTP id u12-20020a170902e5cc00b001b1e8639e77mr7346928plf.18.1686563691267; Mon, 12 Jun 2023 02:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563691; cv=none; d=google.com; s=arc-20160816; b=scr9TJIQi8slMClawnT29HxXoGzh4Vpje2syiN4SP9++2sc+7xj9tjBwiSuOoQlr2t KoPvesfjA3wH6vZTiF3eOlH5UfnPGCi4BhRzXDw2kKA+4+ILqErhZS3YBJs/k+Ov50wm bawuFUqkEHioBSJb64AKCjwZqT8uW4TUr0CdMCCGI5BQ+ieKKWQWAQBtKvc3aB0F55XI 2vwO1H0H52hy+gTPW6fVPkj6MOp1N0eM1+wmERuUru29k4iVUdUj3UQNicUcusjf/ohP 4yabONHmxoXdyO0J49RTQ2u0vtoyBxB2rUi/0CdCoBpDvQtl3UsgDE0kIxfatLup9bX2 S8Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O/BwPT61gNb/fpvsQAhaitGbvL3MEPuuuuNNy2pTzoE=; b=0l+BNqCVsZFOw5N6oZZ7oGNC0BqGj9VchGh/FMDUY3kGsqMOsd0/Byh6f3P9malwHt My8y5VIkOuSNsTocvl4gN0ZlkAs4NNuWGipfwNa6d67aRhSJOJjcPN1sfKJC5vYKm++C CHdH2SDTJ/9WxGLezgx4acZYsShDzZYpD3J9VILFhVDvxA1hCra2qqiGuiEWRbHoE5SY dksC0B8kgUFSLZrb8on7wN+W2/AzvRP1l9ddvayUWyIwbIuyySVN0BhzRTDRa+V/DCUG 3+UEqaSZQi5IcWSbH5vtqDCJz66NJ/fmoj2yUJFQ3jtqk/Szn6fNYlXviuCOmwyCNrKC Fq/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=KHKdjQnx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170902d48900b001b075e2e994si7244762plg.575.2023.06.12.02.54.39; Mon, 12 Jun 2023 02:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=KHKdjQnx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234821AbjFLJcX (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233109AbjFLJaf (ORCPT ); Mon, 12 Jun 2023 05:30:35 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52FDF4EC7 for ; Mon, 12 Jun 2023 02:24:55 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f7378a74faso29364835e9.0 for ; Mon, 12 Jun 2023 02:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561894; x=1689153894; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=O/BwPT61gNb/fpvsQAhaitGbvL3MEPuuuuNNy2pTzoE=; b=KHKdjQnx0PTEmRzkJeZY3O856gAgS3Hdc359skiRzSs2ciEHOPaOFgjUVc/wO0JOvu 8QRdBnSv+EpJxtw+vLXcuZ2cXgNGtF894/O/Z/fQDBOMUUO//qoKGVyNWVnPGZblfP7S 9fuhxIDMQebFvrJhPuZ4btq9pjjepa44vnED5QD5aXI9zMok4d/PF4D+0jEWDMXfujCn oPpYG9VmBg5YBg8Rw5qGxzf6uNUd6/FJit9UvVSVn7GOGDFdSxBGLyVDpcVg6UUUn4Py 1unlaSr7kVEPk0ryxuCCi9hRPqDELZuCqySYJWzNODdIiuQcCRL71x4NS7A49Xm3HIc2 nw5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561894; x=1689153894; h=content-transfer-encoding:mime-version: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=O/BwPT61gNb/fpvsQAhaitGbvL3MEPuuuuNNy2pTzoE=; b=h3qzZper8x+vrzYLaapDakVSfeypJo2M1CA5aup4jkTlKpFV24QN++i7ReIghDjOuI c74v2VdAEUGYTCAU7oh45sEFelXF0qHSewdWa9M1gN6nTjAgQkjMmvXhxj5hcMRoZaA6 wDPKUonLjEhGFG2TmzbnA4GmpGNwVZFjSvqDIdZHEEOKt5ZdJCjxmM+tWhHm61Ca14SU /43b9HFFFpKwVSO7M3h7G2MRxF5DXAjuTaCt5cQcaLfmJjRAv/SyR7LfJzlM0J1S/xq9 x/eX7dui9vTRC0BSKy9/DKGoTWoNQltJ4BfSfosEDX8ap6gr+FQaOFYWFG8I/47P9lT6 7rEw== X-Gm-Message-State: AC+VfDxGSdRLlGMQ5mULZSalbT7pfYMRrqhanG8dLD1bGnosofgyCcA5 iODwvGao5F6loPNUL803BYAAiA== X-Received: by 2002:a05:600c:299:b0:3f6:444:b344 with SMTP id 25-20020a05600c029900b003f60444b344mr5600857wmk.34.1686561893854; Mon, 12 Jun 2023 02:24:53 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:53 -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 19/26] dt-bindings: net: snps,dwmac: add compatible for sa8775p ethqos Date: Mon, 12 Jun 2023 11:23:48 +0200 Message-Id: <20230612092355.87937-20-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768490209062320448?= X-GMAIL-MSGID: =?utf-8?q?1768490209062320448?= From: Bartosz Golaszewski Add the compatible string for the MAC controller on sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 363b3e3ea3a6..ddf9522a5dc2 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -67,6 +67,7 @@ properties: - loongson,ls2k-dwmac - loongson,ls7a-dwmac - qcom,qcs404-ethqos + - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos - qcom,sm8150-ethqos - renesas,r9a06g032-gmac @@ -582,6 +583,7 @@ allOf: - ingenic,x1600-mac - ingenic,x1830-mac - ingenic,x2000-mac + - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos - snps,dwmac-3.50a - snps,dwmac-4.10a @@ -638,6 +640,7 @@ allOf: - ingenic,x1830-mac - ingenic,x2000-mac - qcom,qcs404-ethqos + - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos - qcom,sm8150-ethqos - snps,dwmac-4.00 From patchwork Mon Jun 12 09:23:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106375 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2461147vqr; Mon, 12 Jun 2023 02:35:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5aNEJavVjgy/y/ZaSQfQsE+P2U72KIXCzG6DpIC3LkkrHtGyjn9SHfyrF2RgvkFkRaKj07 X-Received: by 2002:a17:907:7f94:b0:973:fe33:3622 with SMTP id qk20-20020a1709077f9400b00973fe333622mr9937904ejc.29.1686562512675; Mon, 12 Jun 2023 02:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562512; cv=none; d=google.com; s=arc-20160816; b=jUNE6kI/JRleYd6ckW+r/Awj2kuFFnc+9dj+5Z/C2QWUxSkRTgkV4ixATyoTKZxc8/ K1aLQUh0JGTzzRIQZZPnOlvNQUW153k5Tl5W+6bdYmlorBrjQ1iqIkRycnHgN14CVQPw O2qY06/Wq1noNLNOr7oUla9Vy7pRQ71dByg92PGrYM62mRqPrX2dlO0dLEgLOrkiHUyX 3papEcHlOpgnT+gNU9NgdxzxeS5+wt/v5wzdtFDnmni+v8dYHSaA6lol0oW8+ONBW4y7 5rLE0CkR+M6CymmoTXbpPX9kJnaOnv1dckU1ABZzGkaj0H84itjvhI1zV5xlGQGuEebw adnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SXzZMEQkDaBAvE+ZbovBT4hal5Pn3NRrTeiS658EjW4=; b=jAzrHkELNLHhmITeHMiM/3dkMOqfQ2H3a89XZC+PCPk/0RYR3uANDNYtVLS2nHjXeS 7znmk9vQmP4d6Ll/s8MxJhMQ31AFnYL4imR3UmjeE4UYRAV6wmsiu0KcJnBpMyq5xikY GuuJVpug1Ly1tJT0LkDnaY1T6/xUA21vk233rZ5rfOl3VT9TuhBrN93wEhitmQDu3b/W 61k+ktxdUEIG8GEQblArNW8+sy3O7OqluICLaN77U4H03ALEOUzUEDwHd19VyuTKo7Tt eot531nq96YnfKH2EYFD/7a+TNm4GEEGxSnQHQMnwAz6k5xpAFFeKEDGe7zyN3DGtpBx x+pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=DcuBFu7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v25-20020a170906339900b00978891ba8c4si4516069eja.96.2023.06.12.02.34.47; Mon, 12 Jun 2023 02:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=DcuBFu7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235117AbjFLJcZ (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbjFLJat (ORCPT ); Mon, 12 Jun 2023 05:30:49 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D53F35A9 for ; Mon, 12 Jun 2023 02:24:56 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f738f579ceso29735155e9.3 for ; Mon, 12 Jun 2023 02:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561895; x=1689153895; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SXzZMEQkDaBAvE+ZbovBT4hal5Pn3NRrTeiS658EjW4=; b=DcuBFu7i8zRSQw8hKkh2pX678LFY4uXhQRa0m1zoChLoD/0S5zPhOg/N/5fCRqhJYj Z/zKl/ZA0YUpKlj3nfmm8WK7dbqp8Lz1GnBwSjRkWnCXmulByIqXZmyk9SecLTKdlKEp 7XqAqh8l0T6g6hWUOB56/w+7mdIuq30uxJryTPArpeMbN91hdnLaykpbwvvQbF3VlWr5 jvy48WfJVMGchgt+8J6Gp6hkKaiYTL3TgU2oDk+hfhvv+QDEuUdfV1axYsnXyQAb2/ox iKo4fug4hayVecTmLj6RFSmpadhjLeynFjSieMx2ZlRUmPe9LmSJZ1bM+o0ZfZ4+FOxq cyUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561895; x=1689153895; h=content-transfer-encoding:mime-version: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=SXzZMEQkDaBAvE+ZbovBT4hal5Pn3NRrTeiS658EjW4=; b=MN4aqHe5US2dTQeX66WU2jHiqV/YP9tgHtMP+sVveUsuCW6Rx5968TOdTJuV/NA999 STs0bjM/yjlh5C9lkzvptbkNK657Kzkt06G3B7U6vPOsOIIPrrUPr7y0HyKd6t3lOPku Uik5mGUOz+twmqfYrEKqF7KKQBMVRsRqXxiY/s2sAqHFaA1HCx+oZL3CxmE6RNmljlz9 PbRHtz3OtZiBUFKhk5kkjbMwaHWvmNW5j6o7tkRq/xI4Mg5LlfCUB2RtGpLQkDodkeyJ FfU4PvzpfwSemp8sw4y2R9lHo0yBbRg3F4Y9yY3j2o4ZJIrdU+RC6XXprOnNqDMLEcbH S8JA== X-Gm-Message-State: AC+VfDxve4E8pxm74EDoVUDYu2cbJXVAbpbtReJql853zH79A+QWvIAz yG2R9Enoh+vyRkaXlGDckejbow== X-Received: by 2002:a1c:7713:0:b0:3f6:784:9617 with SMTP id t19-20020a1c7713000000b003f607849617mr5402370wmi.11.1686561895166; Mon, 12 Jun 2023 02:24:55 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:54 -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 20/26] dt-bindings: net: qcom,ethqos: add description for sa8775p Date: Mon, 12 Jun 2023 11:23:49 +0200 Message-Id: <20230612092355.87937-21-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488973255755836?= X-GMAIL-MSGID: =?utf-8?q?1768488973255755836?= From: Bartosz Golaszewski Add the compatible for the MAC controller on sa8775p platforms. This MAC works with a single interrupt so add minItems to the interrupts property. The fourth clock's name is different here so change it. Enable relevant PHY properties. Signed-off-by: Bartosz Golaszewski --- .../devicetree/bindings/net/qcom,ethqos.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml index 60a38044fb19..b20847c275ce 100644 --- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml @@ -20,6 +20,7 @@ properties: compatible: enum: - qcom,qcs404-ethqos + - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos - qcom,sm8150-ethqos @@ -32,11 +33,13 @@ properties: - const: rgmii interrupts: + minItems: 1 items: - description: Combined signal for various interrupt events - description: The interrupt that occurs when Rx exits the LPI state interrupt-names: + minItems: 1 items: - const: macirq - const: eth_lpi @@ -49,11 +52,20 @@ properties: - const: stmmaceth - const: pclk - const: ptp_ref - - const: rgmii + - enum: + - rgmii + - phyaux iommus: maxItems: 1 + phys: true + + phy-supply: true + + phy-names: + const: serdes + required: - compatible - clocks From patchwork Mon Jun 12 09:23:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106374 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2461082vqr; Mon, 12 Jun 2023 02:35:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ajLy8s+FxP0i1HDQywcTzvajmpGU1c1DnLla6PJYXSSLHYyTnOi7jUsvKElUzddLCkoS5 X-Received: by 2002:a92:c945:0:b0:33a:a518:653f with SMTP id i5-20020a92c945000000b0033aa518653fmr7899619ilq.15.1686562504178; Mon, 12 Jun 2023 02:35:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562504; cv=none; d=google.com; s=arc-20160816; b=nnTGXPipx3e2mUqt4TlGjYo5mfoS9+oRP/QAL+VMDqg8obTOA3Mb6RZrzaQNYN8C3o 8gYktCm4Bun6sttVswyu3mhnhuE0Eg+Rm6bW5scusrke1OUIp3GgcbT45bko0wMwRCa3 t3TxYlWh1R9ZtiMZdpN7AjQeekgCIizxjZsu0fyF/hOcX7wkPNiP3EL+ZhUZ+U28JA1h T3O3J6TOI47gCdWjdd3xNnDH3Bns9jekaGJFbG1cTFXJRQNyM8HaFEoF9IpyQHLtQwRP m4T0uR1mo6xR8Db3DDphhT7wsBBuHjag2SKlKI+EzMygzaRxYREnBDuu9rVcOllANYxJ OPGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=daR94dVplG+ZI9i0IDfMIEFWnwE1eSwGkl16IK6pqwI=; b=y9r4nZquoMjYeDqlVuxygZqgwj0nxo0FmvGroXANY4tJpXOrc+82e/Y6WXAJO3PKcI vrbdSB8SDF5SDLelPWJ6kOSyapZ7udb4aJ++FslyVQ5zUf71zb8pj5gO35tSkiOGC9R+ XmNK4w4Ea07htfrLVxQwi6dPSBRh27pPwQAqOyaW2DbmLu87D0Dvd0ctf/HofoKSY7WS 9dq0QO7npbV7sRwv76hLy/FQxQifeFuFTu5BA9d6VTszZGeeq47Hmg2uj9Uqm1VNR94I rM6f7PSf3yZ7k0aAlNns1pcsDd7PUA+zMdGRu+2CV1Oh+WOwYzPDpIngMc+zeqkJK8Gf n5WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=uoRxZiUP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b00512fab9493dsi6644104pge.740.2023.06.12.02.34.52; Mon, 12 Jun 2023 02:35:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=uoRxZiUP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbjFLJcc (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231654AbjFLJay (ORCPT ); Mon, 12 Jun 2023 05:30:54 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370864EC6 for ; Mon, 12 Jun 2023 02:24:58 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f732d37d7bso29602485e9.0 for ; Mon, 12 Jun 2023 02:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561896; x=1689153896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=daR94dVplG+ZI9i0IDfMIEFWnwE1eSwGkl16IK6pqwI=; b=uoRxZiUPtxnfmNryRY5Rnwq1ha8eB/FcnBi2lahhDqg941OiFCwgMJdV5vgRId9uq4 /TyZwSbQWan6lMJfE7LV4PJs/RmG9lUGpm9CQl3UDwa8I4V9rGcvZR3ICmwfe7UURu5C Bqb5yljGhjDVR0x36RuIYypr9JevX+iHfhUG4LIEvPPOyNEbG48oRl4XsmphWMAb7iLy +Zn0VrCahCaKLP0tPf4sEfrnJNcHkyEIPP2IZw7fTxGKacoGuzEulIEIATBzR26s9AuA Rw6qAUeAkGBlwewnJvAEzhUnUvU32AjdHyn9AZpXKWcMh65K+O05T+95QC/Kof8VMOzR cG3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561896; x=1689153896; h=content-transfer-encoding:mime-version: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=daR94dVplG+ZI9i0IDfMIEFWnwE1eSwGkl16IK6pqwI=; b=TGqL+kPUP70T/9kDWgK4B0jCU5kybG6mH6CnJJZvsn4peBBo6jUFoORbNL2LRUv2FY 5X7vqk14UDsZXvWqAVTFeyyPY0ftrR91LqMXU/pXRRuqYDdM0juyzzbPOToIvzhSo6iJ hlareNUBFGeEpwY5wp+3S6YTVKMB4y212zl+LHSRb35PS+0+6jNhAuRxP4rwpTGP7Eaz /qfy/Lkqpr4niOhVskRzn9wyngZZdeKvH6OhCoWWQh3T8m9EEe48WjkANCI8+FPW7GAt waxNLVMj4fZZ5RG5K4u4tFB6kn5C/Q+fj4lfwtRWBXPrZglB20/5nhF/rW7eK3awFGZn SS0Q== X-Gm-Message-State: AC+VfDwCjCM7/YTv/rorKj1YogdVj7ganS8hmyw7GftAqYOcwB2Mg4ac oCJSDVd9CgZnRIJY4ck7yuVACw== X-Received: by 2002:a05:600c:224d:b0:3f8:1110:60c2 with SMTP id a13-20020a05600c224d00b003f8111060c2mr4009580wmm.33.1686561896419; Mon, 12 Jun 2023 02:24:56 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:56 -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 21/26] net: stmmac: dwmac-qcom-ethqos: add support for emac4 on sa8775p platforms Date: Mon, 12 Jun 2023 11:23:50 +0200 Message-Id: <20230612092355.87937-22-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768488963902063767?= X-GMAIL-MSGID: =?utf-8?q?1768488963902063767?= From: Bartosz Golaszewski sa8775p uses EMAC version 4, add the relevant defines, rename the has_emac3 switch to has_emac_ge_3 (has emac greater-or-equal than 3) and add the new compatible. Signed-off-by: Bartosz Golaszewski --- .../stmicro/stmmac/dwmac-qcom-ethqos.c | 64 +++++++++++++++---- 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 247e3888cca0..047c569e5480 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -89,7 +89,8 @@ struct ethqos_emac_driver_data { const struct ethqos_emac_por *por; unsigned int num_por; bool rgmii_config_loopback_en; - bool has_emac3; + bool has_emac_ge_3; + bool has_integrated_pcs; struct dwmac4_addrs dwmac4_addrs; }; @@ -109,7 +110,7 @@ struct qcom_ethqos { const struct ethqos_emac_por *por; unsigned int num_por; bool rgmii_config_loopback_en; - bool has_emac3; + bool has_emac_ge_3; }; static int rgmii_readl(struct qcom_ethqos *ethqos, unsigned int offset) @@ -203,7 +204,7 @@ static const struct ethqos_emac_driver_data emac_v2_3_0_data = { .por = emac_v2_3_0_por, .num_por = ARRAY_SIZE(emac_v2_3_0_por), .rgmii_config_loopback_en = true, - .has_emac3 = false, + .has_emac_ge_3 = false, }; static const struct ethqos_emac_por emac_v2_1_0_por[] = { @@ -219,7 +220,7 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = { .por = emac_v2_1_0_por, .num_por = ARRAY_SIZE(emac_v2_1_0_por), .rgmii_config_loopback_en = false, - .has_emac3 = false, + .has_emac_ge_3 = false, }; static const struct ethqos_emac_por emac_v3_0_0_por[] = { @@ -235,7 +236,40 @@ static const struct ethqos_emac_driver_data emac_v3_0_0_data = { .por = emac_v3_0_0_por, .num_por = ARRAY_SIZE(emac_v3_0_0_por), .rgmii_config_loopback_en = false, - .has_emac3 = true, + .has_emac_ge_3 = true, + .dwmac4_addrs = { + .dma_chan = 0x00008100, + .dma_chan_offset = 0x1000, + .mtl_chan = 0x00008000, + .mtl_chan_offset = 0x1000, + .mtl_ets_ctrl = 0x00008010, + .mtl_ets_ctrl_offset = 0x1000, + .mtl_txq_weight = 0x00008018, + .mtl_txq_weight_offset = 0x1000, + .mtl_send_slp_cred = 0x0000801c, + .mtl_send_slp_cred_offset = 0x1000, + .mtl_high_cred = 0x00008020, + .mtl_high_cred_offset = 0x1000, + .mtl_low_cred = 0x00008024, + .mtl_low_cred_offset = 0x1000, + }, +}; + +static const struct ethqos_emac_por emac_v4_0_0_por[] = { + { .offset = RGMII_IO_MACRO_CONFIG, .value = 0x40c01343 }, + { .offset = SDCC_HC_REG_DLL_CONFIG, .value = 0x2004642c }, + { .offset = SDCC_HC_REG_DDR_CONFIG, .value = 0x80040800 }, + { .offset = SDCC_HC_REG_DLL_CONFIG2, .value = 0x00200000 }, + { .offset = SDCC_USR_CTL, .value = 0x00010800 }, + { .offset = RGMII_IO_MACRO_CONFIG2, .value = 0x00002060 }, +}; + +static const struct ethqos_emac_driver_data emac_v4_0_0_data = { + .por = emac_v4_0_0_por, + .num_por = ARRAY_SIZE(emac_v3_0_0_por), + .rgmii_config_loopback_en = false, + .has_emac_ge_3 = true, + .has_integrated_pcs = true, .dwmac4_addrs = { .dma_chan = 0x00008100, .dma_chan_offset = 0x1000, @@ -276,7 +310,7 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) rgmii_updatel(ethqos, SDCC_DLL_CONFIG_DLL_EN, SDCC_DLL_CONFIG_DLL_EN, SDCC_HC_REG_DLL_CONFIG); - if (!ethqos->has_emac3) { + if (!ethqos->has_emac_ge_3) { rgmii_updatel(ethqos, SDCC_DLL_MCLK_GATING_EN, 0, SDCC_HC_REG_DLL_CONFIG); @@ -317,7 +351,7 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos) rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_DDR_CAL_EN, SDCC_DLL_CONFIG2_DDR_CAL_EN, SDCC_HC_REG_DLL_CONFIG2); - if (!ethqos->has_emac3) { + if (!ethqos->has_emac_ge_3) { rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_DLL_CLOCK_DIS, 0, SDCC_HC_REG_DLL_CONFIG2); @@ -387,7 +421,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) /* PRG_RCLK_DLY = TCXO period * TCXO_CYCLES_CNT / 2 * RX delay ns, * in practice this becomes PRG_RCLK_DLY = 52 * 4 / 2 * RX delay ns */ - if (ethqos->has_emac3) { + if (ethqos->has_emac_ge_3) { /* 0.9 ns */ rgmii_updatel(ethqos, SDCC_DDR_CONFIG_PRG_RCLK_DLY, 115, SDCC_HC_REG_DDR_CONFIG); @@ -422,7 +456,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) rgmii_updatel(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, 0, RGMII_IO_MACRO_CONFIG2); - if (ethqos->has_emac3) + if (ethqos->has_emac_ge_3) rgmii_updatel(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, RGMII_CONFIG2_RX_PROG_SWAP, RGMII_IO_MACRO_CONFIG2); @@ -462,7 +496,7 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) RGMII_IO_MACRO_CONFIG); rgmii_updatel(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, 0, RGMII_IO_MACRO_CONFIG2); - if (ethqos->has_emac3) + if (ethqos->has_emac_ge_3) rgmii_updatel(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, RGMII_CONFIG2_RX_PROG_SWAP, RGMII_IO_MACRO_CONFIG2); @@ -512,7 +546,7 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos) rgmii_updatel(ethqos, SDCC_DLL_CONFIG_PDN, SDCC_DLL_CONFIG_PDN, SDCC_HC_REG_DLL_CONFIG); - if (ethqos->has_emac3) { + if (ethqos->has_emac_ge_3) { if (ethqos->speed == SPEED_1000) { rgmii_writel(ethqos, 0x1800000, SDCC_TEST_CTL); rgmii_writel(ethqos, 0x2C010800, SDCC_USR_CTL); @@ -542,7 +576,7 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos) SDCC_HC_REG_DLL_CONFIG); /* Set USR_CTL bit 26 with mask of 3 bits */ - if (!ethqos->has_emac3) + if (!ethqos->has_emac_ge_3) rgmii_updatel(ethqos, GENMASK(26, 24), BIT(26), SDCC_USR_CTL); @@ -729,7 +763,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ethqos->por = data->por; ethqos->num_por = data->num_por; ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en; - ethqos->has_emac3 = data->has_emac3; + ethqos->has_emac_ge_3 = data->has_emac_ge_3; ethqos->rgmii_clk = devm_clk_get_optional(dev, "rgmii"); if (IS_ERR(ethqos->rgmii_clk)) { @@ -769,12 +803,13 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->fix_mac_speed = ethqos_fix_mac_speed; plat_dat->dump_debug_regs = rgmii_dump; plat_dat->has_gmac4 = 1; - if (ethqos->has_emac3) + if (ethqos->has_emac_ge_3) plat_dat->dwmac4_addrs = &data->dwmac4_addrs; plat_dat->pmt = 1; plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) plat_dat->rx_clk_runs_in_lpi = 1; + plat_dat->has_integrated_pcs = data->has_integrated_pcs; if (ethqos->serdes_phy) { plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; @@ -795,6 +830,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev) static const struct of_device_id qcom_ethqos_match[] = { { .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data}, + { .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data}, { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data}, { .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data}, { } From patchwork Mon Jun 12 09:23:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106379 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2461842vqr; Mon, 12 Jun 2023 02:37:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Xe1okq6i+hbmF4/Zv3IZNNCZBcgDOmvaHtIT3rEVnMPiHMAFrtworN9gf6rAHvHdy9LoQ X-Received: by 2002:a17:906:fe4d:b0:974:1e0e:91ee with SMTP id wz13-20020a170906fe4d00b009741e0e91eemr10528036ejb.13.1686562629258; Mon, 12 Jun 2023 02:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562629; cv=none; d=google.com; s=arc-20160816; b=I3xFKwrAy+lnq8D7j2Nlym1NSQvbMyF5faifwR+M1myu2GWZPa9sIXDP/QkrgMDnby O5nWIfkjaqBRgxZivWKCLKvYE+e80Gq99DycGHIb9GphCKEHUCk8+QkLiuvB5LEKPIkr NkQ4ZfTjgclMNsusj/i2tRvZAdLYKpBbV7PFugsoj83WAMW6d7P0D3qrrEDJ1UWhoraf zi/kEul831DKxko9EqrtnvRtlcY1Rvws391PJ+q+SYJTp9G+y9o0cAzrhQXmHYppPMUq NgAPmNTHagpS+L5AJs64cohIclqAceIkWq388tvb1FA3S239PyPQlJs98cfWet252RWQ +0XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dryPugxzZVkqmEr4Pa67GWmkXSnMJtg4EXukR1I6igY=; b=tZAi2LdNC+NaTBuV/RE0AdSfhn2A3vbAp80Dbx9BaDNkojva2YLX6kubnZ6s4R+xnt Aisy4/SrDHExwe6EwaJp0OuD7yeayfcH0iQ2kPErtepxzdjTHP7UVOavGBPRpopoY5QZ Ny3AZbywUUzHkbYdUZke/BjvM300DrLDPlyd4uTe5lkYlof6sWWtD/HlFZMNpXqFzMQI TPrE89ArpEFcNHKnm1CWbibbpRv3xxux7FWuphkhUAI7lubqwwGrhbacxnJ4t6ktUTxw oVMKsbM3Shk5hswbG2523xovTqQ4Bw3UFHJJ+lsC2fvvUemvD9iO2IRduNkIBPl+sJMa yWeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="M5U/hsAR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d27-20020a170906371b00b00974605cdff7si4708157ejc.605.2023.06.12.02.36.41; Mon, 12 Jun 2023 02:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="M5U/hsAR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234883AbjFLJck (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234867AbjFLJbE (ORCPT ); Mon, 12 Jun 2023 05:31:04 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 749083AB3 for ; Mon, 12 Jun 2023 02:24:59 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f7368126a6so27901735e9.0 for ; Mon, 12 Jun 2023 02:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561898; x=1689153898; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dryPugxzZVkqmEr4Pa67GWmkXSnMJtg4EXukR1I6igY=; b=M5U/hsARaGla6BtHBrfakRsf8bgC4Xv7LPP5Nj/IRwkteEW4yhKwcSaFwSQ1iHYbWm Q0yiPLZAjS9ogGsUnUy/dhShfi9KcDvvB2h2CuruXjTqQF5VmqHPzqtBqySGi24k9f7c ZzcFGICrp8SyArBAwoabUFjTt474+VBi0upbh1KdppDpS2YwuCJH863C6jTtvXX93E3O RwShAOBQ99lfLQ8gcI9PTAVl4liqjyOogX/Z4fLNTj7ZrvRel3u6DlbW+ZTFUyxj/e0d +zcpbnQHWCVagDqk6GjVif26k6GX9dlAwxw6XZWdkX1DKUWy9b1/JZjtUV/uxvFF871x WYFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561898; x=1689153898; h=content-transfer-encoding:mime-version: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=dryPugxzZVkqmEr4Pa67GWmkXSnMJtg4EXukR1I6igY=; b=L/1Mwicu4avnh2ti1pJDJ30C95kL2hMHD1j+yJfantNnfhgvEWrW5ssul5HXdMJBBP 2xDEV2lpXcjmtpHHyHD/RYO4CRLIP85Sy5i5mpFC+qDkXIQ+RLoFwV7aekZSjotCOkxy lhDxzyWfGNShhbbS0eI7u5kxDTNRYGUJ7wQvwhT28fNSCEQgjt9i1G91uGRb3xRu5fVm dwZ4PFKaDkFzqAL4s2igUzLs3rqHVWNl+fYPCi5O9HVVC0vmj80V+oMrcmE7lO932QAH JzjiR1muKfUlvOf12CwY5Xt/KXQ8wBd7BJuMgA3l6QIS+X6/MroJ6nxrrAKzQsogp5sM IsOQ== X-Gm-Message-State: AC+VfDw6mUDqioSl8dvmfc0c/9Rl3NO7YhfZj4JCGFqRria0xepcEL1Z UtfaTdSjCujGLDcRaUKFPA30hw== X-Received: by 2002:a7b:cd19:0:b0:3f7:536e:fff3 with SMTP id f25-20020a7bcd19000000b003f7536efff3mr5410313wmj.25.1686561897926; Mon, 12 Jun 2023 02:24:57 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:57 -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 22/26] arm64: dts: qcom: sa8775p-ride: add the SGMII PHY node Date: Mon, 12 Jun 2023 11:23:51 +0200 Message-Id: <20230612092355.87937-23-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489095893901348?= X-GMAIL-MSGID: =?utf-8?q?1768489095893901348?= From: Bartosz Golaszewski Add the internal SGMII/SerDes PHY node for sa8775p platforms. Signed-off-by: Bartosz Golaszewski --- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi index b130136acffe..0e59000a0c82 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi @@ -1837,6 +1837,15 @@ adreno_smmu: iommu@3da0000 { ; }; + serdes_phy: phy@8901000 { + compatible = "qcom,sa8775p-dwmac-sgmii-phy"; + reg = <0 0x08901000 0 0xe10>; + clocks = <&gcc GCC_SGMI_CLKREF_EN>; + clock-names = "sgmi_ref"; + #phy-cells = <0>; + status = "disabled"; + }; + pdc: interrupt-controller@b220000 { compatible = "qcom,sa8775p-pdc", "qcom,pdc"; reg = <0x0 0x0b220000 0x0 0x30000>, From patchwork Mon Jun 12 09:23:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2462273vqr; Mon, 12 Jun 2023 02:38:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CuI+fGJnpSJyzIXGt0Fs85ZZLMUWj/ejjnKJEtjaqEDYxXQyiiMi8J//kvo85BAJLM9C8 X-Received: by 2002:a17:906:fe0c:b0:976:b93f:26db with SMTP id wy12-20020a170906fe0c00b00976b93f26dbmr8137739ejb.53.1686562691744; Mon, 12 Jun 2023 02:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562691; cv=none; d=google.com; s=arc-20160816; b=Au6mHKw4LKRT052WhNbLkxLpiJuLfnoi6D/EtqC+5lBE+Z8D/HbaknS8Qi4eIojYRA wVdnokE3zwiSI7c3Vo1Ee1g+EfuZxjptlW9d0he3B5+964QrjDoEGDvxWDfvJtZuuX6h yzBEKqZdi9s8bOaocbYcWMxWDu2RJlwmnUF4Re7XKxXRCxMPf4vxOzSn2Pn13mOw46Qw zr1FaZ5NL5/yxopv/xDCvUh9NUA0aTdSSminK29Q8BK59QYusbjlib18/I2OuP53JD4G q5r4MENSYR+RVNRcIvZWypxjYrzvJT1lfn9jFLvmJR9sBqnenjGwfDAufb0cmWLBtJ93 DB9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GgOU29bwSmA1xmnYvgN48ffEdaMQtMdjrdVTUnvg0aY=; b=qKT26LUN1q2SaG2+bOjmeJAkxgLA+xL4wVE3vbICTp2ezGeDygTDdxoZT3EMVSNwF2 OMFDfEY8zJHl49mh8GHFErlH3xFywdeDx9R2QAEelQtvHegkt2e3xCHg3eXyZ4p/gEt4 ektJUKDVB5tnK6AVa7mUuJLtpNveT7QOXTWa+NibvtXaqBbv7bORS22erWsDcGNWOqma e0IZXeTb0kZdf91jNF4UGCR9WWVsVroS9/Fi0/p5sOftPh1+zg9JmD2OdyLyLGSJfYrL 1DlmZjKEkNeMk+Jsj13Id5ejAfqjWAsyfPk0MnzFnPFHfsAAbH5UAQRArkEIaXiDeh8x FCUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=vyX9Q+kD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a170906950f00b00978acf8b44esi4844905ejx.707.2023.06.12.02.37.47; Mon, 12 Jun 2023 02:38:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=vyX9Q+kD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbjFLJcp (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjFLJbR (ORCPT ); Mon, 12 Jun 2023 05:31:17 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F16554EC9 for ; Mon, 12 Jun 2023 02:25:00 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f640e48bc3so4669382e87.2 for ; Mon, 12 Jun 2023 02:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561899; x=1689153899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GgOU29bwSmA1xmnYvgN48ffEdaMQtMdjrdVTUnvg0aY=; b=vyX9Q+kD9G1p5rZ6oHppIAZRDTqqLuaLmmx8ER/1w9clbWGVKsqSzOZIssSGm8lUKA dlBs3V+g8fkc6+a3VNSEJc5CAKqMBwCpBJobp58ZPlkjDf4gYm8MeEiyGt0H3nYapjdU rLNaG8AWbRv39nWwT4gHrrsq2bGBt/mjyDGKhCQVoeiOFWfkZWRsJ8TQOz31yUf3AvL5 nw3BwJ8ocxS+TzBLzPUgr5JBsXuA1EbH4qK8yPDA2P/kQJF+Z+Aujhld1mA4LMr+t/W/ D+y18SR7STIM5gSDK9/lewz4exGG34D7uUb6LQAITMMCYN23tDt0IYL700rjOgmkyHSJ iMMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561899; x=1689153899; h=content-transfer-encoding:mime-version: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=GgOU29bwSmA1xmnYvgN48ffEdaMQtMdjrdVTUnvg0aY=; b=R9DeWAZJpAJbtxm/42sBHDH3nNpFWDlZtOsyrK9zWkhkn25L/OoUKoWP2OSnfzG7Uz bHJiZ0tTBszrZ/MzUKuu+EZsl+LuqVGXPuy3wkVkonIg7PlK7vnxjMN6HsXwaZXtUc4e LyywiixqHnd4xp82ZsUgDSwToOkSQWCt0vVtjiuEAj14uNRN0gnyJmPryuujvNWi5d4y RsBZmoYfAPT2K43FmDOcL1Pzxymn3hh7CGOt1jdevReeWGrQOidBjHIDKIljhsxj59OM 7impThq1I4hbtknA9rb54DNzSbSneD5VGGJRWsMzh7Siohwvoj4T1JhYWZ1rrvVDM8Cr aLow== X-Gm-Message-State: AC+VfDyfsSGlNkCuQHUnVHHrT3l3AqPI2nDrlCH4fuZPvLaRS7vDKmpb Jcp+aNIVL9HL5f3MoX5opoRp+g== X-Received: by 2002:a19:6550:0:b0:4f4:b218:e85f with SMTP id c16-20020a196550000000b004f4b218e85fmr2780825lfj.31.1686561899243; Mon, 12 Jun 2023 02:24:59 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:24:58 -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 23/26] arm64: dts: qcom: sa8775p: add the first 1Gb ethernet interface Date: Mon, 12 Jun 2023 11:23:52 +0200 Message-Id: <20230612092355.87937-24-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489161259160888?= X-GMAIL-MSGID: =?utf-8?q?1768489161259160888?= From: Bartosz Golaszewski Add the node for the first ethernet interface on sa8775p platforms. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi index 0e59000a0c82..f43a2a5d1d11 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi @@ -2315,6 +2315,36 @@ cpufreq_hw: cpufreq@18591000 { #freq-domain-cells = <1>; }; + + ethernet0: ethernet@23040000 { + compatible = "qcom,sa8775p-ethqos"; + reg = <0x0 0x23040000 0x0 0x10000>, + <0x0 0x23056000 0x0 0x100>; + reg-names = "stmmaceth", "rgmii"; + + clocks = <&gcc GCC_EMAC0_AXI_CLK>, + <&gcc GCC_EMAC0_SLV_AHB_CLK>, + <&gcc GCC_EMAC0_PTP_CLK>, + <&gcc GCC_EMAC0_PHY_AUX_CLK>; + clock-names = "stmmaceth", "pclk", "ptp_ref", "phyaux"; + + power-domains = <&gcc EMAC0_GDSC>; + + interrupts = ; + interrupt-names = "macirq"; + + phys = <&serdes_phy>; + phy-names = "serdes"; + + iommus = <&apps_smmu 0x120 0xf>; + + snps,tso; + snps,pbl = <32>; + rx-fifo-depth = <16384>; + tx-fifo-depth = <16384>; + + status = "disabled"; + }; }; arch_timer: timer { From patchwork Mon Jun 12 09:23:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2461828vqr; Mon, 12 Jun 2023 02:37:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zCKTF9XNrxOZNpwBj05cTw2Qk1EjJR1EMqXCWko2cKNfGk4r22/aRx7deFxNE5T4BwvPd X-Received: by 2002:aa7:d38f:0:b0:510:72b1:5f4e with SMTP id x15-20020aa7d38f000000b0051072b15f4emr4520700edq.22.1686562628158; Mon, 12 Jun 2023 02:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562628; cv=none; d=google.com; s=arc-20160816; b=BpJBteoVi+a1RiKCNW4aewAVJagxkc26o6GCPSK4ZVMxW5Mj1NioTQLmYOELWs53Ov b8hQtGseXPXBN3o/Y+JP/d3dFY0xDAvfTjNRgHxyNeDYP22RgUXIDlSJgSsJxmumgA1W NytLJsCaeT2b9ozx0/on5jgrNs0a5lvKGqMDrFtibBBPftPh1m4ISCZhxg34NWtttQ3a 0//ZWbEVqX2DK9hnNyraMvCka/E+1AtGCl9h5IoRpifpC7qc/WOUUCzRfiL0W/uTl2H4 hs3/ceeuB/aO3bCboMP7W+1tajmImDdgV1I52tV3IMVDo0hGk2ODjhuxvrsmIIVEFQfT wXZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f4hcroDV0hdKX/DQDft+g0yZ5ckCppngKltjTy4swGs=; b=RknVMXnlwtKeDGAvOC8cHNSoSbpiX9qOfzX+kA6QANj0lBIY2GXLqDYBfH1cQJZ7e9 pYoGq46YfHodDSeziuGKGD082gfhmEBmwYovTE81qZexW16dz7o1WWqF9bOflkqw7WJN M/8BIFyUMjOhhngcD3a61mbNMByZsgqKFHm6qhOjBKsAgdg3C2H20ComYEq3gwxLcvW4 56qRBWKWwxnR7A9B26LL3mHWlNSVB51x84H7y7S+E4DOfrtHk9KZ3dU5lf3fU3TTHlz4 +oDd9SqL66RvvqkD5esp8s7iaAg3qFvMw1txAOeDXWU2jeYoA7sK67vJ21pj9iHSYzCr H+GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="MAMjiLP/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a50ee0f000000b005149e5d29edsi5898837eds.395.2023.06.12.02.36.40; Mon, 12 Jun 2023 02:37:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="MAMjiLP/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235219AbjFLJcu (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233724AbjFLJbR (ORCPT ); Mon, 12 Jun 2023 05:31:17 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D94199B for ; Mon, 12 Jun 2023 02:25:02 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f6dfc4dffaso29775935e9.0 for ; Mon, 12 Jun 2023 02:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561900; x=1689153900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f4hcroDV0hdKX/DQDft+g0yZ5ckCppngKltjTy4swGs=; b=MAMjiLP/Ub2YMkZrYMQu9I+vzT6+M/KG3XopFjXfiAgrNHxfkR1XAmH5b8FPhTzsfl AqRdT7fKsLe1LsAM2ySEpkmdoZpmATyl8UlCZdD0WerCqDDnXfaLcu9TW+BsqAjtpDP3 h4Y8lowLuAZMm8+6vaV2+O5tZ4JOtojf9TOohwrc3VXLVH0Lp62NqHuEEzvSQ7XMsIgJ FjwcfKOhlAEOQ+sWQqGMbhR8naVGQyOA17XnUN5/G+unqZS2uYPEfzRepIdPMJ3pNCJT C2VSAmBfiHnpDcna93MrdqjGaOpKmOoY5f4NTJ2Krkj/Qavu3TIAsxqxZqX2d9tNvUnX YUrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561900; x=1689153900; h=content-transfer-encoding:mime-version: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=f4hcroDV0hdKX/DQDft+g0yZ5ckCppngKltjTy4swGs=; b=QWm0pwBdK6FUcHyjmgAlWSX/nStBj2abHIb4tTrNYN3fDtX8Bh77VKGgohC/4gNolQ dzvFtZiHNIybFigy3UMxlCUY/UioeBmiAMi6X+Uy0CyVUme7fUf9KlMXnkIzSuTTbWl/ wPt04RWmjmWpKkpaRJq0KGy+/worKM0wICknpP8rMkiwWLT/3Q/8Q32tgIZPfjfcJGCh 9kJkiLuRVPi+B+hfeOO5+I4C5kFHparcRUhX8OsrwGlXnOuIYwY3zPUJ+87U9x5acGAY ix1Lq7vGGP/2wqx/bvDxhOxvTGO+umjXgCZ5qmC/TAkAhl7e93HqLsHw1EZUvc1+8432 hX1A== X-Gm-Message-State: AC+VfDz6gRtXthJyu0JiS8MWGreelsYP8cSSZOvhfgcSG3ZBmmqfy1cj pfGRK9kt1Cf8P5TaBQ9XQbRjrA== X-Received: by 2002:a7b:c047:0:b0:3f8:1b55:ac08 with SMTP id u7-20020a7bc047000000b003f81b55ac08mr1200775wmc.28.1686561900531; Mon, 12 Jun 2023 02:25:00 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:25:00 -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 24/26] arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY Date: Mon, 12 Jun 2023 11:23:53 +0200 Message-Id: <20230612092355.87937-25-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489094836698618?= X-GMAIL-MSGID: =?utf-8?q?1768489094836698618?= From: Bartosz Golaszewski Enable the internal PHY on sa8775p-ride. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts index ab767cfa51ff..7754788ea775 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts @@ -355,6 +355,10 @@ &qupv3_id_2 { status = "okay"; }; +&serdes_phy { + status = "okay"; +}; + &sleep_clk { clock-frequency = <32764>; }; From patchwork Mon Jun 12 09:23:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2461829vqr; Mon, 12 Jun 2023 02:37:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6SRzxV0LZLRU93swCJFZmfZ8ccyuyxnnzH7BusjetupUT+T/+dZlJvCj/+2qMz2Z+BJjoN X-Received: by 2002:a17:907:3681:b0:96b:e93:3aa8 with SMTP id bi1-20020a170907368100b0096b0e933aa8mr10922702ejc.21.1686562628194; Mon, 12 Jun 2023 02:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686562628; cv=none; d=google.com; s=arc-20160816; b=mMf4LFiW8OjLHWfq/LUWyyOjuqgsHc7qrGosYQUuhYo/O6e4bxboOAiI3o5gWrqClV 5KiknvbBI0LM781FYtnTRHiomZlcYr4gVNGmuclyHIuRsbm+cakdECrYJpUglPhx3/E1 bNDTzSM8FVrENp1br/tAtgBbVjMM/3Py0fdYFPKt8VgZDXkN2+wOeRGt46X/ch+bOIwk p/0iKMqKwb/P4SDmlrL3cb6ywiLa2FF1QVPJ/qX6QQhddX1cAyNZmK4kQa6jtNu2t+Fa klFOqx2X10mAFb7wnQVYNUnv0R80NnsdylXQe2i0bWcScVS+63eYcg05OLF1xV39+d5x P8Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CLaMx9+e4iuA9k0HKzXztUaaZBEZ9bpdRm0ATPtxSFs=; b=wpiTvr9XIg4wO/T+lp+vRqWZahH3/fRTigrChIWP5kfIXNkjQZ0VEm6nrtUvSyU4dg 2rm6yilOCeFgJsU3LMg9Hj1S8jq8glGezvG1W4GtiXo0eUgNzJsZoW4/6KSdObqPeCHT 39GtMchm8LNqAcUY2j4jMH6XYLWauOh95H7BM+194XYd6SjNeI1KPsxubX6c9yZFIiJt QSSVHWy9T0cCfmyHAV5wBzXhKUxJaj+Efh089c3RLOLdiUc40VnGiRbEvsX2/Ir4xNZ/ lAWwBiPDQjxKn9NJEshERog3xNl0sLAxTDfiuv4zsUoOhVrmnHlvJaiaKtZ2ZEHOHk7I LhHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Z0vGtlAO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a1709062c4c00b0097104874bfesi5212274ejh.259.2023.06.12.02.36.40; Mon, 12 Jun 2023 02:37:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Z0vGtlAO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234681AbjFLJcy (ORCPT + 99 others); Mon, 12 Jun 2023 05:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbjFLJbS (ORCPT ); Mon, 12 Jun 2023 05:31:18 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB024ECB for ; Mon, 12 Jun 2023 02:25:02 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f732d37d7bso29603575e9.0 for ; Mon, 12 Jun 2023 02:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561901; x=1689153901; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CLaMx9+e4iuA9k0HKzXztUaaZBEZ9bpdRm0ATPtxSFs=; b=Z0vGtlAOr73GZC/Gj6eNFC/9k2Sm7GthQ5ThOHdTEND/fWcqoz9SHGZU7g4Oejo0+B RaV6BZ/igQvP2b+/IrEGbCH17+t+nX1v97JhXRnct3KrN+NH+rKKSmNU5mCdV4b8VRdx LxPR1YJ1FiMBcCV/4psL9l/br0kTlIiTM9S2TXH8Yt5k/l/Yji6lXbMjA3yDLYaN1t5F yTkATjmoZYcy0mVncUpNLUH8UkjQNLy9HERgoOXFhfpbFPFdkrhehA7+aktL68oKI3fc VfoghKsM37C8k9q6fKStc7pJd2JFqcOuHZ/fiUcQndVgIGO+EMPW0QhTOi40Ae765TFr GNLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561901; x=1689153901; h=content-transfer-encoding:mime-version: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=CLaMx9+e4iuA9k0HKzXztUaaZBEZ9bpdRm0ATPtxSFs=; b=VXQISwRZuV2n2DuA4TGvcvjkjJ1es98dVYW4HL5GGYEO13ZmgoybemXJey7KBr7080 cuLtRTeFgyUJw7b3k3XCX4oH/Se44f/eC0nOdBsuBjYeIA+8sd7/J4xx+8qNaWCYjJnM fj9Zm3sJwjirbre/DD6+FHr0ReDl6/3kkEuzxNLMDPs8HdsZMheUex08LxeUbbQwFgId 4vK0LkfVwsC251Ifm+Mq2jP2l1po+c3W4OyZmBm1oQXAe1ZZRzqdROSKz+l528seDFOF lDr2jDduwZjepXvAu4b90KorkaYMT4TfLoMffpxDp+4bjRiII6UnDzIK1QQSNa8+IgBi x+LQ== X-Gm-Message-State: AC+VfDxLKm5XoIKN+Fm7jWJn2aFJ3N7KNjI1O3i7pW+AG85JI70GWZiE 6eyq3JXNxslsGEepsfF9O0DYqg== X-Received: by 2002:a05:600c:284a:b0:3f7:e818:1eb with SMTP id r10-20020a05600c284a00b003f7e81801ebmr5507867wmb.40.1686561901784; Mon, 12 Jun 2023 02:25:01 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:25:01 -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 25/26] arm64: dts: qcom: sa8775p-ride: add pin functions for ethernet0 Date: Mon, 12 Jun 2023 11:23:54 +0200 Message-Id: <20230612092355.87937-26-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489094726173550?= X-GMAIL-MSGID: =?utf-8?q?1768489094726173550?= From: Bartosz Golaszewski Add the MDC and MDIO pin functions for ethernet0 on sa8775p-ride. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts index 7754788ea775..dbd9553aa5c7 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts @@ -370,6 +370,22 @@ &spi16 { }; &tlmm { + ethernet0_default: ethernet0-default-state { + ethernet0_mdc: ethernet0-mdc-pins { + pins = "gpio8"; + function = "emac0_mdc"; + drive-strength = <16>; + bias-pull-up; + }; + + ethernet0_mdio: ethernet0-mdio-pins { + pins = "gpio9"; + function = "emac0_mdio"; + drive-strength = <16>; + bias-pull-up; + }; + }; + qup_uart10_default: qup-uart10-state { pins = "gpio46", "gpio47"; function = "qup1_se3"; From patchwork Mon Jun 12 09:23:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 106384 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2466027vqr; Mon, 12 Jun 2023 02:48:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70GR+gG/JVW8te6TzYy1V1L86uqOj0gp47uWUa26YvSDsiBeooAm9RDA64hMTdODKOToUS X-Received: by 2002:a17:902:e811:b0:1ad:f407:37d2 with SMTP id u17-20020a170902e81100b001adf40737d2mr7407071plg.5.1686563280109; Mon, 12 Jun 2023 02:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686563280; cv=none; d=google.com; s=arc-20160816; b=eTJC9pq/mmk38vX0u/+JmKSlLqUo3HNUchHc6MGzZazL9ZwKO0JIr6FLpwh1fxX1bG xW/15hHd/o6IpcNWmU8FjdP0GA+TmrZzBZqO/BfxKF2zAAGol0UvP/QxWJyo7wQCPVnu 8NvnOMSSPAo3M2nYAwhr9qF45a+YD0iV19M6px6xtMX1X5X+81vQamSox00ikOYZLxA8 5A5fPjFHO2fEwK5ZAjf5i/jf61/BwmJQe2/KUYv6HhVKulEUUZuRG6Ldq1pCeg/CjP16 5uZK7Q8jqcm4XWoJI6hTk4pzWEPe+YX43ppaskhdnqGaK02UfcU3K2X6mhaV8iOtVy0h A6ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R5Kztbbt+Lx+Q6hVK4LvKEHOry/qYQ8OvL9Z8ei/Rso=; b=CsMczRhDOHCBboYytVihO4+7Fntp98hOLXO00PySPTB5IWZwHhxMQneNPyp+fYLA7Y Vz70GMHvOIDEfmsscF/vYORIC+6G6oRTsp12YTNm8+IkY36eq/ebQ3sJuIYgJderLNJc +ZWnesnLhOAKlDxaFu5PQQxKZH9d01ZQFAhnKSvHmVgEPWdaPo+ZWvdLa7uhVCmg9Ugu 2iFrkBTPt+irlxR5ThXTTE8yREB9AqA/smZpzB4ddHe0yErO+Z0eDszmDF11218a/Gjn ZJcV+ReoAKdTDLK9vP+5KW5MSA2FiPrM9fwYVEU9/WMKBO1yp0FWV1p1r5ys/ny7qJ2e pb0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="P/Jhfjzh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j14-20020a170903028e00b001b251877944si4261423plr.50.2023.06.12.02.47.47; Mon, 12 Jun 2023 02:48:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b="P/Jhfjzh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjFLJdA (ORCPT + 99 others); Mon, 12 Jun 2023 05:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229942AbjFLJbX (ORCPT ); Mon, 12 Jun 2023 05:31:23 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B28614205 for ; Mon, 12 Jun 2023 02:25:04 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3090d3e9c92so3894818f8f.2 for ; Mon, 12 Jun 2023 02:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1686561903; x=1689153903; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R5Kztbbt+Lx+Q6hVK4LvKEHOry/qYQ8OvL9Z8ei/Rso=; b=P/Jhfjzh0ruh8aQrw/lvBEWcmDeyZDzd+KU0wuDZSn9r92Pbi5G0y48qPXJTHn5RC4 kIzNj52wkDwMA68v/kq9zzP3zPaQKZim/cG9i+vNjAzcAMo1M4AcuVkSgWsHGt2DU2LU PFrSXKzl06uMIUf7pVrJo4DjNQp8LvcL0gIpifSO0LwHiJsrWKXsQGTWDhllY4QeBTNF CNaL9VHRXacLDGSae9qdh7Z++fN1rP4KZe9SPL0P3QQeakYkXnojA+fEt/yIZB3h/PPT QNUg7068ipJqt+O5/0maFA8OJzwE+Ya05qCeGA7lNrXRD1vNSDOG0Hl6TSakoutgdRgf VzLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686561903; x=1689153903; h=content-transfer-encoding:mime-version: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=R5Kztbbt+Lx+Q6hVK4LvKEHOry/qYQ8OvL9Z8ei/Rso=; b=SEkNFmUguLxCgx1WBHiXXS0MWG5CMffGuPmAcLhYuG6HmupFyEka7jJldKGrCK8d3N 4JWCkNALFLAh5SVqwxdLeRkgP0KL7g0n6u/m4sNQBvMnkSA4L17SdJEf3bSc2fZHTAXI FOVru16D31Ly5qU4vMiIYAjGqslzMBwsLqiaFfM50Gff7AbPE1KBgVEbvQrEKSmOxX3v vOap6BH10OtnNNfz3rl9rau6X1BfNgAhaKyh8Ts+yx6KGIwX3MCgYwrsYQ6e1xhx1ZRW CTT8E3hwHvNlmkRzScLqLz3YMIFIAntRSf3TLNwKKY44cPreJOOcbtx/gTtSOJL3yW7X nbHg== X-Gm-Message-State: AC+VfDzU9YlJwYB/uyfX7axMbes/etprF9IEiyxWlnmcje+XcSj16vhv 1IQ2fH8Tg1z9kvZfxoV19EzgBw== X-Received: by 2002:a5d:6403:0:b0:307:7e64:4b52 with SMTP id z3-20020a5d6403000000b003077e644b52mr4735283wru.36.1686561903258; Mon, 12 Jun 2023 02:25:03 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a222:bbe9:c688:33ae]) by smtp.gmail.com with ESMTPSA id p14-20020a7bcc8e000000b003f727764b10sm10892044wma.4.2023.06.12.02.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 02:25:02 -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 26/26] arm64: dts: qcom: sa8775p-ride: enable ethernet0 Date: Mon, 12 Jun 2023 11:23:55 +0200 Message-Id: <20230612092355.87937-27-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612092355.87937-1-brgl@bgdev.pl> References: <20230612092355.87937-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768489778205202168?= X-GMAIL-MSGID: =?utf-8?q?1768489778205202168?= From: Bartosz Golaszewski Enable the first 1Gb ethernet port on sa8775p-ride development board. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 89 +++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts index dbd9553aa5c7..13508271bca8 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts @@ -261,6 +261,95 @@ vreg_l8e: ldo8 { }; }; +ðernet0 { + phy-mode = "sgmii"; + phy-handle = <&sgmii_phy>; + phy-supply = <&vreg_l5a>; + + pinctrl-0 = <ðernet0_default>; + pinctrl-names = "default"; + + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + snps,ps-speed = <1000>; + + status = "okay"; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + reset-gpios = <&pmm8654au_2_gpios 8 GPIO_ACTIVE_LOW>; + reset-delay-us = <11000>; + reset-post-delay-us = <70000>; + + sgmii_phy: phy@8 { + reg = <0x8>; + device_type = "ethernet-phy"; + }; + }; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <4>; + snps,rx-sched-sp; + + queue0 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x0>; + snps,route-up; + snps,priority = <0x1>; + }; + + queue1 { + snps,dcb-algorithm; + snps,map-to-dma-channel = <0x1>; + snps,route-ptp; + }; + + queue2 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x2>; + snps,route-avcp; + }; + + queue3 { + snps,avb-algorithm; + snps,map-to-dma-channel = <0x3>; + snps,priority = <0xc>; + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <4>; + snps,tx-sched-sp; + + queue0 { + snps,dcb-algorithm; + }; + + queue1 { + snps,dcb-algorithm; + }; + + queue2 { + snps,avb-algorithm; + snps,send_slope = <0x1000>; + snps,idle_slope = <0x1000>; + snps,high_credit = <0x3e800>; + snps,low_credit = <0xffc18000>; + }; + + queue3 { + snps,avb-algorithm; + snps,send_slope = <0x1000>; + snps,idle_slope = <0x1000>; + snps,high_credit = <0x3e800>; + snps,low_credit = <0xffc18000>; + }; + }; +}; + &i2c11 { clock-frequency = <400000>; pinctrl-0 = <&qup_i2c11_default>;