public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nhi Pham via groups.io" <nhi=os.amperecomputing.com@groups.io>
To: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>, devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jeremy Linton <jeremy.linton@arm.com>,
	Chuong Tran <chuong@os.amperecomputing.com>,
	Rebecca Cran <rebecca@os.amperecomputing.com>
Subject: Re: [edk2-devel] [PATCH edk2-platforms v2 0/4] Provide XHCI USB controller only for newer hardware
Date: Tue, 17 Oct 2023 18:46:52 +0700	[thread overview]
Message-ID: <0fb28403-2174-43ab-b064-bc829bf6808f@os.amperecomputing.com> (raw)
In-Reply-To: <20231016-ehci-xhci-fix-v2-0-cec625451daf@linaro.org>

Hi Marcin,

On 10/16/2023 5:06 PM, Marcin Juszkiewicz wrote:
> 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.
> 
> Now we check are we on Platform Version 0.3 at least and then initialize
> XHCI controller. Otherwise we disable it's node in DSDT table.
> 
> I checked several ways to handle the situation.
> 
> SSDT overlay enabling with LocateAndInstallAcpiFromFvConfitional() was
> first one but this function had only DBG2 and FACP tables.
> 
> Then looked at trying to detect XHCI from _STA method. But this is
> sysbus device which is there or not without way to discover it.
> 
> Next attempt was to have variable in DSDT and to use it in _STA. Too
> much trouble.
> 
> Then looked again at code from
> Ampere/JadePkg/Drivers/AcpiPlatformDxe/AcpiDsdt.c and noticed
> UpdateStatusMethodObject() function. Copied some code and it worked.

Could you please check whether we can replace the 
UpdateStatusMethodObject() function with the 
AcpiAmlObjectUpdateInteger() function provided by AcpiLib?

Regards,
Nhi
> 
> Booting OpenBSD reminded me to update table checksum.
> 
> ---
> Changes in v2:
> - XHCI initialized only on PlatVer 0.3+
> - XHCI disabled in DSDT for older platforms
> - no SSDT overlays for EHCI/XHCI
> - no EHCI at all (it does not work anyway)
> - no Pcd renaming
> 
> ---
> Marcin Juszkiewicz (4):
>        SbsaQemu: introduce macro to compare platform version
>        SbsaQemu: add AcpiLib
>        SbsaQemu: initialize XHCI only if it exists
>        SbsaQemu: disable XHCI in DSDT if not present
> 
>   Platform/Qemu/SbsaQemu/SbsaQemu.dsc                  |  2 +
>   .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.inf      |  4 +
>   .../IndustryStandard/SbsaQemuPlatformVersion.h       | 25 ++++++
>   .../Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c        | 93 ++++++++++++++++++++
>   .../SbsaQemuPlatformDxe/SbsaQemuPlatformDxe.c        | 47 +++++-----
>   5 files changed, 149 insertions(+), 22 deletions(-)
> ---
> base-commit: 06f6274d56422084281886fad447ab117fd0e487
> change-id: 20231013-ehci-xhci-fix-c529356a7a8f
> 
> Best regards,


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109675): https://edk2.groups.io/g/devel/message/109675
Mute This Topic: https://groups.io/mt/101992601/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2023-10-17 11:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 10:06 [edk2-devel] [PATCH edk2-platforms v2 0/4] Provide XHCI USB controller only for newer hardware Marcin Juszkiewicz
2023-10-16 10:06 ` [edk2-devel] [PATCH edk2-platforms v2 1/4] SbsaQemu: introduce macro to compare platform version Marcin Juszkiewicz
2023-10-16 10:06 ` [edk2-devel] [PATCH edk2-platforms v2 2/4] SbsaQemu: add AcpiLib Marcin Juszkiewicz
2023-10-16 10:06 ` [edk2-devel] [PATCH edk2-platforms v2 3/4] SbsaQemu: initialize XHCI only if it exists Marcin Juszkiewicz
2023-10-16 10:06 ` [edk2-devel] [PATCH edk2-platforms v2 4/4] SbsaQemu: disable XHCI in DSDT if not present Marcin Juszkiewicz
2023-10-17 11:46 ` Nhi Pham via groups.io [this message]
2023-10-17 13:18   ` [edk2-devel] [PATCH edk2-platforms v2 0/4] Provide XHCI USB controller only for newer hardware Marcin Juszkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0fb28403-2174-43ab-b064-bc829bf6808f@os.amperecomputing.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox