From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 4851778003C for ; Wed, 10 Jan 2024 23:52:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7hKJDQlOOEvNBFNjZtzk0NuztWzccZ4abfcBwWdjbN4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1704930765; v=1; b=FglGUxbnKO8bobGEBij8M8rS4H8umqPjS04vzKzXOGQPIZij8nsTr0bmeIObYiC/dZiM5wxZ +9TKYeK7X6fnHzTSbqewHey5Jbyl213Czi2vZdRTEr4ocMjORTm8kP+OXNeH2A7SaxqVxc5VL8E uYOsbRz5EbmA4TsWl6KXPXQM= X-Received: by 127.0.0.2 with SMTP id XpshYY7687511xvtBtgpKBiB; Wed, 10 Jan 2024 15:52:45 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.9163.1704930763233679741 for ; Wed, 10 Jan 2024 15:52:43 -0800 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 D413DDA7; Wed, 10 Jan 2024 15:53:28 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C01DD3F5A1; Wed, 10 Jan 2024 15:52:42 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, Jeremy Linton Subject: [edk2-devel] [PATCH 5/5] Platform/RaspberryPi: Update PCIe MMIO window for DT Date: Wed, 10 Jan 2024 17:52:27 -0600 Message-ID: <20240110235227.2734271-6-jeremy.linton@arm.com> In-Reply-To: <20240110235227.2734271-1-jeremy.linton@arm.com> References: <20240110235227.2734271-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: 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,jeremy.linton@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4VjpFBlIZbjskLl49L6d8cvxx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=FglGUxbn; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Since we are updating the DT memory map and telling it how we have configured the PCIe, there isn't a reason for moving the MMIO window. In fact this appears to fix OpenBSD+DT as well as it makes the linux XHCI reset sequence happier. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c index dd4fc0a05e..e6942df6a3 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c @@ -375,6 +375,30 @@ SyncPcie ( return EFI_NOT_FOUND; } + // move the MMIO window too + DmaRanges[0] = cpu_to_fdt32 (0x02000000); //non prefech 32-bit + DmaRanges[1] = cpu_to_fdt32 (0x00000000); //bus addr @ 0x0f8000000 + DmaRanges[2] = cpu_to_fdt32 (0xf8000000); + DmaRanges[3] = cpu_to_fdt32 (0x00000006); //cpu addr @ 0x600000000 + DmaRanges[4] = cpu_to_fdt32 (0x00000000); + DmaRanges[5] = cpu_to_fdt32 (0x00000000); + DmaRanges[6] = cpu_to_fdt32 (0x04000000); // len = 0x4000 0000 + + DEBUG ((DEBUG_INFO, "%a: Updating PCIe ranges\n", __func__)); + + /* + * Match dma-ranges with the EDK2+ACPI setup we are using. This works + * around a failure in Linux and OpenBSD to reset the PCIe/XHCI correctly + * when in DT mode. + */ + Retval = fdt_setprop (mFdtImage, Node, "ranges", + DmaRanges, sizeof DmaRanges); + if (Retval != 0) { + DEBUG ((DEBUG_ERROR, "%a: failed to locate PCIe MMIO 'ranges' property (%d)\n", + __func__, Retval)); + return EFI_NOT_FOUND; + } + if (PcdGet32 (PcdXhciReload) != 1) { return EFI_SUCCESS; } -- 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113548): https://edk2.groups.io/g/devel/message/113548 Mute This Topic: https://groups.io/mt/103652857/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-