From patchwork Thu Jul 13 02:46:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feiyang Chen X-Patchwork-Id: 13311209 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 2A82663B for ; Thu, 13 Jul 2023 02:47:16 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 74BC819BA for ; Wed, 12 Jul 2023 19:47:11 -0700 (PDT) Received: from loongson.cn (unknown [112.20.109.108]) by gateway (Coremail) with SMTP id _____8BxXeuuZa9kqT8EAA--.6691S3; Thu, 13 Jul 2023 10:47:10 +0800 (CST) Received: from localhost.localdomain (unknown [112.20.109.108]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx_c6sZa9kuJcrAA--.57200S2; Thu, 13 Jul 2023 10:47:09 +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: [RFC PATCH 00/10] net: phy/stmmac: Add Loongson platform support Date: Thu, 13 Jul 2023 10:46:52 +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: AQAAf8Cx_c6sZa9kuJcrAA--.57200S2 X-CM-SenderInfo: hfkh0wphl1t03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoWxuF4rK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lIxAIcVC2z280aVCY1x0267AK xVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUcbAwUUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 X-Patchwork-State: RFC Add driver for Loongson PHY. Extend stmmac functions and macros for Loongson DWMAC. Add LS7A support for dwmac_loongson. Feiyang Chen (10): net: phy: Add driver for Loongson PHY 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: Add 64-bit DMA and multi-vector support net: stmmac: dwmac-loongson: Add GNET support drivers/net/ethernet/stmicro/stmmac/Kconfig | 1 + .../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 | 214 +++++++++++++----- .../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 +++++++-- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 31 ++- drivers/net/phy/Kconfig | 5 + drivers/net/phy/Makefile | 1 + drivers/net/phy/loongson-phy.c | 69 ++++++ drivers/net/phy/phy_device.c | 16 ++ include/linux/phy.h | 2 + include/linux/stmmac.h | 51 +++++ 32 files changed, 1054 insertions(+), 359 deletions(-) create mode 100644 drivers/net/phy/loongson-phy.c