Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2825419pxb; Mon, 18 Oct 2021 02:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH4yyrDxV8bcQW54yNPk+g9AxkGIGEwue4MWn6j/wZ4DuETw9rag97oRMPIsPVLfwOxyDZ X-Received: by 2002:a50:e005:: with SMTP id e5mr42602891edl.211.1634550158305; Mon, 18 Oct 2021 02:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634550158; cv=none; d=google.com; s=arc-20160816; b=KXxt+FrLjig4vcXcqJHs+/+B5FO6gIVmaQMdE8KX0kFWZF/bngXZfk/7x15TfCDSID BYcrztavyyNJAgTeXuGeSLMNWuPOlvEZbWNvv0mWaJkGLCgIe6KtK+bf4nelkDHbpURz udfVsVKv58HlwjHTn3feOAxQaud0P7/evKC8w/mVUz3HV6oD79T+AR1Js+CIvoDd6msH b8ndpkmwSDTevsMYs2Y/JpGmGPmwSMLeAcTCftfBccldKqOTx0RXl24zUvNpgd313zk/ WpRg2CdLsd72Rpyp3VphYKzcOdmtto3Eh0UIDGqgN3Bm6ERvjXJj+9W2pl417yoeGOCU bJ4Q== 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:dkim-signature; bh=v684pXQvnkH726GvM19gurGAI9+/mguWyz76aeI12nQ=; b=SIjTjkmKxip7/fJrMsX8ffblaAbN0ig40yPpWOqqAYANG0RBaG5l3BZUF7fN21Lu84 o2co822vPL1qvmPREDTUOk8GkZgV6kOiVoKDc6pKCQSvFIyz8xDVRasnBMtAkviZyOyO Bbnt+1TUTgitf9utZ1XFYVdXwNsQALKCwhlZmYWLJmcKPByOhwbp9pNruLO2Nn/S0R4y 57BTQFUDQByH8LOeqpY8GpbfGmxmDAGtDFY3B2557nQ6Ihh8+QIEC7edE1hr11P1gCNr MrS3QoQJt62gUJt79fUiQQP01XIp5+Ark/HyGIqhY/biaF2/4gApxINCVlBjH75gZXNE KAug== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@pqrs.dk header.s=google header.b=enVdtu4N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y22si26580469edc.353.2021.10.18.02.42.13; Mon, 18 Oct 2021 02:42:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@pqrs.dk header.s=google header.b=enVdtu4N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231375AbhJRJmi (ORCPT + 99 others); Mon, 18 Oct 2021 05:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231420AbhJRJmg (ORCPT ); Mon, 18 Oct 2021 05:42:36 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E76EC061768 for ; Mon, 18 Oct 2021 02:40:25 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id i20so67618650edj.10 for ; Mon, 18 Oct 2021 02:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqrs.dk; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v684pXQvnkH726GvM19gurGAI9+/mguWyz76aeI12nQ=; b=enVdtu4Ng/rJMl7F33WtKZfyqHpGPpmGgMQGLTZKITVoVCD7Y15MqRZOCUwOfeW2mj MjVbzYu1CZdT29ZoNL9c1Rqb8GsQmKTPBmER1hMPQ/wvbEVBOlZ7Vl3HJcahDqGiBGUO nLrbjfDy7hUI5SPcyxM7pit16ZJ4r+Sfh5DaM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v684pXQvnkH726GvM19gurGAI9+/mguWyz76aeI12nQ=; b=mqJcTqrgnz4gjbx5HkF911fhNHUo6YyUZJvxB90sTwsbt1ADA0tAZJDDz2/9ru7PL8 7NnWwQFlKl8E4VbwDHZcW1VljZLMMbkcxM9JBhnjMXvEwi400r8OaSEL8JDdVcc/iwaF pfVoKshsdsnm+VQDJRudSgK+LEkt5tTapJrVBong/2Pu5kHw3bwzPnCZwVslVbpWCldq Hw4HnJk6+SNaaPFJxewpdhjnQs/0h3wqr/Dez8bgL4/pHr3bAjTzpHrZrogdQ6Pnjtsf XkU3m1r6dIh9WU+Dj6OPIv3lxWqYTbh6O2eRn51D2me+mvhljBxWesNwHf/IJE6MPLQH aTNg== X-Gm-Message-State: AOAM53118nKEBAyTsvEx9mEnRC5qK8xiAKR1TZQ7sAKFcCP3GBZzXMM5 EMwq/fysJbvju4eR0K0i7U9zT8RKfteRI/Kh X-Received: by 2002:a50:e1c3:: with SMTP id m3mr43306642edl.28.1634550023234; Mon, 18 Oct 2021 02:40:23 -0700 (PDT) Received: from capella.. ([80.208.66.147]) by smtp.gmail.com with ESMTPSA id z1sm10134566edc.68.2021.10.18.02.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 02:40:22 -0700 (PDT) From: =?UTF-8?q?Alvin=20=C5=A0ipraga?= To: Linus Walleij , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King Cc: arinc.unal@arinc9.com, =?UTF-8?q?Alvin=20=C5=A0ipraga?= , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 net-next 0/7] net: dsa: add support for RTL8365MB-VC Date: Mon, 18 Oct 2021 11:37:55 +0200 Message-Id: <20211018093804.3115191-1-alvin@pqrs.dk> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alvin Šipraga This series adds support for Realtek's RTL8365MB-VC, a 4+1 port 10/100/1000M Ethernet switch. The driver - rtl8365mb - was developed by Michael Ramussen and myself. This version of the driver is relatively slim, implementing only the standalone port functionality and no offload capabilities. It is based on a previous RFC series [1] from August, and the main difference is the removal of some spurious VLAN operations. Otherwise I have simply addressed most of the feedback. Please see the respective patches for more detail. In parallel I am working on offloading the bridge layer capabilities, but I would like to get the basic stuff upstreamed as soon as possible. v3 -> v4: - get irq before setting virq parents (fixes kernel test robot warning) - remove pad-to-72-bytes logic in tagger xmit (fixes DENG Qingfang's suggestion); no longer needed as we set CPU minimum RX size to 64 bytes - use mutex to protect MIB counter access instead of a spinlock (fixes Jakub's feedback on v3 statistics refactoring) v2 -> v3: - move IRQ setup earlier in probe per Florian's suggestion - fix compilation error on some archs due to FIELD_PREP use in v1 - follow Jakub's suggestion and use the standard ethtool stats API; NOTE: new patch in the series for relevant DSA plumbing - following the stats change, it became apparent that the rtl8366 helper library is no longer that helpful; scrap it and implement the ethtool ops specifically for this chip v1 -> v2: - drop DSA port type checks during MAC configuration - use OF properties to configure RGMII TX/RX delay - don't set default fwd_offload_mark if packet is trapped to CPU - remove port mapping macros - update device tree bindings documentation with an example - cosmetic changes to the tagging driver using FIELD_* macros [1] https://lore.kernel.org/netdev/20210822193145.1312668-1-alvin@pqrs.dk/ Alvin Šipraga (7): ether: add EtherType for proprietary Realtek protocols net: dsa: allow reporting of standard ethtool stats for slave devices net: dsa: move NET_DSA_TAG_RTL4_A to right place in Kconfig/Makefile dt-bindings: net: dsa: realtek-smi: document new compatible rtl8365mb net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC net: phy: realtek: add support for RTL8365MB-VC internal PHYs .../bindings/net/dsa/realtek-smi.txt | 87 + drivers/net/dsa/Kconfig | 1 + drivers/net/dsa/Makefile | 2 +- drivers/net/dsa/realtek-smi-core.c | 4 + drivers/net/dsa/realtek-smi-core.h | 1 + drivers/net/dsa/rtl8365mb.c | 1982 +++++++++++++++++ drivers/net/phy/realtek.c | 8 + include/net/dsa.h | 8 + include/uapi/linux/if_ether.h | 1 + net/dsa/Kconfig | 20 +- net/dsa/Makefile | 3 +- net/dsa/slave.c | 34 + net/dsa/tag_rtl8_4.c | 178 ++ 13 files changed, 2320 insertions(+), 9 deletions(-) create mode 100644 drivers/net/dsa/rtl8365mb.c create mode 100644 net/dsa/tag_rtl8_4.c -- 2.32.0