From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.41580.1622449409972150836 for ; Mon, 31 May 2021 01:23:30 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: sunny.wang@arm.com) 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 928C96D; Mon, 31 May 2021 01:23:29 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 84E3B3F73D; Mon, 31 May 2021 01:23:27 -0700 (PDT) From: "Sunny Wang" To: devel@edk2.groups.io Cc: Sunny Wang , Samer El-Haj-Mahmoud , Sami Mujawar , Jeremy Linton , Pete Batard , Ard Biesheuvel , =?UTF-8?q?Mario=20B=C4=83l=C4=83nic=C4=83?= , Sunny Wang Subject: [PATCH v3 2/2] Platform/RaspberryPi: Enable Bluetooth and UART in Windows OS Date: Mon, 31 May 2021 16:22:39 +0800 Message-Id: <20210531082239.918-3-Sunny.Wang@arm.com> X-Mailer: git-send-email 2.31.0.windows.1 In-Reply-To: <20210531082239.918-1-Sunny.Wang@arm.com> References: <20210531082239.918-1-Sunny.Wang@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This change is based on edk2-platforms-raspberrypi-pl011-bth-noflow.diff in https://github.com/worproject/RPi-Bluetooth-Testing/ for enabling Bluetooth and serial port (Mini UART) in Windows IOT. Note that PL011 UART still doesn't work with Windows 10 IOT with this change, but PL011 UART works fine with VMware ESXi-Arm Fling v1.3. Therefore, there should be no issue with PL011 UART related changes, and we will still need a Windows expert to take a further look in the future. Making PL011 UART work properly with Windows 10 IOT may require additional changes to Windows driver or firmware's ACPI table. Testing Done: - Successfully booted Windows Windows 10 IOT (20279.1) on SD (made by W= OR) with the RPi-Windows-Drivers release ver 0.5 downloaded from https://github.com/worproject/RPi-Windows-Drivers/releases and checked that both Bluetooth and serial port (Mini UART) can work fine. - Successfully booted VMware ESXi-Arm Fling v1.3 with only serial console connection (PL011 UART). Cc: Samer El-Haj-Mahmoud Cc: Sami Mujawar Cc: Jeremy Linton Cc: Pete Batard Cc: Ard Biesheuvel Cc: Mario B=C4=83l=C4=83nic=C4=83 Signed-off-by: Sunny Wang --- Platform/RaspberryPi/AcpiTables/Uart.asl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/Raspberr= yPi/AcpiTables/Uart.asl index bac9d791eb..cb99086d39 100644 --- a/Platform/RaspberryPi/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/AcpiTables/Uart.asl @@ -30,6 +30,12 @@ Device (URT0) { MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836= _PL011_UART_INTERRUPT } + + PinFunction (Exclusive, PullDown, BCM_ALT3, "\\_SB.GDV0.GPI0", 0, Re= sourceConsumer, , ) { 32, 33 } + + // fake the CTS signal as we don't support HW flow control yet + // BCM_ALT2 is set as output (low) by default + PinFunction (Exclusive, PullNone, BCM_ALT2, "\\_SB.GDV0.GPI0", 0, Re= sourceConsumer, , ) { 31 } }) Method (_CRS, 0x0, Serialized) { @@ -79,6 +85,11 @@ Device (URTM) // from muxing the pins away. =20 // PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, Reso= urceConsumer, , ) { 14, 15 } + PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GDV0.GPI0", 0, Re= sourceConsumer, , ) { 32, 33 } + + // fake the CTS signal as we don't support HW flow control yet + // BCM_ALT2 is set as output (low) by default + PinFunction (Exclusive, PullNone, BCM_ALT2, "\\_SB.GDV0.GPI0", 0, Re= sourceConsumer, , ) { 31 } }) Method (_CRS, 0x0, Serialized) { @@ -143,10 +154,6 @@ Device(BTH0) UAR0, // DescriptorName: creates name // for offset of resource descriptor ) // Vendor data - // - // RPIQ connection for BT_ON/OFF - // - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.RPIQ", = 0, ResourceConsumer, , ) { 128 } }) =20 // @@ -190,10 +197,6 @@ Device(BTH0) UARM, // DescriptorName: creates name // for offset of resource descriptor ) // Vendor data - // - // RPIQ connection for BT_ON/OFF - // - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.RPIQ", = 0, ResourceConsumer, , ) { 128 } }) =20 Method (_CRS, 0x0, Serialized) --=20 2.31.0.windows.1