From nobody Thu May 16 13:33:21 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+75867+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+75867+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1622449405; cv=none; d=zohomail.com; s=zohoarc; b=OOnebWyB0bc0mEgznyF5MJCUEUjscqnL6a9Po6Z5M2WgpfkBbBBx5PXeLdlA4irySBU9HD5yxhi1zvkROciAE2nOwQQdN+SwQ/SWCeheEWA69vccaU+/lltdfSw9yYuvJCE+kFMnYEKCo2S4620avcMWIvxNjZI3mutAmccK+Nw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622449405; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=dhb2ZbMzs9jKV0cDgnzrYfwZZAPFDDxgoTvINPeNuSU=; b=AlDrIUu7bEHvM28i4AlSj6ZoabXlsBtroq10JSR0e6TAgOWb2kIcL0Z7vTd76e20avJu9o3DlRWnWkijdhWfVfqLnm5amnt1VCk1T/TREO1wzQT75KVv58APXM2s6eVAcJZpQj7l27RlxnB7RMQzzYoQzBjcq7VakBD8OZQ5Z/0= 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+75867+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622449405912982.3836123564545; Mon, 31 May 2021 01:23:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mXRjYY1788612xw0zVmauax7; Mon, 31 May 2021 01:23:25 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.41578.1622449399809401141 for ; Mon, 31 May 2021 01:23:20 -0700 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 677B96D; Mon, 31 May 2021 01:23:19 -0700 (PDT) X-Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 545C93F73D; Mon, 31 May 2021 01:23:17 -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: [edk2-devel] [PATCH v3 1/2] Platform/RaspberryPi: Dynamically build UARTs info in ACPI Date: Mon, 31 May 2021 16:22:38 +0800 Message-Id: <20210531082239.918-2-Sunny.Wang@arm.com> In-Reply-To: <20210531082239.918-1-Sunny.Wang@arm.com> References: <20210531082239.918-1-Sunny.Wang@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,Sunny.Wang@arm.com X-Gm-Message-State: AzYnwKxqIVV6PdzoLSxbvX4Qx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622449405; bh=OJMTJVImK2qR1fgTehrJoxKFo/rK3m/AIGrYiUL1gNY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=WWEskd6aS6Kk2yf7SW3U4DkNlOotmV2Gfv5tV5OWCLCkBooF+LyJ9FHPCqO7gIlJ3wG yCuYG6nIQso+YrdEowfimU+4t4/yiHb3naydcGma7ZCfzU0pKEmjMqwq6HzzulvmApuCw lsLlJVD6CyO6z4gO13SvVRAtyRkYX3+HiDs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Changes: 1. Add code to ConfigDxe driver and AcpiTables module to dynamically build either Mini UART or PL011 UART info in ACPI. This alos fixes the issue discussed in https://github.com/pftf/RPi4/issues/118. 2. Cleanup by moving duplicate Debug Port 2 table related defines and structures to a newly created header file (RpiDebugPort2Table.h). Testing Done: - Booted to UEFI shell and use acpiview command to check the result of the different UART settings in config.txt (enabling either Mini UART or PL011) and SPCR, DBG2 tables and device BTH0 are dynamically changed as expected. 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 --- .../RaspberryPi/AcpiTables/AcpiTables.inf | 8 +- .../RaspberryPi/AcpiTables/Dbg2MiniUart.aslc | 81 +++++++++ .../AcpiTables/{Dbg2.aslc =3D> Dbg2Pl011.aslc} | 30 +--- .../RaspberryPi/AcpiTables/SpcrMiniUart.aslc | 91 ++++++++++ .../AcpiTables/{Spcr.aslc =3D> SpcrPl011.aslc} | 10 +- Platform/RaspberryPi/AcpiTables/Uart.asl | 155 +++++++++++++----- .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 48 +++++- .../Drivers/ConfigDxe/ConfigDxe.inf | 1 + .../IndustryStandard/RpiDebugPort2Table.h | 33 ++++ Platform/RaspberryPi/Include/UartSelection.h | 20 +++ Platform/RaspberryPi/RPi3/RPi3.dsc | 8 + Platform/RaspberryPi/RPi4/RPi4.dsc | 8 + Platform/RaspberryPi/RaspberryPi.dec | 1 + 13 files changed, 410 insertions(+), 84 deletions(-) create mode 100644 Platform/RaspberryPi/AcpiTables/Dbg2MiniUart.aslc rename Platform/RaspberryPi/AcpiTables/{Dbg2.aslc =3D> Dbg2Pl011.aslc} (72= %) create mode 100644 Platform/RaspberryPi/AcpiTables/SpcrMiniUart.aslc rename Platform/RaspberryPi/AcpiTables/{Spcr.aslc =3D> SpcrPl011.aslc} (87= %) create mode 100644 Platform/RaspberryPi/Include/IndustryStandard/RpiDebugP= ort2Table.h create mode 100644 Platform/RaspberryPi/Include/UartSelection.h diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf b/Platform/Rasp= berryPi/AcpiTables/AcpiTables.inf index d3363a76a1..1ddc9ca5fe 100644 --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf @@ -2,7 +2,7 @@ # # ACPI table data and ASL sources required to boot the platform. # -# Copyright (c) 2019, ARM Limited. All rights reserved. +# Copyright (c) 2019-2021, ARM Limited. All rights reserved. # Copyright (c) 2017, Andrey Warkentin # Copyright (c) Microsoft Corporation. All rights reserved. # @@ -28,12 +28,14 @@ Emmc.asl Madt.aslc Fadt.aslc - Dbg2.aslc + Dbg2MiniUart.aslc + Dbg2Pl011.aslc Gtdt.aslc Iort.aslc Dsdt.asl Csrt.aslc - Spcr.aslc + SpcrMiniUart.aslc + SpcrPl011.aslc Pptt.aslc SsdtThermal.asl =20 diff --git a/Platform/RaspberryPi/AcpiTables/Dbg2MiniUart.aslc b/Platform/R= aspberryPi/AcpiTables/Dbg2MiniUart.aslc new file mode 100644 index 0000000000..be7d96c179 --- /dev/null +++ b/Platform/RaspberryPi/AcpiTables/Dbg2MiniUart.aslc @@ -0,0 +1,81 @@ +/** @file + * + * Debug Port Table (DBG2) + * + * Copyright (c) 2019, Pete Batard + * Copyright (c) 2012-2021, ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include +#include +#include +#include +#include + +#include "AcpiTables.h" + +#pragma pack(1) + +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_BCM2835_UART +#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_= BASE_ADDRESS +#define RPI_UART_LENGTH BCM2836_MINI_UART_= LENGTH +// +// RPI_UART_STR should match the value used Uart.asl +// +#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', 'M', 0x00 } + +#define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNa= meStr) { \ + { = \ + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* U= INT8 Revision */ \ + sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* U= INT16 Length */ \ + NumReg, /* U= INT8 NumberofGenericAddressRegisters */ \ + RPI_DBG2_NAMESPACESTRING_FIELD_SIZE, /* U= INT16 NameSpaceStringLength */ \ + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* U= INT16 NameSpaceStringOffset */ \ + 0, /* U= INT16 OemDataLength */ \ + 0, /* U= INT16 OemDataOffset */ \ + EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* U= INT16 Port Type */ \ + SubType, /* U= INT16 Port Subtype */ \ + {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, /* U= INT8 Reserved[2] */ \ + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), /* U= INT16 BaseAddressRegister Offset */ \ + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* U= INT16 AddressSize Offset */ \ + }, = \ + ARM_GAS32 (UartBase), /* EFI_ACPI_6_3_GENER= IC_ADDRESS_STRUCTURE BaseAddressRegister */ \ + UartAddrLen, /* UINT32 AddressSiz= e */ \ + UartNameStr /* UINT8 NameSpaceS= tring[MAX_DBG2_NAME_LEN] */ \ + } + + +STATIC DBG2_TABLE Dbg2 =3D { + { + ACPI_HEADER ( + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, + DBG2_TABLE, + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION + ), + OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo), + RPI_DBG2_NUM_DEBUG_PORTS /* U= INT32 NumberDbgDeviceInfo */ + }, + { + /* + * Kernel Debug Port + */ + DBG2_DEBUG_PORT_DDI ( + RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS, + RPI_UART_INTERFACE_TYPE, + RPI_UART_BASE_ADDRESS, + RPI_UART_LENGTH, + RPI_UART_STR + ), + } +}; + +#pragma pack() + +// +// Reference the table being generated to prevent the optimizer from remov= ing +// the data structure from the executable +// +VOID* CONST ReferenceAcpiTable =3D &Dbg2; diff --git a/Platform/RaspberryPi/AcpiTables/Dbg2.aslc b/Platform/Raspberry= Pi/AcpiTables/Dbg2Pl011.aslc similarity index 72% rename from Platform/RaspberryPi/AcpiTables/Dbg2.aslc rename to Platform/RaspberryPi/AcpiTables/Dbg2Pl011.aslc index e3f2adae7e..e07869b027 100644 --- a/Platform/RaspberryPi/AcpiTables/Dbg2.aslc +++ b/Platform/RaspberryPi/AcpiTables/Dbg2Pl011.aslc @@ -3,7 +3,7 @@ * Debug Port Table (DBG2) * * Copyright (c) 2019, Pete Batard - * Copyright (c) 2012-2020, ARM Limited. All rights reserved. + * Copyright (c) 2012-2021, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -11,7 +11,7 @@ =20 #include #include -#include +#include #include #include =20 @@ -19,37 +19,13 @@ =20 #pragma pack(1) =20 -#define RPI_DBG2_NUM_DEBUG_PORTS 1 -#define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 -#define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 15 - -#if (RPI_MODEL =3D=3D 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART= _BASE_ADDRESS #define RPI_UART_LENGTH BCM2836_PL011_UART= _LENGTH -#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', '0', 0x00 } -#else -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_DBG2_PORT= _SUBTYPE_SERIAL_BCM2835_UART -#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_= BASE_ADDRESS -#define RPI_UART_LENGTH BCM2836_MINI_UART_= LENGTH // // RPI_UART_STR should match the value used Uart.asl // -#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', 'M', 0x00 } -#endif - -typedef struct { - EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device; - EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddressRegiste= r; - UINT32 AddressSize; - UINT8 NameSpaceString[RP= I_DBG2_NAMESPACESTRING_FIELD_SIZE]; -} DBG2_DEBUG_DEVICE_INFORMATION; - -typedef struct { - EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description; - DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[RPI= _DBG2_NUM_DEBUG_PORTS]; -} DBG2_TABLE; - +#define RPI_UART_STR { '\\', '_', 'S', = 'B', '.', 'G', 'D', 'V', '0', '.', 'U', 'R', 'T', '0', 0x00 } =20 #define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, UartNa= meStr) { \ { = \ diff --git a/Platform/RaspberryPi/AcpiTables/SpcrMiniUart.aslc b/Platform/R= aspberryPi/AcpiTables/SpcrMiniUart.aslc new file mode 100644 index 0000000000..2f638c61a5 --- /dev/null +++ b/Platform/RaspberryPi/AcpiTables/SpcrMiniUart.aslc @@ -0,0 +1,91 @@ +/** @file +* SPCR Table +* +* Copyright (c) 2019 Pete Batard +* Copyright (c) 2014-2021, ARM Limited. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include +#include +#include +#include + +#include "AcpiTables.h" + +#define RPI_UART_FLOW_CONTROL_NONE 0 + +#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART +#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRESS +#define RPI_UART_INTERRUPT BCM2836_MINI_UART_INTERRUPT + +STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D { + ACPI_HEADER ( + EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE, + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION + ), + // UINT8 InterfaceType; + RPI_UART_INTERFACE_TYPE, + // UINT8 Reserved1[3]; + { + EFI_ACPI_RESERVED_BYTE, + EFI_ACPI_RESERVED_BYTE, + EFI_ACPI_RESERVED_BYTE + }, + // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddress; + ARM_GAS32 (RPI_UART_BASE_ADDRESS), + // UINT8 InterruptType; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC, + // UINT8 Irq; + 0, // Not used on ARM + // UINT32 GlobalSystemInterrupt; + RPI_UART_INTERRUPT, + // UINT8 BaudRate; +#if (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 9600) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_9600, +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 19200) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_19200, +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 57600) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_57600, +#elif (FixedPcdGet64 (PcdUartDefaultBaudRate) =3D=3D 115200) + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200, +#else +#error Unsupported SPCR Baud Rate +#endif + // UINT8 Parity; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY, + // UINT8 StopBits; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1, + // UINT8 FlowControl; + RPI_UART_FLOW_CONTROL_NONE, + // UINT8 TerminalType; + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_VT_UTF8, + // UINT8 Reserved2; + EFI_ACPI_RESERVED_BYTE, + // UINT16 PciDeviceId; + 0xFFFF, + // UINT16 PciVendorId; + 0xFFFF, + // UINT8 PciBusNumber; + 0x00, + // UINT8 PciDeviceNumber; + 0x00, + // UINT8 PciFunctionNumber; + 0x00, + // UINT32 PciFlags; + 0x00000000, + // UINT8 PciSegment; + 0x00, + // UINT32 Reserved3; + EFI_ACPI_RESERVED_DWORD +}; + +// +// Reference the table being generated to prevent the optimizer from remov= ing the +// data structure from the executable +// +VOID* CONST ReferenceAcpiTable =3D &Spcr; diff --git a/Platform/RaspberryPi/AcpiTables/Spcr.aslc b/Platform/Raspberry= Pi/AcpiTables/SpcrPl011.aslc similarity index 87% rename from Platform/RaspberryPi/AcpiTables/Spcr.aslc rename to Platform/RaspberryPi/AcpiTables/SpcrPl011.aslc index 07df3a718d..06e19c1245 100644 --- a/Platform/RaspberryPi/AcpiTables/Spcr.aslc +++ b/Platform/RaspberryPi/AcpiTables/SpcrPl011.aslc @@ -2,7 +2,7 @@ * SPCR Table * * Copyright (c) 2019 Pete Batard -* Copyright (c) 2014-2016, ARM Limited. All rights reserved. +* Copyright (c) 2014-2021, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -18,16 +18,10 @@ =20 #define RPI_UART_FLOW_CONTROL_NONE 0 =20 -// Prefer PL011 serial output on the Raspberry Pi 4 -#if (RPI_MODEL =3D=3D 4) #define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART #define RPI_UART_BASE_ADDRESS BCM2836_PL011_UART_BASE_ADDRE= SS #define RPI_UART_INTERRUPT BCM2836_PL011_UART_INTERRUPT -#else -#define RPI_UART_INTERFACE_TYPE EFI_ACPI_SERIAL_PORT_CONSOLE_= REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART -#define RPI_UART_BASE_ADDRESS BCM2836_MINI_UART_BASE_ADDRESS -#define RPI_UART_INTERRUPT BCM2836_MINI_UART_INTERRUPT -#endif + STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D { ACPI_HEADER ( EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryP= i/AcpiTables/Uart.asl index 81ae6711af..bac9d791eb 100644 --- a/Platform/RaspberryPi/AcpiTables/Uart.asl +++ b/Platform/RaspberryPi/AcpiTables/Uart.asl @@ -2,6 +2,7 @@ * * [DSDT] Serial devices (UART). * + * Copyright (c) 2021, ARM Limited. All rights reserved. * Copyright (c) 2020, Pete Batard * Copyright (c) 2018, Andrey Warkentin * Copyright (c) Microsoft Corporation. All rights reserved. @@ -93,57 +94,125 @@ Device(BTH0) { Name (_HID, "BCM2EA6") Name (_CID, "BCM2EA6") + + // + // UART In Use will be dynamically updated during boot + // 0x55 0x52 0x49 0x55 0xA 0x2 (Value must > 1) + // + Name (URIU, 0x2) + Method (_STA) { Return (0xf) } + + // + // Resource for URT0 (PL011) + // + Name (BTPL, ResourceTemplate () + { + UARTSerialBus( + 115200, // InitialBaudRate: in BPS + , // BitsPerByte: default to 8 bits + , // StopBits: Defaults to one bit + 0x00, // LinesInUse: 8 1-bit flags to + // declare enabled control lines. + // Raspberry Pi does not exposed + // HW control signals -> not supported. + // Optional bits: + // - Bit 7 (0x80) Request To Send (RTS) + // - Bit 6 (0x40) Clear To Send (CTS) + // - Bit 5 (0x20) Data Terminal Ready (DTR) + // - Bit 4 (0x10) Data Set Ready (DSR) + // - Bit 3 (0x08) Ring Indicator (RI) + // - Bit 2 (0x04) Data Carrier Detect (DTD) + // - Bit 1 (0x02) Reserved. Must be 0. + // - Bit 0 (0x01) Reserved. Must be 0. + , // IsBigEndian: + // default to LittleEndian. + , // Parity: Defaults to no parity + , // FlowControl: Defaults to + // no flow control. + 16, // ReceiveBufferSize + 16, // TransmitBufferSize + "\\_SB.GDV0.URT0", // ResourceSource: + // UART bus controller name + , // ResourceSourceIndex: assumed to be 0 + , // ResourceUsage: assumed to be + // ResourceConsumer + 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 } + }) + + // + // Resource for URTM (miniUART) + // + Name (BTMN, ResourceTemplate () + { + // + // BT UART: ResourceSource will be dynamically updated to + // either URT0 (PL011) or URTM (miniUART) during boot + // + UARTSerialBus( + 115200, // InitialBaudRate: in BPS + , // BitsPerByte: default to 8 bits + , // StopBits: Defaults to one bit + 0x00, // LinesInUse: 8 1-bit flags to + // declare enabled control lines. + // Raspberry Pi does not exposed + // HW control signals -> not supported. + // Optional bits: + // - Bit 7 (0x80) Request To Send (RTS) + // - Bit 6 (0x40) Clear To Send (CTS) + // - Bit 5 (0x20) Data Terminal Ready (DTR) + // - Bit 4 (0x10) Data Set Ready (DSR) + // - Bit 3 (0x08) Ring Indicator (RI) + // - Bit 2 (0x04) Data Carrier Detect (DTD) + // - Bit 1 (0x02) Reserved. Must be 0. + // - Bit 0 (0x01) Reserved. Must be 0. + , // IsBigEndian: + // default to LittleEndian. + , // Parity: Defaults to no parity + , // FlowControl: Defaults to + // no flow control. + 16, // ReceiveBufferSize + 16, // TransmitBufferSize + "\\_SB.GDV0.URTM", // ResourceSource: + // UART bus controller name + , // ResourceSourceIndex: assumed to be 0 + , // ResourceUsage: assumed to be + // ResourceConsumer + 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) { - Name (RBUF, ResourceTemplate () + if (URIU =3D=3D 0) { - // BT UART: URT0 (PL011) or URTM (miniUART) - UARTSerialBus( - 115200, // InitialBaudRate: in BPS - , // BitsPerByte: default to 8 bits - , // StopBits: Defaults to one bit - 0x00, // LinesInUse: 8 1-bit flags to - // declare enabled control lines. - // Raspberry Pi does not exposed - // HW control signals -> not supported. - // Optional bits: - // - Bit 7 (0x80) Request To Send (RTS) - // - Bit 6 (0x40) Clear To Send (CTS) - // - Bit 5 (0x20) Data Terminal Ready (DTR) - // - Bit 4 (0x10) Data Set Ready (DSR) - // - Bit 3 (0x08) Ring Indicator (RI) - // - Bit 2 (0x04) Data Carrier Detect (DTD) - // - Bit 1 (0x02) Reserved. Must be 0. - // - Bit 0 (0x01) Reserved. Must be 0. - , // IsBigEndian: - // default to LittleEndian. - , // Parity: Defaults to no parity - , // FlowControl: Defaults to - // no flow control. - 16, // ReceiveBufferSize - 16, // TransmitBufferSize -#if (RPI_MODEL =3D=3D 4) - "\\_SB.GDV0.URTM", // ResourceSource: -#else - "\\_SB.GDV0.URT0", // ResourceSource: -#endif - // UART bus controller name - , // ResourceSourceIndex: assumed to be 0 - , // ResourceUsage: assumed to be - // ResourceConsumer - UAR0, // DescriptorName: creates name - // for offset of resource descriptor - ) // Vendor data - // - // RPIQ connection for BT_ON/OFF + // PL011 UART is configured for console output + // Return Mini UART for Bluetooth // - GpioIO (Shared, PullUp, 0, 0, IoRestrictionNone, "\\_SB.GDV0.RPIQ", = 0, ResourceConsumer, , ) { 128 } - }) - Return (RBUF) + return (^BTMN) + } + else + { + // + // Mini UART is configured for console output + // Return PL011 UART for Bluetooth + // + return (^BTPL) + } } } diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index d3c5869949..d6efb59793 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -12,6 +12,10 @@ #include #include #include +#include +#include +#include + #include #include #include @@ -23,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -743,6 +748,11 @@ STATIC CONST AML_NAME_OP_REPLACE SsdtEmmcNameOpReplace= [] =3D { { } }; =20 +STATIC CONST AML_NAME_OP_REPLACE DsdtNameOpReplace[] =3D { + { "URIU", PcdToken (PcdUartInUse) }, + { } +}; + STATIC CONST NAMESPACE_TABLES SdtTables[] =3D { { SIGNATURE_64 ('R', 'P', 'I', 'T', 'H', 'F', 'A', 'N'), @@ -756,11 +766,11 @@ STATIC CONST NAMESPACE_TABLES SdtTables[] =3D { PcdToken(PcdSdIsArasan), SsdtEmmcNameOpReplace }, - { + { // DSDT SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0), 0, 0, - NULL + DsdtNameOpReplace }, { } }; @@ -779,6 +789,9 @@ HandleDynamicNamespace ( { UINTN Tables; =20 + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE *SpcrTable; + DBG2_TABLE *Dbg2Table; + switch (AcpiHeader->Signature) { case SIGNATURE_32 ('D', 'S', 'D', 'T'): case SIGNATURE_32 ('S', 'S', 'D', 'T'): @@ -788,14 +801,37 @@ HandleDynamicNamespace ( } } DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n")); - return FALSE; + case SIGNATURE_32 ('I', 'O', 'R', 'T'): // only enable the IORT on machines with >3G and no limit // to avoid problems with rhel/centos and other older OSs if (PcdGet32 (PcdRamLimitTo3GB) || !PcdGet32 (PcdRamMoreThan3GB)) { return FALSE; } + return TRUE; + + case SIGNATURE_32 ('S', 'P', 'C', 'R'): + SpcrTable =3D (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE *)AcpiHe= ader; + if ((PcdGet32 (PcdUartInUse) =3D=3D PL011_UART_IN_USE) && + (SpcrTable->InterfaceType =3D=3D EFI_ACPI_SERIAL_PORT_CONSOLE_REDI= RECTION_TABLE_INTERFACE_TYPE_ARM_PL011_UART)) { + return TRUE; + } else if ((PcdGet32 (PcdUartInUse) =3D=3D MINI_UART_IN_USE) && + (SpcrTable->InterfaceType =3D=3D EFI_ACPI_SERIAL_PORT_CONSO= LE_REDIRECTION_TABLE_INTERFACE_TYPE_BCM2835_UART)) { + return TRUE; + } + return FALSE; + + case SIGNATURE_32 ('D', 'B', 'G', '2'): + Dbg2Table =3D (DBG2_TABLE *)AcpiHeader; + if ((PcdGet32 (PcdUartInUse) =3D=3D PL011_UART_IN_USE) && + (Dbg2Table->Dbg2DeviceInfo[0].Dbg2Device.PortSubtype =3D=3D EFI_AC= PI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART)) { + return TRUE; + } else if ((PcdGet32 (PcdUartInUse) =3D=3D MINI_UART_IN_USE) && + (Dbg2Table->Dbg2DeviceInfo[0].Dbg2Device.PortSubtype =3D=3D= EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_BCM2835_UART)) { + return TRUE; + } + return FALSE; } =20 return TRUE; @@ -812,6 +848,12 @@ ConfigInitialize ( EFI_STATUS Status; EFI_EVENT EndOfDxeEvent; =20 + if ((MmioRead32(GPIO_GPFSEL1) & GPFSEL1_UART_MASK) =3D=3D PL011_UART_IN_= USE_REG_VALUE) { + PcdSet32S (PcdUartInUse, PL011_UART_IN_USE); + } else if ((MmioRead32(GPIO_GPFSEL1) & GPFSEL1_UART_MASK) =3D=3D MINI_UA= RT_IN_USE_REG_VALUE) { + PcdSet32S (PcdUartInUse, MINI_UART_IN_USE); + } + Status =3D gBS->LocateProtocol (&gRaspberryPiFirmwareProtocolGuid, NULL, (VOID**)&mFwProtocol); ASSERT_EFI_ERROR (Status); diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index 032e40b0c3..597e1b4205 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -94,6 +94,7 @@ gRaspberryPiTokenSpaceGuid.PcdFanOnGpio gRaspberryPiTokenSpaceGuid.PcdFanTemp gRaspberryPiTokenSpaceGuid.PcdBootPolicy + gRaspberryPiTokenSpaceGuid.PcdUartInUse =20 [Depex] gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid diff --git a/Platform/RaspberryPi/Include/IndustryStandard/RpiDebugPort2Tab= le.h b/Platform/RaspberryPi/Include/IndustryStandard/RpiDebugPort2Table.h new file mode 100644 index 0000000000..73134dfdc2 --- /dev/null +++ b/Platform/RaspberryPi/Include/IndustryStandard/RpiDebugPort2Table.h @@ -0,0 +1,33 @@ +/** @file + + Copyright (c) 2021, ARM Limited. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + + **/ +#ifndef __RPI_DEBUG_PORT_2_H__ +#define __RPI_DEBUG_PORT_2_H__ + +#include + +#define RPI_DBG2_NUM_DEBUG_PORTS 1 +#define RPI_DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1 +#define RPI_DBG2_NAMESPACESTRING_FIELD_SIZE 15 + +#pragma pack(1) + + +typedef struct { + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device; + EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddressRegiste= r; + UINT32 AddressSize; + UINT8 NameSpaceString[RP= I_DBG2_NAMESPACESTRING_FIELD_SIZE]; +} DBG2_DEBUG_DEVICE_INFORMATION; + +typedef struct { + EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description; + DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[RPI= _DBG2_NUM_DEBUG_PORTS]; +} DBG2_TABLE; + +#pragma pack() +#endif //__RPI_DEBUG_PORT_2_H__ diff --git a/Platform/RaspberryPi/Include/UartSelection.h b/Platform/Raspbe= rryPi/Include/UartSelection.h new file mode 100644 index 0000000000..803bf860bb --- /dev/null +++ b/Platform/RaspberryPi/Include/UartSelection.h @@ -0,0 +1,20 @@ +/** @file + * + * Copyright (c) 2021, ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#ifndef UART_SELECTION_H +#define UART_SELECTION_H + +#define GPFSEL1_UART_MASK (BIT17 | BIT16 | BIT15 | BIT14 | BIT= 13 | BIT12) + +#define PL011_UART_IN_USE_REG_VALUE (BIT17 | BIT14) // ALT0 - 0x240= 00 +#define MINI_UART_IN_USE_REG_VALUE (BIT16 | BIT13) // ALT5 - 0x120= 00 + +#define PL011_UART_IN_USE 0 +#define MINI_UART_IN_USE 1 + +#endif /* UART_SELECTION_H */ diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 425c7ff9ec..53825bcf62 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -552,6 +552,14 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 =20 + # + # UART in use + # This value will be synchronized with the setting in config.txt + # 0 - PL011_UART_IN_USE + # 1 - MINI_UART_IN_USE + # + gRaspberryPiTokenSpaceGuid.PcdUartInUse|1 + ##########################################################################= ###### # # Components Section - list of all EDK II Modules needed by this Platform diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index d8c6fdd4bd..fd73c4d14b 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -568,6 +568,14 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 =20 + # + # UART in use + # This value will be synchronized with the setting in config.txt + # 0 - PL011_UART_IN_USE + # 1 - MINI_UART_IN_USE + # + gRaspberryPiTokenSpaceGuid.PcdUartInUse|0 + ##########################################################################= ###### # # Components Section - list of all EDK II Modules needed by this Platform diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index 8eb1c2bac7..f1dd8ac0ed 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -72,3 +72,4 @@ gRaspberryPiTokenSpaceGuid.PcdPlatformResetDelay|0|UINT32|0x0000001E gRaspberryPiTokenSpaceGuid.PcdMmcEnableDma|0|UINT32|0x0000001F gRaspberryPiTokenSpaceGuid.PcdBootPolicy|0|UINT32|0x00000020 + gRaspberryPiTokenSpaceGuid.PcdUartInUse|1|UINT32|0x00000021 --=20 2.31.0.windows.1 -=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 (#75867): https://edk2.groups.io/g/devel/message/75867 Mute This Topic: https://groups.io/mt/83205745/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 Thu May 16 13:33:21 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+75868+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+75868+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1622449411; cv=none; d=zohomail.com; s=zohoarc; b=N/VJWKEsCpS93YeXjBtT/ZMLGhLRSkDr0jWuXTIrl/1cuutHghGav9mASpAZV1vAGboyOoER5W2F1Dxc0Dc38JMaMu0C3OyK7CvxaxR/9ieGX/YFjmVy7uM/MnxvmyFtVgmsblFVUSOFU7W0sdmiBepfnlT5bx6c7P74MSBzCKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622449411; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ULCBHNf+OfMQwDdsOgxuJkRAdzB1mK2I9Wt/8NbPM+Q=; b=iAP7xdpFLhUFBHDpC72HELOEMLH9v7Js0d4FdOCgswSbDoUbG2BXJTWFE9E7ll6PXChCyICnk0yVYS52fMxv6Pu02rESDayzED7dKz8RuEbb1fyT10Qu1C+SAtbkypRTZl66hC4xEHwUBkybRhoPLzcd7YGK5gDFMnDSBP2zB/c= 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+75868+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1622449411261899.3150454830237; Mon, 31 May 2021 01:23:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id poexYY1788612xgvtjQwpTVR; Mon, 31 May 2021 01:23:30 -0700 X-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 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 928C96D; Mon, 31 May 2021 01:23:29 -0700 (PDT) X-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: [edk2-devel] [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> In-Reply-To: <20210531082239.918-1-Sunny.Wang@arm.com> References: <20210531082239.918-1-Sunny.Wang@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,Sunny.Wang@arm.com X-Gm-Message-State: mP8mLJEP9DttsqtNMzM3CMsWx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1622449410; bh=K0bBxw5Cs7f0sJD2fnctMNw/Dgiw1SJ1WEtWWG/whdU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=CVNypE7e45UI8Jd1WT92OfF1ryDA4ExDEzmTT8eH47BMaSeJ5SVn7h0/qgzrMO1ypgi SmNAHbOurL0Pmh94VEx0pr6Kq9Cq6rzMG1mYi7YG3ZRt1KpLUe6Z2fDwoFuUTTMpZ5an8 NAUahwbhhdf9CPfAzTnxmTTJIjtCLx6bHAs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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/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) { MEMORY32FIXED (ReadWrite, 0, BCM2836_PL011_UART_LENGTH, RMEM) Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { BCM2836_P= L011_UART_INTERRUPT } + + PinFunction (Exclusive, PullDown, BCM_ALT3, "\\_SB.GDV0.GPI0", 0, Reso= urceConsumer, , ) { 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, Reso= urceConsumer, , ) { 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, Resour= ceConsumer, , ) { 14, 15 } + PinFunction (Exclusive, PullDown, BCM_ALT5, "\\_SB.GDV0.GPI0", 0, Reso= urceConsumer, , ) { 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, Reso= urceConsumer, , ) { 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 -=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 (#75868): https://edk2.groups.io/g/devel/message/75868 Mute This Topic: https://groups.io/mt/83205747/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-