<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:PMingLiU;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@PMingLiU";
        panose-1:2 1 6 1 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#203864">Hi Mario, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">Thanks for checking this.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">Yeah, the problem is NO COM port for PL011 UART in Windows IOT’s device manager, so I thought it doesn’t work. If there is no COM port for PL011 UART, how can I check PL011 UART’s functionality? How can I use
 a telnet tool like PuTTY to send messages from RPi4 to my laptop? How to use SerCx2? Is there a guideline for using PL011 UART on RPi4 with Windows IoT?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">As for why I mux both UARTs to the BT chip, I was trying to address your comment “This always assumes that PL011 is used for Bluetooth”. Apparently, it didn’t address your comment. No matter whether I add “</span>PinFunction
 (Exclusive, PullDown, BCM_ALT5, "<a href="file://_SB.GDV0.GPI0">\\_SB.GDV0.GPI0</a>", 0, ResourceConsumer, , ) { 32, 33 }”
<span style="color:#203864">or not, the Bluetooth has NOT worked when I configure PL011 UART as the primary serial console. Bluetooth only works when I configure Mini UART as the Primary serial console. I also confirmed that this problem also exists with RPi4
 Release FW 1.26 + edk2-platforms-raspberrypi-pl011-bth-noflow.diff in <a href="https://github.com/worproject/RPi-Bluetooth-Testing/">
https://github.com/worproject/RPi-Bluetooth-Testing/</a>. Do you have any idea to make the Bluetooth work with configuring PL011 UART as the primary serial console? By the way, it is good to know the loading sequence. Do you know where I can quickly find this
 information without using WinDbg?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#203864"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">Actually, the original code change (Patch 2/2) is the patch (edk2-platforms-raspberrypi-pl011-bth-noflow.diff) on  <a href="https://github.com/worproject/RPi-Bluetooth-Testing/">https://github.com/worproject/RPi-Bluetooth-Testing/</a>.
 I’m not familiar with Windows drivers’ behavior, so I had no idea about why we need to change them and couldn’t find more information about the changes’ background either. It looks like you know the details. Could you share with me more information about the
 background of these changes? At least, I have some questions below: <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">1.  What is the connection between GPIO 128 and Bluetooth (BT_ON)? Why did we add this line in the beginning? I just removed it by your request and according to the change in worproject/RPi-Bluetooth-Testing/,
 but I’m still worried about if we did this for some other purposes.  <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">2.  Why do we need to configure GPIO 32 and 33? Is the Bluetooth using GPIO 32 and 33? Or Is Windows OS checking GPIO 32 and 33 for Bluetooth? Where can I find the information?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">3.  As for your comment about GPIO 31, I was confused, so I didn’t update anything for addressing this comment. My understanding was that It is intended to override the BCM_ALT2’s default setting from PullLow
 to PullNone to fack the CTS signal. If we change it to PullLow, it will be used for HW flow control, which is unwanted, isn’t it? What did you want me to change? Could you directly paste the code change you wanted here for my reference?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">Moreover, for the changes you want, could you also paste the code change?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864"><br>
</span><span style="color:#203864">Best </span><span style="color:#203864">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#203864">Sunny</span><span style="color:#203864"> Wang<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> devel@edk2.groups.io <devel@edk2.groups.io> <b>
On Behalf Of </b>Mario Balanica via groups.io<br>
<b>Sent:</b> Monday, May 31, 2021 8:41 PM<br>
<b>To:</b> Sunny Wang <Sunny.Wang@arm.com><br>
<b>Cc:</b> devel@edk2.groups.io; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Sami Mujawar <Sami.Mujawar@arm.com>; Jeremy Linton <Jeremy.Linton@arm.com>; Pete Batard <pete@akeo.ie>; Ard Biesheuvel <ardb+tianocore@kernel.org><br>
<b>Subject:</b> Re: [edk2-devel] [PATCH v3 2/2] Platform/RaspberryPi: Enable Bluetooth and UART in Windows OS<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi Sunny,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">It won't show up as a COM port (like mini UART does) as it's built using SerCx2.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">@@ -30,6 +30,12 @@ Device (URT0)<br>
   {<br>
     MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM)<br>
     Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_PL011_UART_INTERRUPT }<br>
