From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id CD65F7803D0 for ; Fri, 13 Oct 2023 12:28:57 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=bqZqVC+J2Gek1Z9Rr1dOuEaWqSK9UaSefOKJSLidyXo=; c=relaxed/simple; d=groups.io; h=From:Subject:Date:Message-Id:MIME-Version: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=1697200136; v=1; b=giVY5C6AjiVqqoRKf001FqI8aQEQDeYpfp07J5C8uQW0ZKqV6VVmlXUjf8kE+DhYrHRZvcB9 dcFSaverIpyza4Dws3UgmwDb9Mdiqrh1gyQ++G/rzgOz9/3HQLvr+e3gBAutjDqRlYGxgNSQ8oX tUHBAWbzyZme9cDd4f65ng8M= X-Received: by 127.0.0.2 with SMTP id JrL5YY7687511xyufwpjN6hm; Fri, 13 Oct 2023 05:28:56 -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.37079.1697200135640913123 for ; Fri, 13 Oct 2023 05:28:55 -0700 X-Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 01DCC260B8D; Fri, 13 Oct 2023 14:28:52 +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 LoSF8uO208VT; 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 58FC8260837; Fri, 13 Oct 2023 14:28:50 +0200 (CEST) From: "Marcin Juszkiewicz" Subject: [edk2-devel] [PATCH edk2-platforms WIP 0/5] Provide EHCI or XHCI USB controller Date: Fri, 13 Oct 2023 14:28:48 +0200 Message-Id: <20231013-ehci-xhci-fix-v1-0-f56f28e70e36@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAA4KWUC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2NDA0Nj3dSM5EzdChCRllmhm2xqZGlsapZonmiRpgTUU1CUChQGmxetFO4 ZoBRbWwsAn3JPgWQAAAA= 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: 3fn8vut9yYikkWh1sCYV8BMhx7686176AA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=giVY5C6A; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linaro.org (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Platform version 0.3 introduced XHCI USB controller instead of EHCI one. But we did it in a way that there is no in-EDK2 check for platform version (XHCI is always given). This behaviour works with Linux as it complains about being unable to initialize EHCI and goes on. Free/Net/Open BSD systems hang in such situation. So two solutions came to my mind: 1. rewrite DSDT generation into C 2. provide EHCI/XHCI in SSDT table instead of DSDT This changeset is my attempt for the second solution. Idea is to have both EHCI and XHCI as ASL code and then use LocateAndInstallAcpiFromFvConfitional() function to choose which one should be provided (based on PlatformVersion being less than 0.3 for EHCI). This does not work as LocateAndInstallAcpiFromFvConfitional() only sees DBG2 and FACP tables. There was one or two moments when it saw all generated ones so I assume some kind of race condition. Any ideas what I did wrong? All patches are work-in-progress. --- Marcin Juszkiewicz (5): SbsaQemu: introduce macro to compare platform version WIP: SbsaQemu: rename USB controller variables to be generic SbsaQemu: move XHCI to SSDT SbsaQemu: add EHCI to SSDT WIP: try to enable/disable proper USB controller Silicon/Qemu/SbsaQemu/SbsaQemu.dec | 4 +- Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 6 +- Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 6 +- .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf | 3 + .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.inf | 4 +- .../IndustryStandard/SbsaQemuPlatformVersion.h | 25 ++++ .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c | 62 +++++++++ .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c | 4 +- Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 116 ----------------= - Silicon/Qemu/SbsaQemu/AcpiTables/Ehci.asl | 132 ++++++++++++++++= ++++ Silicon/Qemu/SbsaQemu/AcpiTables/Xhci.asl | 132 ++++++++++++++++= ++++ 11 files changed, 368 insertions(+), 126 deletions(-) --- base-commit: 06f6274d56422084281886fad447ab117fd0e487 change-id: 20231013-ehci-xhci-fix-c529356a7a8f Best regards, --=20 Marcin Juszkiewicz -=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 (#109586): https://edk2.groups.io/g/devel/message/109586 Mute This Topic: https://groups.io/mt/101938735/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-