From nobody Fri May 17 05:54:37 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+113544+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+113544+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704930761; cv=none; d=zohomail.com; s=zohoarc; b=M4MteU8DTO2+3wOn2g32WHfu7j/+8PtnGsYTRJi48B8CfzEKhNHpNeCWsk7JWBFyHtT9manxhkcBJz2Uj1jAzyOkMXUmpeWfdaVEM00F75vdmujUEtGvwE/rMy6hk4ErU7hu4Kl4HSFcD+XoiScbYbEb9o6Lh7C6+C2f3reT2jI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704930761; 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=koM4Dw6bxj7JdtzeFW9E8AKWbjPlqcWhzE17vrbPRZo=; b=grbaqLJ0UJOJI+Gesk62LjvDrYai9o/iHitfmJhzJWwXqywevWmp7SmXViddPLFTWvI7/zz3/fPzsJKodxfi2X0BHCGLq8TSR2Q2XRKEHHAK0kKNhBqxvNr3cv9DWvoZHGjdVu/2kkZql7gWEo625Durp4noHpPWeSTsOumTnIU= 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+113544+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 1704930761345930.7360501823471; Wed, 10 Jan 2024 15:52:41 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=0FUtVC7JWLz0CukF90vWFDQ1jhxzQgE8+oRwzE/2FDw=; 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=1704930761; v=1; b=Cf8UdAknaPlIPSTvC60oFciZVsGyRDo7O+nEw3Hu+HW34JquIzVmTc1OYx2CcBnZedNSgJ92 /nJzT7xoC7zRHV/uRCh8sJwk8rEhPmq/lAXbTiQuVcqo5Ia0NJa80r1KzFIL/Tvsw05Kc3ITwRZ sT9iJ/M0lYaszh6c2SqN+vCg= X-Received: by 127.0.0.2 with SMTP id S4o3YY1788612xDyiK7hwtp2; Wed, 10 Jan 2024 15:52:41 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9110.1704930760015913596 for ; Wed, 10 Jan 2024 15:52:40 -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 80FA0DA7; Wed, 10 Jan 2024 15:53:25 -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 6CE983F5A1; Wed, 10 Jan 2024 15:52:39 -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 1/5] Platform/RaspberryPi/DualSerialPortLib: Always configure the pl011 Date: Wed, 10 Jan 2024 17:52:23 -0600 Message-ID: <20240110235227.2734271-2-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: OcXlslBWd4NywPMkBvUmjXfMx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704930763419100007 Content-Type: text/plain; charset="utf-8" The rpi's config.txt controls which uart (pl011, or miniuart) is selected as the console. TFA and edk2 follow its lead, but if the miniuart is selected as the primary and the machine is booted in ACPI mode the baud/etc is never configured for the pl011. The linux kernel won't reconfigure it either as its listed as a "SBSA" uart, so it simply won't work. This re-enables BT on the pl011 in ACPI mode, and it somewhat starts to work again. Signed-off-by: Jeremy Linton --- .../DualSerialPortLib/DualSerialPortLib.c | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortL= ib.c b/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c index d2f983bf0a..79545d93d6 100644 --- a/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c +++ b/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c @@ -76,6 +76,8 @@ SerialPortInitialize ( EFI_PARITY_TYPE Parity; UINT8 DataBits; EFI_STOP_BITS_TYPE StopBits; + RETURN_STATUS Ret; + UINTN Timeout; =20 // // First thing we need to do is determine which of PL011 or miniUART is = selected @@ -85,23 +87,27 @@ SerialPortInitialize ( UsePl011UartSet =3D TRUE; } =20 - if (UsePl011Uart) { - BaudRate =3D FixedPcdGet64 (PcdUartDefaultBaudRate); + // always init the pl011 on the pi4, linux expects a SBSA uart to be at = 115200 + // this means we need to set the baud/etc even if we arn't using it as a= console + if ((UsePl011Uart) || (RPI_MODEL =3D 4)) { ReceiveFifoDepth =3D 0; // Use default FIFO depth + BaudRate =3D FixedPcdGet64 (PcdUartDefaultBaudRate); Parity =3D (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity); DataBits =3D FixedPcdGet8 (PcdUartDefaultDataBits); StopBits =3D (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits= ); =20 - return PL011UartInitializePort ( - PL011_UART_REGISTER_BASE, - PL011UartClockGetFreq(), - &BaudRate, - &ReceiveFifoDepth, - &Parity, - &DataBits, - &StopBits - ); - } else { + Ret =3D PL011UartInitializePort ( + PL011_UART_REGISTER_BASE, + PL011UartClockGetFreq(), + &BaudRate, + &ReceiveFifoDepth, + &Parity, + &DataBits, + &StopBits + ); + } + + if (!UsePl011Uart) { SerialRegisterBase =3D MINI_UART_REGISTER_BASE; Divisor =3D SerialPortGetDivisor (PcdGet32 (PcdSerialBaudRate)); =20 @@ -127,7 +133,8 @@ SerialPortInitialize ( // Wait for the serial port to be ready. // Verify that both the transmit FIFO and the shift register are empty. // - while ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & (B_U= ART_LSR_TEMT | B_UART_LSR_TXRDY)) !=3D (B_UART_LSR_TEMT | B_UART_LSR_TXRDY)= ); + Timeout =3D 1000; + while (((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & (B_= UART_LSR_TEMT | B_UART_LSR_TXRDY)) !=3D (B_UART_LSR_TEMT | B_UART_LSR_TXRDY= )) && (Timeout--)); =20 // // Configure baud rate @@ -158,9 +165,9 @@ SerialPortInitialize ( // Put Modem Control Register(MCR) into its reset state of 0x00. // SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, 0x00); - - return RETURN_SUCCESS; + Ret =3D RETURN_SUCCESS; } + return Ret; } =20 /** --=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 (#113544): https://edk2.groups.io/g/devel/message/113544 Mute This Topic: https://groups.io/mt/103652853/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- From nobody Fri May 17 05:54:37 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+113545+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+113545+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704930761; cv=none; d=zohomail.com; s=zohoarc; b=IM3aOAoJGzu+fJ4SjnJjQ3ufAuOj9V0cl7vIAg5BrrSn44X0tyLNUm3b+8WpdVICESD7pw/ssIqHvGpfnrAkcJjZxWEcD41f8gB/SKkTdu6q7M6x1hFvl7Neby/Oi9flZ8prcgjcBsq6Tig1P+3JLBYFBbLKyaoAZlukZpFyh4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704930761; 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=WcC4xECMePIs2w7Uf+9S4FA5wju/iG9lrTeCWUNe1Vw=; b=FPSQtMPkHjWQOczt2/Rb1OdIILh6tL0+UCZGnx1CWrqFWTwMe6hvIikYHxB0yaMI5daEpLvY0uayAmM/BKW+5ZVtJt8Crq5l+nlvlC7ocg5rC0USYndjYE7+1TcGrdW2YLWZw+8ncppcLc+TsMLJwjhP4h5ZnIYymo/gIVEMYmU= 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+113545+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 1704930761833143.44065833256604; Wed, 10 Jan 2024 15:52:41 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=gcFqGGlOyroBFUBtjrUZiNMamuL4z58+7ZR0ydUsnww=; 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=1704930761; v=1; b=Hodj1kx6h/LdGhhF5g/1rQI+0Rqxn0ozcReyTYlEcAHcPIFAlQBtuglpE0naQjRWGkMcYI6L ZNtiP4Wd9Q+9OE0VHAKFFRpbzxnY0MYuV0ELPMyiSi8EvKggPkYzPj2RShcuw487SRoihHWYHsE VbSyT7ecOcfUa9v/Fl3r1Pl8= X-Received: by 127.0.0.2 with SMTP id vxTdYY1788612xuy1mmyghM4; Wed, 10 Jan 2024 15:52:41 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.9112.1704930760938820271 for ; Wed, 10 Jan 2024 15:52:41 -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 51893106F; Wed, 10 Jan 2024 15:53:26 -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 3E9DD3F5A1; Wed, 10 Jan 2024 15:52:40 -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 2/5] Silicon/Broadcom/BcmGenetDxe: Suppress some bogus compiler warnings Date: Wed, 10 Jan 2024 17:52:24 -0600 Message-ID: <20240110235227.2734271-3-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: fYGEXqrBVXqWFk3KZhFXuUfhx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704930763398100005 Content-Type: text/plain; charset="utf-8" Some recent GCC revisions will throw warnings about values being used before being initialized. But in the case where the lack of initialization is the result of the called function returning error status the EFI_ERROR() macro/error seems to confuse the compiler about the fact that the value is then never used. So, while the code appears to be fine, lets just zero the variables anyway to make the compiler happy. Signed-off-by: Jeremy Linton --- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c | 2 ++ Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c b/Silico= n/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c index 9e5d30fafd..2d5f70170e 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenericPhy.c @@ -381,6 +381,8 @@ GenericPhyUpdateConfig ( BOOLEAN LinkUp; =20 Status =3D GenericPhyGetLinkStatus (Phy); + Speed =3D 0; + Duplex =3D 0; LinkUp =3D EFI_ERROR (Status) ? FALSE : TRUE; =20 if (Phy->LinkUp !=3D LinkUp) { diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c b/Sil= icon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c index 3b51a86d65..7a7c398b1f 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c @@ -731,6 +731,9 @@ GenetSimpleNetworkReceive ( UINT8 *Frame; UINTN FrameLength; =20 + DescIndex =3D 0; + FrameLength =3D 0; + if (This =3D NULL || Buffer =3D NULL) { DEBUG ((DEBUG_ERROR, "%a: Invalid parameter (missing handle or buffer)= \n", __FUNCTION__)); --=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 (#113545): https://edk2.groups.io/g/devel/message/113545 Mute This Topic: https://groups.io/mt/103652854/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- From nobody Fri May 17 05:54:37 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+113546+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+113546+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704930762; cv=none; d=zohomail.com; s=zohoarc; b=Aco97H9+9w50KBe17FoT39CNWFq+psQdS9OpIKMI1yiU8Jcq5bqUE5u1J5vW+t7GfUVkoYU+f4xFxLLyReLFN67DjfDhFU0ruEYwlv3rdLWQycD+y7p1vzv6gLbNRALIH8LUmYeunYZycjkeqcMn1+wtYU7pzXIGc/I1KA9TkdI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704930762; 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=JDuoukAg0ixTdC2ytL+aL4KGbHRmcYjaXepI0JqLpRA=; b=IAeavTPuefuDvXnzKWxZ3Xi+Vfdx+SWBfhTo+MDzihMR/Sg9eP8y/4LS+afmVtYYk6KmZMMu6VD6c+MLuHvEU7dvkHT6Tg0KoHWvgifUTaOblIa6FEiYCi5DA2/teCMrgbtgqAiRbbUKP97Bvozrryf/lAj69bFoPmBYo7Mxv+s= 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+113546+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 1704930762376962.1648757986136; Wed, 10 Jan 2024 15:52:42 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=0AImXigPN8vazeEWP0Sq33i0mvOyr5kZfqgN/TnpzJE=; 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=1704930762; v=1; b=JAFmAUlAieLITiAcEhXGvBbDqn9cCi5U1NhAkF138PW85YrAYSBGP7O9x88FErmut161SpqI xY6hfsxUNS5azt7nDjrPyuLB4kIo/6SnuQhi3Nr+PWLYX0+64QKFL61icicoei4GdcwcFRI/IKK xXMzq7Y0Yrd31L1Fvrs9gIA0= X-Received: by 127.0.0.2 with SMTP id VrePYY1788612xhXEd3uOKEY; Wed, 10 Jan 2024 15:52:42 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.9162.1704930761535897291 for ; Wed, 10 Jan 2024 15:52:41 -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 28CDB12FC; Wed, 10 Jan 2024 15:53:27 -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 1301E3F5A1; Wed, 10 Jan 2024 15:52:41 -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 3/5] Platform/RaspberryPi: Cleanup menu visibility Date: Wed, 10 Jan 2024 17:52:25 -0600 Message-ID: <20240110235227.2734271-4-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: Ko0iCM0vqYeh8UnRwMiFbU7lx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704930763417100006 Content-Type: text/plain; charset="utf-8" Lets allow some of these options to change when the system is in ACPI+DT mode. Plus the fan temp should be disabled when ACPI isn't enabled. Signed-off-by: Jeremy Linton --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index e8bf16312d..f668b7a553 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -196,7 +196,7 @@ formset endoneof; =20 #if (RPI_MODEL =3D 4) - grayoutif NOT ideqval SystemTableMode.Mode =3D SYSTEM_TABLE_MODE_A= CPI; + grayoutif ideqval SystemTableMode.Mode =3D SYSTEM_TABLE_MODE_DT; oneof varid =3D FanOnGpio.Enabled, prompt =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_PROMPT), help =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_HELP), @@ -207,7 +207,7 @@ formset endoneof; endif; =20 - grayoutif ideqval FanOnGpio.Enabled =3D 0; + grayoutif ideqval FanOnGpio.Enabled =3D 0 OR ideqval SystemTableMo= de.Mode =3D SYSTEM_TABLE_MODE_DT; numeric varid =3D FanTemp.Value, prompt =3D STRING_TOKEN(STR_ADVANCED_FANTEMP_PROMPT), help =3D STRING_TOKEN(STR_ADVANCED_FANTEMP_HELP), @@ -219,7 +219,7 @@ formset endif; =20 suppressif ideqval XhciPci.Value =3D 2; - grayoutif NOT ideqval SystemTableMode.Mode =3D SYSTEM_TABLE_MODE= _ACPI; + grayoutif ideqval SystemTableMode.Mode =3D SYSTEM_TABLE_MODE_DT; oneof varid =3D XhciPci.Value, prompt =3D STRING_TOKEN(STR_ADVANCED_XHCIPCI_PROMPT), help =3D STRING_TOKEN(STR_ADVANCED_XHCIPCI_HELP), --=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 (#113546): https://edk2.groups.io/g/devel/message/113546 Mute This Topic: https://groups.io/mt/103652855/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- From nobody Fri May 17 05:54:37 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+113547+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+113547+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1704930763; cv=none; d=zohomail.com; s=zohoarc; b=TYL8WOILoDtJ3Hh3iaFbE8zZUeufn98Uos2aaeAXyV0c4w6lnuchkonW0laInqKeqd+e8ic9RNFhlW5zqXJbCFHaRemoVP2Uv5X2EjYq5RDlHITNz+CkG6RAigM4FxVSr5dIC3sdyzD8QK4kRUrXMBcytAdETWCvjcx1T/HRlEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704930763; 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=ls9le4AocxKqd3+LLWQren6xolTb3kn0NDe1S5d0vKM=; b=Iw072dS27RbGkNHCoVsVezFnQN4QTkx7+W2yXo2Lo8fYu+6ESzd2QxlItbem8W6luCTwXkudUdPm24g/ZLm/4wB2I34sXNNF1GWdDP8hmmzm4ewta879A8UbgzZdz3UddqxP9PyEgFxvF6lEQGq/vW9DYNxPsymy+QeYageqEmU= 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+113547+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 1704930763388344.6878975283913; Wed, 10 Jan 2024 15:52:43 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=j5J31P2v/ERLGzSGYxiISSsmyCHp5S06MxrwIvR9cy4=; 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=Uf1I8jWUddywreFRYodMRWt6Z7c8EAr4x3uRohpcKbZRhrANdYsl2kxboQ51VZxO5HUGCnH1 PJ8UfeEcOMkI0iriluEyufwkQoot0Rl5S+vuDrZJpjwv3zcwujgGDthLv4uwbbLuOSzibqaSt4X sNKqDzuhjhB4I4+Op0/WLPZQ= X-Received: by 127.0.0.2 with SMTP id 4jRGYY1788612x0E5U2CR4bm; 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.web11.9113.1704930762429128782 for ; Wed, 10 Jan 2024 15:52:42 -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 0BACF1424; 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 E5B673F5A1; Wed, 10 Jan 2024 15:52:41 -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 4/5] Platform/RaspberryPi: Give the user control over the XHCI mailbox Date: Wed, 10 Jan 2024 17:52:26 -0600 Message-ID: <20240110235227.2734271-5-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: lra3Dub0w3ikbILNYU0PcRgRx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1704930765602100020 Content-Type: text/plain; charset="utf-8" Its a complete tossup whether removing the mailbox call after we have set up the XHCI works for a given kernel+distro in DT mode. So lets give users which want to try DT the option of flipping this on/off. Users that don't want to have to deal with DT, can use ACPI. Signed-off-by: Jeremy Linton --- .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 10 ++++++++++ .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 1 + .../Drivers/ConfigDxe/ConfigDxeHii.uni | 5 +++++ .../Drivers/ConfigDxe/ConfigDxeHii.vfr | 15 +++++++++++++++ Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c | 4 ++++ Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf | 1 + Platform/RaspberryPi/RPi3/RPi3.dsc | 6 ++++++ Platform/RaspberryPi/RPi4/RPi4.dsc | 7 +++++++ Platform/RaspberryPi/RaspberryPi.dec | 1 + 9 files changed, 50 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 3dcf2bac0d..2484787982 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -298,6 +298,16 @@ SetupVariables ( Status =3D PcdSet32S (PcdXhciPci, 1); ASSERT_EFI_ERROR (Status); } + + Size =3D sizeof (UINT32); + Status =3D gRT->GetVariable (L"XhciReload", + &gConfigDxeFormSetGuid, + NULL, &Size, &Var32); + if (EFI_ERROR (Status)) { + Status =3D PcdSet32S (PcdXhciReload, PcdGet32 (PcdXhciReload)); + ASSERT_EFI_ERROR (Status); + } + } } else { /* diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index 6f6e8f42ac..475e645537 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -96,6 +96,7 @@ gRaspberryPiTokenSpaceGuid.PcdUartInUse gRaspberryPiTokenSpaceGuid.PcdXhciPci gRaspberryPiTokenSpaceGuid.PcdMiniUartClockRate + gRaspberryPiTokenSpaceGuid.PcdXhciReload =20 [Depex] gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index 5ec17072c3..8130638876 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -62,6 +62,11 @@ #string STR_ADVANCED_XHCIPCI_XHCI #language en-US "XHCI" #string STR_ADVANCED_XHCIPCI_PCIE #language en-US "PCIe" =20 +#string STR_ADVANCED_XHCIRELOAD_PROMPT #language en-US "DT Reload XHCI fi= rmware" +#string STR_ADVANCED_XHCIRELOAD_HELP #language en-US "OS should reload = XHCI firmware on reset" +#string STR_ADVANCED_XHCIRELOAD_DISABLE #language en-US "Disabled" +#string STR_ADVANCED_XHCIRELOAD_RELOAD #language en-US "Reload" + #string STR_ADVANCED_ASSET_TAG_PROMPT #language en-US "Asset Tag" #string STR_ADVANCED_ASSET_TAG_HELP #language en-US "Set the system Asse= t Tag" =20 diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index f668b7a553..f13b70711d 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -61,6 +61,11 @@ formset name =3D XhciPci, guid =3D CONFIGDXE_FORM_SET_GUID; =20 + efivarstore ADVANCED_XHCIPCI_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D XhciReload, + guid =3D CONFIGDXE_FORM_SET_GUID; + efivarstore SYSTEM_TABLE_MODE_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D SystemTableMode, @@ -228,6 +233,16 @@ formset option text =3D STRING_TOKEN(STR_ADVANCED_XHCIPCI_PCIE), val= ue =3D 1, flags =3D 0; endoneof; endif; + + grayoutif ideqval SystemTableMode.Mode =3D SYSTEM_TABLE_MODE_ACP= I; + oneof varid =3D XhciReload.Value, + prompt =3D STRING_TOKEN(STR_ADVANCED_XHCIRELOAD_PROMPT), + help =3D STRING_TOKEN(STR_ADVANCED_XHCIRELOAD_HELP), + flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRE= D, + option text =3D STRING_TOKEN(STR_ADVANCED_XHCIRELOAD_DISABLE= ), value =3D 0, flags =3D DEFAULT; + option text =3D STRING_TOKEN(STR_ADVANCED_XHCIRELOAD_RELOAD)= , value =3D 1, flags =3D 0; + endoneof; + endif; endif; #endif string varid =3D AssetTag.AssetTag, diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c b/Platform/Raspbe= rryPi/Drivers/FdtDxe/FdtDxe.c index cbbc2ad30d..dd4fc0a05e 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c @@ -375,6 +375,10 @@ SyncPcie ( return EFI_NOT_FOUND; } =20 + if (PcdGet32 (PcdXhciReload) !=3D 1) { + return EFI_SUCCESS; + } + /* * Now that we are always running without DMA translation, and with a 3G * limit, there shouldn't be a need to reset/reload the XHCI. The diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf b/Platform/Rasp= berryPi/Drivers/FdtDxe/FdtDxe.inf index 26f84e5940..d9fb6ee480 100644 --- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf +++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.inf @@ -47,3 +47,4 @@ =20 [Pcd] gRaspberryPiTokenSpaceGuid.PcdSystemTableMode + gRaspberryPiTokenSpaceGuid.PcdXhciReload diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index a967cd5a20..f5361ab95e 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -529,6 +529,12 @@ # gRaspberryPiTokenSpaceGuid.PcdXhciPci|L"XhciPci"|gConfigDxeFormSetGuid|0= x0|0 =20 + # DT contains XHCI quirk node (not valid on rpi3) + # + # 0 - DISABLED + # + gRaspberryPiTokenSpaceGuid.PcdXhciReload|L"XhciReload"|gConfigDxeFormSet= Guid|0x0|0 + # # Common UEFI ones. # diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 8c49c67ab2..4e91eb9aea 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -547,6 +547,13 @@ # gRaspberryPiTokenSpaceGuid.PcdXhciPci|L"XhciPci"|gConfigDxeFormSetGuid|0= x0|0 =20 + # DT contains XHCI quirk node + # + # 0 - No reload + # 1 - Yes, DT has Reload + # + gRaspberryPiTokenSpaceGuid.PcdXhciReload|L"XhciReload"|gConfigDxeFormSet= Guid|0x0|0 + # # Common UEFI ones. # diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index 17b6061a05..6bd16a5ae9 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -73,3 +73,4 @@ gRaspberryPiTokenSpaceGuid.PcdUartInUse|1|UINT32|0x00000021 gRaspberryPiTokenSpaceGuid.PcdXhciPci|0|UINT32|0x00000022 gRaspberryPiTokenSpaceGuid.PcdMiniUartClockRate|0|UINT32|0x00000023 + gRaspberryPiTokenSpaceGuid.PcdXhciReload|0|UINT32|0x00000024 --=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 (#113547): https://edk2.groups.io/g/devel/message/113547 Mute This Topic: https://groups.io/mt/103652856/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- From nobody Fri May 17 05:54:37 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+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-