From nobody Fri Oct 18 09:16:15 2024 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+113965+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+113965+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1705527381; cv=none; d=zohomail.com; s=zohoarc; b=kIGZlJ6jc2jt/9+XYzIKBTOLRwnT/qp8iU3gg7iEKiLMByzMaw++aQT3qy9mspzF6cGv+sXQ7UsJqttildDv0QxznfsODbR486W+tUtGSj1ZLnVaT+bZctqTYgvf6WRJ3zdyyeDVGwn+0PQkuXHmUPFD4cLA7gltz6KivnG1IMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705527381; 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=E6PeaTOq8t+006qCtTpwI6N0i1JJ1PDvm1fS66Fa9WQ=; b=RttBTOJm18RODpreEMwjPoJ29Lif+98J82nL+zFgrakBHTiHq1zIlJBACbuvwUBynx2Z8dhwsUoMozVftErQSiwtz1xqXGNXzNWw2SSDChRZu755CY6htsXU/IUGDz+AdtA1tET1XowisT4jsQVmffb0cT+FJ2RjnbCVJJcMWF0= 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+113965+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 1705527381575779.722223119716; Wed, 17 Jan 2024 13:36:21 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=nnJYoXV9e86RDEasVEPFlr1OfzA8NVhsvKMHQbzniQE=; 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=1705527381; v=1; b=O13Djy4abOxGc5vYYi93CuawOku9YamT/40BtUWoJ0KaroIIxDk1Z8vhXzA/uILdX12Mn8En 5Dv27X8nUPazzOwIa/LT+z1QjkJ2GfyiGHfy4NCtcw/UK75WvhpAwGxelPd7+Nm5/+YEmIOZeoD eic/Dd/4T4UdZE61kngZ/Y+A= X-Received: by 127.0.0.2 with SMTP id LVRQYY1788612x4ksnu56E3y; Wed, 17 Jan 2024 13:36:21 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.629.1705527379189720949 for ; Wed, 17 Jan 2024 13:36:19 -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 5E1ED165C; Wed, 17 Jan 2024 13:37:05 -0800 (PST) X-Received: from u200865.usa.arm.com (unknown [10.119.39.253]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 289653F73F; Wed, 17 Jan 2024 13:36:19 -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 v2 5/5] Platform/RaspberryPi: Update PCIe MMIO window for DT Date: Wed, 17 Jan 2024 15:36:14 -0600 Message-ID: <20240117213614.4188518-6-jeremy.linton@arm.com> In-Reply-To: <20240117213614.4188518-1-jeremy.linton@arm.com> References: <20240117213614.4188518-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: bnVmnE2LSMcu7lV5vewBVtBsx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1705527382608100014 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 | 22 +++++++++++++++++++ .../RaspberryPi/Drivers/FdtDxe/FdtDxe.inf | 6 +++++ 2 files changed, 28 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c b/Platform/Raspbe= rryPi/Drivers/FdtDxe/FdtDxe.c index dd4fc0a05e..a247aa36ed 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c @@ -375,6 +375,28 @@ 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 (FixedPcdGet64 (PcdBcm27xxPciBusMmioAdr) >= > 32); //bus addr @ 0x0f8000000 + DmaRanges[2] =3D cpu_to_fdt32 (FixedPcdGet64 (PcdBcm27xxPciBusMmioAdr) &= MAX_UINT32); + DmaRanges[3] =3D cpu_to_fdt32 (FixedPcdGet64 (PcdBcm27xxPciCpuMmioAdr) >= > 32); //cpu addr @ 0x600000000 + DmaRanges[4] =3D cpu_to_fdt32 (FixedPcdGet64 (PcdBcm27xxPciCpuMmioAdr) &= MAX_UINT32); + DmaRanges[5] =3D cpu_to_fdt32 (0x00000000); + DmaRanges[6] =3D cpu_to_fdt32 (FixedPcdGet32 (PcdBcm27xxPciBusMmioLen) += 1); // len =3D 0x4000 0000 + + DEBUG ((DEBUG_INFO, "%a: Updating PCIe ranges\n", __func__)); + + /* + * Match ranges (BAR/MMIO) with the EDK2+ACPI setup we are using. + */ + 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; } diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf b/Platform/Rasp= berryPi/Drivers/FdtDxe/FdtDxe.inf index d9fb6ee480..90e138af7c 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf @@ -23,6 +23,7 @@ MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec Platform/RaspberryPi/RaspberryPi.dec + Silicon/Broadcom/Bcm27xx/Bcm27xx.dec =20 [LibraryClasses] BaseLib @@ -44,6 +45,11 @@ =20 [FixedPcd] gRaspberryPiTokenSpaceGuid.PcdFdtBaseAddress + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciRegBase + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioAdr + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciBusMmioLen + gBcm27xxTokenSpaceGuid.PcdBcm27xxPciCpuMmioAdr + =20 [Pcd] gRaspberryPiTokenSpaceGuid.PcdSystemTableMode --=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 (#113965): https://edk2.groups.io/g/devel/message/113965 Mute This Topic: https://groups.io/mt/103796311/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-