From patchwork Thu Jul 27 07:15:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feiyang Chen X-Patchwork-Id: 13329049 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68BF8C2E8 for ; Thu, 27 Jul 2023 07:18:26 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE82483D0 for ; Thu, 27 Jul 2023 00:18:14 -0700 (PDT) Received: from loongson.cn (unknown [112.20.109.108]) by gateway (Coremail) with SMTP id _____8AxTeu+GcJkaZsKAA--.21091S3; Thu, 27 Jul 2023 15:16:14 +0800 (CST) Received: from localhost.localdomain (unknown [112.20.109.108]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxJ8y8GcJkkrY8AA--.56466S2; Thu, 27 Jul 2023 15:16:12 +0800 (CST) From: Feiyang Chen To: andrew@lunn.ch, hkallweit1@gmail.com, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, chenhuacai@loongson.cn Cc: Feiyang Chen , linux@armlinux.org.uk, dongbiao@loongson.cn, loongson-kernel@lists.loongnix.cn, netdev@vger.kernel.org, loongarch@lists.linux.dev, chris.chenfeiyang@gmail.com Subject: [PATCH v2 00/10] stmmac: Add Loongson platform support Date: Thu, 27 Jul 2023 15:15:44 +0800 Message-Id: X-Mailer: git-send-email 2.39.3 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxJ8y8GcJkkrY8AA--.56466S2 X-CM-SenderInfo: hfkh0wphl1t03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWxJry7Jw1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1x02 67AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8Gii3UUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Extend stmmac functions and macros for Loongson DWMAC. Add LS7A support for dwmac_loongson. Feiyang Chen (10): net: stmmac: Pass stmmac_priv and chan in some callbacks net: stmmac: dwmac1000: Allow platforms to choose some register offsets net: stmmac: dwmac1000: Add multi-channel support net: stmmac: dwmac1000: Add 64-bit DMA support net: stmmac: dwmac1000: Add Loongson register definitions net: stmmac: Add Loongson HWIF entry net: stmmac: dwmac-loongson: Add LS7A support net: stmmac: dwmac-loongson: Disable flow control for GMAC net: stmmac: dwmac-loongson: Add 64-bit DMA and multi-vector support net: stmmac: dwmac-loongson: Add GNET support .../net/ethernet/stmicro/stmmac/chain_mode.c | 28 +- drivers/net/ethernet/stmicro/stmmac/common.h | 3 + drivers/net/ethernet/stmicro/stmmac/descs.h | 7 + .../net/ethernet/stmicro/stmmac/descs_com.h | 49 +++- .../ethernet/stmicro/stmmac/dwmac-loongson.c | 246 +++++++++++++----- .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 20 +- .../net/ethernet/stmicro/stmmac/dwmac1000.h | 4 +- .../ethernet/stmicro/stmmac/dwmac1000_core.c | 63 +++-- .../ethernet/stmicro/stmmac/dwmac1000_dma.c | 110 +++++++- .../ethernet/stmicro/stmmac/dwmac100_core.c | 12 +- .../ethernet/stmicro/stmmac/dwmac100_dma.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 11 +- .../ethernet/stmicro/stmmac/dwmac4_descs.c | 19 +- .../net/ethernet/stmicro/stmmac/dwmac4_dma.c | 8 +- .../net/ethernet/stmicro/stmmac/dwmac_dma.h | 210 ++++++++------- .../net/ethernet/stmicro/stmmac/dwmac_lib.c | 156 +++++++++-- .../ethernet/stmicro/stmmac/dwxgmac2_core.c | 11 +- .../ethernet/stmicro/stmmac/dwxgmac2_descs.c | 17 +- .../ethernet/stmicro/stmmac/dwxgmac2_dma.c | 8 +- .../net/ethernet/stmicro/stmmac/enh_desc.c | 38 ++- drivers/net/ethernet/stmicro/stmmac/hwif.c | 48 +++- drivers/net/ethernet/stmicro/stmmac/hwif.h | 77 +++--- .../net/ethernet/stmicro/stmmac/norm_desc.c | 17 +- .../net/ethernet/stmicro/stmmac/ring_mode.c | 105 ++++++-- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 6 + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 38 ++- include/linux/stmmac.h | 54 ++++ 27 files changed, 997 insertions(+), 370 deletions(-)