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 6E2A4941465 for ; Thu, 11 Jan 2024 07:49:37 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=wbZe3RsPEI2WvKNS1pzt6JRPki2h+3PJq8fOsFs+7+s=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1704959375; v=1; b=EiDrufVKBZ95+xPmOsO/sShxlxXK7+pEGiz9itOBL5Euox4Ls2yb6NtNjYt0kPVVwZejW6dR oEbmP4fkihVsMSbmRsDi6MU5dQNJJvJqTihBPjULoBvSs0hMAOhg55YDD0wFs//CVIBVEnTKe0O Y7DCwVk4xRPJPa7hAs/4fac0= X-Received: by 127.0.0.2 with SMTP id pCVFYY7687511x8NmKll2Xrm; Wed, 10 Jan 2024 23:49:35 -0800 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.6907.1704959375314520561 for ; Wed, 10 Jan 2024 23:49:35 -0800 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D2AD060EBC for ; Thu, 11 Jan 2024 07:49:34 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B8B5C43399 for ; Thu, 11 Jan 2024 07:49:34 +0000 (UTC) X-Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-50ed808db11so1888019e87.2 for ; Wed, 10 Jan 2024 23:49:34 -0800 (PST) X-Gm-Message-State: uzAHzMprn4JwuLRHXmnxYl26x7686176AA= X-Google-Smtp-Source: AGHT+IHtSsiff3SabQl7FZJ7yCp6PYkC8nXAV+7qQV9MUYZU8QmFrW40HMzM8M1b7Pvcjacw3c7Smd1Vh8eXcYAGRWI= X-Received: by 2002:ac2:495a:0:b0:50e:b1b1:430c with SMTP id o26-20020ac2495a000000b0050eb1b1430cmr273088lfi.116.1704959372680; Wed, 10 Jan 2024 23:49:32 -0800 (PST) MIME-Version: 1.0 References: <20240110235227.2734271-1-jeremy.linton@arm.com> <20240110235227.2734271-6-jeremy.linton@arm.com> In-Reply-To: <20240110235227.2734271-6-jeremy.linton@arm.com> From: "Ard Biesheuvel" Date: Thu, 11 Jan 2024 08:49:21 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH 5/5] Platform/RaspberryPi: Update PCIe MMIO window for DT To: Jeremy Linton Cc: devel@edk2.groups.io, ardb+tianocore@kernel.org, quic_llindhol@quicinc.com 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,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=EiDrufVK; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (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 On Thu, 11 Jan 2024 at 00:52, Jeremy Linton wrote: > > 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 > + Is there any way we can use symbolic constants here? > + 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. > + */ Please sync the comment with the code. > + 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 (#113591): https://edk2.groups.io/g/devel/message/113591 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] -=-=-=-=-=-=-=-=-=-=-=-