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.web09.6072.1623505214182901114 for ; Sat, 12 Jun 2021 06:40:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=VsCEvb/e; spf=pass (domain: akeo.ie, ip: 209.85.221.44, mailfrom: pete@akeo.ie) Received: by mail-wr1-f44.google.com with SMTP id c5so9033556wrq.9 for ; Sat, 12 Jun 2021 06:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3F3YBXEVO3if8+JlEZdEUm7Gy0FkFSd86+M1HabhgEU=; b=VsCEvb/eLKYBsiRdcvqx2M7q954HklVINnlnPiDpuj9LVnN6h37xmfiBKUomhDz5Xe m1cKmiHUTMZvtZfUMWAi+0spVtAo9UrTZNxYCeQmV+L1Izej9KErGAGIShHatIZOssoN xN01IPLz9rDQdHdJxJ4B3kNOuAHkEv7TkE3N7n8iye49N7ENr2ypgDx0sOXXCOEqC8MS e5h3w2v5kX77GnzIGgGSlqbJpFvmtrMHIQmQe1X/yGRyrKuwp4aa29Q14920eOTjvGgn 7DVH7nmbpaf2Uc5AC7kqQa67A5sE5lnmHe0Viq91ycrq6LvbnfYGd/Sb3xjoewDO82hx oXZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3F3YBXEVO3if8+JlEZdEUm7Gy0FkFSd86+M1HabhgEU=; b=rqWWLx91/xLTccCMM7AQBonf0RgRMaJTO+JQ71a2deJaCoZHC1hPSR51C4Btg/EyCC d7POIUzb8S4yyaBx1TP/r8erZzw87uIXGKFFshKePveevZYNVtqtFuaO5rBa6DHOFUK1 fW1BeSLzdFOw7NwNVfVJB9quxieU7VGH3I0xZipK61vnkWnv2ISl1z7z799a0m8w+9E5 IEQKtvG32UUmuVcoQpKfuPh7EIzUpVetDTGnnTROnc0d/SphFxDQ62FMvragcPwPfarK PsIN6YiYCEpcz2q/hcTP/QVB2dthRINYL7OcqaNHkbuoLmXIASpmsvjRGc2L/l0NHoKj Ey+g== X-Gm-Message-State: AOAM530uEDholOQ1cY/4fGOTzxnhnjpJV1R0W77VSZ54hIhMJS02GHsD WrdPP7PploDuOKwlV+ZdQSbaDQ== X-Google-Smtp-Source: ABdhPJz04513rlTqdzuYDibh/QAME0fQyFAMoJLAIK6SJ+7zFVPugNWyts5D3eQBkyYsKuKeDqCOFg== X-Received: by 2002:adf:f207:: with SMTP id p7mr9019527wro.275.1623505212840; Sat, 12 Jun 2021 06:40:12 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.35.112]) by smtp.googlemail.com with ESMTPSA id x10sm10547479wrt.26.2021.06.12.06.40.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Jun 2021 06:40:12 -0700 (PDT) Subject: Re: [PATCH v4 3/3] Platform/RaspberryPi: Enable Bluetooth and UART in Windows OS To: Sunny Wang , devel@edk2.groups.io Cc: Samer El-Haj-Mahmoud , Sami Mujawar , Jeremy Linton , Ard Biesheuvel , =?UTF-8?B?TWFyaW8gQsSDbMSDbmljxIM=?= References: <20210607075339.342-1-Sunny.Wang@arm.com> <20210607075339.342-4-Sunny.Wang@arm.com> From: "Pete Batard" Message-ID: <11456b71-c6ae-0e7f-2680-3343d5458cf6@akeo.ie> Date: Sat, 12 Jun 2021 14:40:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210607075339.342-4-Sunny.Wang@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit On 2021.06.07 08:53, Sunny Wang wrote: > This change is based on edk2-platforms-raspberrypi-pl011-bth-noflow.diff > in https://github.com/worproject/RPi-Bluetooth-Testing/ with the > modifications and additional changes below for enabling Bluetooth > and serial port (Mini UART) in Windows IOT. > - Remove RPIQ connection for BT_ON/OFF in Uart.asl because it is > useless. The firmware already turns on the Bluetooth by default. > - Move the GPIO pin muxing stuff from Uart.asl to ConfigDxe driver. > > 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ălănică > Signed-off-by: Sunny Wang > --- > Platform/RaspberryPi/AcpiTables/Uart.asl | 16 -------------- > .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 22 +++++++++++++++++++ > 2 files changed, 22 insertions(+), 16 deletions(-) > > diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryPi/AcpiTables/Uart.asl > index bac9d791eb..167f94e889 100644 > --- a/Platform/RaspberryPi/AcpiTables/Uart.asl > +++ b/Platform/RaspberryPi/AcpiTables/Uart.asl > @@ -71,14 +71,6 @@ Device (URTM) > MEMORY32FIXED (ReadWrite, 0, BCM2836_MINI_UART_LENGTH, RMEM) > Interrupt(ResourceConsumer, Level, ActiveHigh, Shared) { BCM2836_MINI_UART_INTERRUPT } > > - // NTRAID#MSFT-7141401-2016/04/7-jordanrh - disable UART muxing > - // until a proper solution can be created for the dmap conflict. > - // When muxing is enabled, must consider DBG2 table conflict. > - // The alternate function resource needs to be reserved when > - // the kernel debugger is enabled to prevent another client > - // from muxing the pins away. > - > - // PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GPI0", 0, ResourceConsumer, , ) { 14, 15 } > }) > Method (_CRS, 0x0, Serialized) > { > @@ -143,10 +135,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 +178,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) > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > index d6efb59793..cf9880bd20 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > @@ -618,6 +618,28 @@ ApplyVariables ( > DEBUG ((DEBUG_INFO, "Fan enabled on GPIO %d\n", FanOnGpio)); > GpioPinFuncSet (FanOnGpio, GPIO_FSEL_OUTPUT); > } > + > + // > + // Fake the CTS signal as we don't support HW flow control yet. > + // Pin 31 must be held LOW so that we can talk to the BT chip > + // without flow control > + // > + GpioPinFuncSet (31, GPIO_FSEL_OUTPUT); > + GpioPinConfigure (31, CLEAR_GPIO); > + > + // > + // Bluetooth pin muxing > + // > + if ((PcdGet32 (PcdUartInUse) == PL011_UART_IN_USE)) { > + DEBUG ((DEBUG_INFO, "Enable Bluetooth over MiniUART\n")); > + GpioPinFuncSet (32, GPIO_FSEL_ALT5); > + GpioPinFuncSet (33, GPIO_FSEL_ALT5); > + } else { > + DEBUG ((DEBUG_INFO, "Enable Bluetooth over PL011 UART\n")); > + GpioPinFuncSet (32, GPIO_FSEL_ALT3); > + GpioPinFuncSet (33, GPIO_FSEL_ALT3); > + } > + > } > > > Reviewed-by: Pete Batard