From patchwork Wed Jan 30 01:24:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Ungerer X-Patchwork-Id: 10787471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1249691E for ; Wed, 30 Jan 2019 01:24:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0234D2C97C for ; Wed, 30 Jan 2019 01:24:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E832E2C980; Wed, 30 Jan 2019 01:24:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E05702C97C for ; Wed, 30 Jan 2019 01:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=GiBeeJyPrAuT0y+3n/IP6fCKiiwnSHxn/vdtUg5JnQo=; b=hZd4gLQe5tKGZY XCeyDu25j2LmDap168a9M/rUuJRjUoJQAu/rX8wNpFz8jm3Ibwqr/zHyWKsxA9X7JD+o2rDNrW4h5 WfsTQhMajgIZbbZYFdOh2CW1vTyZbb1/czAfxVvS6MTSBC9WI3Tbtf5CN6S8Wj94Hf/QRwvPAxQXS fcZsNljrmKUHsltq4GXSkVWQa58gOPTYVXF9tWIPBh+PucRtPopdGVp8Ht1lXR/4iZTR8whBlRtYD wsVYBDPz4KE1n6D3WDXjS9CZaFdC8B3MGdonYR1IH7yjcFGB/VOcmxuufqX9SsV98Gk5N2Xt9prds nCafrOQC7aFOzFFEgjVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1goecB-0001CR-4q; Wed, 30 Jan 2019 01:24:31 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1goec7-0001Bu-Rl for linux-mediatek@lists.infradead.org; Wed, 30 Jan 2019 01:24:29 +0000 Received: from goober.digi.com (unknown [103.48.210.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9508621473; Wed, 30 Jan 2019 01:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548811465; bh=c7XVaXiQK6oHiO05bi6jCj8TOPniw5fhssCDACoDmp8=; h=From:To:Cc:Subject:Date:From; b=xWpjNXe1dJeIHPdQ0U2D4yb4ZJf52aslqwu8mNTBeya2/K+8qmhGsKF8K+99d2oNi RxODpxmtBuHcMfLo3gE0857oHRd3j9Kq4l2gPcqFqFTTefCEFMnXTL/3B5gAa6Xzv8 +n+FOs+l3CzI6XWKzp4sH+687PNC/LZqX+J154hw= From: gerg@kernel.org To: sean.wang@mediatek.com, linux-mediatek@lists.infradead.org, bjorn@mork.no, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org Subject: [PATCHv4 0/3]: net: dsa: mt7530: support MT7530 in the MT7621 SoC Date: Wed, 30 Jan 2019 11:24:03 +1000 Message-Id: <20190130012406.28271-1-gerg@kernel.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190129_172427_917316_B367C1E1 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: neil@brown.name, rene@vdorst.com, john@phrozen.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This is the fourth version of a patch series supporting the MT7530 switch as used in the MediaTek MT7621 SoC. Unlike the MediaTek MT7623 the MT7621 is built around a dual core MIPS CPU architecture. But inside it uses basically the same 7530 switch. This series resolves all issues I had with previous versions, and I can now reliably use the driver on a 7621 SoC platform. These patches were generated against linux-5.0-rc4. The first patch enables support for the existing kernel mediatek ethernet driver on the MT7621 SoC. This support is from Bjørn Mork, with an update and fix by me. Using this driver fixed a number of problems I had (TX checksums, large RX packet drop) over the staging driver (drivers/staging/mt7621-eth). Patch 2 modifies the mt7530 DSA driver to support the 7530 switch as implemented in the Mediatek MT7621 SoC. The last patch updates the devicetree bindings to reflect the new support in the mt7530 driver. There is no real dependencies between the patches, so they can be taken independantly. Creating a new binding for the MT7621 seems like the only viable approach to distinguish between a stand alone 7530 switch, the silicon module in the MT7623 SoC and the silicon in the MT7621. Certainly the 7530 ID register in the MT7623 and MT7621 returns the same value, "0x7530001". Looking at the mt7530.c DSA driver it might make some sense to convert the existing "mediatek,mcm" binding to something like "mediatek,mt7623" to be consistent with this new MT7621 support. As far as I can tell this is the intention of this binding. Documentation/devicetree/bindings/net/dsa/mt7530.txt | 6 - drivers/net/dsa/mt7530.c | 96 +++++++++++-------- drivers/net/dsa/mt7530.h | 9 + drivers/net/ethernet/mediatek/Kconfig | 2 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 48 ++++++++- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 4 6 files changed, 117 insertions(+), 48 deletions(-) v1: initial patch series v2: rebase to linux-5.0-rc2 include mediatek ethernet driver changes use devicetree binding to identify platform v3: dropped mediatek ethernet driver auto negotiate patch change devicetree binding text as per feedback rebase onto 5.0-rc3 v4: simplify by using of_device_get_match_data() fix casting for 7530/7621 ID to be 32 and 64 bit clean add review-by tag rebase onto 5.0-rc4