From patchwork Fri Jul 12 21:27:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13732210 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D199C2BD09 for ; Fri, 12 Jul 2024 21:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=5J7ue26xa1NhX55NC6ok0hRebIrKJaEOc0k9XobaO7w=; b=Jl04FV8D0Rrw00rlgW/m7Ult7l lC7CW1X5pOmrs2uCcfDriUwT5s9JAUc0VaoW9XlS/+/FA7TYlqpOC9dabXLnlLuCpqFA0EKgKOlGg sT6PGqKxaHBmSd0gKuiJQV6VtubdAfCXv2v2U/Dtwwm/ta6GwL5Ig82405R4jtXLD02SwR9DmhnGh 0WO4oKGk1oBB6gF/a8JYSDw1bMSMn67TVBnGuqdXaMgr8HTW/JRPi+MzJZZ01MvxV+5SJEJIt2DJr ICKQ+jbp5YDG0uCnzSn6Yx1i54iu32GYfT4wPKdLWeLQMIJh4qVjoVLcay19I0Gi0125jyo8Zj52Z OszD2XlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSNp4-00000001Hzq-44SC; Fri, 12 Jul 2024 21:28:58 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSNok-00000001Hth-46Xf for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 21:28:40 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 996CBCE1B70; Fri, 12 Jul 2024 21:28:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F567C32782; Fri, 12 Jul 2024 21:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720819715; bh=prZR6aM4EKNdsOI/0jAAqiAVqZ+acG7FM9SplaNmqgk=; h=From:To:Cc:Subject:Date:From; b=foaFQg4R3sPKotlH2e0WErCEfM8YWPV04D3DsdBqfuxl1qinv1qLEjiRRfRxYVpU/ 3iU8zx1JvQG2NNE95Yt+Es86bnoMvPI3tbGtJ9V+LdBr5kPKBDYqZwtVbk1KxJMNsT YyMPcVYzY67jOmRDiRcuUJYsALsTrZ4MGosmTZ9eJjcwStGE3ApfaBvUtSERmFAMzY VnHcanLNXsoUaJBcB1FuMmM62PBdEMTCKcca5okfLeZnQvqmDY8vzCaxek3LcAxq75 WIzoOY8rKciWMeoEhb1ZcMNlrnV8QpV712L5+Hg9nAS4q72xV5zuKTLk7HZJrJ2n7L pXEBzN3EcKHOA== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: nbd@nbd.name, lorenzo.bianconi83@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, conor@kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, upstream@airoha.com, angelogioacchino.delregno@collabora.com, benjamin.larsson@genexis.eu, rkannoth@marvell.com, sgoutham@marvell.com, andrew@lunn.ch, arnd@arndb.de, horms@kernel.org Subject: [PATCH v8 net-next 0/2] Introduce EN7581 ethernet support Date: Fri, 12 Jul 2024 23:27:56 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_142839_396197_CDC2E48F X-CRM114-Status: GOOD ( 13.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add airoha_eth driver in order to introduce ethernet support for Airoha EN7581 SoC available on EN7581 development board. EN7581 mac controller is mainly composed by Frame Engine (FE) and QoS-DMA (QDMA) modules. FE is used for traffic offloading (just basic functionalities are supported now) while QDMA is used for DMA operation and QOS functionalities between mac layer and the dsa switch (hw QoS is not available yet and it will be added in the future). Currently only hw lan features are available, hw wan will be added with subsequent patches. Changes since v7: - remove possible sleep while atomic dumping hw_stats - move ethtool stats in ethtool_eth_mac_stats and ethtool_rmon_stats structures and get rid of .get_ethtool_stats() callback - remove BQL - add missing netif_tx_stop_queue() in airoha_dev_xmit() - remove PAGE_POOL_STATS reporting for the moment - add missing napi_disable() stopping the hw and move airoha_qdma_start_napi() before net_device registration Changes since v6: - set eth->ports[] before registering netdevice - make page_pool_params const Changes since v5: - implement .ndo_get_stats64() callback and remove duplicated ethtool entries - remove "ethernet-controller.yaml#" from parent node in device tree binding - rename child node from "mac" to "ethernet" in device tree binding - fix checkpatch errors Changes since v4: - fix compilation warnings - use airoha_qdma_rr() and not airoha_rr() in airoha_qdma_set_irqmask() - add missing descriptions in dt-binding - remove mdio node in binding example Changes since v3: - rework architecture to allow future gdm{1,4} support - read REG_INT_ENABLE() register in airoha_qdma_set_irqmask() to guarantee airoha_qdma_wr() complete in the spinlock critical section - thx Arnd for the clarification - remove unnecessary wmb() - remove debugfs - move register definitions in .c and remove .h - fix warnings - enable NAPI thread by default Changes since v2: - rename airoha,en7581.yaml in airoha,en7581-eth.yaml - remove reset dependency in airoha,en7581-eth.yaml - remove airoha_dev_change_mtu() callback Changes since v1: - drop patch 2/3 - remove queue lock for rx queues - add bql support - add ethtool stats support - fix possible infinite loop in airoha_qdma_rx_process routine - always destroy page_pool in case of error during initialization - cosmetics Lorenzo Bianconi (2): dt-bindings: net: airoha: Add EN7581 ethernet controller net: airoha: Introduce ethernet support for EN7581 SoC .../bindings/net/airoha,en7581-eth.yaml | 143 + MAINTAINERS | 9 + drivers/net/ethernet/mediatek/Kconfig | 10 +- drivers/net/ethernet/mediatek/Makefile | 1 + drivers/net/ethernet/mediatek/airoha_eth.c | 2730 +++++++++++++++++ 5 files changed, 2892 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml create mode 100644 drivers/net/ethernet/mediatek/airoha_eth.c