Add a distinct configuration for the SiFive FU740-C000 ethernet
controller to comply with the SiFive IP versioning guidelines.
The FU740 ethernet controller uses the same management IP block as
the FU540, which is tightly coupled with the Cadence MACB IP and
manages boundary signals. To avoid code duplication while maintaining
distinct SoC identification, this patch:
- Renames sifive_fu540_macb_mgmt to sifive_macb_mgmt to reflect
that it's shared between FU540 and FU740
- Adds a fu740_c000_config structure that reuses the FU540
initialization functions
- Follows the established pattern in this driver where multiple
SoC configs share the same init functions
Signed-off-by: Max Hsu <max.hsu@sifive.com>
---
drivers/net/ethernet/cadence/macb_main.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 43cd013bb70e..10d049391a73 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -39,8 +39,8 @@
#include <net/pkt_sched.h>
#include "macb.h"
-/* This structure is only used for MACB on SiFive FU540 devices */
-struct sifive_fu540_macb_mgmt {
+/* This structure is used for MACB on SiFive FU540/FU740 devices */
+struct sifive_macb_mgmt {
void __iomem *reg;
unsigned long rate;
struct clk_hw hw;
@@ -4650,7 +4650,7 @@ static const struct macb_usrio_config macb_default_usrio = {
/* max number of receive buffers */
#define AT91ETHER_MAX_RX_DESCR 9
-static struct sifive_fu540_macb_mgmt *mgmt;
+static struct sifive_macb_mgmt *mgmt;
static int at91ether_alloc_coherent(struct macb *lp)
{
@@ -5236,6 +5236,16 @@ static const struct macb_config fu540_c000_config = {
.usrio = &macb_default_usrio,
};
+static const struct macb_config fu740_c000_config = {
+ .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
+ MACB_CAPS_GEM_HAS_PTP,
+ .dma_burst_length = 16,
+ .clk_init = fu540_c000_clk_init,
+ .init = fu540_c000_init,
+ .jumbo_max_len = 10240,
+ .usrio = &macb_default_usrio,
+};
+
static const struct macb_config at91sam9260_config = {
.caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
.clk_init = macb_clk_init,
@@ -5411,6 +5421,7 @@ static const struct of_device_id macb_dt_ids[] = {
{ .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config}, /* deprecated */
{ .compatible = "cdns,zynq-gem", .data = &zynq_config }, /* deprecated */
{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
+ { .compatible = "sifive,fu740-c000-gem", .data = &fu740_c000_config },
{ .compatible = "microchip,mpfs-macb", .data = &mpfs_config },
{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
{ .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config },
--
2.43.0
On Fri, Feb 20, 2026 at 04:27:07PM +0800, Max Hsu wrote:
> Add a distinct configuration for the SiFive FU740-C000 ethernet
> controller to comply with the SiFive IP versioning guidelines.
We are in the merge window at the moment, so net-next is closed.
As requested, please reword the commit messages to replace the SiFive
guidelines with the generic DT guidelines. And repost when net-next
reopens.
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
The Subject line also needs to indicate which tree this is for.
Andrew
---
pw-bot: cr
Thanks for the review, Andrew!
Based on Conor's feedback on patch 1, I'll be dropping this patch entirely
in v2. Instead, I'll use a fallback compatible string pattern
("sifive,fu740-c000-gem", "sifive,fu540-c000-gem") in the device tree,
which makes this driver change redundant.
Since there will be no net subsystem changes in v2, the series will go
through the devicetree and RISC-V trees instead.
Thanks,
Max
On Fri, Feb 20, 2026 at 9:15 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Fri, Feb 20, 2026 at 04:27:07PM +0800, Max Hsu wrote:
> > Add a distinct configuration for the SiFive FU740-C000 ethernet
> > controller to comply with the SiFive IP versioning guidelines.
>
> We are in the merge window at the moment, so net-next is closed.
>
> As requested, please reword the commit messages to replace the SiFive
> guidelines with the generic DT guidelines. And repost when net-next
> reopens.
>
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
>
> The Subject line also needs to indicate which tree this is for.
>
> Andrew
>
> ---
> pw-bot: cr
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
On Sat, Feb 21, 2026 at 02:35:03AM +0800, Max Hsu wrote:
> Thanks for the review, Andrew!
>
> Based on Conor's feedback on patch 1, I'll be dropping this patch entirely
> in v2. Instead, I'll use a fallback compatible string pattern
> ("sifive,fu740-c000-gem", "sifive,fu540-c000-gem") in the device tree,
> which makes this driver change redundant.
>
> Since there will be no net subsystem changes in v2, the series will go
> through the devicetree and RISC-V trees instead.
Nope, you still have one patch for net - the dt-binding for the macb
goes via net. Nothing in this series goes via devicetree or RISC-V trees
either.
Generally, bindings go through driver trees and dts patches go through
the soc tree.
Cheers,
Conor.
© 2016 - 2026 Red Hat, Inc.