From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web10.43631.1622464843620966901 for ; Mon, 31 May 2021 05:40:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=So12LB4o; spf=pass (domain: gmail.com, ip: 209.85.221.44, mailfrom: mariobalanica02@gmail.com) Received: by mail-wr1-f44.google.com with SMTP id z17so10795407wrq.7 for ; Mon, 31 May 2021 05:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4f6PbflXKGksuDfS+luis7IzrtpGpo6Y0kOc9dRXYd0=; b=So12LB4oiBYXgP/Y4sGRy41bfN9XpROl5noJ5GJ2ymD9YIlG1q6DRaMZydljYJuUoy bqzsjgT7uKYjqKPUNQKUdqquYN3i4uFphEYp1FrhoEdO2jzczkdt6xarVePCUC/Cxjay ehe8/2GOm0oH2RgLNSG1v+9oE+nJ/jUMaYueENPLe2nV82D5HJqNfLPMlkoWyk5NJG2V W8m8KuQE1dcCCh5iec2IirLVW4std46v2BOD1gVT7vVGrCqUCXbA3zXnIQhPAA9s5IUw cEeEaj1xDy8FVqckZ21KFMMdq7VYJLli8THUKbeXNG5mpvI6/+7oaQHIXfVHgm39Z3OF r4rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4f6PbflXKGksuDfS+luis7IzrtpGpo6Y0kOc9dRXYd0=; b=COjrlJrtOBlmzMKBRqR7zJM3HAxbKUq9taUaSqHhvxZFu3nZu2+yuJGtCqDO8MQ5H1 SIRkbz6+SidhjD3VRvmhSzwzgfva9gaW+Lr6WLX7ZHdhBfb4kI2yt6eFpsb+8z7AT5yn rmKqqofPBFSVpY42yoZAmEq02Fx8GjmEIfDpY5q0hyftROeFGqh5Xrtc21ZOCKDCy4L/ YlfXaVykDbzLs4/dEpcXNc/RChMMdGHFzkFcI/c3ZdDQjQjyj42DE/Rnq4duGJ05Z+uO 6vyJeTnYz08T+R3xc/GP6GuUyPPi9xsR5Sivna8b6ul+/LJsjGi+5/lbucvyi6zkdVW6 Yhtw== X-Gm-Message-State: AOAM533GQR32DAP04/UVx5gVoB8hGLXP0I+DorcDpFfVUriZQ6rfC6Jo kaktherEq4RJnkSMvWsSEtWj2nc5u9dJ4hCNKDY= X-Google-Smtp-Source: ABdhPJxJHcHbyKHF/jAk1Y67QNN6GjvIPbMyueRAxJC+nWvkO+psUZH+O1d8XHg6jEZxcJLi4R4hBTaP5y2uzPtytNU= X-Received: by 2002:a5d:4890:: with SMTP id g16mr22137491wrq.353.1622464842227; Mon, 31 May 2021 05:40:42 -0700 (PDT) MIME-Version: 1.0 References: <20210531082239.918-1-Sunny.Wang@arm.com> <20210531082239.918-3-Sunny.Wang@arm.com> In-Reply-To: <20210531082239.918-3-Sunny.Wang@arm.com> From: =?UTF-8?B?TWFyaW8gQsSDbMSDbmljxIM=?= Date: Mon, 31 May 2021 15:40:31 +0300 Message-ID: Subject: Re: [PATCH v3 2/2] Platform/RaspberryPi: Enable Bluetooth and UART in Windows OS To: Sunny Wang Cc: devel@edk2.groups.io, Samer El-Haj-Mahmoud , Sami Mujawar , Jeremy Linton , Pete Batard , Ard Biesheuvel Content-Type: multipart/alternative; boundary="00000000000094e24705c39f8887" --00000000000094e24705c39f8887 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sunny, What issues are you seeing with the PL011 UART in Windows? Last time I checked, it worked fine, and the fact that Bluetooth works also confirms this. It won't show up as a COM port (like mini UART does) as it's built using SerCx2. @@ -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, > ResourceConsumer, , ) { 32, 33 } > + @@ -79,6 +85,11 @@ Device (URTM) > // from muxing the pins away. > > // PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, > ResourceConsumer, , ) { 14, 15 } > + PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GDV0.GPI0", 0, > ResourceConsumer, , ) { 32, 33 } > + > What is the reason for trying to mux both UARTs to the BT chip? If PL011 is used for Bluetooth and the mini UART driver loads *after* it, wouldn't it mux away the pins and break Bluetooth? =C3=8En lun., 31 mai 2021 la 11:23, Sunny Wang a scris= : > 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 > WOR) 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/RaspberryPi/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, > ResourceConsumer, , ) { 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, > ResourceConsumer, , ) { 31 } > }) > Method (_CRS, 0x0, Serialized) > { > @@ -79,6 +85,11 @@ Device (URTM) > // from muxing the pins away. > > // PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, > ResourceConsumer, , ) { 14, 15 } > + PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GDV0.GPI0", 0, > ResourceConsumer, , ) { 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, > ResourceConsumer, , ) { 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 } > }) > > // > @@ -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 } > }) > > Method (_CRS, 0x0, Serialized) > -- > 2.31.0.windows.1 > > --00000000000094e24705c39f8887 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Sunny,

=
What issues are you seeing with the PL011 UART in Windows? Last time I= checked, it worked fine, and the fact that Bluetooth works also confirms t= his.
It won't show up as a COM port (like mini UART does) as = it's built using SerCx2.

