From nobody Tue Dec 16 11:43:25 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39F21CDB46E for ; Thu, 12 Oct 2023 10:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377977AbjJLK5i (ORCPT ); Thu, 12 Oct 2023 06:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235675AbjJLK5g (ORCPT ); Thu, 12 Oct 2023 06:57:36 -0400 Received: from mail.helmholz.de (mail.helmholz.de [217.6.86.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85211C0 for ; Thu, 12 Oct 2023 03:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=helmholz.de ; s=dkim1; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=W6plsMgI7pFZJCkL2mweUmcnjvQTbEecJRGjwd0y4cU=; b=fRZ4z50tdppvr4wVGOH0Cwp5Z1 lJ74teyAbcDhdshVa5KjroJd/M/tONNV8HqR4jHbORrEI0RfVhL6RON/qR9EsbhU8o6Qxl/x6jXif lgzIBYZD54oBxR2KSQCxvB0XYRzc7fqLXgX6P2v9cJeqI2VVWLOOEb311tAEAi9v2O+NeUqoxEp9C IKn78SMJSoUal3ZC1hgZ+d0hixFHbyG9Ijy+Z3ffWPF/Gz1Z1Bp+QV6Ig+IpJUggQx38hHvDCCOwP vJ3XDDLtdLEmaXB3GzJ5k3wHxsOqTrLxlobbmcW/wvc/9pk4Li7ZneoyA7JUFN90q6ZRdgSkW8ORU V8/6/2iA==; Received: from [192.168.1.4] (port=44479 helo=SH-EX2013.helmholz.local) by mail.helmholz.de with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (Exim 4.96) (envelope-from ) id 1qqtMN-0005Tl-16; Thu, 12 Oct 2023 12:56:07 +0200 Received: from linuxdev.helmholz.local (192.168.6.7) by SH-EX2013.helmholz.local (192.168.1.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 12 Oct 2023 12:56:06 +0200 From: Ante Knezic To: CC: , , , , , , , , , , , , , , Ante Knezic Subject: [PATCH net-next v2 1/2] net:dsa:microchip: add property to select internal RMII reference clock Date: Thu, 12 Oct 2023 12:55:55 +0200 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [192.168.6.7] X-ClientProxiedBy: SH-EX2013.helmholz.local (192.168.1.4) To SH-EX2013.helmholz.local (192.168.1.4) X-EXCLAIMER-MD-CONFIG: 2ae5875c-d7e5-4d7e-baa3-654d37918933 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Microchip KSZ8863/KSZ8873 have the ability to select between internal and external RMII reference clock. By default, reference clock needs to be provided via REFCLKI_3 pin. If required, device can be setup to provide RMII clock internally so that REFCLKI_3 pin can be left unconnected. Add a new "microchip,rmii-clk-internal" property which will set RMII clock reference to internal. If property is not set, reference clock needs to be provided externally. Signed-off-by: Ante Knezic --- drivers/net/dsa/microchip/ksz8795.c | 5 +++++ drivers/net/dsa/microchip/ksz8795_reg.h | 3 +++ drivers/net/dsa/microchip/ksz_common.c | 3 +++ drivers/net/dsa/microchip/ksz_common.h | 1 + 4 files changed, 12 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchi= p/ksz8795.c index 91aba470fb2f..78f3a668aa99 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1434,6 +1434,11 @@ int ksz8_setup(struct dsa_switch *ds) for (i =3D 0; i < (dev->info->num_vlans / 4); i++) ksz8_r_vlan_entries(dev, i); =20 + if (ksz_is_ksz88x3(dev)) + ksz_cfg(dev, KSZ88X3_REG_FVID_AND_HOST_MODE, + KSZ88X3_PORT3_RMII_CLK_INTERNAL, + dev->rmii_clk_internal); + return ksz8_handle_global_errata(ds); } =20 diff --git a/drivers/net/dsa/microchip/ksz8795_reg.h b/drivers/net/dsa/micr= ochip/ksz8795_reg.h index 3c9dae53e4d8..beca974e0171 100644 --- a/drivers/net/dsa/microchip/ksz8795_reg.h +++ b/drivers/net/dsa/microchip/ksz8795_reg.h @@ -22,6 +22,9 @@ #define KSZ8863_GLOBAL_SOFTWARE_RESET BIT(4) #define KSZ8863_PCS_RESET BIT(0) =20 +#define KSZ88X3_REG_FVID_AND_HOST_MODE 0xC6 +#define KSZ88X3_PORT3_RMII_CLK_INTERNAL BIT(3) + #define REG_SW_CTRL_0 0x02 =20 #define SW_NEW_BACKOFF BIT(7) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/micro= chip/ksz_common.c index b800ace40ce1..0a0a53ce5b1b 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -4160,6 +4160,9 @@ int ksz_switch_register(struct ksz_device *dev) } } =20 + dev->rmii_clk_internal =3D of_property_read_bool(dev->dev->of_node, + "microchip,rmii-clk-internal"); + ret =3D dsa_register_switch(dev->ds); if (ret) { dev->dev_ops->exit(dev); diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/micro= chip/ksz_common.h index 8842efca0871..e5b0445fe2ca 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -163,6 +163,7 @@ struct ksz_device { phy_interface_t compat_interface; bool synclko_125; bool synclko_disable; + bool rmii_clk_internal; =20 struct vlan_table *vlan_cache; =20 --=20 2.11.0 From nobody Tue Dec 16 11:43:25 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 671ECCDB46E for ; Thu, 12 Oct 2023 10:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377879AbjJLK4Q (ORCPT ); Thu, 12 Oct 2023 06:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343721AbjJLK4O (ORCPT ); Thu, 12 Oct 2023 06:56:14 -0400 Received: from mail.helmholz.de (mail.helmholz.de [217.6.86.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02158C4 for ; Thu, 12 Oct 2023 03:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=helmholz.de ; s=dkim1; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kF6x+Fgbiwq3N84Gqz/O9h8/CPuXjgmj8foJ2+MIIno=; b=BwARkRV2ZlTMVaTOSohsyEhArx Z2BJQOLrZNGmrMe0a5uaFtVax3GTLtuUO9ZRP3NLl0DSKToVCIeMJHPmI1K3VkrDKOzKA2jcENl7O VtTRtBt6JO/85c1zhZWf8dyQURo/wqdVswULqmBRb2qWRZySg+OL+EVNIOZg1fHiPMOeySyCJJBg8 l9hEVDx6DoWg2SN9WiIlfNJxJnI5mliKj4g+J9UjlSFA2iQHYTZNx6kLEZCyWI11H90KRjt3xIwNw dZU4Sprlb3Qs61Ho72YQZh8MSgmYWq9gmJRtcVew542OMtEpT/ryEU4RMYZX0KotfINRPcLWeg2Sa Ojw/6L7w==; Received: from [192.168.1.4] (port=44485 helo=SH-EX2013.helmholz.local) by mail.helmholz.de with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (Exim 4.96) (envelope-from ) id 1qqtMN-0005Tn-3D; Thu, 12 Oct 2023 12:56:08 +0200 Received: from linuxdev.helmholz.local (192.168.6.7) by SH-EX2013.helmholz.local (192.168.1.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 12 Oct 2023 12:56:07 +0200 From: Ante Knezic To: CC: , , , , , , , , , , , , , , Ante Knezic Subject: [PATCH net-next v2 2/2] dt-bindings: net: microchip,ksz: document microchip,rmii-clk-internal Date: Thu, 12 Oct 2023 12:55:56 +0200 Message-ID: <1b8db5331638f1380ec2ba6e00235c8d5d7a882c.1697107915.git.ante.knezic@helmholz.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [192.168.6.7] X-ClientProxiedBy: SH-EX2013.helmholz.local (192.168.1.4) To SH-EX2013.helmholz.local (192.168.1.4) X-EXCLAIMER-MD-CONFIG: 2ae5875c-d7e5-4d7e-baa3-654d37918933 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add documentation for selecting reference rmii clock on KSZ88X3 devices Signed-off-by: Ante Knezic --- .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 19 +++++++++++++++= ++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b= /Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index 41014f5c01c4..eaa347b04db1 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -72,6 +72,25 @@ properties: interrupts: maxItems: 1 =20 + microchip,rmii-clk-internal: + $ref: /schemas/types.yaml#/definitions/flag + description: + Set if the RMII reference clock is provided internally. Otherwise + reference clock should be provided externally. + +if: + not: + properties: + compatible: + enum: + - microchip,ksz8863 + - microchip,ksz8873 +then: + not: + required: + - microchip,rmii-clk-internal + + required: - compatible - reg --=20 2.11.0