From patchwork Tue May 5 14:02:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 201087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06A48C47247 for ; Tue, 5 May 2020 14:03:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D75E020661 for ; Tue, 5 May 2020 14:03:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="a8DMxibR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728135AbgEEODG (ORCPT ); Tue, 5 May 2020 10:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729087AbgEEODF (ORCPT ); Tue, 5 May 2020 10:03:05 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B0A3C061A10 for ; Tue, 5 May 2020 07:03:05 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id k1so2911145wrx.4 for ; Tue, 05 May 2020 07:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PK31tVWfgrccN1MBhDjrbakpYyyD2tO24v7BYQEkurI=; b=a8DMxibRqTrZGmyZ0KLtsYlfgQSvtBtYx+i51AoL6kzVb3a3Zcw5KFc8r5emhX2L/e qLVl57SKF7PdhjnPEnfYmiBsHkXDn94m+UKH2rLq8YYGcxS7EN5GAv4eWBPvoY1byN7N QxZMFs3Qb+qVtydhG5IbCi+FEqOcJ0waPkxXqf2ILV3oLLL0N8BnwvrKySVqhV+H6q/X 68KP5IqC6ZqPMnSBCsQ0mVeuFaW8UzGdm+AMBhfl1Jooa4pbk4UE+wnG551wvwjBL9yZ yo8Kq56xX0wXRuQs1Lf5bbGGIUhYjKU0+mCWMv1cZeNM2eZ0NXSh3Pl4lvUmp2tjq5pt c2Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PK31tVWfgrccN1MBhDjrbakpYyyD2tO24v7BYQEkurI=; b=FAxFwgQ3Wn6WM7VBnO30Sf/1QwCK+risAkheqLM5/miT7xEOu0zL6mVVYJxsvkTu7n IqnkyoJ0ADjc6KMl2btEIL1vVGVfqPK44EZv3vlO1l6PrB2PsZU+/FvNkyEHsFbq6y3v Jq8AJPaMeeQAPfuCQPv0/ECVpHUBr35pyA/ua34wYib0i53Jydj1ppQTzvFBwO0fOKfD ln/HIjtVRwKhAUV2Y7zSc9jwa0wrymIZNiuy5A7S4kZbhUvY883X8y81iTFKpKaJdPhK s/vL3tL4KP+pR/1GqFzZF20rmpZwgAp/VsVkhY2b+x1IuujlY0CH3iiabmIyjvw87NFV zLQg== X-Gm-Message-State: AGi0PuaPSwCQM7Ux0ufPpX5v8CtTxq9t5tZPa4aDyBjVLRrbdgFAPeJD c0gM416IecyRK3E3+vz+K4zgkw== X-Google-Smtp-Source: APiQypJK0fRzPjzYsRI0o6WTCpJIb10ZVt2+vpQjB2QmGMKqpkl9pQ80cS/ZweDjU4zPMeSAzrIc8g== X-Received: by 2002:a5d:4711:: with SMTP id y17mr3781592wrq.49.1588687383658; Tue, 05 May 2020 07:03:03 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id c190sm4075755wme.4.2020.05.05.07.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 07:03:03 -0700 (PDT) From: Bartosz Golaszewski To: Rob Herring , "David S . Miller" , Matthias Brugger , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Jakub Kicinski , Arnd Bergmann , Fabien Parent Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH 00/11] mediatek: add support for MediaTek Ethernet MAC Date: Tue, 5 May 2020 16:02:20 +0200 Message-Id: <20200505140231.16600-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Bartosz Golaszewski This adds support for the Ethernet Controller present on MediaTeK SoCs from the MT8* family. The first two patches add binding documents for the PERICFG syscon and for the MAC itself. Patches 3/11 & 4/11 do some cleanup of the mediatek ethernet drivers directory. Patch 5/11 provides a devres variant of register_netdev(). Patch 6/11 adds the new ethernet driver. The rest of the patches add DT fixups for the boards already supported upstream. Bartosz Golaszewski (11): dt-bindings: add a binding document for MediaTek PERICFG controller dt-bindings: new: add yaml bindings for MediaTek Ethernet MAC net: ethernet: mediatek: rename Kconfig prompt net: ethernet: mediatek: remove unnecessary spaces from Makefile net: core: provide devm_register_netdev() net: ethernet: mtk-eth-mac: new driver ARM64: dts: mediatek: add pericfg syscon to mt8516.dtsi ARM64: dts: mediatek: add the ethernet node to mt8516.dtsi ARM64: dts: mediatek: add an alias for ethernet0 for pumpkin boards ARM64: dts: mediatek: add ethernet pins for pumpkin boards ARM64: dts: mediatek: enable ethernet on pumpkin boards .../arm/mediatek/mediatek,pericfg.yaml | 34 + .../bindings/net/mediatek,eth-mac.yaml | 80 + arch/arm64/boot/dts/mediatek/mt8516.dtsi | 17 + .../boot/dts/mediatek/pumpkin-common.dtsi | 34 + drivers/net/ethernet/mediatek/Kconfig | 8 +- drivers/net/ethernet/mediatek/Makefile | 3 +- drivers/net/ethernet/mediatek/mtk_eth_mac.c | 1476 +++++++++++++++++ include/linux/netdevice.h | 4 + net/core/dev.c | 48 + net/ethernet/eth.c | 1 + 10 files changed, 1703 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,pericfg.yaml create mode 100644 Documentation/devicetree/bindings/net/mediatek,eth-mac.yaml create mode 100644 drivers/net/ethernet/mediatek/mtk_eth_mac.c