Re: Does uart_pl011.c support non interrupt mode

Jaxson Han <Jaxson.Han@...>

Hi Ayan,

-----Original Message-----
From: Ayan Kumar Halder <ayankuma@...>
Sent: Tuesday, August 2, 2022 5:23 PM
To: users@...; daniel.leung@...; Jaxson Han
Cc: Stabellini, Stefano <stefano.stabellini@...>;
michalorzel.eng@...; Luca Fancellu <Luca.Fancellu@...>
Subject: Does uart_pl011.c support non interrupt mode

Hi Zephyr Users,

When I try to compile with fvp_baser_armv8r_aarch32_defconfig and
CONFIG_UART_INTERRUPT_DRIVEN=n, I get the following compilation error


pl011.c:474:4: error: 'struct pl011_config' has no member named 'uart'
474 | .uart = (volatile struct pl011_regs *)DT_INST_REG_ADDR(n), \

I fixed this error using the following diff

ayan@ayan-Lenovo-V15-IIL:~/zephyrproject/zephyr$ git diff
drivers/serial/uart_pl011.c diff --git a/drivers/serial/uart_pl011.c
b/drivers/serial/uart_pl011.c index d00d805f..636d2fcf 100644
--- a/drivers/serial/uart_pl011.c
+++ b/drivers/serial/uart_pl011.c
@@ -49,7 +49,9 @@ struct pl011_config {
uint32_t sys_clk_freq;
uart_irq_config_func_t irq_config_func;
+ volatile struct pl011_regs *uart; #endif /*

But I do not get any serial output.

So, does uart_pl011 support non interrupt mode ? Or is there some issue with
my diff ?
Sure, it does support.
You may try this:

diff --git a/drivers/serial/uart_pl011.c b/drivers/serial/uart_pl011.c
index d00d805f10..a39a562946 100644
--- a/drivers/serial/uart_pl011.c
+++ b/drivers/serial/uart_pl011.c
@@ -467,7 +467,7 @@ void pl011_isr(const struct device *dev)
#define PL011_CONFIG_PORT(n) \
static struct pl011_config pl011_cfg_port_##n = { \
- .uart = (volatile struct pl011_regs *)DT_INST_REG_ADDR(n), \
.sys_clk_freq = DT_INST_PROP_BY_PHANDLE(n, clocks, clock_frequency), \


Appreciate any help.

Kind regards,

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Join to automatically receive all group messages.