@@ -30,6 +30,12 @@ Device (URT0)
=C2=A0 =C2=A0{<= br>=C2=A0 =C2=A0 =C2=A0MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENG= TH, RMEM)
=C2=A0 =C2=A0 =C2=A0Interrupt (ResourceConsumer, Level, Active= High, Exclusive) { BCM2836_PL011_UART_INTERRUPT }
+
+=C2=A0 =C2=A0 Pi= nFunction (Exclusive, PullDown, BCM_ALT3, "\\_SB.GDV0.GPI0", 0, R= esourceConsumer, , ) { 32, 33 }
+

@@ -79,6 +85,11 @@ Device (URTM)
= =C2=A0 =C2=A0 =C2=A0// from muxing the pins away.

=C2=A0 =C2=A0 =C2= =A0// PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0= , ResourceConsumer, , ) { 14, 15 }
+=C2=A0 =C2=A0 PinFunction (Exclusive= , PullDown, BCM_ALT5, "\\_SB.GDV0.GPI0", 0, ResourceConsumer, , )= { 32, 33 }
+

What is the reason for= trying to mux both UARTs to the BT chip? If PL011 is used for Bluetooth an= d the mini UART driver loads after=C2=A0it, wouldn't it mux away= the pins and break Bluetooth?



=

=C3=8En lun., 31 mai 2021 la 11:23, Sunny Wang <Sunny.Wang@arm.com> a scris:
This change is based on= edk2-platforms-raspberrypi-pl011-bth-noflow.diff
in https://github.com/worproject/RPi-Bluetooth-T= esting/ 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:
=C2=A0 - Successfully booted Windows Windows 10 IOT (20279.1) on SD (made b= y WOR) with
=C2=A0 =C2=A0 the RPi-Windows-Drivers release ver 0.5 downloaded from
=C2=A0 =C2=A0 https://github.com/worprojec= t/RPi-Windows-Drivers/releases
=C2=A0 =C2=A0 and checked that both Bluetooth and serial port (Mini UART) c= an
=C2=A0 =C2=A0 work fine.
=C2=A0 - Successfully booted VMware ESXi-Arm Fling v1.3 with only serial =C2=A0 =C2=A0 console connection (PL011 UART).

Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jeremy Linton <jeremy.linton@arm.com>
Cc: Pete Batard <pete@= akeo.ie>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Mario B=C4=83l=C4=83nic=C4=83 <mariobalanica02@gmail.com>
Signed-off-by: Sunny Wang <sunny.wang@arm.com>
---
=C2=A0Platform/RaspberryPi/AcpiTables/Uart.asl | 19 +++++++++++--------
=C2=A01 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryP= i/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)
=C2=A0 =C2=A0{
=C2=A0 =C2=A0 =C2=A0MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH,= RMEM)
=C2=A0 =C2=A0 =C2=A0Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusi= ve) { BCM2836_PL011_UART_INTERRUPT }
+
+=C2=A0 =C2=A0 PinFunction (Exclusive, PullDown, BCM_ALT3, "\\_SB.GDV0= .GPI0", 0, ResourceConsumer, , ) { 32, 33 }
+
+=C2=A0 =C2=A0 // fake the CTS signal as we don't support HW flow contr= ol yet
+=C2=A0 =C2=A0 // BCM_ALT2 is set as output (low) by default
+=C2=A0 =C2=A0 PinFunction (Exclusive, PullNone, BCM_ALT2, "\\_SB.GDV0= .GPI0", 0, ResourceConsumer, , ) { 31 }
=C2=A0 =C2=A0})
=C2=A0 =C2=A0Method (_CRS, 0x0, Serialized)
=C2=A0 =C2=A0{
@@ -79,6 +85,11 @@ Device (URTM)
=C2=A0 =C2=A0 =C2=A0// from muxing the pins away.

=C2=A0 =C2=A0 =C2=A0// PinFunction (Exclusive, PullDown, BCM_ALT5, "\\= _SB.GPI0", 0, ResourceConsumer, , ) { 14, 15 }
+=C2=A0 =C2=A0 PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GDV0= .GPI0", 0, ResourceConsumer, , ) { 32, 33 }
+
+=C2=A0 =C2=A0 // fake the CTS signal as we don't support HW flow contr= ol yet
+=C2=A0 =C2=A0 // BCM_ALT2 is set as output (low) by default
+=C2=A0 =C2=A0 PinFunction (Exclusive, PullNone, BCM_ALT2, "\\_SB.GDV0= .GPI0", 0, ResourceConsumer, , ) { 31 }
=C2=A0 =C2=A0})
=C2=A0 =C2=A0Method (_CRS, 0x0, Serialized)
=C2=A0 =C2=A0{
@@ -143,10 +154,6 @@ Device(BTH0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0UAR0,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // Descr= iptorName: creates name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0//=C2=A0 =C2=A0for offset of resource descriptor
=C2=A0 =C2=A0 =C2=A0)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 // Vendor data
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 // RPIQ connection for BT_ON/OFF
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB= .GDV0.RPIQ", 0, ResourceConsumer, , ) { 128 }
=C2=A0 =C2=A0})

=C2=A0 =C2=A0//
@@ -190,10 +197,6 @@ Device(BTH0)
=C2=A0 =C2=A0 =C2=A0 =C2=A0UARM,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // Descr= iptorName: creates name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0//=C2=A0 =C2=A0for offset of resource descriptor
=C2=A0 =C2=A0 =C2=A0)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 // Vendor data
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 // RPIQ connection for BT_ON/OFF
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB= .GDV0.RPIQ", 0, ResourceConsumer, , ) { 128 }
=C2=A0 =C2=A0})

=C2=A0 =C2=A0Method (_CRS, 0x0, Serialized)
--
2.31.0.windows.1

--00000000000094e24705c39f8887--