From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.2410.1664827934484633195 for ; Mon, 03 Oct 2022 13:12:14 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jeremy.linton@arm.com) 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 C1BDB1515; Mon, 3 Oct 2022 13:12:20 -0700 (PDT) Received: from [192.168.122.164] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6EFB3F73B; Mon, 3 Oct 2022 13:12:13 -0700 (PDT) Message-ID: <8594b186-d1b6-052c-7bcc-6e0d81ddc313@arm.com> Date: Mon, 3 Oct 2022 15:12:13 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [edk2-platforms PATCH 0/2] Platform/RaspberryPi: SyncPcie() fixes To: Adrien Thierry Cc: Ard Biesheuvel , Leif Lindholm , devel@edk2.groups.io References: <20220929195335.61495-1-athierry@redhat.com> From: "Jeremy Linton" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 9/30/22 13:47, Adrien Thierry wrote: > Hi Jeremy, > >> If you just add the range tweak, does that fix the XHCI config in your setup >> too? > > I tested applying the range tweak in your patch, unfortunately it doesn't > seem to work on my setup. I'm still getting "usb 1-1: device descriptor > read/64, error -71" errors. That is unfortunate. Which revision/how much RAM? Can you paste the before/after kernel/pci output like: ] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges: ] brcm-pcie fd500000.pcie: No bus range found for /scb/pcie@7d500000, using [bus 00-ff] ] brcm-pcie fd500000.pcie: MEM 0x0600000000..0x0603ffffff -> 0x00f8000000 ] brcm-pcie fd500000.pcie: IB MEM 0x0000000000..0x00bfffffff -> 0x0000000000 ] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00 ] pci_bus 0000:00: root bus resource [bus 00-ff] ] pci_bus 0000:00: root bus resource [mem 0x600000000-0x603ffffff] (bus address [0xf8000000-0xfbffffff]) I tested it on a C0 with 8G and a B0 with 4G, and it seems to work on both, although the C0 might have been misbehaving a bit (likely unrelated). In both cases I swapped in the latest Pi foundation DT (https://github.com/raspberrypi/firmware/blob/master/boot/bcm2711-rpi-4-b.dtb) which uses the address you suggest, and it still seems to work either way (with or without the reset). If we reroll the PFTF firmware it is usually with the latest pi foundation DTs. So the first patch makes sense, but I think it should probably be checking both DT property names (pci0,0 and pci1,0) since we probably want maximum compatibility with differing DT's the user might swap in, and the upstream linux change which changes the node from 1,0 to 0,0 is from august of last year, so not old at all.. The second one, I'm less sure about, since the primary thing your changing (AFAIK) is whether the XHCI BIOS handoff is being checked, and since EDK2 supports the hand-off and Linux doesn't throw the XHCI bios failure message I think we actually want to leave that in place. If you have debugging turned on, the XHCI/LegacyBios ownership control is the message you see during exit boot services that says "XhciClearBiosOwnership: called to clear BIOS ownership". I suspect the kernel patch is yet another case of "UBOOT and/or the pi foundation firmware is broken so we fixed the kernel" Do you see a difference with/without the second patch? > > Here's my SyncPcie function with the range tweak applied [1] > > I'm running upstream linux 6.0-rc6 with the downstream device tree > provided in [2] > > Thank you, > Adrien > > [1] http://pastebin.test.redhat.com/1075875 > [2] https://github.com/pftf/RPi4/releases/tag/v1.33 >