From nobody Sun May 19 01:15:24 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+109587+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+109587+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697200137; cv=none; d=zohomail.com; s=zohoarc; b=mrx/JvbLf5ZoY6ydZwgG/WYkMIqHffXxmZCNSZhtZLRfla8/0YUhPM4vfC3REwvDo+TdcSitv6Xji9uPEgumvbVCEI+VHAcIbCF1QfQvTlikQKsA4GG/9en6/c+txAD608yqM2hLuxfYdI2zsyh8QtFqRX0CwL/gB/3GmXlvkpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697200137; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=7oaUuhQHPJ7BvZ4qkbDqCyglPNlXbLbNQGTOJXiZnms=; b=Ae14RMxBFjjXoG2eC2SPPwAng4r6SNzGXpEytc9L3ykOVm6GSXhCDxMNsGbQDnWPz78xVD2y7TjkzOxtPUL4/s+Pz6RdTTjF8M0tBnK8fiqygtd+e3Ftip5RuHOGM4rFDDw6rSTc0xgv1w/W2PIhkFFvuIzvPax9wo2FtCkmP1o= 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+109587+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697200137541187.3773289284901; Fri, 13 Oct 2023 05:28:57 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=bDIdKBfO6cb6bC5quJCdSoNTgKeDqT5DwIgDCOeTXDI=; c=relaxed/simple; d=groups.io; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1697200137; v=1; b=vZ1VnV8YM8l5BpTZFgCnrHYdkaxkAYe/bHO5XciExZ//2tvbP0fFoQR91AGLeuGviluKNElQ ismRHKQLmr0K+B/EvrwhvjKqLnWW/zaU9haAHUP2zkOoPym83iLYdmE7BTk0ND8aeirYA7n1iFX IpYeY1O4mGR+vBZJsFosMQ7M= X-Received: by 127.0.0.2 with SMTP id So9RYY1788612xVB1qIrxqfZ; Fri, 13 Oct 2023 05:28:57 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.37080.1697200135801426836 for ; Fri, 13 Oct 2023 05:28:56 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id A93B5260837; Fri, 13 Oct 2023 14:28:53 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id p-Aeh3ifq_H1; Fri, 13 Oct 2023 14:28:51 +0200 (CEST) X-Received: from [172.17.0.1] (83.11.27.172.ipv4.supernova.orange.pl [83.11.27.172]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 235EA260839; Fri, 13 Oct 2023 14:28:51 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Fri, 13 Oct 2023 14:28:49 +0200 Subject: [edk2-devel] [PATCH edk2-platforms WIP 1/5] SbsaQemu: introduce macro to compare platform version MIME-Version: 1.0 Message-Id: <20231013-ehci-xhci-fix-v1-1-f56f28e70e36@linaro.org> References: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> In-Reply-To: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton Precedence: Bulk 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,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: aDJOJI56uAQ7L6p5ZGPJYX72x1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697200139011100004 We want to check "if platver < 0.3" in an easy way. --- .../IndustryStandard/SbsaQemuPlatformVersion.h | 25 ++++++++++++++++= ++++ 1 file changed, 25 insertions(+) diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatfor= mVersion.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatfor= mVersion.h new file mode 100644 index 000000000000..dd2483787002 --- /dev/null +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersio= n.h @@ -0,0 +1,25 @@ +/** @file +* +* Copyright (c) Linaro Limited. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef SBSAQEMUPLATFORM_VERSION_H +#define SBSAQEMUPLATFORM_VERSION_H + +/* + * Compare PlatformVersion + * + */ + +#define PLATFORM_VERSION_LESS_THAN(Major, Minor) ( \ + ( \ + ( PcdGet32 (PcdPlatformVersionMajor) < Major) || \ + ( \ + ( PcdGet32 (PcdPlatformVersionMajor) =3D=3D Major) && \ + ( PcdGet32 (PcdPlatformVersionMinor) < Minor) \ + ) \ + ) \ +) +#endif --=20 2.41.0 -=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 (#109587): https://edk2.groups.io/g/devel/message/109587 Mute This Topic: https://groups.io/mt/101938736/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 Sun May 19 01:15:24 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+109588+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+109588+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697200138; cv=none; d=zohomail.com; s=zohoarc; b=SIcfRFdCM301eTTrdsCgeibACBK6SGi6BMFPC+jn3ukSuSGt4EKSwkhv78tR/+TyIAYrvo1T9GeO9cIBjLBKCQTsFDU7HiyMHl8Np2obGyz7y+jZrt2630PcO7+ino2MThF6JcUAnjkGtAmUMIX0C9swBInbcNoxUKhn2M7lyTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697200138; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=uR8BvIo5ItRJOvFNbEsnz+gwzlEVwh0qMbnJoM1x+k4=; b=HzOl5e1CICagyScuUAyl8t+RnetUzLzaWXLhs5j4vmUZ9MUrVridHM+YoGdABJU281JDUq6ID7ZH5sud4nE51L7e43GLhO/iTutqKbyJA47FcrQAM3bRSvwVLu6il/WY2RSV7LO4Pe0jU15Zlb3f+Z7RYispNlSlzrcbessMcIE= 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+109588+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697200138384733.4956834912208; Fri, 13 Oct 2023 05:28:58 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=IFdJLLJhWXuuc/qhfdNRVbyDRK/QWfXhbRvnvZmeVPs=; c=relaxed/simple; d=groups.io; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1697200138; v=1; b=p6E71gqlOJVEd4c8unUhjh7MsJ84jwwXb9JMNqK6ZtGXLkC4a1KMWM7lTfLnVmdfRSrTavTu j2zNWfWAuWppx/8Jf1/UD8TZD/VMPrfqt6D7sruYKygc0x+T4Cat723MvHATbgt7dMBR+SeLKg4 mn+aeagewNr++4O65yBpZScs= X-Received: by 127.0.0.2 with SMTP id 3URLYY1788612xiVlXYmtmcJ; Fri, 13 Oct 2023 05:28:58 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.37081.1697200137164467924 for ; Fri, 13 Oct 2023 05:28:57 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 3A8FF260839; Fri, 13 Oct 2023 14:28:55 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id zrZpWGVUZN4S; Fri, 13 Oct 2023 14:28:53 +0200 (CEST) X-Received: from [172.17.0.1] (83.11.27.172.ipv4.supernova.orange.pl [83.11.27.172]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id B600226083A; Fri, 13 Oct 2023 14:28:51 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Fri, 13 Oct 2023 14:28:50 +0200 Subject: [edk2-devel] [PATCH edk2-platforms WIP 2/5] WIP: SbsaQemu: rename USB controller variables to be generic MIME-Version: 1.0 Message-Id: <20231013-ehci-xhci-fix-v1-2-f56f28e70e36@linaro.org> References: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> In-Reply-To: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton Precedence: Bulk 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,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: kfiQITEHHJEF7uKimKHRjPiRx1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697200139020100005 If run on PlatformVersion <0.3 then we have EHCI controller (not working) instead of XHCI one. *BSD platforms hang with wrong combination. --- Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 4 = ++-- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 4 = ++-- Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 4 = ++-- .../Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf | 4 = ++-- .../Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 4 = ++-- Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 4 = ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec b/Silicon/Qemu/SbsaQemu/Sbs= aQemu.dec index 913d1d75ef29..5e6578068fc8 100644 --- a/Silicon/Qemu/SbsaQemu/SbsaQemu.dec +++ b/Silicon/Qemu/SbsaQemu/SbsaQemu.dec @@ -32,8 +32,8 @@ [PcdsFixedAtBuild.common] # Non discoverable devices Pcds gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase|0|UINT64|0x00= 000001 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize|0x10000|UINT3= 2|0x00000002 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciBase|0|UINT64|0x00= 000003 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciSize|0x10000|UINT3= 2|0x00000004 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbBase|0|UINT64|0x000= 00003 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbSize|0x10000|UINT32= |0x00000004 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdDeviceTreeBaseAddress|0x100000= 00000|UINT64|0x00000005 =20 # PCDs complementing PCIe layout pulled into ACPI tables diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/S= bsaQemu.dsc index 36723e21d7b5..3900fed0c7dc 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc @@ -432,8 +432,8 @@ [PcdsFixedAtBuild.common] # Non discoverable devices (AHCI,XHCI) gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase|0x60100000 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize|0x00010000 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciBase|0x60110000 - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciSize|0x00010000 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbBase|0x60110000 + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbSize|0x00010000 =20 # PL011 - Serial Terminal gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x60000000 diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu= /SbsaQemu/AcpiTables/AcpiTables.inf index 8d4905362edc..42cc203eeb7b 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf @@ -68,8 +68,8 @@ [FixedPcd] =20 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciBase - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciSize + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbBase + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbSize =20 [Pcd] gArmTokenSpaceGuid.PcdGicDistributorBase diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlat= formDxe.inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPla= tformDxe.inf index 19534b7a274a..4cda4eae0f7b 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .inf +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .inf @@ -37,8 +37,8 @@ [LibraryClasses] [Pcd] gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciBase gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformAhciSize - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciBase - gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformXhciSize + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbBase + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformUsbSize =20 gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlat= formDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatf= ormDxe.c index 36ada4270bbf..9aca789b5673 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .c @@ -57,9 +57,9 @@ InitializeSbsaQemuPlatformDxe ( return Status; } =20 - Base =3D (VOID*)(UINTN)PcdGet64 (PcdPlatformXhciBase); + Base =3D (VOID*)(UINTN)PcdGet64 (PcdPlatformUsbBase); ASSERT (Base !=3D NULL); - Size =3D (UINTN)PcdGet32 (PcdPlatformXhciSize); + Size =3D (UINTN)PcdGet32 (PcdPlatformUsbSize); ASSERT (Size !=3D 0); =20 DEBUG ((DEBUG_INFO, "%a: Got platform XHCI %llx %u\n", diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl b/Silicon/Qemu/SbsaQ= emu/AcpiTables/Dsdt.asl index 543b5782580a..4ff267e00802 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl @@ -79,8 +79,8 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", Method (_CRS, 0x0, Serialized) { Name (RBUF, ResourceTemplate() { Memory32Fixed (ReadWrite, - FixedPcdGet32 (PcdPlatformXhciBase), - FixedPcdGet32 (PcdPlatformXhciSize)) + FixedPcdGet32 (PcdPlatformUsbBase), + FixedPcdGet32 (PcdPlatformUsbSize)) Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive)= { 43 } }) Return (RBUF) --=20 2.41.0 -=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 (#109588): https://edk2.groups.io/g/devel/message/109588 Mute This Topic: https://groups.io/mt/101938738/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 Sun May 19 01:15:24 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+109589+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+109589+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697200139; cv=none; d=zohomail.com; s=zohoarc; b=gaYQKLwZwtJ19cDJpYx5vcMRvW89US+BZpTg28ewKCgwefXIbcHJ6B2tQeV/9GgP48V2GsrjXbj06UKI4ZEv49hV9kbYvEK7ng1L0HEO52L765wp4BIIu0zEcbPXhHA6FGMyiXhfbNre+CybJx4RzFVDhUo+l0lvU1HQzBiwUoA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697200139; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=mboYWsr7fSP9AS9xWXe5l62Jcv/9xJoWVsbvu+iscf8=; b=fVNjLA+NmRZUtYhGdJiEahs6IDO4nlNxivt1rVpVu/prrB99Rj+L8KDuOSS8A0tnxacX/H2XMjZiJURsLvTXjEF4C+esMwgPO4S6Bt+LGUvZpa6j+u6SmSnBFRo6Ve+2/xfkVm/7eAy5Wb7uPcqrFJAfGSJwIN6ule/Taud5s98= 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+109589+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697200139514148.67749568886416; Fri, 13 Oct 2023 05:28:59 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=UYhuKYesdbcNpGpJwWzSBFa4s7AGP63RRuVWzIi0Nbc=; c=relaxed/simple; d=groups.io; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1697200139; v=1; b=mVgRVgqcvI3CcXqYSiAIoE+3tkYmFEu6Z2AoZ2rtP1itiJViwOHAplI9usNlbWSA2JLYPtM/ VehZo3QTDUfkV2FqaHJlRjAB3uUJqoOXvlLVk8mia3L4Fs7Q5BaFnyvXvfsIv5AMCuKptG24N4W n0UA0FcLzFnIvfbwKDOKH3Do= X-Received: by 127.0.0.2 with SMTP id iaRrYY1788612xuuKuN21T53; Fri, 13 Oct 2023 05:28:59 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web10.37091.1697200138072839382 for ; Fri, 13 Oct 2023 05:28:58 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id D5BA526083A; Fri, 13 Oct 2023 14:28:55 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id xPjF0KmHqiPh; Fri, 13 Oct 2023 14:28:54 +0200 (CEST) X-Received: from [172.17.0.1] (83.11.27.172.ipv4.supernova.orange.pl [83.11.27.172]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 6F4F9260B30; Fri, 13 Oct 2023 14:28:52 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Fri, 13 Oct 2023 14:28:51 +0200 Subject: [edk2-devel] [PATCH edk2-platforms WIP 3/5] SbsaQemu: move XHCI to SSDT MIME-Version: 1.0 Message-Id: <20231013-ehci-xhci-fix-v1-3-f56f28e70e36@linaro.org> References: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> In-Reply-To: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton Precedence: Bulk 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,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4HJt7by9niSoM238iFIbtOJ2x1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697200141074100013 I want to add EHCI/XHCI switching so platforms older than 0.3 would not complain about missing XHCI. --- Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 1 + Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 116 ----------------- Silicon/Qemu/SbsaQemu/AcpiTables/Xhci.asl | 132 ++++++++++++++++++++ 3 files changed, 133 insertions(+), 116 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu= /SbsaQemu/AcpiTables/AcpiTables.inf index 42cc203eeb7b..cd89ab346aa7 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf @@ -21,6 +21,7 @@ [Sources] Fadt.aslc Mcfg.aslc Spcr.aslc + Xhci.asl =20 [Packages] ArmPlatformPkg/ArmPlatformPkg.dec diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl b/Silicon/Qemu/SbsaQ= emu/AcpiTables/Dsdt.asl index 4ff267e00802..714636b518a5 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl @@ -68,122 +68,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", } } =20 - // USB XHCI Host Controller - Device (USB0) { - Name (_HID, "PNP0D10") // _HID: Hardware ID - Name (_UID, 0x00) // _UID: Unique ID - Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute - Method (_STA) { - Return (0xF) - } - Method (_CRS, 0x0, Serialized) { - Name (RBUF, ResourceTemplate() { - Memory32Fixed (ReadWrite, - FixedPcdGet32 (PcdPlatformUsbBase), - FixedPcdGet32 (PcdPlatformUsbSize)) - Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive)= { 43 } - }) - Return (RBUF) - } - - // Root Hub - Device (RHUB) { - Name (_ADR, 0x00000000) // Address of Root Hub should be 0 as= per ACPI 5.0 spec - Method (_STA) { - Return (0xF) - } - - // Ports connected to Root Hub - Device (HUB1) { - Name (_ADR, 0x00000001) - Name (_UPC, Package() { - 0x00, // Port is NOT connectable - 0xFF, // Don't care - 0x00000000, // Reserved 0 must be zero - 0x00000000 // Reserved 1 must be zero - }) - Method (_STA) { - Return (0xF) - } - - Device (PRT1) { - Name (_ADR, 0x00000001) - Name (_UPC, Package() { - 0xFF, // Port is connectable - 0x00, // Port connector is A - 0x00000000, - 0x00000000 - }) - Name (_PLD, Package() { - Buffer(0x10) { - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }) - Method (_STA) { - Return (0xF) - } - } // USB0_RHUB_HUB1_PRT1 - Device (PRT2) { - Name (_ADR, 0x00000002) - Name (_UPC, Package() { - 0xFF, // Port is connectable - 0x00, // Port connector is A - 0x00000000, - 0x00000000 - }) - Name (_PLD, Package() { - Buffer(0x10) { - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }) - Method (_STA) { - Return (0xF) - } - } // USB0_RHUB_HUB1_PRT2 - - Device (PRT3) { - Name (_ADR, 0x00000003) - Name (_UPC, Package() { - 0xFF, // Port is connectable - 0x09, // Type C connector - USB2 and SS wit= h Switch - 0x00000000, - 0x00000000 - }) - Name (_PLD, Package() { - Buffer (0x10) { - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }) - Method (_STA) { - Return (0xF) - } - } // USB0_RHUB_HUB1_PRT3 - - Device (PRT4) { - Name (_ADR, 0x00000004) - Name (_UPC, Package() { - 0xFF, // Port is connectable - 0x09, // Type C connector - USB2 and SS wit= h Switch - 0x00000000, - 0x00000000 - }) - Name (_PLD, Package() { - Buffer (0x10){ - 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - } - }) - Method (_STA) { - Return (0xF) - } - } // USB0_RHUB_HUB1_PRT4 - } // USB0_RHUB_HUB1 - } // USB0_RHUB - } // USB0 - Device (PCI0) { Name (_HID, EISAID ("PNP0A08")) // PCI Express Root Bridge diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Xhci.asl b/Silicon/Qemu/SbsaQ= emu/AcpiTables/Xhci.asl new file mode 100644 index 000000000000..bfdcb09b28f0 --- /dev/null +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Xhci.asl @@ -0,0 +1,132 @@ +/** @file +* [DSDT] XHCI Usb Host controller +* +* Copyright (c) 2023, Linaro Ltd. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +DefinitionBlock (__FILE__, "SSDT", 2, "LINARO", "SBSAXHCI", 2) +{ + Scope (\_SB_) + { + // USB XHCI Host Controller + Device (USB3) { + Name (_HID, "PNP0D10") // _HID: Hardware ID + Name (_UID, 0x00) // _UID: Unique ID + Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute + Method (_STA) { + Return (0xF) + } + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, + FixedPcdGet32 (PcdPlatformUsbBase), + FixedPcdGet32 (PcdPlatformUsbSize)) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 43 } + }) + Return (RBUF) + } + + // Root Hub + Device (RHUB) { + Name (_ADR, 0x00000000) // Address of Root Hub should be 0 as per= ACPI 5.0 spec + Method (_STA) { + Return (0xF) + } + + // Ports connected to Root Hub + Device (HUB1) { + Name (_ADR, 0x00000001) + Name (_UPC, Package() { + 0x00, // Port is NOT connectable + 0xFF, // Don't care + 0x00000000, // Reserved 0 must be zero + 0x00000000 // Reserved 1 must be zero + }) + Method (_STA) { + Return (0xF) + } + + Device (PRT1) { + Name (_ADR, 0x00000001) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Port connector is A + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer(0x10) { + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT1 + Device (PRT2) { + Name (_ADR, 0x00000002) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Port connector is A + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer(0x10) { + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT2 + + Device (PRT3) { + Name (_ADR, 0x00000003) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x09, // Type C connector - USB2 and SS with Switch + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer (0x10) { + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT3 + + Device (PRT4) { + Name (_ADR, 0x00000004) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x09, // Type C connector - USB2 and SS with Switch + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer (0x10){ + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT4 + } // USB0_RHUB_HUB1 + } // USB0_RHUB + } // USB0 + } //\SB +} --=20 2.41.0 -=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 (#109589): https://edk2.groups.io/g/devel/message/109589 Mute This Topic: https://groups.io/mt/101938742/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 Sun May 19 01:15:24 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+109590+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+109590+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697200140; cv=none; d=zohomail.com; s=zohoarc; b=aWh5DfYD/W3kp17gLXr07FgA1l6Y4rjkvnld3V4PxgICuhjvqScLtHBpAAGp+Ovtv1V+BQ6zvU54BacTEqcLVygkVKbKwdLa7KAo4JB25t8gVVadUqqvi8AcJtg6Wf0F/Nq5OWGh6JLLdVBUVKj0dwOEIr5TBmSRw+/TCeE9Kl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697200140; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=sFCgOYOWMTocpsZEQp+uk5n+kj6eH9nCzY3q0rli4iw=; b=i1eEWQ8woiMIHWu+jioTbXk2ic0bCzRfWIZkksz7RBqNIaklr8oGX3WKXmHLUWKUiLKQzUvc758pH6hc8txQ1bFD+oZ2E39pK+6bGL/JzBtyYpkr/oEninfJS3oL9KpMfntpJzEcrcgYVAI75e4fGxyY3bjGA/7noOUVnDMTgIw= 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+109590+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697200140547641.8724793984329; Fri, 13 Oct 2023 05:29:00 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=5j2tjYu3yA1j0qXcdYaFgnfGZ3Z9Dr/l6M764BeaZ50=; c=relaxed/simple; d=groups.io; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1697200140; v=1; b=gIn0rjYX9Ktxk/eqGl4MovYTRoWqff3f0FdVlu6w+MbhUXv3HAop8UG0PqllpwfVlzOWFA+b e/zhMWgD+cXDj8jHLB7vNpObYyfVfmgwE2whDXTGEG22k2a2ak4JXWDxAeKHIUVR0nYbXYF4kpr Bh53zu9tL2GNoxE1lIq1XX28= X-Received: by 127.0.0.2 with SMTP id kGP8YY1788612xtfjrRrSMol; Fri, 13 Oct 2023 05:29:00 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.37083.1697200139266424089 for ; Fri, 13 Oct 2023 05:28:59 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 24B26260B30; Fri, 13 Oct 2023 14:28:57 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id mjM7QUV0KSSx; Fri, 13 Oct 2023 14:28:55 +0200 (CEST) X-Received: from [172.17.0.1] (83.11.27.172.ipv4.supernova.orange.pl [83.11.27.172]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 082EE260BB4; Fri, 13 Oct 2023 14:28:52 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Fri, 13 Oct 2023 14:28:52 +0200 Subject: [edk2-devel] [PATCH edk2-platforms WIP 4/5] SbsaQemu: add EHCI to SSDT MIME-Version: 1.0 Message-Id: <20231013-ehci-xhci-fix-v1-4-f56f28e70e36@linaro.org> References: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> In-Reply-To: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton Precedence: Bulk 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,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: x9XWu2O5YuRMAM3E7ex86Jo8x1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697200141086100014 I want to add EHCI/XHCI switching so platforms older than 0.3 would not complain about missing XHCI. --- Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 1 + Silicon/Qemu/SbsaQemu/AcpiTables/Ehci.asl | 132 ++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu= /SbsaQemu/AcpiTables/AcpiTables.inf index cd89ab346aa7..b58a2137ec03 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf @@ -22,6 +22,7 @@ [Sources] Mcfg.aslc Spcr.aslc Xhci.asl + Ehci.asl =20 [Packages] ArmPlatformPkg/ArmPlatformPkg.dec diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Ehci.asl b/Silicon/Qemu/SbsaQ= emu/AcpiTables/Ehci.asl new file mode 100644 index 000000000000..186f28363d95 --- /dev/null +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Ehci.asl @@ -0,0 +1,132 @@ +/** @file +* [DSDT] XHCI Usb Host controller +* +* Copyright (c) 2023, Linaro Ltd. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +DefinitionBlock (__FILE__, "SSDT", 1, "LINARO", "SBSAEHCI", 1) +{ + Scope (\_SB_) + { + // USB EHCI Host Controller + Device (USB2) { + Name (_HID, "PNP0D20") // _HID: Hardware ID + Name (_UID, 0x00) // _UID: Unique ID + Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute + Method (_STA) { + Return (0xF) + } + Method (_CRS, 0x0, Serialized) { + Name (RBUF, ResourceTemplate() { + Memory32Fixed (ReadWrite, + FixedPcdGet32 (PcdPlatformUsbBase), + FixedPcdGet32 (PcdPlatformUsbSize)) + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 43 } + }) + Return (RBUF) + } + + // Root Hub + Device (RHUB) { + Name (_ADR, 0x00000000) // Address of Root Hub should be 0 as per= ACPI 5.0 spec + Method (_STA) { + Return (0xF) + } + + // Ports connected to Root Hub + Device (HUB1) { + Name (_ADR, 0x00000001) + Name (_UPC, Package() { + 0x00, // Port is NOT connectable + 0xFF, // Don't care + 0x00000000, // Reserved 0 must be zero + 0x00000000 // Reserved 1 must be zero + }) + Method (_STA) { + Return (0xF) + } + + Device (PRT1) { + Name (_ADR, 0x00000001) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Port connector is A + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer(0x10) { + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT1 + Device (PRT2) { + Name (_ADR, 0x00000002) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Port connector is A + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer(0x10) { + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT2 + + Device (PRT3) { + Name (_ADR, 0x00000003) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Port connector is A + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer (0x10) { + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT3 + + Device (PRT4) { + Name (_ADR, 0x00000004) + Name (_UPC, Package() { + 0xFF, // Port is connectable + 0x00, // Port connector is A + 0x00000000, + 0x00000000 + }) + Name (_PLD, Package() { + Buffer (0x10){ + 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x31, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + } + }) + Method (_STA) { + Return (0xF) + } + } // USB0_RHUB_HUB1_PRT4 + } // USB0_RHUB_HUB1 + } // USB0_RHUB + } // USB0 + } //\SB +} --=20 2.41.0 -=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 (#109590): https://edk2.groups.io/g/devel/message/109590 Mute This Topic: https://groups.io/mt/101938743/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 Sun May 19 01:15:24 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+109591+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+109591+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697200141; cv=none; d=zohomail.com; s=zohoarc; b=igJEFfgzslNnLMxAK6TuO8hLR9L0ih9vgy/okwx5slPKOeu39irXEX6d9HBrFs0X7MZ6sbeJE/l5VFSF67sdYpIbhMp37XcVdCew8jraXtjJ7uOLXpQZOT7+92f28hOydKFp/umv27WOwoXfDOWsI89oqixezaVq5ixXnk3xo54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697200141; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=O9Lx0mfc+LFvoi7EuPGklwuSl6+fD63XREdvUSwaxzc=; b=hSqXFq883clkzMJaHUcqyOAJAg1aLy2ZLp09/mWZic5GIw6NHkIgRLiRLly6Y/vZYEs6LxVw5XssGDUG2mtyG31W0wx3xbdd63ECHNlKPAEEIm52kEbypnw4ihPdqKnELtMO6cTtjiYDY5fUnwZ3cK3Q0fyOYvt29TdTbDsn+ss= 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+109591+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697200141003996.3372224323276; Fri, 13 Oct 2023 05:29:01 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=8yeyLmzh5CKXqPJduQIkXAeDhtTZweuqDpOcD/87YLs=; c=relaxed/simple; d=groups.io; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1697200140; v=1; b=vSR7DMGKKUoYmBbTta30KIqwi0Vpj6CJz9XTiq5oTU6bKiTqAwCbedLBfX1Ii2aknBdGsV85 b30BJIWYkqFjmPEjBD6G3bucMO+JwbWeGnieoTbHE5JFKKfMDsVBnIK6qxnfHDXZOy3wIpdZ55i aT/WJtyMAbjVbTyCALofMJpQ= X-Received: by 127.0.0.2 with SMTP id tvCZYY1788612xT3bR6CpW8V; Fri, 13 Oct 2023 05:29:00 -0700 X-Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) by mx.groups.io with SMTP id smtpd.web11.37084.1697200139920933707 for ; Fri, 13 Oct 2023 05:29:00 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id EBAB7260BB4; Fri, 13 Oct 2023 14:28:57 +0200 (CEST) X-Virus-Scanned: Debian amavis at juszkiewicz.com.pl X-Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id 5VqrUh_-tovk; Fri, 13 Oct 2023 14:28:56 +0200 (CEST) X-Received: from [172.17.0.1] (83.11.27.172.ipv4.supernova.orange.pl [83.11.27.172]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id AE36B260C04; Fri, 13 Oct 2023 14:28:53 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Fri, 13 Oct 2023 14:28:53 +0200 Subject: [edk2-devel] [PATCH edk2-platforms WIP 5/5] WIP: try to enable/disable proper USB controller MIME-Version: 1.0 Message-Id: <20231013-ehci-xhci-fix-v1-5-f56f28e70e36@linaro.org> References: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> In-Reply-To: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton Precedence: Bulk 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,marcin.juszkiewicz@linaro.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: KFFxz7TSHGzycc6ZcVAdovCQx1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697200143042100023 If platform version < 0.3 then we want EHCI. Otherwise XHCI needs to be present. The problem: LocateAndInstallAcpiFromFvConditional() gets only DBG2 and FACP tables. Looks like synchronization issue as there were moments when it got all present tables. Anyway even if all goes well then SSDT nodes for both XHCI and EHCI were present in resulting system. --- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 2 + .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 3 + .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 62 ++++++++++++++++= ++++ 3 files changed, 67 insertions(+) diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/S= bsaQemu.dsc index 3900fed0c7dc..80ea4ed2edd2 100644 --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc @@ -172,6 +172,8 @@ [LibraryClasses.common] =20 ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf =20 + AcpiLib|EmbeddedPkg/Library/AcpiLib/AcpiLib.inf + ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf =20 diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf index 7c7e08e0fd3a..c67f9a92fd4c 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf @@ -29,6 +29,7 @@ [Packages] Silicon/Qemu/SbsaQemu/SbsaQemu.dec =20 [LibraryClasses] + AcpiLib ArmLib BaseMemoryLib BaseLib @@ -50,6 +51,8 @@ [Pcd] gArmTokenSpaceGuid.PcdGicRedistributorsBase gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdGicItsBase gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdSmmuBase + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMajor + gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPlatformVersionMinor =20 [Depex] gEfiAcpiTableProtocolGuid ## CONSUMES diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index fd849ca1594b..b103111606e3 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,14 @@ =20 #pragma pack(1) =20 +/* + * The GUID inside Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf _must_ = match + * below. + */ +STATIC CONST EFI_GUID mAcpiTableFile =3D { + 0x7E374E25, 0x8E01, 0x4FEE, { 0x87, 0xf2, 0x39, 0x0C, 0x23, 0xC6, 0x06, = 0xCD } + //7E374E25-8E01-4FEE-87F2-390C23C606CD +}; =20 static UINTN GicItsBase; =20 @@ -682,6 +691,55 @@ AddGtdtTable ( return Status; } =20 +// +// Monitor the ACPI tables being installed and when +// a DSDT/SSDT is detected check do we want to enable +// EHCI or XHCI USB controller +// +STATIC +BOOLEAN +HandleDynamicNamespace ( + IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader + ) +{ + switch (AcpiHeader->Signature) { + case SIGNATURE_32 ('D', 'S', 'D', 'T'): + case SIGNATURE_32 ('S', 'S', 'D', 'T'): + if (AcpiHeader->OemTableId =3D=3D SIGNATURE_64 ('S', 'B', 'S', 'A', 'X= ', 'H', 'C', 'I')) + { + DEBUG ((DEBUG_ERROR, "HRW: XHCI\n")); + if (! PLATFORM_VERSION_LESS_THAN(0, 3) ) + { + + DEBUG ((DEBUG_ERROR, "HRW: XHCI enabled\n")); + return TRUE; + } + else + { + DEBUG ((DEBUG_ERROR, "HRW: XHCI disabled\n")); + return FALSE; + } + } + if (AcpiHeader->OemTableId =3D=3D SIGNATURE_64 ('S', 'B', 'S', 'A', 'E= ', 'H', 'C', 'I')) + { + DEBUG ((DEBUG_ERROR, "HRW: EHCI\n")); + if ( PLATFORM_VERSION_LESS_THAN(0, 3) ) + { + + DEBUG ((DEBUG_ERROR, "HRW: EHCI enabled\n")); + return TRUE; + } + else + { + DEBUG ((DEBUG_ERROR, "HRW: EHCI disabled\n")); + return FALSE; + } + } + } + + return TRUE; +} + EFI_STATUS EFIAPI InitializeSbsaQemuAcpiDxe ( @@ -738,5 +796,9 @@ InitializeSbsaQemuAcpiDxe ( DEBUG ((DEBUG_ERROR, "Failed to add GTDT table\n")); } =20 + Status =3D LocateAndInstallAcpiFromFvConditional (&mAcpiTableFile, + &HandleDynamicNamespace); + ASSERT_EFI_ERROR (Status); + return EFI_SUCCESS; } --=20 2.41.0 -=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 (#109591): https://edk2.groups.io/g/devel/message/109591 Mute This Topic: https://groups.io/mt/101938744/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-