From nobody Fri Nov 20 13:55:51 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jWH134xLSz71nTm for ; Fri, 20 Nov 2026 13:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jWH132j2fz4TlG for ; Fri, 20 Nov 2026 13:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795182951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/SA2nY9neFn6377G4Tc1Hkfv2jSLE2duReUGEEqR6M=; b=OXVGRCIltxnaOM/idCMCU8LmpSj28JHxKPuXlJpyB+QbD28jZaeQjETKSj/NwyT80oEO+D kA8LhLjbHwMc3EAuvmtfsRvkyHChzwuFuszsqHIjsnjFAOzd/gGJI3FTBD8badzxU2I8Iq KvRJGYkrz29dDd7sbXq5apTSpfouVG//ioulpG3+JF3A7LVGePctgqZKCrhiuy+umQWRvd AGs03yGJNGInOtC86uVPQ1uoAHeQuboqaJ/Mb4qTb7b6ELAUo7/tvmN6ASxiCyRq0IV57N nrXWyKnT/yry9Ax3/vXCVzkCnp5onlJYqAxVTuY7JTYTWjps0v1OXHAbulYcUQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795182951; b=CTNkYJ14xkSheqX/3H//SYFkSX2r4lc5sSthT+1GIPzEWSPp5ZzZKD81xQhyfhnGzIomq9 NH1mkRWyR2ocvR4iV8B6Qha86iwv4/pW2UEbKuahMNjZXRfpAPMJ33fNl0nEhim0JuXmse OPESGXzyO2B9cyQgSOzj02XxMctPjrMhNvjW2viB7B164c2mtnInoQSDBZzFs61ZqCKUrW JDqPmmk7RSY0Y+c7jF4JsyTAyqRO4aV54Q4OZgJXhzyTZBJtPvvL8X7DB4xkLfe8LGsV5m yjkzlNzzVHorwoJtLd/v583OaraikzOZzyP2kwCTF/zdop8QVjqjozcNhJkhvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795182951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/SA2nY9neFn6377G4Tc1Hkfv2jSLE2duReUGEEqR6M=; b=JmBIu48vyegd4uREp7QB9mcXPMELZBrm4EegXVJeFwVLQ9yXWUlVtSj3PluoQVujTF3btd iIml9l3b57Dks5x4f/CcdnIGzsJHZShYn8h2cm28DnfI5Rjoig045LhdujRiroPZ+TLiGU jmPXNuoSGxnP2l3c27HhjULaNIAfEwNdjc7xg193jlgW/zilomTgKdD8E5P3pc7jYK2Dfr 3lIMHT0JUDMvCahYJWMNhPuPvZ8jxzhFbsy7G1DyIREGU0MELAIyYs15oPsj+qr+q7jCFc NsKtdALi+55ChzTDLpm9nVnkjk+AE3oQnTB4OmhWu+yJFtf7Iwh9bpyXsoHLug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jWH1329zGzqyY for ; Fri, 20 Nov 2026 13:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e969 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 20 Nov 2026 13:55:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 9c3faa7da860 - main - dwc: Configure the AXI request limits and mixed burst of the QoS core List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c3faa7da8600e9b1215b5b298cfda9df8627c34 Auto-Submitted: auto-generated Date: Fri, 20 Nov 2026 13:55:51 +0000 Message-Id: <6b005167.e969.1796036d@gitrepo.freebsd.org> The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=9c3faa7da8600e9b1215b5b298cfda9df8627c34 commit 9c3faa7da8600e9b1215b5b298cfda9df8627c34 Author: Emmanuel Vadot AuthorDate: 2026-10-20 15:01:29 +0000 Commit: Emmanuel Vadot CommitDate: 2026-11-20 13:55:26 +0000 dwc: Configure the AXI request limits and mixed burst of the QoS core dma4_init() wrote the system bus mode register with only the burst length and enhanced address bits, which left the maximum number of outstanding AXI requests at its reset value of one and did not honour mixed burst. The receive DMA could not keep up and dropped frames in the FIFO while the CPU was mostly idle. Parse the snps,axi-config node of the device tree (the maximum number of outstanding read and write requests) with the other snps properties, and program the limits, the hardware fields hold the limit minus one. Set the mixed burst bit when snps,mixed-burst is present, as the eqos driver does. Differential Revision: https://reviews.freebsd.org/D60918 --- sys/dev/dwc/dwc4_dma.c | 9 +++++++++ sys/dev/dwc/dwc4_dma.h | 4 ++++ sys/dev/dwc/if_dwc.c | 16 ++++++++++++++++ sys/dev/dwc/if_dwcvar.h | 2 ++ 4 files changed, 31 insertions(+) diff --git a/sys/dev/dwc/dwc4_dma.c b/sys/dev/dwc/dwc4_dma.c index 4c796c5a8688..58e8b009e08e 100644 --- a/sys/dev/dwc/dwc4_dma.c +++ b/sys/dev/dwc/dwc4_dma.c @@ -644,6 +644,11 @@ dma4_init(struct dwc_softc *sc) reg |= DMASBMR_BLEN8; reg |= DMASBMR_BLEN16; reg |= DMASBMR_EAME; + /* The hardware fields hold the limits minus one. */ + reg |= ((sc->axi_rd_osr_lmt - 1) << DMASBMR_RD_OSR_LMT_S) & + DMASBMR_RD_OSR_LMT_M; + reg |= ((sc->axi_wr_osr_lmt - 1) << DMASBMR_WR_OSR_LMT_S) & + DMASBMR_WR_OSR_LMT_M; WRITE4(sc, ETH_DMASBMR, reg); reg = READ4(sc, ETH_DMASBMR); @@ -651,6 +656,10 @@ dma4_init(struct dwc_softc *sc) reg |= DMASBMR_FB; else reg &= ~DMASBMR_FB; + if (sc->mixed_burst) + reg |= DMASBMR_MB; + else + reg &= ~DMASBMR_MB; if (sc->aal) reg |= DMASBMR_AAL; else diff --git a/sys/dev/dwc/dwc4_dma.h b/sys/dev/dwc/dwc4_dma.h index 97d060eb77f1..83239b13be55 100644 --- a/sys/dev/dwc/dwc4_dma.h +++ b/sys/dev/dwc/dwc4_dma.h @@ -29,7 +29,11 @@ #define ETH_DMAMR 0x1000 #define DMAMR_SWR (1 << 0) /* Software Reset */ #define ETH_DMASBMR 0x1004 +#define DMASBMR_WR_OSR_LMT_S 24 /* AXI Maximum Write Outstanding Req Limit */ +#define DMASBMR_WR_OSR_LMT_M (0xf << DMASBMR_WR_OSR_LMT_S) #define DMASBMR_RD_OSR_LMT_S 16 /* AXI Maximum Read Outstanding Req Limit */ +#define DMASBMR_RD_OSR_LMT_M (0xf << DMASBMR_RD_OSR_LMT_S) +#define DMASBMR_MB (1 << 14) /* Mixed Burst */ #define DMASBMR_AAL (1 << 12) /* Address-Aligned Beats */ #define DMASBMR_EAME (1 << 11) /* Enhanced Address Mode Enable */ #define DMASBMR_BLEN16 (1 << 3) /* Fixed Burst Length */ diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index 78216a5d14f6..82af47220ccf 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -549,6 +549,8 @@ dwc_attach(device_t dev) if_t ifp; int error; uint32_t pbl; + phandle_t axi; + pcell_t xref; sc = device_get_softc(dev); sc->dev = dev; @@ -586,6 +588,20 @@ dwc_attach(device_t dev) if (OF_hasprop(sc->node, "snps,aal")) sc->aal = true; + /* Maximum number of outstanding AXI requests. */ + sc->axi_rd_osr_lmt = 1; + sc->axi_wr_osr_lmt = 1; + if (OF_getencprop(sc->node, "snps,axi-config", &xref, + sizeof(xref)) > 0) { + axi = OF_node_from_xref(xref); + OF_getencprop(axi, "snps,rd_osr_lmt", &sc->axi_rd_osr_lmt, + sizeof(uint32_t)); + OF_getencprop(axi, "snps,wr_osr_lmt", &sc->axi_wr_osr_lmt, + sizeof(uint32_t)); + } + sc->axi_rd_osr_lmt = MIN(MAX(sc->axi_rd_osr_lmt, 1), 16); + sc->axi_wr_osr_lmt = MIN(MAX(sc->axi_wr_osr_lmt, 1), 16); + error = clk_set_assigned(dev, ofw_bus_get_node(dev)); if (error != 0 && error != ENOENT) { device_printf(dev, "clk_set_assigned failed\n"); diff --git a/sys/dev/dwc/if_dwcvar.h b/sys/dev/dwc/if_dwcvar.h index 7b21be7629a1..bfe7ca5ce29b 100644 --- a/sys/dev/dwc/if_dwcvar.h +++ b/sys/dev/dwc/if_dwcvar.h @@ -120,6 +120,8 @@ struct dwc_softc { /* DMA config */ uint32_t txpbl; /* TX Burst lenght */ uint32_t rxpbl; /* RX Burst lenght */ + uint32_t axi_rd_osr_lmt; /* AXI max outstanding reads */ + uint32_t axi_wr_osr_lmt; /* AXI max outstanding writes */ bool nopblx8; bool fixed_burst; bool mixed_burst;