From nobody Fri Nov 20 13:55:49 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 4jWH115Ly6z71nZ8 for ; Fri, 20 Nov 2026 13:55:49 +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 4jWH111hJ9z4TTK for ; Fri, 20 Nov 2026 13:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795182949; 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=X/rKseLy3HNZt5wsFfzozivZ2c6GQwo9ZTGivP5Mv1Q=; b=uy9Leh+Sae1lLjmq8EVUb3fRN5/yDvbH+KgpJU8dyft7CVpSZLO9Y6V3FHhCoXvu/uCJ+N k79F+jfFRJ1Lxn4oVYGDJN/O9ffkeK7Tp8tbH7Igk5DBxVB/7KoknfTHQIGmV/THXClyIH hwzimmwvfsBxr2SrXmlwTBVCIgM+GKecfUpxhurlUAhkQgJg7GL5dpJjppgNSgONixhhku F5MQmrhXS25R6QzR1iZ60bu1/UbO19QQxgzBpfewMIqvE+SMuDkjbNISVM+vJyi7ndhBTI 7FGXVD5V4VCRSjCgpwRHvky20zJZbADhzAEEaEI0QIp6yebo5YZvL2Y1yZZJow== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795182949; b=HgmW7eizCLGJhgZUHL/xQU31hHn/9HUPiApHyzPywRM6DrUycWFXmqhS8E+6UUhNv8f4Ql vtl9guFGbB+XF1PLTn0yT0bJe86n1hW7NA+dF72iOUSUBjVGoKHj1reskn4wi7Bg8k2FZH Wzljj4P+snXfFU8bo5dlnYH/mCUKGLDxZdvY05buQlKipy/JufHeIJ7sSGW74rD0hhNB7G W333k0OLRx9Dma2yHL0ycO5+JLMDoxkdiUuB74iGtEeU0EJnyjWoObxbKZ3tMJxio3HMDI bo7V2fFyEl8nv9BE4LkVN2vhx36UDVpsuhanOwd3LAA53Jrxzp7GHj9cUGPW9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795182949; 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=X/rKseLy3HNZt5wsFfzozivZ2c6GQwo9ZTGivP5Mv1Q=; b=kL1PVSOvjZRO0ObxDkucbMb9L0Af6ByDUagmT4g1vDo/QDMlTaibh07t9YRcRXh/RsEChj 44jVIaQMs5HLo7WxgZiPPx0RTNmWIuDeIG9EGmcE96Sao5qxCUhNn1fi5L10XHoaUu6sbb b5MZz4XIUTwiwNDHAPp20469U57m/e/oBifJHiRXyFCES9EbA+aZPP9pdyz6YDYbAjy9Vm E9KMm+cDStaLyhmQ81Gl22UM+wAeW3Ump5hxYjti4w0HUk0hJT+OpLAhFrDMWtBBlfD1JK LgzuWWOOAgkjZ7yF47GJPnW8OASZ3jqdQC/WPfIHu2uuFviGA0kk8dMleoyHHQ== 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 4jWH111LY6zrlv for ; Fri, 20 Nov 2026 13:55:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id efc8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 20 Nov 2026 13:55:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 9efa26959d3f - main - dwc: Use the MAC address from the device tree 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: 9efa26959d3fc29b104971329377f89729c17b74 Auto-Submitted: auto-generated Date: Fri, 20 Nov 2026 13:55:49 +0000 Message-Id: <6b005165.efc8.18d93c10@gitrepo.freebsd.org> The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=9efa26959d3fc29b104971329377f89729c17b74 commit 9efa26959d3fc29b104971329377f89729c17b74 Author: Emmanuel Vadot AuthorDate: 2026-10-20 15:30:48 +0000 Commit: Emmanuel Vadot CommitDate: 2026-11-20 13:55:22 +0000 dwc: Use the MAC address from the device tree The bootloader usually sets the Ethernet address of the device in the device tree (mac-address or local-mac-address), but the driver only used the address read from the hardware, or a random one if there is none. Use fdt_ether_get_addr() right before attaching the interface, so the address from the device tree is preferred and the one from the hardware (or generated) remains the fallback. Differential Revision: https://reviews.freebsd.org/D60916 --- sys/dev/dwc/if_dwc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index f0b32e1bf410..78216a5d14f6 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include @@ -683,6 +684,12 @@ dwc_attach(device_t dev) } sc->mii_softc = device_get_softc(sc->miibus); + /* + * Prefer the address from the device tree (set by the bootloader) + * over the one read from the hardware or generated. + */ + fdt_ether_get_addr(sc->node, ifp, macaddr); + /* All ready to run, attach the ethernet interface. */ ether_ifattach(ifp, macaddr); sc->is_attached = true;