Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded UARTs in ACPI #118

Closed
worproject opened this issue Dec 9, 2020 · 5 comments
Closed

Hardcoded UARTs in ACPI #118

worproject opened this issue Dec 9, 2020 · 5 comments
Assignees

Comments

@worproject
Copy link
Contributor

On the Pi 4, PL011 is hardcoded in DBG2 & SPCR, and mini UART is used for the Bluetooth device.
This doesn't make sense when booting Windows, because GPIO 14 / 15 are set to ALT5 (mini UART) by default. So we end up with a debug port that's not exposed on the GPIO header.

I also want to use PL011 for Bluetooth instead as it's better than mini UART.

@samerhaj
Copy link
Member

samerhaj commented Dec 9, 2020

This is already referenced as a working item here #80

@pbatard
Copy link
Member

pbatard commented Dec 9, 2020

I asked for a separate issue to be created to better track this item.

Basically, we have the following ACPI entries that are hardcoded according to the platform:

Instead, these tables should be updated to reflect if the miniUART overlay has been applied by the user (similar to what we are doing here) to properly set either PL011 or miniUART to be used for serial/BT on the Pi 4.

@pbatard
Copy link
Member

pbatard commented Dec 9, 2020

Hopefully, we can do something along the lines of what Jeremy did in tianocore/edk2-platforms@e372412 to set these ASL values at runtime. Otherwise, we may have to look into using DynamicTablesPkg...

@samerhaj
Copy link
Member

A patch for this has already been sent to TianoCore EDK2, not merged yet: https://edk2.groups.io/g/devel/topic/81572763#73237

ardbiesheuvel pushed a commit to tianocore/edk2-platforms that referenced this issue Jun 12, 2021
Changes:
  1. Add code to ConfigDxe driver and AcpiTables module to dynamically
     build either Mini UART or PL011 UART info in ACPI. This also fixes
     the issue discussed in pftf/RPi4#118.
  2. Cleanup by moving duplicate Debug Port 2 table related defines and
     structures to a newly created header file (RpiDebugPort2Table.h).

Testing Done:
  - Booted to UEFI shell and use acpiview command to check the result of
    the different UART settings in config.txt (enabling either Mini UART
    or PL011) and SPCR, DBG2 tables and device BTH0 are dynamically
    changed as expected.

Signed-off-by: Sunny Wang <sunny.wang@arm.com>
Reviewed-by: Pete Batard <pete@akeo.ie>
Tested-by: Pete Batard <pete@akeo.ie>
@sunnywang-arm
Copy link

sunnywang-arm commented Jun 14, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants