From nobody Sun Nov 22 14:05:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+113548+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113548+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704930764; cv=none; d=zohomail.com; s=zohoarc; b=SJ7R1c0cH+R8bSnxjdTFTllHVhgOgwd8OEWiMUarKRNKC0M6UDmEzGFE9jC6h9N0qkAFt85b8OiN+4GQYD9HLmqL34oOxgzzb0/QyV7+0R5J0PLHFlRJLUqyrOMwVOCV1tBcaiFPcL4PbD/Mgk68u+12R/aaSihOZoC1uUBmLso= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704930764; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=hsXNvzoqbKQdOIQHhXJqnutxPpWkBKi8X7aD+oRO7S8=; b=Ch2MQdzTgzdSBjt4033ICLO4LTOb4Jie7QMaSM3094/yQ5omi8B0TUa/9jFubXKRFI8os+vxtzOtsavk2RZ7/VN9zWljfvNmKSe5ERAT4vQXIKu+dm/pzTpZgD9cRmO9YNeUpaLWQUK8i34E6ea2anmkn9C22ujKEwA03QoMSyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+113548+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1704930764052310.85873480715657; Wed, 10 Jan 2024 15:52:44 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=N2W2cF944tfscWDOw+hWN7CRNhUn1IU2KGZ8vHwJ5KE=; 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=1704930763; v=1; b=GE7MuIVoICQvy5J09oWEykl78mrcn2Bf3quaKp+JQDGLIW2e0/eKCZn77DCJ6Qygwpr8xyzL VpC20q+Q+yEr5PwjHyD/dk6hJsQstAutSgJ+wXoCw0izJE9+dh16gJ1ht1mIj2qBncqhvy6ZlOY 8mrAgaIQU6+VYj5DMGlK784U= X-Received: by 127.0.0.2 with SMTP id v1qqYY1788612xt84baUkj0R; Wed, 10 Jan 2024 15:52:43 -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: eEGqpAUjdn1fPITXJ3tBmcqXx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704930765562100019 Content-Type: text/plain; charset="utf-8" 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/Raspbe= rryPi/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; } =20 + // move the MMIO window too + DmaRanges[0] =3D cpu_to_fdt32 (0x02000000); //non prefech 32-bit + DmaRanges[1] =3D cpu_to_fdt32 (0x00000000); //bus addr @ 0x0f8000000 + DmaRanges[2] =3D cpu_to_fdt32 (0xf8000000); + DmaRanges[3] =3D cpu_to_fdt32 (0x00000006); //cpu addr @ 0x600000000 + DmaRanges[4] =3D cpu_to_fdt32 (0x00000000); + DmaRanges[5] =3D cpu_to_fdt32 (0x00000000); + DmaRanges[6] =3D cpu_to_fdt32 (0x04000000); // len =3D 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 =3D fdt_setprop (mFdtImage, Node, "ranges", + DmaRanges, sizeof DmaRanges); + if (Retval !=3D 0) { + DEBUG ((DEBUG_ERROR, "%a: failed to locate PCIe MMIO 'ranges' property= (%d)\n", + __func__, Retval)); + return EFI_NOT_FOUND; + } + if (PcdGet32 (PcdXhciReload) !=3D 1) { return EFI_SUCCESS; } --=20 2.43.0 -=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 (#113548): https://edk2.groups.io/g/devel/message/113548 Mute This Topic: https://groups.io/mt/103652857/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-