[edk2-platforms PATCH 2/2] Platform/RaspberryPi: delete usb node instead of pci in SyncPcie()


Adrien Thierry
 

In SyncPcie(), the pci node is removed from the device tree to make sure
the XHCI controller is not reset by Linux in DT mode. However, we should
only remove the usb child node and not the whole pci node. Removing the
whole pci node prevents Linux to bypass XHCI handoff for the Raspberry
Pi 4 [1]. Moreover, removing the usb node seems to have been the
original intent according to the error messages shown if the node is not
detected.

[1] https://elixir.bootlin.com/linux/latest/source/drivers/usb/host/pci-quirks.c#L1258

Fixes: efff29cdcdb7 ("Platform/RaspberryPi: Always use non translating DMA in DT mode")
Signed-off-by: Adrien Thierry <athierry@...>
---
Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c
index 55c9d185fc..26334e50b8 100644
--- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c
+++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c
@@ -388,7 +388,7 @@ SyncPcie (
* triggering the mailbox by removing the node.
*/

- Node = fdt_path_offset (mFdtImage, "/scb/pcie@7d500000/pci@0,0");
+ Node = fdt_path_offset (mFdtImage, "/scb/pcie@7d500000/pci@0,0/usb@0,0");
if (Node < 0) {
// This can happen on CM4/etc which doesn't have an onboard XHCI
DEBUG ((DEBUG_INFO, "%a: failed to locate /scb/pcie@7d500000/pci@0/usb@0\n", __FUNCTION__));
--
2.37.3

Join devel@edk2.groups.io to automatically receive all group messages.