From nobody Tue Feb 10 23:33:42 2026 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+109738+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+109738+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697630148; cv=none; d=zohomail.com; s=zohoarc; b=ec/tjx+3j0Hmy3+td/G+2TlOFI5E48lLjRaBPsBiTBJNDtZ1V+2hds8IOISImzU419NA/tjfc1NKL2cz48AkVEQyvYP8l0RCo/Er6vlv6hJbWWmE0P2Cj8vCNoSTOc1MPddJ7cJPV2dC1efK0AtSITLaPGvk+Cf2Cv5+dyNiSmY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697630148; 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=YqT0GzFq2OZMC1axMzlAi45KGCSrky5hPJVdPdXuMuc=; b=hcfNNVKMpgRgfHOzwF8I2TYBEaBPnAEsIU2ITNSpuT1CtFB/HMACykOOH5f7KpZDFeJBH4kQe1267+0XTsnliXEYJerdEqTPLK2e8scKtje7OnHVfcxXNrVHaL0OMf8BRHDZRFslt/xEksVOm5X5WZifbPXhGVoZ0EbD2yBl3Uo= 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+109738+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 1697630148560715.1018869660543; Wed, 18 Oct 2023 04:55:48 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=6KI6OtNQAwjneIC10PP5KAXG1hdNsW0szwXHB664ff4=; 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=1697630148; v=1; b=vHrcAPz2+7Ozo9y6aFagPiJNJB2UAYokqQjkvZ3rCOgwaXQ5+IvW+VMs52KirHaR+ysUN8Gy jBfgZFkblT3ioO9qeLIzONp2nNEqmnsz6Xy9NdHIMUWu2VxylnkKgle66LoxVtDevQpeTHWBCTO +W/LkfPowvkuIhcvYfZDc8Dc= X-Received: by 127.0.0.2 with SMTP id gtr7YY1788612xtAlxtrdkrT; Wed, 18 Oct 2023 04:55:48 -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.279388.1697630147078100038 for ; Wed, 18 Oct 2023 04:55:47 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id EAAD8260BB4; Wed, 18 Oct 2023 13:55:44 +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 YC7gLA5r-zBQ; Wed, 18 Oct 2023 13:55:43 +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 3203B260CC8; Wed, 18 Oct 2023 13:55:42 +0200 (CEST) From: "Marcin Juszkiewicz" Date: Wed, 18 Oct 2023 13:55:40 +0200 Subject: [edk2-devel] [PATCH edk2-platforms v5 3/4] SbsaQemu: initialize XHCI only if it exists MIME-Version: 1.0 Message-Id: <20231018-ehci-xhci-fix-v5-3-f42995a3dfd9@linaro.org> References: <20231018-ehci-xhci-fix-v5-0-f42995a3dfd9@linaro.org> In-Reply-To: <20231018-ehci-xhci-fix-v5-0-f42995a3dfd9@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: Bqj0mMUWmiGnWb69sGZ93wSix1787277AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697630149263100012 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 | 49 +++++++++++-----= ---- 1 file changed, 27 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..4ebbe7c93a19 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,31 @@ 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 ( + NonDiscoverableDeviceTypeX= hci, + NonDiscoverableDeviceDmaTy= peCoherent, + NULL, + NULL, + 1, + Base, + Size + ); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: NonDiscoverable: Cannot install XHCI devic= e @%p (Status =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 (#109738): https://edk2.groups.io/g/devel/message/109738 Mute This Topic: https://groups.io/mt/102037245/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-