From nobody Tue May 14 02:15:10 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+113961+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+113961+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1705527379; cv=none; d=zohomail.com; s=zohoarc; b=C0Gco049leVZdGNx9XwgQvRlTCRgvr+1v5T8Tl563v4R4d/+SuXIgxVcDpAv0WaJZBe3ifUC5kKToq84AngGia+QE4j7PE6U2U1ycYvVWyBXQPEiDvOqut0fmvAkTmeC6bVCAW5t8os77SOKUvc9/B6igNsdj3TKuFXShhnITcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705527379; 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=xXsa7NX8ZLRm8p4E89SEFl1MMzRR3V78OocIjBH6uHU=; b=LMgvCgITjjL0gWmxtQdnhAW43EFLa4KpOGlfAgCkS+oVPQcECT3YuFNnsSmY7JEd/OlyNI+9B1satB5YX0iQKJA408dE8nOlFcaggCczsSmBMhl8TrWpgv7jA3c/CGHWTGt5hf5LNuiYtNaae8YaOOU3N2F435mj9c1EVIzktxU= 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+113961+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 1705527379929578.9620127145768; Wed, 17 Jan 2024 13:36:19 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=8yaaqHpf9Lz26zH2UMzKAHdXoJ7tN/JYkHC3ZYm7ddE=; 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=1705527379; v=1; b=i8XTLCbsH79Vm39zEzE3Rz4S+NXGYdDwX55OMHYUeDLC2l+CZTJnD9LiqqNl3Psr8djqsujx 0mGsY+fQD1Z4qa17inIjyPWFwPegC/8aTGu8aolIjY9rzhk2t5eBx2BBPKVvZ/x3RBwSdbf7D8l bC8ox8/kqqhPjhfv77xVKkC4= X-Received: by 127.0.0.2 with SMTP id IKmBYY1788612x0t7XLh0TY1; Wed, 17 Jan 2024 13:36:19 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.650.1705527378691614911 for ; Wed, 17 Jan 2024 13:36:18 -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 54C58152B; Wed, 17 Jan 2024 13:37:04 -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 21FBF3F73F; Wed, 17 Jan 2024 13:36:18 -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 1/5] Platform/RaspberryPi/DualSerialPortLib: Always configure the pl011 Date: Wed, 17 Jan 2024 15:36:10 -0600 Message-ID: <20240117213614.4188518-2-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: 5QPUcxRpPOzeD38JWbOuc0Nax1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1705527380671100002 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 | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortL= ib.c b/Platform/RaspberryPi/Library/DualSerialPortLib/DualSerialPortLib.c index d2f983bf0a..09d3e33c00 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,34 @@ SerialPortInitialize ( UsePl011UartSet =3D TRUE; } =20 - if (UsePl011Uart) { - BaudRate =3D FixedPcdGet64 (PcdUartDefaultBaudRate); + // always init the pl011 on the RPi4, linux expects a SBSA uart to be at= 115200 + // this means we need to set the baud/etc even if we aren't using it as = a console + if ((UsePl011Uart) || (RPI_MODEL =3D=3D 4)) { ReceiveFifoDepth =3D 0; // Use default FIFO depth + if (!UsePl011Uart) + { + BaudRate =3D 115200; + } + else + { + 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 +140,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 +172,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 (#113961): https://edk2.groups.io/g/devel/message/113961 Mute This Topic: https://groups.io/mt/103796307/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 Tue May 14 02:15:10 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+113962+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+113962+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1705527380; cv=none; d=zohomail.com; s=zohoarc; b=li706uy4HkVqQA8aZv587fs1lp+uq7JCoQzsSbTeA6UVkvDWhYItSa9gPmp5FW5ThFvIpqsMvVBmskB/6BGroioNTIz9p1cE4ausUZSu79xuQSS+yaj/hz3Zw+xriaofnJqSdxK4QC1uCBm3vqlkx6BA2IPfoXFYRjGijaZH9J4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705527380; 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=GrYnccXQCBSSWbQDtccEBOon+OAPxCQCwkNfLUmtpZY=; b=PoTtyGjUj4tiWNbTibuogy+begDAiP9dS/9D9N4YNzUtqRRFEXdHEA6B+fQ4J1QXluhk0ckvBfRZtTOcBWE87W0vGe+1f+uG1V9QtR4oB96yQY8EBYrcVOJrHMdVxcQw12sBV3Ks8Sxx8UfOUMO6tKxwNR58YkLqsdr5CIOQOGI= 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+113962+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 1705527380478241.88221808066965; Wed, 17 Jan 2024 13:36:20 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=XZ0GfoPZkxOm4bC0dFZzgS5BJdsScCPFpxtJMRIiVRc=; 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=1705527380; v=1; b=myqcfrjh70XDMCBuwbJsblXyr/QGDWssrxeCDTzK7UJ0O7EmP9FOApjaY4UQoutVdJu0VfLe RCWn+aD9iIFenklmALqLQnG0VGOqvYFLYrJo011ZPnuaDPjZZM69gOUZqghDcL72/iTFCz5lj6A ShI0gpjHj8ejAh4ve9zvOlOU= X-Received: by 127.0.0.2 with SMTP id DSvZYY1788612xgNiVzb9ReB; Wed, 17 Jan 2024 13:36:20 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.628.1705527379109716188 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 9119215DB; Wed, 17 Jan 2024 13:37:04 -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 5E5D23F73F; Wed, 17 Jan 2024 13:36:18 -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 2/5] Silicon/Broadcom/BcmGenetDxe: Suppress some bogus compiler warnings Date: Wed, 17 Jan 2024 15:36:11 -0600 Message-ID: <20240117213614.4188518-3-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: 3ZaUAltIkDK8oQOGsHJaw2BOx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1705527382605100013 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=3D NULL || Buffer =3D=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 (#113962): https://edk2.groups.io/g/devel/message/113962 Mute This Topic: https://groups.io/mt/103796308/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 Tue May 14 02:15:10 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+113963+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+113963+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1705527380; cv=none; d=zohomail.com; s=zohoarc; b=k6B34kfK/hqA0KXF9kXvJZcOza/2YJ+/rXuAWHgxd47yyjk/52m0rnHsm2xDKPI3ZeZa5BIudJtWWXaLdDvvpHJJpTiCqBHoPsG6YHvFU6xr9kxzjGmDWcPPDSi8cRvJ9R1Pp0YZ7R+0zUggnTMIpGK0FM/kLQ+OztUHyaIlKT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705527380; 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=VJcWwr58pKrc0iwgpUGtpAHYBF3lBXd2KhXkucXnaQk=; b=UdXUXMdbVSxlY+oIRNnJ3WyGNuLnlIUwK/HXPwAYAL2h0Hm7ToKMcMNfz2VyAAK2UK7fjlk9BT1LYRQrP+CWNHo4C2GlCWdW/F1JW/jcv3/ieTMDP8q8zBxEYVy+3ax7DcXYinbC1Q72hqI35UBnn9jZ2YllZaUKeFDu78WLFyc= 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+113963+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 1705527380899990.9181888142454; Wed, 17 Jan 2024 13:36:20 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=HzG1hxvAhzhciEQC12Wrl66e8iiPHcOZuCLD5uTmJjY=; 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=1705527380; v=1; b=Z7npwEjGC2tBFLWpAHm82p/OdNjd59A7EbDnppWaD4m7NTD3VF3GAognF8PbacNVp/ufa6rt TjrqUjOKx0Q8KFn8b9eKPqlUQQPwSkH6oDBMlVSJJpyzKI3P1P48IHo28EO0CKVjY1x34q+Ht1A /0YlyJLabn8i9WHUh48lMYr8= X-Received: by 127.0.0.2 with SMTP id HjuwYY1788612xbDrVKZxIo9; Wed, 17 Jan 2024 13:36:20 -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 CFE341650; Wed, 17 Jan 2024 13:37:04 -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 9C94B3F73F; Wed, 17 Jan 2024 13:36:18 -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 3/5] Platform/RaspberryPi: Cleanup menu visibility Date: Wed, 17 Jan 2024 15:36:12 -0600 Message-ID: <20240117213614.4188518-4-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: AhWiVtE5N6DGGxnZ72PcoNWnx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1705527382613100015 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=3D 4) - grayoutif NOT ideqval SystemTableMode.Mode =3D=3D SYSTEM_TABLE_MOD= E_ACPI; + grayoutif ideqval SystemTableMode.Mode =3D=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=3D 0; + grayoutif ideqval FanOnGpio.Enabled =3D=3D 0 OR ideqval SystemTabl= eMode.Mode =3D=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=3D 2; - grayoutif NOT ideqval SystemTableMode.Mode =3D=3D SYSTEM_TABLE_M= ODE_ACPI; + grayoutif ideqval SystemTableMode.Mode =3D=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 (#113963): https://edk2.groups.io/g/devel/message/113963 Mute This Topic: https://groups.io/mt/103796309/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 Tue May 14 02:15:10 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+113964+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+113964+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=ly4z7lX/qm6uUpx9IkLopNMmZENk+PLQyGRg+Jb99K9cGWNM/bZJSnIyQc4RdiLTYSGWljSmpnIT5qElQuYBXEdhQ5VR1ADradX0vskIrgFkbsRw4BbY9jGt38oCO20t5tZ7Wpnw6txaA2U/Tzm5o5MjKd5ofcm1+Qg2AUtyCDo= 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=ZRKBYb6BU9/86HJ4QxX3qbeHPe3X0ngNi6JFRR5Zc6g=; b=PrxsRJLxKEhra1rd1H69I39NdD0ZmRtmuxBB2iEZfH841/j2vgSdPx9QKWwOA6AeSqx40E0UsZZL36m0auk3+RGKRXOw/XR5+KYkgOB0D3yYOf4+v6pHSn7g0FfDSiKqMhq6rxwFKdApQNX2Kjghn0GAbE+/itBIyE8QigxDw3I= 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+113964+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 170552738117155.55561655779161; Wed, 17 Jan 2024 13:36:21 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Y1WO9Imc+8YUr0bpKEBojpXjg1oYWTvTc8hat5ao8Yg=; 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=1705527380; v=1; b=a1M/z3dT/lq+lLk9M1xcXWO/X754oalgVgIb6NWOjJ/w67/gkd+C1BZqDHmB7CDhdSRLw56G Eor1LJhOt/RSK7B95bgZUIecWOftMY0oG3N+Ij0VJLIy93xMmazV5zVc+cEozZY6fyYpTNq2/FE DakGbSIQZkcwImTadXZo+Zo8= X-Received: by 127.0.0.2 with SMTP id s1cOYY1788612x14dAhh0Nr4; Wed, 17 Jan 2024 13:36:20 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.630.1705527379425693047 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 1E27F1655; 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 DA15D3F73F; Wed, 17 Jan 2024 13:36:18 -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 4/5] Platform/RaspberryPi: Give the user control over the XHCI mailbox Date: Wed, 17 Jan 2024 15:36:13 -0600 Message-ID: <20240117213614.4188518-5-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: 2rrys9qSQkhM19eQ1eeW8WFcx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1705527382650100016 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=3D SYSTEM_TABLE_MODE_= ACPI; + 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 (#113964): https://edk2.groups.io/g/devel/message/113964 Mute This Topic: https://groups.io/mt/103796310/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 Tue May 14 02:15:10 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-