From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.773.1664481233904342830 for ; Thu, 29 Sep 2022 12:53:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LX7TUyCj; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: athierry@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664481233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g3BFF8EldVtQw0005TfsLv5YuvwgFiwewaCJ4CBypEw=; b=LX7TUyCjBcxTuD3RpQWRDmO9we8pmUXjsulioGWxaOVCAXZRjYgNcEeyA+cLai8jLL+Ljx FI4T1DMlIYLOT7YRsNwQhDyHdrbct4K7s+KVKAfN5kKAEqJ9HN7whUrY7K/xiC2GYwOxea uipqV5xgPHDE1WYrZyrQMvxLK/7ruU4= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-163-oCjS3M40OnKrhZuU-dwtTw-1; Thu, 29 Sep 2022 15:53:52 -0400 X-MC-Unique: oCjS3M40OnKrhZuU-dwtTw-1 Received: by mail-oo1-f70.google.com with SMTP id z1-20020a4a3041000000b0047620da9e7dso879737ooz.18 for ; Thu, 29 Sep 2022 12:53:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=g3BFF8EldVtQw0005TfsLv5YuvwgFiwewaCJ4CBypEw=; b=AY1Aiq2w+xu3GO7am14s7WXWMOqyu/LIsJlAqiKOZw6HVguZ4tudN/h0nbkh2v6ywT 1kuDPCr6KklEc69+Goi1Q5Q42zwI7q1UbMqts3ly4bjygkDrmjzhAi9BIDfPgqf2yo3j StMwiIMdlMrewSriX+s7jbkapZJ1EdgkJLDNPL6GZZsxhUQbrGru8/9YhedIaM0Pyvvh L6r4hvFkeG/THsk1yaEfKnFgesy3+O52UyUMMg322nZtPdbydHK5qkH2ymCEmnBN7oew 7brdSQkUJuJz0wjS0NvmQA9RDtZgJHhXgcqKugcR/jZK26dM+GnnQu+EOSXgxUqAjagd JOpA== X-Gm-Message-State: ACrzQf1a91UiDOnJuTds/QCrAAfO3Ej4NtYp8vWtd6ZvsaNaTDIIFnpm GdXKhXT4tgAyC+dxyXFBZgMbO8pJhTe8ySqP7OE8PFJYXm9Bac6KgMU8/rEbM8vfD1ncildw7+b DGUHAffQfhPwD6g== X-Received: by 2002:a05:6808:1986:b0:350:8c87:c5a2 with SMTP id bj6-20020a056808198600b003508c87c5a2mr2402492oib.57.1664481231280; Thu, 29 Sep 2022 12:53:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5GJpXBbON9+M6GDIY1oiJIRyiFkbYbyYe4ozEOb/y8QqprdZ1ADdzlqDhk2/XUCc2Nu2W/BA== X-Received: by 2002:a05:6808:1986:b0:350:8c87:c5a2 with SMTP id bj6-20020a056808198600b003508c87c5a2mr2402483oib.57.1664481231036; Thu, 29 Sep 2022 12:53:51 -0700 (PDT) Return-Path: Received: from fedora.redhat.com (modemcable149.19-202-24.mc.videotron.ca. [24.202.19.149]) by smtp.gmail.com with ESMTPSA id 110-20020a9d0ef7000000b00654625c0c4dsm139529otj.17.2022.09.29.12.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 12:53:50 -0700 (PDT) From: "Adrien Thierry" To: Ard Biesheuvel , Leif Lindholm , Jeremy Linton , devel@edk2.groups.io Cc: Adrien Thierry Subject: [edk2-platforms PATCH 1/2] Platform/RaspberryPi: fix pci DT node address in SyncPcie() Date: Thu, 29 Sep 2022 15:53:34 -0400 Message-Id: <20220929195335.61495-2-athierry@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220929195335.61495-1-athierry@redhat.com> References: <20220929195335.61495-1-athierry@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true To make sure the XHCI controller does not get reset by Linux in DT mode, we remove its pci parent node from the device tree. However, the pci node address has been updated in the Raspberry Pi 4 device tree [1] and no longer matches the one we are trying to remove in SyncPcie(). This results in the XHCI controller actually being reset by Linux, which leads to errors during USB initialization: [ 3.563963] xhci_hcd 0000:01:00.0: xHCI Host Controller [ 3.569538] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1 [ 3.577452] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0000040000000890 [ 3.587725] xhci_hcd 0000:01:00.0: xHCI Host Controller [ 3.593115] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2 [ 3.600693] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed [ 3.608106] hub 1-0:1.0: USB hub found [ 3.612026] hub 1-0:1.0: 1 port detected [ 3.616819] hub 2-0:1.0: USB hub found [ 3.620726] hub 2-0:1.0: 4 ports detected [ 3.875902] usb 1-1: new high-speed USB device number 2 using xhci_hcd [ 4.008123] usb 1-1: device descriptor read/64, error -71 [ 4.256088] usb 1-1: device descriptor read/64, error -71 [ 4.495882] usb 1-1: new high-speed USB device number 3 using xhci_hcd [ 4.628111] usb 1-1: device descriptor read/64, error -71 [ 4.872083] usb 1-1: device descriptor read/64, error -71 [ 5.407888] usb 1-1: new high-speed USB device number 4 using xhci_hcd [ 6.023964] xhci_hcd 0000:01:00.0: Setup ERROR: setup address command for slot 1. [ 6.239977] xhci_hcd 0000:01:00.0: Setup ERROR: setup address command for slot 1. This patch updates the pci node address (and usb node address in the error messages) to match those found in the RPi4 device tree. [1] https://lore.kernel.org/all/20210831125843.1233488-1-nsaenzju@redhat.com/ Fixes: efff29cdcdb7 ("Platform/RaspberryPi: Always use non translating DMA in DT mode") Signed-off-by: Adrien Thierry --- Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c index e72d132b18..55c9d185fc 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c @@ -388,14 +388,14 @@ SyncPcie ( * triggering the mailbox by removing the node. */ - Node = fdt_path_offset (mFdtImage, "/scb/pcie@7d500000/pci@1,0"); + Node = fdt_path_offset (mFdtImage, "/scb/pcie@7d500000/pci@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@1/usb@1\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: failed to locate /scb/pcie@7d500000/pci@0/usb@0\n", __FUNCTION__)); } else { Retval = fdt_del_node (mFdtImage, Node); if (Retval != 0) { - DEBUG ((DEBUG_ERROR, "Failed to remove /scb/pcie@7d500000/pci@1/usb@1\n")); + DEBUG ((DEBUG_ERROR, "Failed to remove /scb/pcie@7d500000/pci@0/usb@0\n")); return EFI_NOT_FOUND; } } -- 2.37.3