Skip to content

drivers: serial: pl011: Add fifo enable configuration #79474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions drivers/serial/uart_pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct pl011_config {
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
uart_irq_config_func_t irq_config_func;
#endif
bool fifo_disable;
int (*clk_enable_func)(const struct device *dev, uint32_t clk);
int (*pwr_on_func)(void);
};
Expand Down Expand Up @@ -205,6 +206,7 @@ static int pl011_runtime_configure_internal(const struct device *dev,
const struct uart_config *cfg,
bool disable)
{
const struct pl011_config *config = dev->config;
struct pl011_data *data = dev->data;
uint32_t lcrh;
int ret = -ENOTSUP;
Expand Down Expand Up @@ -286,7 +288,9 @@ static int pl011_runtime_configure_internal(const struct device *dev,

enable:
if (disable) {
pl011_enable_fifo(dev);
if (!config->fifo_disable) {
pl011_enable_fifo(dev);
}
pl011_enable(dev);
}

Expand Down Expand Up @@ -527,7 +531,9 @@ static int pl011_init(const struct device *dev)
| FIELD_PREP(PL011_IFLS_RXIFLSEL_M, RXIFLSEL_1_2_FULL);

/* Enabling the FIFOs */
pl011_enable_fifo(dev);
if (!config->fifo_disable) {
pl011_enable_fifo(dev);
}
}
/* initialize all IRQs as masked */
get_uart(dev)->imsc = 0U;
Expand Down Expand Up @@ -648,6 +654,7 @@ void pl011_isr(const struct device *dev)
CLOCK_INIT(n) \
PINCTRL_INIT(n) \
.irq_config_func = pl011_irq_config_func_##n, \
.fifo_disable = DT_INST_PROP(n, fifo_disable), \
.clk_enable_func = COMPAT_SPECIFIC_CLK_ENABLE_FUNC(n), \
.pwr_on_func = COMPAT_SPECIFIC_PWR_ON_FUNC(n), \
};
Expand Down
4 changes: 4 additions & 0 deletions dts/bindings/serial/arm,pl011.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ properties:

interrupts:
required: true

fifo-disable:
type: boolean
description: Disable the UART FIFO
Loading