Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Imre Kaloz
Sat, 28 Nov 2026 15:51
[PATCH net-next v3 0/2] net: sgi: ioc3-eth: two changes for the IOC3 on SGI IP35 machines
Author: Imre Kaloz
Date: Sat, 28 Nov 2026 15:51
Date: Sat, 28 Nov 2026 15:51
32 lines
8572 bytes
8572 bytes
These two changes prepare ioc3-eth for the IOC3 of the SGI Fuel, which sits behind an XBridge and has no MAC PROM. They were part of the IP35 support series, which hands the IOC3 window addresses; its next version attaches the MAC property. Neither side has a build dependency on the other. v2 was tested on an SGI Fuel with the IP35 support, where the address comes only from the property, so the new order in patch 2 is not exercised there. --- Changes in v3: - Patch 1: message only; it now says that window DMA takes its attributes and RX barrier from Device(x), where no in-tree code sets them, and why ERBAR stays 0. - Patch 2 reads the device property before the 1-wire PROM, and its message names the board. v2: https://lore.kernel.org/r/20261116102115.27574-1-kaloz@kernel.org Imre Kaloz (2): net: sgi: ioc3-eth: apply the DMA attributes only to 64-bit addresses net: sgi: ioc3-eth: take the MAC address from a device property drivers/net/ethernet/sgi/ioc3-eth.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) base-commit: f89726ffabef1b08c52e6163b7ab94b0d5f15503 -- 2.47.3
[PATCH net-next v3 1/2] net: sgi: ioc3-eth: apply the DMA attributes only to 64-bit addresses
Author: Imre Kaloz
Date: Sat, 28 Nov 2026 15:51
Date: Sat, 28 Nov 2026 15:51
71 lines
9996 bytes
9996 bytes
A Bridge 32-bit direct window address carries no target widget, so
DMA attributes OR-ed onto it aim it at widget 0. IP27 and IP30 only
hand the IOC3 64-bit direct addresses; IP35 will hand it window
addresses.
DMA through the window takes its attributes and barrier only from the
slot's Device(x) register, where no in-tree code sets them. ERBAR stays
0 for a window address, as its upper bits would make the last RX store
a widget 0 address.
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
---
drivers/net/ethernet/sgi/ioc3-eth.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index ee284a4f75ff..8ea6a54d6da3 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -152,19 +152,37 @@ static inline int ioc3_alloc_skb(struct ioc3_private *ip, struct sk_buff **skb,
}
#ifdef CONFIG_PCI_XTALK_BRIDGE
+/* A Bridge 64-bit direct-mapped DMA address carries the target widget in
+ * bits 63:60 and the DMA attributes below it. An address in the 32-bit
+ * direct window carries neither, so attributes OR-ed onto one form a
+ * 64-bit address aimed at widget 0.
+ */
static inline unsigned long ioc3_map(dma_addr_t addr, unsigned long attr)
{
+ if (!(addr & PCI64_ATTR_TARG_MASK))
+ return addr;
+
return (addr & ~PCI64_ATTR_BAR) | attr;
}
-#define ERBAR_VAL (ERBAR_BARRIER_BIT << ERBAR_RXBARR_SHIFT)
+/* The RX barrier's upper address bits follow the same form. */
+static inline u32 ioc3_erbar(dma_addr_t addr)
+{
+ if (!(addr & PCI64_ATTR_TARG_MASK))
+ return 0;
+
+ return ERBAR_BARRIER_BIT << ERBAR_RXBARR_SHIFT;
+}
#else
static inline unsigned long ioc3_map(dma_addr_t addr, unsigned long attr)
{
return addr;
}
-#define ERBAR_VAL 0
+static inline u32 ioc3_erbar(dma_addr_t addr)
+{
+ return 0;
+}
#endif
static int ioc3eth_nvmem_match(struct device *dev, const void *data)
@@ -727,7 +745,7 @@ static void ioc3_init(struct net_device *dev)
readl(®s->emcr);
/* Misc registers */
- writel(ERBAR_VAL, ®s->erbar);
+ writel(ioc3_erbar(ip->rxr_dma), ®s->erbar);
readl(®s->etcdc); /* Clear on read */
writel(15, ®s->ercsr); /* RX low watermark */
writel(0, ®s->ertr); /* Interrupt immediately */
--
2.47.3
[PATCH net-next v3 2/2] net: sgi: ioc3-eth: take the MAC address from a device property
Author: Imre Kaloz
Date: Sat, 28 Nov 2026 15:51
Date: Sat, 28 Nov 2026 15:51
34 lines
9038 bytes
9038 bytes
The system-board IOC3 of the SGI Fuel has no MAC PROM on its 1-wire bus, so an ioc3-eth probe there would defer forever. The Fuel and the Origin 300 take the address from the L1 controller. Take it from a device property, for platforms that describe the address that way. Read the property first, so a board with both does not depend on when the 1-wire bus is enumerated. Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/179508377126.3136.8138823841306639675@kernel.org/ Signed-off-by: Imre Kaloz <kaloz@kernel.org> --- drivers/net/ethernet/sgi/ioc3-eth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c index 8ea6a54d6da3..a3e6f511d43d 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -857,8 +857,9 @@ static int ioc3eth_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Invalid resource\n"); return -EINVAL; } - /* get mac addr from one wire prom */ - if (ioc3eth_get_mac_addr(regs, mac_addr)) + /* get mac addr from a device property, or from one wire prom */ + if (device_get_mac_address(&pdev->dev, mac_addr) && + ioc3eth_get_mac_addr(regs, mac_addr)) return -EPROBE_DEFER; /* not available yet */ dev = alloc_etherdev(sizeof(struct ioc3_private)); -- 2.47.3
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads