|
|
Log in / Subscribe / Register

riscv: spacemit: Add ethernet support for K3

From:  Inochi Amaoto <inochiama-AT-gmail.com>
To:  Andrew Lunn <andrew+netdev-AT-lunn.ch>, "David S. Miller" <davem-AT-davemloft.net>, Eric Dumazet <edumazet-AT-google.com>, Jakub Kicinski <kuba-AT-kernel.org>, Paolo Abeni <pabeni-AT-redhat.com>, Rob Herring <robh-AT-kernel.org>, Krzysztof Kozlowski <krzk+dt-AT-kernel.org>, Conor Dooley <conor+dt-AT-kernel.org>, Yixun Lan <dlan-AT-gentoo.org>, Maxime Coquelin <mcoquelin.stm32-AT-gmail.com>, Alexandre Torgue <alexandre.torgue-AT-foss.st.com>, Richard Cochran <richardcochran-AT-gmail.com>, Paul Walmsley <pjw-AT-kernel.org>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Albert Ou <aou-AT-eecs.berkeley.edu>, Alexandre Ghiti <alex-AT-ghiti.fr>, "Russell King (Oracle)" <rmk+kernel-AT-armlinux.org.uk>, Yanteng Si <siyanteng-AT-cqsoftware.com.cn>, Yao Zi <ziyao-AT-disroot.org>, Inochi Amaoto <inochiama-AT-gmail.com>, Lad Prabhakar <prabhakar.mahadev-lad.rj-AT-bp.renesas.com>, Shangjuan Wei <weishangjuan-AT-eswincomputing.com>, Maxime Chevallier <maxime.chevallier-AT-bootlin.com>, Chen-Yu Tsai <wens-AT-kernel.org>, Zhi Li <lizhi2-AT-eswincomputing.com>, Boon Khai Ng <boon.khai.ng-AT-altera.com>, Quentin Schulz <quentin.schulz-AT-cherry.de>, Giuseppe Cavallaro <peppe.cavallaro-AT-st.com>, Jose Abreu <joabreu-AT-synopsys.com>
Subject:  [PATCH net-next v4 0/3] riscv: spacemit: Add ethernet support for K3
Date:  Fri, 30 Jan 2026 10:27:01 +0800
Message-ID:  <20260130022705.1059214-1-inochiama@gmail.com>
Cc:  netdev-AT-vger.kernel.org, devicetree-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-riscv-AT-lists.infradead.org, spacemit-AT-lists.linux.dev, linux-stm32-AT-st-md-mailman.stormreply.com, linux-arm-kernel-AT-lists.infradead.org, Longbin Li <looong.bin-AT-gmail.com>
Archive-link:  Article

Add initial support for ethernet controller of the Spacemit K3 SoC.
This ethernet controller is almost a standard Synopsys DesignWare
MAC (version 5.40a). This controller require a syscon device to
configure some basic features, like interface type and internal delay.

Change from v3:
- https://lore.kernel.org/netdev/20260128072931.875041-1-in...
patch 1:
1. fix the uncorrect compatible string postion
patch 3:
1. add "CTRL_" prefix to all ctrl register definition
2. only use delay config 0 to calculate delay code.
3. fix typo in the comment

Change from v2:
- https://lore.kernel.org/netdev/20260121071315.940130-1-in...
patch 1:
1. remove not needed compatible for select
2. drop empty line in "spacemit,apmu" properties
3. add spacemit,apmu properties to required.
patch 3:
1. remove misused phy_fix_phy_mode_for_mac_delays.
2. use local tx clock instead of the clk_tx_i in the dwmac.

Change from v1:
- https://lore.kernel.org/netdev/20260120043609.910302-1-in...
patch 1:
1. remove phy clock
patch 3:
1. improve comment and include something special about Spacmit K3 dwmac
2. reorder the included file
3. fix wrong delay macro used in spacemit_dwmac_set_delay.
4. add check for maximum supported delay.
5. use DIV_ROUND_CLOSEST to calculate best delay configuration.
6. use assign for the ctrl register initial value.
7. fix input when calling of_property_read_u32().

Inochi Amaoto (3):
  dt-bindings: net: Add support for Spacemit K3 dwmac
  net: stmmac: platform: Add snps,dwmac-5.40a IP compatible string
  net: stmmac: Add glue layer for Spacemit K3 SoC

 .../devicetree/bindings/net/snps,dwmac.yaml   |   2 +
 .../bindings/net/spacemit,k3-dwmac.yaml       | 103 ++++++++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../ethernet/stmicro/stmmac/dwmac-spacemit.c  | 194 ++++++++++++++++++
 .../ethernet/stmicro/stmmac/stmmac_platform.c |   1 +
 6 files changed, 313 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/spacemit,k3-dwmac.yaml
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-spacemit.c

--
2.52.0




Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds