From 92e723db93b512b8b3ad59d7fa60045caa23a1a9 Mon Sep 17 00:00:00 2001 From: Hao Luo Date: Fri, 16 May 2025 09:27:48 +0800 Subject: [PATCH] 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 --- drivers/serial/uart_pl011_ambiq.h | 6 +++--- dts/bindings/serial/ambiq,pl011-uart.yaml | 15 +++++++++++++++ dts/bindings/serial/ambiq,uart.yaml | 20 +++++++++++++++++--- 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 dts/bindings/serial/ambiq,pl011-uart.yaml diff --git a/drivers/serial/uart_pl011_ambiq.h b/drivers/serial/uart_pl011_ambiq.h index 41b22f9ba81..6db7e297db4 100644 --- a/drivers/serial/uart_pl011_ambiq.h +++ b/drivers/serial/uart_pl011_ambiq.h @@ -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); \ } diff --git a/dts/bindings/serial/ambiq,pl011-uart.yaml b/dts/bindings/serial/ambiq,pl011-uart.yaml new file mode 100644 index 00000000000..74d29dd80e0 --- /dev/null +++ b/dts/bindings/serial/ambiq,pl011-uart.yaml @@ -0,0 +1,15 @@ +# Copyright (c) 2023 Antmicro +# 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 diff --git a/dts/bindings/serial/ambiq,uart.yaml b/dts/bindings/serial/ambiq,uart.yaml index f87be27f419..cf167c62d45 100644 --- a/dts/bindings/serial/ambiq,uart.yaml +++ b/dts/bindings/serial/ambiq,uart.yaml @@ -1,15 +1,29 @@ -# Copyright (c) 2023 Antmicro +# Copyright (c) 2025, Ambiq Micro Inc. # 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