From nobody Mon Feb 9 23:39:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+59052+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59052+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1589180828; cv=none; d=zohomail.com; s=zohoarc; b=BaAougQXqpkW2hliCh/vSJMdMhaCjrNMoHKZ2Q+RAtoOqzQ8NfNI7sulzNFR+rSrTXqEr41GmO51QWAu3eXucubGgpGhw0H+eQoloSu2K7E/lLEd8WRs1omNnHPVZSPYkJAFue05WJk3Q78NK4c4nich/zGbZmPU51t0qSCRGxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589180828; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=teogFpK9b3vSdCh2yvN4Yemcl6tIL1X2p69Fr/wJ5t0=; b=Ro10PnDS6k3su2Ad9gO2bPeZGkrTyOAnHQd53gi9L9oCF2LCL/kjy9GCTPbT/ONtBh5MUxc7ihnidhyX9ItpHyOQRQmDHPqfcPVP4RGhbxOx05OHPg2m5uxI3JVuwh/qvf+quUjZMcqIpbzJqLAx11QCvCMUiuSYKlLQUOYyGf0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59052+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589180828922855.3610992340456; Mon, 11 May 2020 00:07:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FZePYY1788612xUDgpIE7Iix; Mon, 11 May 2020 00:07:08 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.7635.1589180828065552903 for ; Mon, 11 May 2020 00:07:08 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A67BDD6E; Mon, 11 May 2020 00:07:07 -0700 (PDT) X-Received: from e123331-lin.nice.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 077CA3F68F; Mon, 11 May 2020 00:07:05 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Pete Batard , Jared McNeill , Andrei Warkentin , Samer El-Haj-Mahmoud Subject: [edk2-devel] [PATCH edk2-platforms v3 2/5] Silicon/Broadcom/BcmGenetDxe: add support for broadcast filtering Date: Mon, 11 May 2020 09:06:53 +0200 Message-Id: <20200511070656.32141-3-ard.biesheuvel@arm.com> In-Reply-To: <20200511070656.32141-1-ard.biesheuvel@arm.com> References: <20200511070656.32141-1-ard.biesheuvel@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@arm.com X-Gm-Message-State: adSLOZGnOQUDbBxzVnJ9zRFcx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589180828; bh=e9dhvYgqjEw/B+wZ9IHgFKspihmri9LUnA/VlL39Trk=; h=Cc:Date:From:Reply-To:Subject:To; b=ObpZpNiXtq5nI0KdgF//Y+mLbvVfF25IzjtmXvvQZzveP8uriSEHl4cgKeIskQ8hMk5 h16Jc03rK4QReWzcbCxNdubvODFjujDOHPNVystELCDrYmWa1JdTJPoM4bL3iM1o+ERvZ vRwm/CJQxKo4WdGHd5pjbMPSqvKbNtQsUh8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add a helper to configure the first MDF filter for filtering the broadcast Ethernet address. Signed-off-by: Ard Biesheuvel --- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.h | 7 ++++++ Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c | 24 ++++++++++++++++= ++++ 2 files changed, 31 insertions(+) diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.h b/Silicon= /Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.h index 2e7b78322bcd..1dc7a51a1ca6 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.h +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.h @@ -107,6 +107,7 @@ #define GENET_UMAC_MDF_CTRL 0xe50 #define GENET_UMAC_MDF_ADDR0(n) (0xe54 + (n) * 0x8) #define GENET_UMAC_MDF_ADDR1(n) (0xe58 + (n) * 0x8) +#define GENET_MAX_MDF_FILTER 17 =20 #define GENET_DMA_DESC_COUNT 256 #define GENET_DMA_DESC_SIZE 12 @@ -300,6 +301,12 @@ GenetSetPromisc ( IN BOOLEAN Enable ); =20 +VOID +GenetEnableBroadcastFilter ( + IN GENET_PRIVATE_DATA *Genet, + IN BOOLEAN Enable + ); + VOID GenetDmaInitRings ( IN GENET_PRIVATE_DATA *Genet diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c b/Silicon= /Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c index af7c06656433..2176bb451e7d 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c @@ -492,6 +492,30 @@ GenetSetPromisc ( GenetMmioWrite (Genet, GENET_UMAC_CMD, Value); } =20 +/** + Enable the MAC filter for the Ethernet broadcast address + + @param Genet[in] Pointer to GENET_PRIVATE_DATA. + @param Enable[in] Promiscuous mode state. + +**/ +VOID +GenetEnableBroadcastFilter ( + IN GENET_PRIVATE_DATA *Genet, + IN BOOLEAN Enable + ) +{ + UINT32 Value; + + Value =3D (1U << GENET_MAX_MDF_FILTER) - 1; + if (Enable) { + GenetMmioWrite (Genet, GENET_UMAC_MDF_ADDR0 (0), 0xffff); + GenetMmioWrite (Genet, GENET_UMAC_MDF_ADDR1 (0), 0xffffffff); + Value &=3D ~BIT0; + } + GenetMmioWrite (Genet, GENET_UMAC_MDF_CTRL, Value); +} + /** Configure DMA TX and RX queues, enabling them. =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#59052): https://edk2.groups.io/g/devel/message/59052 Mute This Topic: https://groups.io/mt/74130975/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-