From patchwork Thu Feb 9 09:51:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 5170 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp239963wrn; Thu, 9 Feb 2023 01:52:18 -0800 (PST) X-Google-Smtp-Source: AK7set+njPY66kmDdYCnLKxnvgY0kv6xzn4o2uqW0Nf1POvYbJZrc0ijvBIFCoEnB87dXNTWaVR+ X-Received: by 2002:a17:906:6a04:b0:8af:12d9:a4ac with SMTP id qw4-20020a1709066a0400b008af12d9a4acmr5771003ejc.25.1675936338813; Thu, 09 Feb 2023 01:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675936338; cv=none; d=google.com; s=arc-20160816; b=E4b0yS3e2G0+a0IFwe+N72awH7ldTFEXTBeGiQi3K0PYZx1UpjWYOTDuOG2qu0nt1Y hoduIO9CzZ+0Z7Yq7UgEBhRcA+Fbov8XzKDwwAwuLr1c45m3dGfwpFXjdRQEDFVjUsuP NchIxtCMmson2bVj/HKnC3vneI+NZhXhOKS1tw2uFH/VvXw6FThNPBLvDSZfRuBftdj+ wOw2ecrPgVRfZH+Rh9JIRZwn9GO0BLmhGPZD9B2EXEFGKyi5YBMRQB30c5BLStPFL+lZ 5gTI2op7gLUSgpjgjex1YounlcRDWsRoLah4mTp0qavz/cTbzvYFZNBsdWKvnN87Qv7V vaZg== 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 :message-id:date:subject:cc:to:from; bh=kW8Cc9jK5vgWUhXRF24wB1vusBfe2tDQ1dHY1YGiY2M=; b=j/dnKUHgdmq4olns6VS0IMizbZVXg/RMMsldpvpAcbW9sy/fatolPFdjkdXPEncSqw nHJOW4hPbI6skwKS25/NZloSiQM76kDJ377SLhTkBTKPzmDVee4bk0cyjYkCsLCGDxj4 xqFx4SD4bkKHwyHmo12QQjw58LtGFEkb+JfT8LreitVd5xZo4G6IrORPapvUYXIR2zju SI9DUmXS011BA0GFfvUwI5PEz7Wj1x3UMFMYlKAzPHK9vB4Z2uBvtYZkSop+lPM7s/OH YVxSBl+xigqHDEZ5BLEbR8v2aSWL6hTNy68n8iVqaeRqSdZPSeqEAW5ZzELnSr8UNlRO Yf+Q== ARC-Authentication-Results: i=1; mx.google.com; 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 26-20020a170906011a00b008621404f1d6si1921783eje.892.2023.02.09.01.51.56; Thu, 09 Feb 2023 01:52:18 -0800 (PST) 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; 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 S230267AbjBIJvh (ORCPT + 99 others); Thu, 9 Feb 2023 04:51:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbjBIJv3 (ORCPT ); Thu, 9 Feb 2023 04:51:29 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE9443CE3E for ; Thu, 9 Feb 2023 01:51:27 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQ3aH-0005eP-N5; Thu, 09 Feb 2023 10:51:18 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pQ3aF-003i7n-4t; Thu, 09 Feb 2023 10:51:16 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pQ3aE-001WqU-VT; Thu, 09 Feb 2023 10:51:14 +0100 From: Oleksij Rempel To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wei Fang , Heiner Kallweit Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Arun.Ramadoss@microchip.com Subject: [PATCH net-next v7 0/9] net: add EEE support for KSZ9477 and AR8035 with i.MX6 Date: Thu, 9 Feb 2023 10:51:04 +0100 Message-Id: <20230209095113.364524-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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?1757346622229396413?= X-GMAIL-MSGID: =?utf-8?q?1757346622229396413?= changes v7: - update documentation for genphy_c45_eee_is_active() - address review comments on "net: dsa: microchip: enable EEE support" patch changes v6: - split patch set and send only first 9 patches - Add Reviewed-by: Andrew Lunn - use 0xffff instead of GENMASK - Document @supported_eee - use "()" with function name in comments changes v5: - spell fixes - move part of genphy_c45_read_eee_abilities() to genphy_c45_read_eee_cap1() - validate MDIO_PCS_EEE_ABLE register against 0xffff val. - rename *eee_100_10000* to *eee_cap1* - use linkmode_intersects(phydev->supported, PHY_EEE_CAP1_FEATURES) instead of !linkmode_empty() - add documentation to linkmode/register helpers changes v4: - remove following helpers: mmd_eee_cap_to_ethtool_sup_t mmd_eee_adv_to_ethtool_adv_t ethtool_adv_to_mmd_eee_adv_t and port drivers from this helpers to linkmode helpers. - rebase against latest net-next - port phy_init_eee() to genphy_c45_eee_is_active() changes v3: - rework some parts of EEE infrastructure and move it to c45 code. - add supported_eee storage and start using it in EEE code and by the micrel driver. - add EEE support for ar8035 PHY - add SmartEEE support to FEC i.MX series. changes v2: - use phydev->supported instead of reading MII_BMSR regiaster - fix @get_eee > @set_eee With this patch series we provide EEE control for KSZ9477 family of switches and AR8035 with i.MX6 configuration. According to my tests, on a system with KSZ8563 switch and 100Mbit idle link, we consume 0,192W less power per port if EEE is enabled. Oleksij Rempel (9): net: dsa: microchip: enable EEE support net: phy: add genphy_c45_read_eee_abilities() function net: phy: micrel: add ksz9477_get_features() net: phy: export phy_check_valid() function net: phy: add genphy_c45_ethtool_get/set_eee() support net: phy: c22: migrate to genphy_c45_write_eee_adv() net: phy: c45: migrate to genphy_c45_write_eee_adv() net: phy: migrate phy_init_eee() to genphy_c45_eee_is_active() net: phy: start using genphy_c45_ethtool_get/set_eee() drivers/net/dsa/microchip/ksz_common.c | 66 +++++ drivers/net/phy/micrel.c | 21 ++ drivers/net/phy/phy-c45.c | 319 ++++++++++++++++++++++++- drivers/net/phy/phy.c | 153 ++---------- drivers/net/phy/phy_device.c | 26 +- include/linux/mdio.h | 84 +++++++ include/linux/phy.h | 14 ++ include/uapi/linux/mdio.h | 8 + 8 files changed, 554 insertions(+), 137 deletions(-)