Browse Source

dts: uart: create ambiq uart binding file

This commit creates ambiq uart new binding file
and renamed the previous one as ambiq,pl011-uart

Signed-off-by: Hao Luo <hluo@ambiq.com>
pull/90054/head
Hao Luo 2 months ago committed by Benjamin Cabé
parent
commit
92e723db93
  1. 6
      drivers/serial/uart_pl011_ambiq.h
  2. 15
      dts/bindings/serial/ambiq,pl011-uart.yaml
  3. 20
      dts/bindings/serial/ambiq,uart.yaml

6
drivers/serial/uart_pl011_ambiq.h

@ -168,16 +168,16 @@ static int uart_ambiq_pm_action(const struct device *dev, enum pm_device_action @@ -168,16 +168,16 @@ static int uart_ambiq_pm_action(const struct device *dev, enum pm_device_action
}
#endif /* CONFIG_PM_DEVICE */
#define AMBIQ_UART_DEFINE(n) \
#define AMBIQ_PL011_UART_DEFINE(n) \
PM_DEVICE_DT_INST_DEFINE(n, uart_ambiq_pm_action); \
static int pwr_on_ambiq_uart_##n(void) \
static int pwr_on_ambiq_pl011_uart_##n(void) \
{ \
uint32_t module = (DT_INST_REG_ADDR(n) - UART0_BASE) / (UART1_BASE - UART0_BASE); \
am_hal_pwrctrl_periph_e eUARTPowerModule = \
((am_hal_pwrctrl_periph_e)(AM_HAL_PWRCTRL_PERIPH_UART0 + module)); \
return am_hal_pwrctrl_periph_enable(eUARTPowerModule); \
} \
static inline int clk_enable_ambiq_uart_##n(const struct device *dev, uint32_t clk) \
static inline int clk_enable_ambiq_pl011_uart_##n(const struct device *dev, uint32_t clk) \
{ \
return clk_enable_ambiq_uart(dev, clk); \
}

15
dts/bindings/serial/ambiq,pl011-uart.yaml

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
# Copyright (c) 2023 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: Apache-2.0
description: Ambiq UART controller (PL011 compatible)
compatible: "ambiq,pl011-uart"
include: ["arm,pl011.yaml", pinctrl-device.yaml]
properties:
pinctrl-0:
required: true
pinctrl-names:
required: true

20
dts/bindings/serial/ambiq,uart.yaml

@ -1,15 +1,29 @@ @@ -1,15 +1,29 @@
# Copyright (c) 2023 Antmicro <www.antmicro.com>
# Copyright (c) 2025, Ambiq Micro Inc. <www.ambiq.com>
# SPDX-License-Identifier: Apache-2.0
description: Ambiq UART controller (PL011 compatible)
description: Ambiq UART controller
compatible: "ambiq,uart"
include: ["arm,pl011.yaml", pinctrl-device.yaml]
include: [uart-controller.yaml, pinctrl-device.yaml]
properties:
reg:
required: true
interrupts:
required: true
pinctrl-0:
required: true
pinctrl-names:
required: true
clk-src:
type: int
default: 0
description: |
Set the UART clock source, apollo510 only
0x0 - HFRC
0x1 - SYSPLL

Loading…
Cancel
Save