linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Support for AMDI0022 UART
@ 2021-04-23 19:57 Maximilian Luz
  2021-04-24 10:25 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Maximilian Luz @ 2021-04-23 19:57 UTC (permalink / raw)
  To: linux-serial
  Cc: linux-kernel, Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko,
	Wang Hongcheng, Ken Xue

Hi all,

I received a report from a Surface Laptop 4 which has a UART that is
identified as AMDI0022 in ACPI [1] and that does not seem to be
supported by the kernel yet.

 From what I can tell via ACPI, this is similar to the AMDI0020 [2] UART
that's already supported by the kernel (well, both are devices with two
MMIO regions and an interrupt as far as I can tell...). So it's possible
that all that's needed is adding it to the respective device ID lists
[3, 4]. Unfortunately, I a) don't have a device to test this myself, b)
haven't found any more details on that online, and c) don't want to tell
others to test this without knowing a bit more about that (potentially
writing random stuff to some unknown MMIO region that I don't know
anything about doesn't sound as safe to me as I'd like).

Does anyone here have some pointers on what it'd take to support this,
or any contacts at AMD that could provide more insight?

Regards
Max

[1]: AMDI0022 in ACPI (Surface Laptop 4)
https://github.com/linux-surface/acpidumps/blob/2e24c80d4c7a99a9295aa0b1b2e5e92df93378b4/surface_laptop_4_amd/dsdt.dsl#L1432

[2]: AMDI0020 in ACPI (Surface Laptop 3)
https://github.com/linux-surface/acpidumps/blob/62972f0d806cef45ca01341e3cfbabc04c6dd583/surface_laptop_3_15/dsdt.dsl#L1806

[3]: ID list for 8250_dw
https://elixir.bootlin.com/linux/v5.12-rc8/source/drivers/tty/serial/8250/8250_dw.c#L715

[4]: ID list for acpi_apd
https://elixir.bootlin.com/linux/v5.12-rc8/source/drivers/acpi/acpi_apd.c#L228

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Support for AMDI0022 UART
  2021-04-23 19:57 Support for AMDI0022 UART Maximilian Luz
@ 2021-04-24 10:25 ` Andy Shevchenko
  2021-04-30 12:37   ` Maximilian Luz
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2021-04-24 10:25 UTC (permalink / raw)
  To: Maximilian Luz
  Cc: open list:SERIAL DRIVERS, Linux Kernel Mailing List,
	Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko, Wang Hongcheng,
	Ken Xue

On Fri, Apr 23, 2021 at 10:58 PM Maximilian Luz <luzmaximilian@gmail.com> wrote:
>
> Hi all,
>
> I received a report from a Surface Laptop 4 which has a UART that is
> identified as AMDI0022 in ACPI [1] and that does not seem to be
> supported by the kernel yet.
>
>  From what I can tell via ACPI, this is similar to the AMDI0020 [2] UART
> that's already supported by the kernel (well, both are devices with two
> MMIO regions and an interrupt as far as I can tell...). So it's possible
> that all that's needed is adding it to the respective device ID lists
> [3, 4]. Unfortunately, I a) don't have a device to test this myself, b)
> haven't found any more details on that online, and c) don't want to tell
> others to test this without knowing a bit more about that (potentially
> writing random stuff to some unknown MMIO region that I don't know
> anything about doesn't sound as safe to me as I'd like).

To me they look completely the same. Depending on the device which is
connected to the UART, I would suggest just to add an ID and see if it
makes it work.

> Does anyone here have some pointers on what it'd take to support this,
> or any contacts at AMD that could provide more insight?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Support for AMDI0022 UART
  2021-04-24 10:25 ` Andy Shevchenko
@ 2021-04-30 12:37   ` Maximilian Luz
  0 siblings, 0 replies; 3+ messages in thread
From: Maximilian Luz @ 2021-04-30 12:37 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: open list:SERIAL DRIVERS, Linux Kernel Mailing List,
	Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko, Wang Hongcheng,
	Ken Xue



On 4/24/21 12:25 PM, Andy Shevchenko wrote:
> On Fri, Apr 23, 2021 at 10:58 PM Maximilian Luz <luzmaximilian@gmail.com> wrote:
>>
>> Hi all,
>>
>> I received a report from a Surface Laptop 4 which has a UART that is
>> identified as AMDI0022 in ACPI [1] and that does not seem to be
>> supported by the kernel yet.
>>
>>   From what I can tell via ACPI, this is similar to the AMDI0020 [2] UART
>> that's already supported by the kernel (well, both are devices with two
>> MMIO regions and an interrupt as far as I can tell...). So it's possible
>> that all that's needed is adding it to the respective device ID lists
>> [3, 4]. Unfortunately, I a) don't have a device to test this myself, b)
>> haven't found any more details on that online, and c) don't want to tell
>> others to test this without knowing a bit more about that (potentially
>> writing random stuff to some unknown MMIO region that I don't know
>> anything about doesn't sound as safe to me as I'd like).
> 
> To me they look completely the same. Depending on the device which is
> connected to the UART, I would suggest just to add an ID and see if it
> makes it work.

Thanks! We've tried that now and we do have some progress, meaning that
the serial device seems to work as expected (we have some basic
communication working).

The driver that we want to load (drivers/platform/surface/aggregator/)
still doesn't quite load yet, but that now seems to be due to a missing
GPIO driver for an AMDI0031 device. There's again an AMDI0030 in
drivers/pinctrl/pinctrl-amd.c, but this time the definitions do seem a
bit different (compare [5, 6]), specifically there are now two memory
regions (altough the combined size is still the same).

I'll try to have a look around and maybe ping the linux-gpio list if I
don't find anything else. I'll post some patches once we've got the
driver loading properly and can run some more tests.

Regards,
Max

[5]: AMDI0030 on Surface Laptop 3
https://github.com/linux-surface/acpidumps/blob/4da0148744164cea0c924dab92f45842fde03177/surface_laptop_3_amd/dsdt.dsl#L1767-L1802

[6]: AMDI0031 on Surface Laptop 4
https://github.com/linux-surface/acpidumps/blob/4da0148744164cea0c924dab92f45842fde03177/surface_laptop_4_amd/dsdt.dsl#L1404-L1428

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-30 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 19:57 Support for AMDI0022 UART Maximilian Luz
2021-04-24 10:25 ` Andy Shevchenko
2021-04-30 12:37   ` Maximilian Luz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).