public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeremy Linton" <jeremy.linton@arm.com>
To: Adrien Thierry <athierry@redhat.com>
Cc: Andrei Warkentin <awarkentin@vmware.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	Ard Biesheuvel <ardb@kernel.org>, Pete Batard <pete@akeo.ie>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <leif@nuviainc.com>
Subject: Re: [edk2-devel] [edk2-platforms PATCH] Platform/RaspberryPi: Fix miniuart base address and length
Date: Wed, 15 Dec 2021 17:53:11 -0600	[thread overview]
Message-ID: <877303fd-543a-19e9-1ef7-c74c795cb693@arm.com> (raw)
In-Reply-To: <YbkfXGHyCk8oqLGu@fedora>

Hi,

On 12/14/21 16:49, Adrien Thierry wrote:
>> The Raspberry Pi support in edk2-platforms, including ACPI, is a direct ancestor of the original ms-iot tree (https://github.com/ms-iot/RPi-UEFI, by way of https://github.com/andreiw/RaspberryPiPkg).
>> The way the miniUART is described in ACPI came from Microsoft. Microsoft introduced DBG2/SPCR type 0x10 (https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-debug-port-table) and the BCM2836 _HID to describe the miniUART, and the contract is that the base address includes all those crazy registers.
>>
>> To the best of my knowledge, today there isn't any other way to correctly describe the miniUART in a DBG2, SPCR or DSDT. Moreover, because there's code out there in at least two operating systems coded against these specific definitions, you don't get to change how a _HID == BCM2836 device or SPCR/DBG2 type 0x10 is described.
> 
> Thanks for your feedback!
> I only had Linux in mind and didn't think about the other implementations
> that would break. Thank you for stating the historical reasons why things
> are set that way, I better understand now and see why this patch wouldn't
> be such a great idea.
> 
>> I guess I wasn't clear, I wasn't suggesting we change the existing
>> mechanism, so yes, I agree we either need another mechanism, or linux is
>> going to have to deal with it as is. The latter is IMHO the best option
>> (and as I mentioned I have patches to make it work), but sort of moves
>> us away from the standard uart/etc mechanisms we want for systemready.
>> So in that regard its not ideal.
> 
> I'm very interested to play with your patches if you could send them :)
> I've been trying to add ACPI support to the miniuart Linux driver, and
> stumbled across two issues:

I sent you a hatchet job that works with the current firmware.

> - the miniuart base address "off by 0x40" in the DSDT (the subject of
> this thread)
I think a reasonable choice is probably to add a structure to the linux 
acpi_device_id table, and put the offset in there, retrieve it during 
_probe with the macro that checks for a acpi device and picks off the 
acpi device match entry and then add the offset to the resource.


> - how to properly get the clock rate with ACPI

Again if you look in the Uart.asl file you modified at the pl011, you 
will see that there is a clock-frequency DSD. Something similar appears 
to work on the pi4 since the miniuart clock doesn't appear to be 
changing over core frequency changes, and if that starts it looks like 
ACPI won't be the only victim.

> 
> Ideally, the end goal would be to have both the serial console and BT
> working with the miniuart.
> 
> Adrien
> 


      reply	other threads:[~2021-12-15 23:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 17:32 [edk2-platforms PATCH] Platform/RaspberryPi: Fix miniuart base address and length athierry
2021-12-13 14:54 ` Adrien Thierry
2021-12-13 15:14   ` Ard Biesheuvel
2021-12-13 19:17     ` Andrei Warkentin
2021-12-14  5:39       ` [edk2-devel] " Jeremy Linton
2021-12-14  6:21         ` Andrei Warkentin
2021-12-14 13:35           ` Samer El-Haj-Mahmoud
2021-12-14 16:42           ` Jeremy Linton
2021-12-14 22:49             ` Adrien Thierry
2021-12-15 23:53               ` Jeremy Linton [this message]

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=877303fd-543a-19e9-1ef7-c74c795cb693@arm.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