From mboxrd@z Thu Jan 1 00:00:00 1970 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 96783C83F04 for ; Thu, 3 Jul 2025 09:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject: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=q4DX6wiJdtT9JTffxX8jR1aNKDBwZTBC7MtxZGvqWIE=; b=Rxc0fIXbRJq1Hf uWVe0ObJZdaGohvPezFUfy6hb+D2V28luZhHQ73qX4YFIbcrR9NaCB6nXIq4OzSnLGw28RSdzNgQL 1RIwrwp/GlSyU96NNcKjk6RsQj81/FyQ9q1G1WrclJNac2wcIq81NsLy+BsPhs8JDLc9swxCQRz+2 dxur1xVTEepQdE8qc6Elpp6cVtAY+zUkhYV9YSD/kTT9MWApXEhJgSX3bxiHm58PxLfOqOWVeGfj5 mRH3LaOStSk7akJW6Y7KoWdBhDLWnu/cbEcQS4seQYAq41vWJPvicwgws1B60Wg4dM1FOc6HUYLzN ChBVZKjmaDKiSYCkg68A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uXGcU-0000000AtXl-0MJM; Thu, 03 Jul 2025 09:52:42 +0000 Received: from smtp81.cstnet.cn ([159.226.251.81] helo=cstnet.cn) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uXGUG-0000000ArxJ-44ZG for linux-riscv@lists.infradead.org; Thu, 03 Jul 2025 09:44:14 +0000 Received: from [127.0.0.2] (unknown [210.73.43.2]) by APP-03 (Coremail) with SMTP id rQCowAAHX4DWUGZouhe1AA--.40630S2; Thu, 03 Jul 2025 17:43:51 +0800 (CST) From: Vivian Wang Subject: [PATCH net-next v4 0/2] Add Ethernet MAC support for SpacemiT K1 Date: Thu, 03 Jul 2025 17:42:01 +0800 Message-Id: <20250703-net-k1-emac-v4-0-686d09c4cfa8@iscas.ac.cn> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAGlQZmgC/2XOTW7DIBAF4KtYrIvFv0lWvUfVBZ0MCaqMU6AoV eS7l5BIrZXlaN73Zq4kYwqYyX64koQ15LDENqiXgcDJxSPScGgzEUxoZpihEQv95BRnB1Qit1w zi84o0sQ5oQ+X3vZGbsGIl0Le75uEX9+tvjzWHy4jhWWeQ9kP1Yzc0AS8h08hlyX99J8q7+n7e S435yunjAIYv0PNmTHTa8jg8uhghNibqviv7VaLpnfKa88mISZnn7X80xMTWy2btlYcQGvFlJd bva7rL/PpObxbAQAA X-Change-ID: 20250606-net-k1-emac-3e181508ea64 To: Andrew Lunn , Jakub Kicinski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Vivian Wang , "David S. Miller" , Eric Dumazet , Paolo Abeni , Philipp Zabel Cc: Vivian Wang , Vadim Fedorenko , Junhui Liu , Simon Horman , Maxime Chevallier , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org, Conor Dooley X-Mailer: b4 0.14.2 X-CM-TRANSID: rQCowAAHX4DWUGZouhe1AA--.40630S2 X-Coremail-Antispam: 1UD129KBjvJXoWxur43Kw1ftw13Jry5Jr1DWrg_yoW5GryUpa y8AF9akw48trW2gFs7Aw4xuF4fXan5tw13WF13t395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Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250703_024413_380675_BFDA811E X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org SpacemiT K1 has two gigabit Ethernet MACs with RGMII and RMII support. Add devicetree bindings and driver for it. DTS changes will be submitted separately. Tested on BananaPi BPI-F3 and Milk-V Jupiter. I would like to note that even though some bit field names superficially resemble that of DesignWare MAC, all other differences point to it in fact being a custom design. Based on SpacemiT drivers [1]. For convenience of testing, these patches and related DTS changes are also available at: https://github.com/dramforever/linux/tree/k1/ethernet/v4 [1]: https://github.com/spacemit-com/linux-k1x --- Changes in v4: - Resource handling on probe and remove: timer_delete_sync and of_phy_deregister_fixed_link - Drop DTS changes and dependencies (will send through SpacemiT tree) - Minor changes: - Remove redundant phy_stop() and setting of ndev->phydev - Fix error checking for emac_open in emac_resume - Fix one missed dev_err -> dev_err_probe - Fix type of emac_start_xmit - Fix one missed reverse xmas tree formatting - Rename some functions for consistency between emac_* and ndo_* - Link to v3: https://lore.kernel.org/r/20250702-net-k1-emac-v3-0-882dc55404f3@iscas.ac.cn Changes in v3: - Refactored and simplified emac_tx_mem_map - Addressed other minor v2 review comments - Removed what was patch 3 in v2, depend on DMA buses instead - DT nodes in alphabetical order where appropriate - Link to v2: https://lore.kernel.org/r/20250618-net-k1-emac-v2-0-94f5f07227a8@iscas.ac.cn Changes in v2: - dts: Put eth0 and eth1 nodes under a bus with dma-ranges - dts: Added Milk-V Jupiter - Fix typo in emac_init_hw() that broke the driver (Oops!) - Reformatted line lengths to under 80 - Addressed other v1 review comments - Link to v1: https://lore.kernel.org/r/20250613-net-k1-emac-v1-0-cc6f9e510667@iscas.ac.cn --- Vivian Wang (2): dt-bindings: net: Add support for SpacemiT K1 net: spacemit: Add K1 Ethernet MAC .../devicetree/bindings/net/spacemit,k1-emac.yaml | 81 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/spacemit/Kconfig | 29 + drivers/net/ethernet/spacemit/Makefile | 6 + drivers/net/ethernet/spacemit/k1_emac.c | 1891 ++++++++++++++++++++ drivers/net/ethernet/spacemit/k1_emac.h | 420 +++++ 7 files changed, 2429 insertions(+) --- base-commit: d9946fe286439c2aeaa7953b8c316efe5b83d515 change-id: 20250606-net-k1-emac-3e181508ea64 Best regards, -- Vivian "dramforever" Wang _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv