From nobody Sat May 18 09:48:41 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+109720+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+109720+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697623688; cv=none; d=zohomail.com; s=zohoarc; b=UR0Cp8votcI95ndphJ9kb9QovjWp5MCvA/HaX4B1lGJMcgjP/lpofG3YNF2ClAhknvvTQthtj67OW1mIM/U8dyoMJ24XHG8dVfNR6kA5w44Qf1pv+PKvOxZaUYmiGw7r0qlSPAQas7rGuWTC/2aRfnP8QS0mMA3BT/QDNpDTIL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697623688; 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=DoJQaRcmBnMDZrtYQYgP3TJxaZXWOyfDFJtnoHcQFHU=; b=gyqRccfmLhVjdvGbJV3VWSHh/aLb85FFz03IKSYqo4gAEcxaZoGYpv/Y1gUVb+AE/ebLPtSTOfsSldChr704pHu2vmRK0atnHo/plKEkUjSArMRPhYhiBLYIYBfQoXBFvZiIIKdSCur5B0GD/BNww0+Fnpx5XHF3Xo4+rBo5RCc= 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+109720+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 1697623688347126.60598509871159; Wed, 18 Oct 2023 03:08:08 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=NOphYssXItfQxeF2biZItAqhax/EOvsHDnr09eHoIss=; 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=1697623688; v=1; b=GgdkyARxuzOwT9hqxhTVNRudUH965Oxl+Q5eU+p+jezrjNzeWHAxi/QfvbG0r1+9ThbD7Zmh wOF6gQ7TXJiizhAnTcc+AlAoC6qun7h9s8EGT3gb++/68G6GCrb/azvrmg0kSfDBPJJ4BF4DXFQ QoG/PahBh/c5pf5CSZ1deKUM= X-Received: by 127.0.0.2 with SMTP id 4a4qYY1788612x8g8B58JYhI; Wed, 18 Oct 2023 03:08:08 -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.278336.1697623687098771338 for ; Wed, 18 Oct 2023 03:08:07 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 92C9D2600DA; Wed, 18 Oct 2023 12:08:04 +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 82OqnGQ6ZglB; Wed, 18 Oct 2023 12:08:02 +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 47E23260B8D; Wed, 18 Oct 2023 12:08:02 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Wed, 18 Oct 2023 12:07:53 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v4 1/4] SbsaQemu: introduce macro to compare platform version MIME-Version: 1.0 Message-Id: <20231018-ehci-xhci-fix-v4-1-aa53138997a5@linaro.org> References: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> In-Reply-To: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton , Nhi Pham , Chuong Tran , Rebecca Cran 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: gpjjefSmBKctu7I9isgUQJYVx1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697623689824100001 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 (#109720): https://edk2.groups.io/g/devel/message/109720 Mute This Topic: https://groups.io/mt/102035951/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 Sat May 18 09:48:41 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+109722+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+109722+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697623690; cv=none; d=zohomail.com; s=zohoarc; b=FpBzKChvmlQUPkklu9LeWvn3QHRKDBfoNpJb501RyNJQ8vyxIWGdo6iMHFHBDTSOA1gDMOuKm1GY77JynmkMEg8rnJoxOZ1nxkKrErvyDjxA6HRhASAhaFoYOyImVfbsbdQG70AQ5zlHYwQewAC6ncnVuWBQvYcy7S1Lumx26jI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697623690; 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=q966Nt+ThPJbNNjmJ+rICt4IxX3BTqjKMhXOpJYnc8o=; b=n+vq0D9+HzqgITRvUVllvEGaCPpOwEQ7ZMZyONb7nyvmqdvqaGG1NwHn1eBz6UaRkjiMKSFVwaVLgUcXXa1M8wNG89aS3tuVwzkg/C9ax+2afQCj4kk7iIDaaeSGO8zS5/V3aPYGDdgY5oROA4Kx22yTf/p6fwzSILgLduwbu2E= 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+109722+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 1697623690470122.76587734228576; Wed, 18 Oct 2023 03:08:10 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=xL8WdFiXGdoO3C9ZIdyW14Igw+nO7xrzPE/ZpgDHvuU=; 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=1697623690; v=1; b=F3wBASipwE5R2QLoGX38SxPedgjnl/MehBDHMn4KAJUJccFbTeD98fiPk+tnz45qvY+jemVZ Vaftrc8FwXuVj4/OXlAc2of6BmigbTWvrw6Jkl4hrg6XmC+WvlSH3+qdQwawH5YfNm4aaZIeDJR p6F5aaNVqBpvM2qvSz8vlT+w= X-Received: by 127.0.0.2 with SMTP id vYXcYY1788612xdbJNPMkszZ; Wed, 18 Oct 2023 03:08:10 -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.278338.1697623688940570514 for ; Wed, 18 Oct 2023 03:08:09 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 04236260B8D; Wed, 18 Oct 2023 12:08:06 +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 WbmuolK4sliY; Wed, 18 Oct 2023 12:08:04 +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 F2122260BB4; Wed, 18 Oct 2023 12:08:02 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Wed, 18 Oct 2023 12:07:54 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v4 2/4] SbsaQemu: add AcpiLib MIME-Version: 1.0 Message-Id: <20231018-ehci-xhci-fix-v4-2-aa53138997a5@linaro.org> References: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> In-Reply-To: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton , Nhi Pham , Chuong Tran , Rebecca Cran , Marcin Juszkiewicz 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: stK7DWARVbXWOfIsJS8BJ0rZx1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697623691821100009 It will be needed for playing with disabling XHCI later. Signed-off-by: Marcin Juszkiewicz --- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/S= bsaQemu.dsc index 36723e21d7b5..1e650350cb63 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 --=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 (#109722): https://edk2.groups.io/g/devel/message/109722 Mute This Topic: https://groups.io/mt/102035953/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 Sat May 18 09:48:41 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+109721+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+109721+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697623689; cv=none; d=zohomail.com; s=zohoarc; b=TFcfIsep5e3D3VWgvyuMlGB3cD4Ob4cQh9EGoWr87LROAWnX5Kerrc2Cqf+bvI5xYZTXggDmL+zu/nB6X6HnYK/eBlrHddkH7NG0KCcpJ4QtC9PkhHMlhnX/YIeuXqyTKv4toIsehk4hSKQ4wVrTWLHgdn0oVTxDElrvarpqu20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697623689; 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=TOJq7PhxqNQCzTBtkpPUyWg0qgSaTB7Jvbv6IuPaO5s=; b=CkBFHPG9MfR/XpOKf6Qqp0dCejCeC/RGk4muZyYEWkBdlSZjTHEO9ouTGMpDzmse029PbMhTuhbnREJZEj1gqaoG/Sre3xPXaYKMhuIHZ3XbXxmeetlHtPCEHQNmwE9hxObOyRxwt+5D5rTZovVS+7baEM6lnbXY/ZCJ2HPS16k= 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+109721+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 1697623689956263.9059158192366; Wed, 18 Oct 2023 03:08:09 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Y58lEgZJkXnb3Ac09yEUF4YH+ItM+VHnewAHOY3eclw=; 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=1697623689; v=1; b=aBQg1VGH9aISqBqk9Oiz+U+OVU7jLSl90G/gxg0oFHaMyydlgr4X0ufSD+Mdh7VrVoHi2ZtR SKe41kZy92VeLlKFVreTmNSEXaIh0m/7bXueUldvdJIHXwbgHTNW/R7pLmW63hu4un8uMEqNxPS HW7XhSTJ/WzcAh8dsCiC2RM8= X-Received: by 127.0.0.2 with SMTP id HWroYY1788612xEHhsIvADo6; Wed, 18 Oct 2023 03:08:09 -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.278337.1697623688858113447 for ; Wed, 18 Oct 2023 03:08:09 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id A6A9E260BB4; Wed, 18 Oct 2023 12:08:06 +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 4j9sLZC40xEp; Wed, 18 Oct 2023 12:08:05 +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 BC456260C04; Wed, 18 Oct 2023 12:08:03 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Wed, 18 Oct 2023 12:07:55 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v4 3/4] SbsaQemu: initialize XHCI only if it exists MIME-Version: 1.0 Message-Id: <20231018-ehci-xhci-fix-v4-3-aa53138997a5@linaro.org> References: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> In-Reply-To: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton , Nhi Pham , Chuong Tran , Rebecca Cran , Marcin Juszkiewicz 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: lWIHXaNbqCOAFVRS8Qtm3nEPx1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697623691846100011 We need platform version to be at least 0.3 to have XHCI in virtual hardware. On older platforms there is non-working EHCI which we ignore. Signed-off-by: Marcin Juszkiewicz --- .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 47 +++++++++++-----= ---- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlat= formDxe.c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatf= ormDxe.c index 36ada4270bbf..76a9cd62d4a4 100644 --- a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .c +++ b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuPlatformDxe/SbsaQemuPlatformDxe= .c @@ -15,6 +15,7 @@ #include #include #include +#include =20 #include =20 @@ -57,28 +58,6 @@ InitializeSbsaQemuPlatformDxe ( return Status; } =20 - Base =3D (VOID*)(UINTN)PcdGet64 (PcdPlatformXhciBase); - ASSERT (Base !=3D NULL); - Size =3D (UINTN)PcdGet32 (PcdPlatformXhciSize); - ASSERT (Size !=3D 0); - - DEBUG ((DEBUG_INFO, "%a: Got platform XHCI %llx %u\n", - __FUNCTION__, Base, Size)); - - Status =3D RegisterNonDiscoverableMmioDevice ( - NonDiscoverableDeviceTypeXhci, - NonDiscoverableDeviceDmaTypeCoherent, - NULL, - NULL, - 1, - Base, Size); - - if (EFI_ERROR(Status)) { - DEBUG ((DEBUG_ERROR, "%a: NonDiscoverable: Cannot install XHCI device = @%p (Staus =3D=3D %r)\n", - __FUNCTION__, Base, Status)); - return Status; - } - SmcResult =3D ArmCallSmc0 (SIP_SVC_VERSION, &Arg0, &Arg1, NULL); if (SmcResult =3D=3D SMC_ARCH_CALL_SUCCESS) { Result =3D PcdSet32S (PcdPlatformVersionMajor, Arg0); @@ -118,5 +97,29 @@ InitializeSbsaQemuPlatformDxe ( =20 DEBUG ((DEBUG_INFO, "GICI base: 0x%x\n", Arg0)); =20 + if (! PLATFORM_VERSION_LESS_THAN(0, 3) ) { + Base =3D (VOID*)(UINTN)PcdGet64 (PcdPlatformXhciBase); + ASSERT (Base !=3D NULL); + Size =3D (UINTN)PcdGet32 (PcdPlatformXhciSize); + ASSERT (Size !=3D 0); + + DEBUG ((DEBUG_INFO, "%a: Got platform XHCI %llx %u\n", + __FUNCTION__, Base, Size)); + + Status =3D RegisterNonDiscoverableMmioDevice ( + NonDiscoverableDeviceTypeXhci, + NonDiscoverableDeviceDmaTypeCoherent, + NULL, + NULL, + 1, + Base, Size); + + if (EFI_ERROR(Status)) { + DEBUG ((DEBUG_ERROR, "%a: NonDiscoverable: Cannot install XHCI device = @%p (Staus =3D=3D %r)\n", + __FUNCTION__, Base, Status)); + return 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 (#109721): https://edk2.groups.io/g/devel/message/109721 Mute This Topic: https://groups.io/mt/102035952/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 Sat May 18 09:48:41 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+109723+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+109723+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697623691; cv=none; d=zohomail.com; s=zohoarc; b=ZEFdn7N9Jfk0WNPP44ybo7YHs58pfENQ51FRuQoeeS/BGisENkIqdpDWnc0Gh8/WYFKjf+lYB8amADSUGAJdOpMWInjsRfXS0dT1R8x18C8BXYipU0s4eh5e0Q6N+EPgbEH41U+hAjGlDbc1skyfy3KgXeoFOQZC24T4I4sfHs4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697623691; 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=7DQuqpG9/UOy8q/ie7T+OCJDzJbG/GGCIVQKABAjEDU=; b=LNkb3OoKEfbLTSLs+HKVsZ/cIjyVMR9O4xv6PLplQ2xD7uh3Eyypbh1p7gKhJH9brSw5VKJyZeKbEwb2kG54VKgrr7kkH5er/byBVsmll0MGWSoWBh+nfqqlhdSfNpzN8/WOMpCKsdc/wZMpo4gkMv0kpNYQjanSGJ9dkdCvo7s= 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+109723+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 169762369110945.576771505715215; Wed, 18 Oct 2023 03:08:11 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=G2waLS6wcI8VJbAPpgGmii7MN3x8bMjvvW6QTb1Lqhc=; 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=1697623690; v=1; b=r8jV9bbBbj15pjG5Iqo4HhbFLhqrQh2eJAETYZFbHWSb7iK7CQwc5tWCg2jJDJdb1IFtlQ6P 0pnw0Tq/smiqsKadab51+evpUzgTNARU1VdsKA6LYxRjCKnvl/LuNt1uGWDcFzyghAr/It+eR0J 2t6n8TZWX+iGz1Ua89bh9zZ4= X-Received: by 127.0.0.2 with SMTP id z5WJYY1788612xn7ucJlercn; Wed, 18 Oct 2023 03:08:10 -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.277791.1697623689904555043 for ; Wed, 18 Oct 2023 03:08:10 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id EFC11260C04; Wed, 18 Oct 2023 12:08:07 +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 diL78X5onpu6; Wed, 18 Oct 2023 12:08:06 +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 830DF26110A; Wed, 18 Oct 2023 12:08:04 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Wed, 18 Oct 2023 12:07:56 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v4 4/4] SbsaQemu: disable XHCI in DSDT if not present MIME-Version: 1.0 Message-Id: <20231018-ehci-xhci-fix-v4-4-aa53138997a5@linaro.org> References: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> In-Reply-To: <20231018-ehci-xhci-fix-v4-0-aa53138997a5@linaro.org> To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Jeremy Linton , Nhi Pham , Chuong Tran , Rebecca Cran , Marcin Juszkiewicz 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: ktFn4Q4TIvn6Lag90Uz4tfZax1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697623691826100010 We need platform version to be at least 0.3 to have XHCI in virtual hardware. On older platforms there is non-working EHCI which we ignore. Set DSDT node to be disabled so operating system will not try to initialize not-existing hardware. Signed-off-by: Marcin Juszkiewicz Acked-by: Nhi Pham --- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 4 ++ .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 66 ++++++++++++++++= +++- Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 3 +- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= inf b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf index 7c7e08e0fd3a..d5ded892d6ea 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 @@ -59,6 +62,7 @@ [Guids] =20 [Protocols] gEfiAcpiTableProtocolGuid ## CONSUMES + gEfiAcpiSdtProtocolGuid =20 [FixedPcd] gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId diff --git a/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.= c b/Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c index fd849ca1594b..4d8a57d5a8e4 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 @@ -682,6 +683,69 @@ AddGtdtTable ( return Status; } =20 +EFI_STATUS +DisableXhciOnOlderPlatVer ( + VOID + ) +{ + EFI_STATUS Status; + EFI_ACPI_SDT_PROTOCOL *AcpiSdtProtocol; + EFI_ACPI_DESCRIPTION_HEADER *Table; + UINTN TableKey; + UINTN TableIndex; + EFI_ACPI_HANDLE TableHandle; + + Status =3D EFI_SUCCESS; + + if ( PLATFORM_VERSION_LESS_THAN(0, 3) ) { + DEBUG ((DEBUG_ERROR, "Platform Version < 0.3 - disabling XHCI\n")); + Status =3D gBS->LocateProtocol ( + &gEfiAcpiSdtProtocolGuid, + NULL, + (VOID **)&AcpiSdtProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Unable to locate ACPI table protocol\n")); + return Status; + } + + TableIndex =3D 0; + Status =3D AcpiLocateTableBySignature ( + AcpiSdtProtocol, + EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNAT= URE, + &TableIndex, + &Table, + &TableKey + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "ACPI DSDT table not found!\n")); + ASSERT_EFI_ERROR (Status); + return Status; + } + + Status =3D AcpiSdtProtocol->OpenSdt (TableKey, &TableHandle); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + AcpiSdtProtocol->Close (TableHandle); + return Status; + } + + Status =3D AcpiAmlObjectUpdateInteger (AcpiSdtProtocol, TableHandle, "= \\_SB.USB0.XHCI", 0x0); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to disable XHCI!\n")); + ASSERT_EFI_ERROR (Status); + AcpiSdtProtocol->Close (TableHandle); + return Status; + } + + AcpiSdtProtocol->Close (TableHandle); + AcpiUpdateChecksum ((UINT8 *)Table, Table->Length); + } + + return Status; +} + + EFI_STATUS EFIAPI InitializeSbsaQemuAcpiDxe ( @@ -738,5 +802,5 @@ InitializeSbsaQemuAcpiDxe ( DEBUG ((DEBUG_ERROR, "Failed to add GTDT table\n")); } =20 - return EFI_SUCCESS; + return DisableXhciOnOlderPlatVer (); } diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl b/Silicon/Qemu/SbsaQ= emu/AcpiTables/Dsdt.asl index 543b5782580a..ba3eefc975a5 100644 --- a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl +++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl @@ -73,8 +73,9 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", Name (_HID, "PNP0D10") // _HID: Hardware ID Name (_UID, 0x00) // _UID: Unique ID Name (_CCA, 0x01) // _CCA: Cache Coherency Attribute + Name (XHCI, 0xF) // will be set using AcpiLib Method (_STA) { - Return (0xF) + Return (XHCI) } Method (_CRS, 0x0, Serialized) { Name (RBUF, ResourceTemplate() { --=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 (#109723): https://edk2.groups.io/g/devel/message/109723 Mute This Topic: https://groups.io/mt/102035954/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-