From nobody Sun Apr 28 23:53:51 2024 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+60718+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+60718+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1591264220; cv=none; d=zohomail.com; s=zohoarc; b=Hk2QSh0eeeEtpFrh+ooaJEYDgx8/gMaWIIh4j30nkz3lD462uKTgv+fld4tiSREZnbDX8Ell/vFsZsrt0SZpF6w3ke7LZnf6mp03J7FJgqTU2FffzRDslpI2iitKviq1F2TnEgvrB7TYY+1PYW+rXS2NK9rNZ9q7r+wBQbB8gi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591264220; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=w0y5X3rRbl7froKo6kM3JXUKpVf+5z3gyJX1CNl4pqE=; b=ilL0XoQDt8kCXP8zHmmk5SD4kPpoNUNDjOPuihnrUtsDtrZ4J81fjLNEJEAy59iyebpWv7QV9saiNsU2ocrbFYu11imAwRUDS2Z9Ns8qg4KRM8eB1w5y5m+NDirddQmVzmVC2bolsB7M4dqPGT9U0PuWEQCeqzhDWBR6wfkZgkI= 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+60718+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 159126422039530.44560859979981; Thu, 4 Jun 2020 02:50:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4c7mYY1788612x4mSYYYntW9; Thu, 04 Jun 2020 02:50:20 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.10681.1591264219524140877 for ; Thu, 04 Jun 2020 02:50:19 -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 23BA5101E; Thu, 4 Jun 2020 02:50:19 -0700 (PDT) X-Received: from localhost.localdomain (unknown [10.37.8.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 66E543F6CF; Thu, 4 Jun 2020 02:50:17 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jared McNeill , Andrei Warkentin , Samer El-Haj-Mahmoud , Leif Lindholm , Pete Batard , Jeremy Linton Subject: [edk2-devel] [PATCH edk2-platforms 1/3] Silicon/Broadcom/BcmGenetDxe: program MAC also when not connected Date: Thu, 4 Jun 2020 11:50:05 +0200 Message-Id: <20200604095007.45693-2-ard.biesheuvel@arm.com> In-Reply-To: <20200604095007.45693-1-ard.biesheuvel@arm.com> References: <20200604095007.45693-1-ard.biesheuvel@arm.com> MIME-Version: 1.0 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: yumCKR6RyX17mL0QskCGSoHUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591264220; bh=OeNXCsoO8CzfX+m/xo5rvnnvLxBut7NQ6eCM466nHEM=; h=Cc:Date:From:Reply-To:Subject:To; b=eSi+GPuYc3jd/bAnPkrHvb1xe/QQJEw3cVYemL1qYEU8ALC0fSEPYx9Tz32p/kViVNb BajQ81NNBZbum8YUz0pKF8tVgNYpdA8BW1kHaqNg1dXOIOGjBtQtqzxENbN6apqOqp6kQ 2QajxmKCx2XV6Q1fVpn2Ln0pMS4I26XaBxI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" In preparation of removing the EfiBootManagerConnectAll() from the ordinary boot path, ensure that the MAC programming of the GENET occurs even if the SNP driver for it is never invoked by the BDS. Signed-off-by: Ard Biesheuvel Acked-by: Leif Lindholm Reviewed-By: Pete Batard --- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c | 66 ++++++++++++= ++++++++ 1 file changed, 66 insertions(+) diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c b/Sil= icon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c index f37da3b65511..7f93c68cd608 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,9 @@ =20 #include "BcmGenetDxe.h" =20 +STATIC EFI_EVENT mProtocolNotifyEvent; +STATIC VOID *mProtocolNotifyEventRegistration; + /** Tests to see if this driver supports a given controller. =20 @@ -305,6 +309,57 @@ STATIC EFI_DRIVER_BINDING_PROTOCOL mGenetDriverBinding= =3D { NULL }; =20 +STATIC +VOID +EFIAPI +OnProtocolNotify ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + BCM_GENET_PLATFORM_DEVICE_PROTOCOL *GenetDevice; + EFI_STATUS Status; + EFI_HANDLE *HandleBuffer; + UINTN HandleCount; + UINTN Index; + UINT32 Mac0, Mac1; + + while (TRUE) { + Status =3D gBS->LocateHandleBuffer (ByRegisterNotify, NULL, + mProtocolNotifyEventRegistration, &HandleCount, + &HandleBuffer); + if (EFI_ERROR (Status)) { + break; + } + + for (Index =3D 0; Index < HandleCount; Index++) { + Status =3D gBS->HandleProtocol (HandleBuffer[Index], + &gBcmGenetPlatformDeviceProtocolGuid, + (VOID **)&GenetDevice); + ASSERT_EFI_ERROR (Status); + + Mac0 =3D (GenetDevice->MacAddress.Addr[3]) | + (GenetDevice->MacAddress.Addr[2] << 8) | + (GenetDevice->MacAddress.Addr[1] << 16) | + (GenetDevice->MacAddress.Addr[0] << 24); + Mac1 =3D (GenetDevice->MacAddress.Addr[5]) | + (GenetDevice->MacAddress.Addr[4] << 8); + + MmioOr32 (GenetDevice->BaseAddress + GENET_SYS_RBUF_FLUSH_CTRL, + GENET_SYS_RBUF_FLUSH_RESET); + gBS->Stall (10); + MmioAnd32 (GenetDevice->BaseAddress + GENET_SYS_RBUF_FLUSH_CTRL, + ~GENET_SYS_RBUF_FLUSH_RESET); + + MemoryFence (); + + MmioWrite32 (GenetDevice->BaseAddress + GENET_UMAC_MAC0, Mac0); + MmioWrite32 (GenetDevice->BaseAddress + GENET_UMAC_MAC1, Mac1); + } + FreePool (HandleBuffer); + } +} + /** The entry point of GENET UEFI Driver. =20 @@ -336,6 +391,17 @@ GenetEntryPoint ( =20 ASSERT_EFI_ERROR (Status); =20 + // + // We need to program the MAC address into each existing controller, + // regardless of whether UEFI ever makes use of the interface, so that + // the OS driver will not have to care about this. + // + mProtocolNotifyEvent =3D EfiCreateProtocolNotifyEvent ( + &gBcmGenetPlatformDeviceProtocolGuid, + TPL_CALLBACK, OnProtocolNotify, NULL, + &mProtocolNotifyEventRegistration); + ASSERT (mProtocolNotifyEvent !=3D NULL); + DEBUG ((DEBUG_INIT | DEBUG_INFO, "Installed GENET UEFI driver!\n")); =20 return EFI_SUCCESS; --=20 2.26.2 -=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 (#60718): https://edk2.groups.io/g/devel/message/60718 Mute This Topic: https://groups.io/mt/74668020/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- From nobody Sun Apr 28 23:53:51 2024 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+60719+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+60719+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1591264222; cv=none; d=zohomail.com; s=zohoarc; b=G8eGwwvKnRtpkByKBJzrR4IcQgMJBA3phzNHbHsC+mEb01Re+yq71qXDMesO0OBcBHMXcycQcdnoJjo/jw2hdfdxwDa+CMp2a1NtqGYrRAcdqaYl+rMJbI3G6VSForj2Om+O1k11xpozN2axYX/naPruV8NFW3D6exydVDrUPxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591264222; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=jT5gmaTfOjp6CiySunWOGZWLFChmEIvbIJg3h3tqx1E=; b=dYjFcivNVkHykBj8vG0qOA1p7F+4sOlFG1mGE3Ez/znc3Pe/PRAU8E3daA1ks1a2PGPllrSUaUjMaVos/+IIJGFpyAYpt5nZCIjFli8bxAOJ6HHOt+K0LlQ9CJlkkSw+n4cX4btW6kbhVH7V5yM8Ji24QP4830QQixUnEwLLxLM= 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+60719+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591264222321450.3059797227386; Thu, 4 Jun 2020 02:50:22 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pmHwYY1788612xqndqGmzUWU; Thu, 04 Jun 2020 02:50:22 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.10296.1591264221538527158 for ; Thu, 04 Jun 2020 02:50:21 -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 36EE5101E; Thu, 4 Jun 2020 02:50:21 -0700 (PDT) X-Received: from localhost.localdomain (unknown [10.37.8.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 760653F6CF; Thu, 4 Jun 2020 02:50:19 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jared McNeill , Andrei Warkentin , Samer El-Haj-Mahmoud , Leif Lindholm , Pete Batard , Jeremy Linton Subject: [edk2-devel] [PATCH edk2-platforms 2/3] Platform/RaspberryPi: add UEFI Shell to boot manager menu Date: Thu, 4 Jun 2020 11:50:06 +0200 Message-Id: <20200604095007.45693-3-ard.biesheuvel@arm.com> In-Reply-To: <20200604095007.45693-1-ard.biesheuvel@arm.com> References: <20200604095007.45693-1-ard.biesheuvel@arm.com> MIME-Version: 1.0 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: x92TaRvsmXMPS7gGWjkU3exfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591264222; bh=gZGuXRLIfULDREOjvYPqIdCx1jogJBSKw7gxAmxwOUg=; h=Cc:Date:From:Reply-To:Subject:To; b=j+J7DegElcfFdo5VbLuVTzd28zCyfYq15hSWHIM5Hsxo4ag3aQRjbDLSW/xDfHYG0W/ BQJ+SWMjv0gdHdqYr221zSOIEs73310jr3N8WTD6CYiNa3P7tivZsyyqh5/eGkoS2dQ1Q DIicuSeI9qpvDBGrK04YWO7BiwHNGNh+BRM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Take advantage of a recent change to the core EDK2 BDS code that makes boot options with the LOAD_OPTION_ACTIVE flag cleared visible in the boot manager menu, so that they can be selected manually while never being considered for automatic booting (unless selected specifically via BootNext) Signed-off-by: Ard Biesheuvel Reviewed-by: Pete Batard --- Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm= .c b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c index 996ba8f39938..2bd625ad7e7c 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c @@ -460,7 +460,7 @@ PlatformRegisterOptionsAndKeys ( RemoveStaleBootOptions (); =20 ShellOption =3D PlatformRegisterFvBootOption (&gUefiShellFileGuid, - L"UEFI Shell", LOAD_OPTION_CATEGORY_APP); + L"UEFI Shell", 0); if (ShellOption !=3D -1) { // // F1 boots Shell. --=20 2.26.2 -=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 (#60719): https://edk2.groups.io/g/devel/message/60719 Mute This Topic: https://groups.io/mt/74668021/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- From nobody Sun Apr 28 23:53:51 2024 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+60720+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+60720+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1591264224; cv=none; d=zohomail.com; s=zohoarc; b=RR/3zDojGN4ONoCp3f3tNQY+dKxJ7zsubpFv+9U//b6LGjycB5V6RqOWYoO83m1e+KxddtLTiMcdzWiBmE6A7rmop2YYPUVkoneyl7HjurvEDgob7DNCkqmWLoCkUY3kovQSPuv3URGyqshM+mBUFOoCMHEyG/+iLbRWbZg0Jig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591264224; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Ccf4tinykJye4EKLOJTsbVwJpM5DRehLWuiRuXBVobs=; b=jPD6k0U2849ssQ4uj3c4Qeoy3xbqs2A6JjnJe7pO6ulOnEZUPAIg1Fk9Gb8YUbBzSX6XnkLL8vKCamaALvtbTgvX7qiWbYs4MZue+WH+dLx8cRXUeE2ILEDVuiw+bVn56be3HaYZkhLOEjFmWAvcGdAkRoVUgB5GfG2gBqh5+SA= 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+60720+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591264224504622.3648327917208; Thu, 4 Jun 2020 02:50:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uLHxYY1788612x1l9kRJLNun; Thu, 04 Jun 2020 02:50:24 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.10297.1591264223728134856 for ; Thu, 04 Jun 2020 02:50:23 -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 54E6C55D; Thu, 4 Jun 2020 02:50:23 -0700 (PDT) X-Received: from localhost.localdomain (unknown [10.37.8.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 89BC43F6CF; Thu, 4 Jun 2020 02:50:21 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jared McNeill , Andrei Warkentin , Samer El-Haj-Mahmoud , Leif Lindholm , Pete Batard , Jeremy Linton Subject: [edk2-devel] [PATCH edk2-platforms 3/3] Platform/RaspberryPi: don't connect all devices on an ordinary boot Date: Thu, 4 Jun 2020 11:50:07 +0200 Message-Id: <20200604095007.45693-4-ard.biesheuvel@arm.com> In-Reply-To: <20200604095007.45693-1-ard.biesheuvel@arm.com> References: <20200604095007.45693-1-ard.biesheuvel@arm.com> MIME-Version: 1.0 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: puu42aE811eOUYHjymnAOvUKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591264224; bh=cwdLX5t1IUQFig8j4RB4tJnqDmWofn/CkI/5WOxwapU=; h=Cc:Date:From:Reply-To:Subject:To; b=oW41V3aLU6afO84rVdJVGV36ggOv35dQyMnRX7UH5r5zSAMh+Ej0Ndtbty/wIfgbmd9 No947GJ2AqlI2zJWIJF6ZOsSATNfIf39sh+UJzTIUthK0xddM131l3YyAqG0H7voTniJ8 7p9odMM3jxELtPn6jMkPEWgfUoU6Puo6JXY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The BDS will connect device paths that are considered as boot options, so there is really no reason to always connect absolutely everything. So now that all the drivers have been updated to play nice in this case, remove the ConnectAll() call from the RPi BDS code. Signed-off-by: Ard Biesheuvel Reviewed-by: Pete Batard Tested-by: Pete Batard --- Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm= .c b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c index 2bd625ad7e7c..253614a646c1 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c @@ -655,11 +655,6 @@ PlatformBootManagerAfterConsole ( Print (BOOT_PROMPT); } =20 - // - // Connect the rest of the devices. - // - EfiBootManagerConnectAll (); - Status =3D gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL, (VOI= D**)&EsrtManagement); if (!EFI_ERROR (Status)) { EsrtManagement->SyncEsrtFmp (); --=20 2.26.2 -=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 (#60720): https://edk2.groups.io/g/devel/message/60720 Mute This Topic: https://groups.io/mt/74668022/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-