Commit graph

7 commits

Author SHA1 Message Date
Richard Wheatley
1aebfcdb99 drivers: serial: UART PL011 Ambiq PM Fix
apollo3 driver added PM to UART for only apollo3
but defined PM function for both causing an error
in twister

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-08-27 10:49:38 -04:00
Zhengwei Wang
03a1fe6cd7 drivers: serial: pm: Add power management support for Apollo3 SoCs UART
Add power management support for Apollo3/Apollo3P UART, and
automatically enables device runtime power management

Signed-off-by: Zhengwei Wang <zwang@ambiq.com>
2024-08-20 10:32:52 +02:00
Hao Luo
3c1fd19d96 drivers: serial: pl011: Add support for Ambiq Apollo3 SoCs UART
Apollo3 SoCs have different UART register design compared with
that of Apollo4 SoCs, we need to change the offset and mask for
the power status check

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-05-07 18:57:19 +02:00
TOKITA Hiroshi
155fee5924 drivers: serial: pl011: Introduce macros to separate device-dependent code
Introduce the `COMPAT_SPECIFIC_...` macros to determine the function name
from the compatible name.
These macros allow the isolation of device-dependent code in a generic way.

For example, if the compatible name is `ambiq,uart`,
The `COMPAT_SPECIFIC_DEFINE` macro is replaced by `AMBIQ_UART_DEFINE`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-04-10 10:01:25 +02:00
Bryan Zhu
3e456e8cfb drivers: serial: pl011: Remove busy wait in Ambiq UART initiate
Ambiq UART requires specific busy wait during initialization for
propagating powering control registers, original k_busy_wait()
used here generated a dead loop because k_busy_wait() relays on
timer, who's driver is initialized after UART(UART init in
PRE_KERNEL_1, timer init in PRE_KERNEL_2), replace k_busy_wait()
with checking power status register is more suitable here.

Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
2023-12-11 10:10:39 +01:00
Richard Wheatley
13484b5bdc drivers: serial: uart_pl011_ambiq.h: Remove reserved CLK frequency
UART CLK does not support the 48MHz frequency option

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2023-09-02 15:10:19 +02:00
Maciej Sobkowski
60591598e5 drivers: serial: pl011: Add support for Ambiq UART
UART controller present in Ambiq SoCs is mostly compatible with PL011, but
requires some quirks that are implemented in this commit:
- the peripheral needs to be powered on first, via the PWRCTRL core,
- peripheral clock needs to be enabled and configured via the CLKEN/CLKSEL.
  registers.

The quirks mechanism was inspired by support for STM32F4 SoC in the
usb_dc_dw driver (fce0b85eca).

Co-authored-by: Mateusz Sierszulski <msierszulski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-08-04 10:48:58 +02:00