From nobody Wed May 8 00:53:29 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+60467+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+60467+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1590788432; cv=none; d=zohomail.com; s=zohoarc; b=nBqeUq3sJrl2npXsd7btHG9E+mrEAgizXrnopAlAECfpqL26ggYxBYJjuPNLWLGk/QRtU7ohpSWRR5+3kljBIPB7qsaa1umrReOe1k40mmCrhjBCmjwhxopfN2+SExCfAMgtt8Mke3smg9VgZsvX54isbl1pzMED5DpYTBOXbUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590788432; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=R8svvByzYiQ6vU9/ZgHd3VX8DzCCtg+MjMxk/feuM0U=; b=RtXbvNLqYeddIfTlTPBW8RWbAor3B/Hv72xC0E4mUZVNfw9F0cCiDZX1d5LlI5X0Qi7/cLbHwQKvq6AMlDv25dLu4o+ixVAhhJ5y4q9rdQ7yvEQVXK6AlqExIX8/oMa4wvbAlOWfcVzupPCQaGqEZZPHXe2zHEUC+kkyz0MFn10= 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+60467+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590788432234824.6095767284916; Fri, 29 May 2020 14:40:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yLEQYY1788612xp2bgo37fBF; Fri, 29 May 2020 14:40:31 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.229.1590788430435663790 for ; Fri, 29 May 2020 14:40:30 -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 467151045; Fri, 29 May 2020 14:40:29 -0700 (PDT) X-Received: from localhost.localdomain (unknown [10.37.8.220]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3ADDA3F6C4; Fri, 29 May 2020 14:40:28 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif@nuviainc.com, alan@softiron.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH edk2-platforms] Platform/OverdriveBoard: work around network ConnectAll() dependency Date: Fri, 29 May 2020 23:40:19 +0200 Message-Id: <20200529214019.6063-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: qdTV8SMy5dcrK8bxf8nwR4D5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590788431; bh=KMkTv6E/gOIZUKc0wGkSTANtZJsYnelj9Y7mH+qb8PI=; h=Cc:Date:From:Reply-To:Subject:To; b=U0prl1G1LghmMaBgaTKMf/mY/ZD9Xre0uv4+muB4jW4nu62J7p9wufHlpSkkJBpk+e5 KS75Cs2v0YO0b7c9clbvmaO0gk6KUJJYUUmU2oNDDnIPPhcva0DBOHh6p/2nGpOIx6VGu 2mEthrRTCfiZT6oweHHJuJ/mRFAazDi70WM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The AMD Seattle based platforms have been kept up to date in recent years, even though the hardware is obsolete and was never available that widely in the first place. However, one aspect that has sadly been left behind is the support for the builtin network controllers. These are only wired up and enabled on the Overdrive board to begin with, and the driver was only made available as two separate binary blobs implementing the SNP protocol for each controller separately, without taking the UEFI driver model into account. Even worse, the PHY initialization code that needs to run at boot in order for the OS to be able to use the device never executes unless the upper networking layers start the SNP protocol, which doesn't happen on a fast boot (one that does not use ConnectAll()) unless the boot target is a network device path. We cannot fix the driver, but fortunately, there is another way out: protocols that are installed on a handle during the execution of the entrypoint of a driver will be connected by the DXE core, and so we can ensure that the old behavior is retained regardless of whether ConnectAll() is ever invoked, by reordering the load sequence so that the upper layer drivers have all been registered by the time the entrypoints of the SNP drivers are called. This relies on FV contents to be dispatched in the order they appear in the .FDF file. The AMD SNP driver as well as the upper layer drivers in NetworkPkg are UEFI_DRIVER modules, which means their DEPEXes are implicitly defined as the full set of architectural PI protocols. This means that all these modules become available for dispatch at the same time, and their dispatch order is fully defined by the order of appearance in the FV. Unfortunately, this is an implementation detail rather than something that is supported by the PI spec, but this is unlikely to ever change since other platforms undoubtedly exist that depend on this behavior as well. Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- This is a preparatory patch to ensure that this platform does not break when core EDK2 drops the EfiBootManagerConnectAll() from the ArmPkg version of PlatformBootManagerLib. Platform/AMD/OverdriveBoard/OverdriveBoard.fdf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf b/Platform/AMD/= OverdriveBoard/OverdriveBoard.fdf index 851ae65b5be9..15b5b1bc317f 100644 --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf @@ -178,18 +178,18 @@ [FV.FvMain] INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf =20 - # - # SNP support - # - INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort0.inf - INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort1.inf - # # Networking stack # !include NetworkPkg/Network.fdf.inc INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf =20 + # + # SNP support + # + INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort0.inf + INF Silicon/AMD/Styx/AmdModulePkg/SnpDxe/SnpDxePort1.inf + # # Core Info # --=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 (#60467): https://edk2.groups.io/g/devel/message/60467 Mute This Topic: https://groups.io/mt/74553960/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-