+<br>
+    PinFunction (Exclusive, PullDown, BCM_ALT3, "<a href="file://_SB.GDV0.GPI0">\\_SB.GDV0.GPI0</a>", 0, ResourceConsumer, , ) { 32, 33 }<br>
+<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">@@ -79,6 +85,11 @@ Device (URTM)<br>
     // from muxing the pins away.<br>
<br>
     // PinFunction (Exclusive, PullDown, BCM_ALT5, "<a href="file://_SB.GPI0">\\_SB.GPI0</a>", 0, ResourceConsumer, , ) { 14, 15 }<br>
+    PinFunction (Exclusive, PullDown, BCM_ALT5, "<a href="file://_SB.GDV0.GPI0">\\_SB.GDV0.GPI0</a>", 0, ResourceConsumer, , ) { 32, 33 }<br>
+<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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
<i>after</i> it, wouldn't it mux away the pins and break Bluetooth?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">În lun., 31 mai 2021 la 11:23, Sunny Wang <<a href="mailto:Sunny.Wang@arm.com">Sunny.Wang@arm.com</a>> a scris:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">This change is based on edk2-platforms-raspberrypi-pl011-bth-noflow.diff<br>
in <a href="https://github.com/worproject/RPi-Bluetooth-Testing/" target="_blank">
https://github.com/worproject/RPi-Bluetooth-Testing/</a> for enabling<br>
Bluetooth and serial port (Mini UART) in Windows IOT.<br>
<br>
Note that PL011 UART still doesn't work with Windows 10 IOT with this<br>
change, but PL011 UART works fine with VMware ESXi-Arm Fling v1.3.<br>
Therefore, there should be no issue with PL011 UART related changes,<br>
and we will still need a Windows expert to take a further look in the<br>
future. Making PL011 UART work properly with Windows 10 IOT may require<br>
additional changes to Windows driver or firmware's ACPI table.<br>
<br>
Testing Done:<br>
  - Successfully booted Windows Windows 10 IOT (20279.1) on SD (made by WOR) with<br>
    the RPi-Windows-Drivers release ver 0.5 downloaded from<br>
    <a href="https://github.com/worproject/RPi-Windows-Drivers/releases" target="_blank">
https://github.com/worproject/RPi-Windows-Drivers/releases</a><br>
    and checked that both Bluetooth and serial port (Mini UART) can<br>
    work fine.<br>
  - Successfully booted VMware ESXi-Arm Fling v1.3 with only serial<br>
    console connection (PL011 UART).<br>
<br>
Cc: Samer El-Haj-Mahmoud <<a href="mailto:samer.el-haj-mahmoud@arm.com" target="_blank">samer.el-haj-mahmoud@arm.com</a>><br>
Cc: Sami Mujawar <<a href="mailto:sami.mujawar@arm.com" target="_blank">sami.mujawar@arm.com</a>><br>
Cc: Jeremy Linton <<a href="mailto:jeremy.linton@arm.com" target="_blank">jeremy.linton@arm.com</a>><br>
Cc: Pete Batard <<a href="mailto:pete@akeo.ie" target="_blank">pete@akeo.ie</a>><br>
Cc: Ard Biesheuvel <<a href="mailto:ardb%2Btianocore@kernel.org" target="_blank">ardb+tianocore@kernel.org</a>><br>
Cc: Mario Bălănică <<a href="mailto:mariobalanica02@gmail.com" target="_blank">mariobalanica02@gmail.com</a>><br>
Signed-off-by: Sunny Wang <<a href="mailto:sunny.wang@arm.com" target="_blank">sunny.wang@arm.com</a>><br>
---<br>
 Platform/RaspberryPi/AcpiTables/Uart.asl | 19 +++++++++++--------<br>
 1 file changed, 11 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryPi/AcpiTables/Uart.asl<br>
index bac9d791eb..cb99086d39 100644<br>
--- a/Platform/RaspberryPi/AcpiTables/Uart.asl<br>
+++ b/Platform/RaspberryPi/AcpiTables/Uart.asl<br>
@@ -30,6 +30,12 @@ Device (URT0)<br>
   {<br>
     MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM)<br>
     Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_PL011_UART_INTERRUPT }<br>
+<br>
+    PinFunction (Exclusive, PullDown, BCM_ALT3, "<a href="file://_SB.GDV0.GPI0">\\_SB.GDV0.GPI0</a>", 0, ResourceConsumer, , ) { 32, 33 }<br>
+<br>
+    // fake the CTS signal as we don't support HW flow control yet<br>
+    // BCM_ALT2 is set as output (low) by default<br>
+    PinFunction (Exclusive, PullNone, BCM_ALT2, "<a href="file://_SB.GDV0.GPI0">\\_SB.GDV0.GPI0</a>", 0, ResourceConsumer, , ) { 31 }<br>
   })<br>
   Method (_CRS, 0x0, Serialized)<br>
   {<br>
@@ -79,6 +85,11 @@ Device (URTM)<br>
     // from muxing the pins away.<br>
<br>
     // PinFunction (Exclusive, PullDown, BCM_ALT5, "<a href="file://_SB.GPI0">\\_SB.GPI0</a>", 0, ResourceConsumer, , ) { 14, 15 }<br>
+    PinFunction (Exclusive, PullDown, BCM_ALT5, "<a href="file://_SB.GDV0.GPI0">\\_SB.GDV0.GPI0</a>", 0, ResourceConsumer, , ) { 32, 33 }<br>
+<br>
+    // fake the CTS signal as we don't support HW flow control yet<br>
+    // BCM_ALT2 is set as output (low) by default<br>
+    PinFunction (Exclusive, PullNone, BCM_ALT2, "<a href="file://_SB.GDV0.GPI0">\\_SB.GDV0.GPI0</a>", 0, ResourceConsumer, , ) { 31 }<br>
   })<br>
   Method (_CRS, 0x0, Serialized)<br>
   {<br>
@@ -143,10 +154,6 @@ Device(BTH0)<br>
       UAR0,          // DescriptorName: creates name<br>
                     //   for offset of resource descriptor<br>
     )                // Vendor data<br>
-    //<br>
-    // RPIQ connection for BT_ON/OFF<br>
-    //<br>
-    GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "<a href="file://_SB.GDV0.RPIQ">\\_SB.GDV0.RPIQ</a>", 0, ResourceConsumer, , ) { 128 }<br>
   })<br>
<br>
   //<br>
@@ -190,10 +197,6 @@ Device(BTH0)<br>
       UARM,          // DescriptorName: creates name<br>
                     //   for offset of resource descriptor<br>
     )                // Vendor data<br>
-    //<br>
-    // RPIQ connection for BT_ON/OFF<br>
-    //<br>
-    GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "<a href="file://_SB.GDV0.RPIQ">\\_SB.GDV0.RPIQ</a>", 0, ResourceConsumer, , ) { 128 }<br>
   })<br>
<br>
   Method (_CRS, 0x0, Serialized)<br>
-- <br>
2.31.0.windows.1<o:p></o:p></p>
</blockquote>
</div>
<div>
<p class="MsoNormal"></o:p></span></p>
</div>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose,
 or store or copy the information in any medium. Thank you.
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/75870">View/Reply Online (#75870)</a> |    |  <a target="_blank" href="https://groups.io/mt/83205747/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>