Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4789143imm; Mon, 14 May 2018 13:07:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpGbXrQCGhfMzG9H6171hbiyL8zmTVHYhQUt2SI9xMBWvqnQ8MO2kRKzOgqEpAQ27PM1FrE X-Received: by 2002:a63:8ac4:: with SMTP id y187-v6mr9515995pgd.64.1526328422472; Mon, 14 May 2018 13:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526328422; cv=none; d=google.com; s=arc-20160816; b=zv4JzKfKwHbRnNp5/HW/BGtfFuyj5qVh364nG46gLE0jBhLAeFedFsIl0xaWO/xGQv GOp/8zSfVtPcV6m4r1Mp9pprO59NZbQDABG6vBRR18pQhHulc3WVIF5SGxVPXbeX+gSL wShfpyfNuemLcV25SyRNXVD6sN/ZXPlXEwDHL3UM56W5NISv9qGuc6eE6HPWhLaiDdAT Vd6FAoMqDZM8sErprbgH1kpxkJ4rht1ybTmF6imY/A/KBJdmi9BMvV8aAesqg+6ODq4D hGGqpSiTqHYWW2jm9jCOCyQjw2LXIBj3U41rBCIzSBk8xjo2KMYnqXxbbSkMOHPh6QDD z7cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=RLAXTsjaP9vE3Nq6cB93jW3mER1g5s6+UoIfj+MbKvI=; b=qCPvvuMa3X3g/5pluha4ogStF7yAlgklNcktsDuSkcGpgWTxGPvWsd9rwQMMpiE4a5 TeayXdVdPdTT46wtxP4ZWFqqUJh+LyFhIbA6xgsh1S0n2Ej5rmDuQqYwffdUfObWvCA5 FBMNynsQs2XRREhj3DrPQJi1zlYh6H/yJgYK3KYLrBC9siFNC689NNFf9194hHll93iN 200p4bO9TROzY30ZUG77YN3HTgcxcw1fMiZh4oFddpAAAAyo+mpdwfMDUhXbbBCtOck2 KEv3hLPEfNOQ80Mfrc0pBbPzQBp1BSdxyHwOdmT8Vdz8l/FDw/JouShM75bR551LZvGZ PDKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71-v6si10340740plc.164.2018.05.14.13.06.48; Mon, 14 May 2018 13:07:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752146AbeENUFZ (ORCPT + 99 others); Mon, 14 May 2018 16:05:25 -0400 Received: from mail.bootlin.com ([62.4.15.54]:32893 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751855AbeENUFX (ORCPT ); Mon, 14 May 2018 16:05:23 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id E7A3C2084E; Mon, 14 May 2018 22:05:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [88.191.26.124]) by mail.bootlin.com (Postfix) with ESMTPSA id B8546203B7; Mon, 14 May 2018 22:05:20 +0200 (CEST) From: Alexandre Belloni To: "David S . Miller" Cc: Allan Nielsen , razvan.stefanescu@nxp.com, po.liu@nxp.com, Thomas Petazzoni , Andrew Lunn , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Alexandre Belloni , James Hogan Subject: [PATCH net-next v3 0/7] Microsemi Ocelot Ethernet switch support Date: Mon, 14 May 2018 22:04:53 +0200 Message-Id: <20180514200500.2953-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This series adds initial support for the Microsemi Ethernet switch present on Ocelot SoCs. This only has bridging (and STP) support for now and it uses the switchdev framework. Coming features are VLAN filtering, link aggregation, IGMP snooping. The switch can also be connected to an external CPU using PCIe. Also, support for integration on other SoCs will be submitted. The ocelot dts changes are here for reference and should probably go through the MIPS tree once the bindings are accepted. Changes in v3: - Collected Reviewed-by * Switchdev driver: - Fixed two issues reported by kbuild - Modified ethtool statistics to support different layoiut on different chips and take care of counter overflow Changes in v2: - Dropped Microsemi Ocelot PHY support * MIIM driver: - Documented interrupts bindings - Moved the driver to drivers/net/phy/ - Removed unused mutex - Removed MDIO bus scanning * Switchdev driver: - Changed compatible to mscc,vsc7514-switch - Removed unused header inclusion - Factorized MAC table selection in ocelot_mact_select() - Disable the port in ocelot_port_stop() - Fixed the smatch endianness warnings - int to unsinged int where necessary - Removed VID handling for the FDB it has been reworked anyway and will be submitted with VLAN support - Fixed up unused cases in ocelot_port_attr_set() - Added a loop to register all the IO register spaces - the ports are now in an ethernet-ports node I've tried switching to NAPI but this is not working well, mainly because the only way to disable interrupts is to actually mask them in the interrupt controller (it is not possible to tell the switch to stop generating interrupts). Cc: James Hogan Alexandre Belloni (7): dt-bindings: net: add DT bindings for Microsemi MIIM net: phy: mscc-miim: Add MDIO driver dt-bindings: net: add DT bindings for Microsemi Ocelot Switch net: mscc: Add initial Ocelot switch support MIPS: mscc: Add switch to ocelot MIPS: mscc: connect phys to ports on ocelot_pcb123 MAINTAINERS: Add entry for Microsemi Ethernet switches .../devicetree/bindings/net/mscc-miim.txt | 26 + .../devicetree/bindings/net/mscc-ocelot.txt | 82 + MAINTAINERS | 6 + arch/mips/boot/dts/mscc/ocelot.dtsi | 88 ++ arch/mips/boot/dts/mscc/ocelot_pcb123.dts | 20 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/mscc/Kconfig | 30 + drivers/net/ethernet/mscc/Makefile | 5 + drivers/net/ethernet/mscc/ocelot.c | 1333 +++++++++++++++++ drivers/net/ethernet/mscc/ocelot.h | 572 +++++++ drivers/net/ethernet/mscc/ocelot_ana.h | 625 ++++++++ drivers/net/ethernet/mscc/ocelot_board.c | 316 ++++ drivers/net/ethernet/mscc/ocelot_dev.h | 275 ++++ drivers/net/ethernet/mscc/ocelot_dev_gmii.h | 154 ++ drivers/net/ethernet/mscc/ocelot_hsio.h | 785 ++++++++++ drivers/net/ethernet/mscc/ocelot_io.c | 116 ++ drivers/net/ethernet/mscc/ocelot_qs.h | 78 + drivers/net/ethernet/mscc/ocelot_qsys.h | 270 ++++ drivers/net/ethernet/mscc/ocelot_regs.c | 497 ++++++ drivers/net/ethernet/mscc/ocelot_rew.h | 81 + drivers/net/ethernet/mscc/ocelot_sys.h | 144 ++ drivers/net/phy/Kconfig | 7 + drivers/net/phy/Makefile | 1 + drivers/net/phy/mdio-mscc-miim.c | 197 +++ 25 files changed, 5710 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/mscc-miim.txt create mode 100644 Documentation/devicetree/bindings/net/mscc-ocelot.txt create mode 100644 drivers/net/ethernet/mscc/Kconfig create mode 100644 drivers/net/ethernet/mscc/Makefile create mode 100644 drivers/net/ethernet/mscc/ocelot.c create mode 100644 drivers/net/ethernet/mscc/ocelot.h create mode 100644 drivers/net/ethernet/mscc/ocelot_ana.h create mode 100644 drivers/net/ethernet/mscc/ocelot_board.c create mode 100644 drivers/net/ethernet/mscc/ocelot_dev.h create mode 100644 drivers/net/ethernet/mscc/ocelot_dev_gmii.h create mode 100644 drivers/net/ethernet/mscc/ocelot_hsio.h create mode 100644 drivers/net/ethernet/mscc/ocelot_io.c create mode 100644 drivers/net/ethernet/mscc/ocelot_qs.h create mode 100644 drivers/net/ethernet/mscc/ocelot_qsys.h create mode 100644 drivers/net/ethernet/mscc/ocelot_regs.c create mode 100644 drivers/net/ethernet/mscc/ocelot_rew.h create mode 100644 drivers/net/ethernet/mscc/ocelot_sys.h create mode 100644 drivers/net/phy/mdio-mscc-miim.c -- 2.17.0