From patchwork Tue Feb 7 14:18:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 5083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2388:b0:96:219d:e725 with SMTP id i8csp4037400dyf; Tue, 7 Feb 2023 06:24:07 -0800 (PST) X-Google-Smtp-Source: AK7set8WhaBGZNXHWXHxpTqDMdhjtvvJCZ17tBBzEt7YYm0rWjz86oV6mV99Plt84sduSbEoBDHd X-Received: by 2002:a17:907:3f14:b0:889:33ca:70c6 with SMTP id hq20-20020a1709073f1400b0088933ca70c6mr5185104ejc.2.1675779846873; Tue, 07 Feb 2023 06:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675779846; cv=none; d=google.com; s=arc-20160816; b=p+yqMUWuGZ2OC28tnUgLUzbcOsRPo2UDwrNiBo5sTM2aN21BnPqnE82Vovveevpuat 4xuoyUj5/q3IdYZo8l/J0JWBpPHIsNwjgT2wPtDqabWWtfheNDx41s5AU/UbeVB+lmrx SgWmDJelIBCyiiXKQocQo8SH7m/I4c9CueDQyKbLMRC0x7NC7bKMF1v8/+lWoryhs74S 4pwmh3O8QayJOetYZtHrhKskw+hUMubD2Q6JnnSB+ptmIkwPDzQ0us6E/iywdKCeuHFh Auzk1x7UlT6rKHC/QpuoA8J81j833gLW1nzztN1odk4rk4sYAnNkgrZ+FSd1t9nxWN4m RZLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date; bh=A63t1eGn7h3dP88RqE91ydwXB9x89ILU1z9Hni2COg0=; b=qpLKWUPnNeZ2R6cEHxj+BKYrNFjdIWdj5KDZ7lPmzhSCQrohLq9R6uBU+91XqnyYhA +MpKSvxTz671BwXuQPI+ONbUMfo0/21hCiw62NnI1wX6GeyT0WMJ9Pkh7FvYq5NhSb7f pSB18Voenmz2YAqC8pwxxFaD88DfdzwUmvu+OyKCMVrcb8JUU1niljKnDO+Yq4bPzGXS T+Ymo2zmbrgBW5uGfhA82XmhMIzRmXDE3siS53JLHFK1IqUsLuiFJOsvd332WaaoLCPf IYgEsuAeVbyHp6PFOLS/2x7GGEB5nKpx/WfDHkMjqMC/0EXfzy7ySF1IwgAD/uxXnF5v vDNA== 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 kb1-20020a170907924100b0087039b036ffsi17662264ejb.487.2023.02.07.06.23.44; Tue, 07 Feb 2023 06:24:06 -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 S231709AbjBGOUc (ORCPT + 99 others); Tue, 7 Feb 2023 09:20:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232363AbjBGOU2 (ORCPT ); Tue, 7 Feb 2023 09:20:28 -0500 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD743A871; Tue, 7 Feb 2023 06:20:17 -0800 (PST) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pPOpN-00026K-09; Tue, 07 Feb 2023 15:20:09 +0100 Date: Tue, 7 Feb 2023 14:18:23 +0000 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Russell King , Heiner Kallweit , Lorenzo Bianconi , Mark Lee , John Crispin , Felix Fietkau , AngeloGioacchino Del Regno , Matthias Brugger , DENG Qingfang , Landen Chao , Sean Wang , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Andrew Lunn Cc: Jianhui Zhao , =?iso-8859-1?q?Bj=F8rn?= Mork Subject: [PATCH v2 00/11] net: ethernet: mtk_eth_soc: various enhancements Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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?1757182528905758471?= X-GMAIL-MSGID: =?utf-8?q?1757182528905758471?= This series brings a variety of fixes and enhancements for mtk_eth_soc, adds support for the MT7981 SoC and facilitates sharing the SGMII PCS code between mtk_eth_soc and mt7530. Note that this series depends on commit 697c3892d825 ("regmap: apply reg_base and reg_downshift for single register ops") to not break mt7530 pcs register access. Changes since v1: * apply reverse xmas tree everywhere * improve commit descriptions * add dt bindings * various small changes addressing all comments received for v1 Daniel Golle (11): net: ethernet: mtk_eth_soc: add support for MT7981 SoC dt-bindings: net: mediatek,net: add mt7981-eth binding dt-bindings: arm: mediatek: add 'mediatek,pn_swap' property net: ethernet: mtk_eth_soc: set MDIO bus clock frequency net: ethernet: mtk_eth_soc: reset PCS state net: ethernet: mtk_eth_soc: only write values if needed net: ethernet: mtk_eth_soc: fix RX data corruption issue net: ethernet: mtk_eth_soc: ppe: add support for flow accounting net: pcs: add driver for MediaTek SGMII PCS net: ethernet: mtk_eth_soc: switch to external PCS driver net: dsa: mt7530: use external PCS driver .../arm/mediatek/mediatek,sgmiisys.txt | 4 + .../devicetree/bindings/net/mediatek,net.yaml | 42 +++ MAINTAINERS | 7 + drivers/net/dsa/Kconfig | 1 + drivers/net/dsa/mt7530.c | 277 ++++----------- drivers/net/dsa/mt7530.h | 47 +-- drivers/net/ethernet/mediatek/Kconfig | 2 + drivers/net/ethernet/mediatek/mtk_eth_path.c | 14 +- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 65 +++- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 100 ++---- drivers/net/ethernet/mediatek/mtk_ppe.c | 114 ++++++- drivers/net/ethernet/mediatek/mtk_ppe.h | 25 +- .../net/ethernet/mediatek/mtk_ppe_debugfs.c | 9 +- .../net/ethernet/mediatek/mtk_ppe_offload.c | 8 + drivers/net/ethernet/mediatek/mtk_ppe_regs.h | 14 + drivers/net/ethernet/mediatek/mtk_sgmii.c | 192 ++--------- drivers/net/pcs/Kconfig | 8 + drivers/net/pcs/Makefile | 1 + drivers/net/pcs/pcs-mtk-lynxi.c | 315 ++++++++++++++++++ include/linux/pcs/pcs-mtk-lynxi.h | 13 + 20 files changed, 756 insertions(+), 502 deletions(-) create mode 100644 drivers/net/pcs/pcs-mtk-lynxi.c create mode 100644 include/linux/pcs/pcs-mtk-lynxi.h base-commit: 129af770823407ee115a56c69a04b440fd2fbe61