diff mbox series

[3/3] serial: msm_serial: set .clk_bit_rate in debug UART

Message ID 20240415105028.432404-3-robert.marko@sartura.hr
State Accepted
Delegated to: Caleb Connolly
Headers show
Series [1/3] serial: allow selecting MSM debug UART with ARCH_IPQ40XX | expand

Commit Message

Robert Marko April 15, 2024, 10:49 a.m. UTC
Currently, .clk_bit_rate is not being set in init_serial_data for debug
UART, but its then used uart_dm_init() and this breaks debug UART on
IPQ40xx.

So, lets populate .clk_bit_rate for debug UART as well.
IPQ40xx requires special value of 0xff, so set it if ARCH_IPQ40XX is
selected, otherwise default to the same value that regular DM UART
will use.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 drivers/serial/serial_msm.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Caleb Connolly April 15, 2024, 11:46 a.m. UTC | #1
On 15/04/2024 11:49, Robert Marko wrote:
> Currently, .clk_bit_rate is not being set in init_serial_data for debug
> UART, but its then used uart_dm_init() and this breaks debug UART on
> IPQ40xx.
> 
> So, lets populate .clk_bit_rate for debug UART as well.
> IPQ40xx requires special value of 0xff, so set it if ARCH_IPQ40XX is
> selected, otherwise default to the same value that regular DM UART
> will use.

Ah, I have a patch lying around to configure this automatically, but
didn't get around to sending it. Could you give it a test on your IPQ
board if I send it your way?

Kind regards,
> 
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
>  drivers/serial/serial_msm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
> index 8044d38518..80069f5cfb 100644
> --- a/drivers/serial/serial_msm.c
> +++ b/drivers/serial/serial_msm.c
> @@ -242,6 +242,11 @@ U_BOOT_DRIVER(serial_msm) = {
>  
>  static struct msm_serial_data init_serial_data = {
>  	.base = CONFIG_VAL(DEBUG_UART_BASE),
> +#ifdef CONFIG_ARCH_IPQ40XX
> +	.clk_bit_rate = 0xff,
> +#else
> +	.clk_bit_rate = UART_DM_CLK_RX_TX_BIT_RATE,
> +#endif
>  };
>  
>  #include <debug_uart.h>
Robert Marko April 15, 2024, 11:47 a.m. UTC | #2
On Mon, Apr 15, 2024 at 1:46 PM Caleb Connolly
<caleb.connolly@linaro.org> wrote:
>
>
>
> On 15/04/2024 11:49, Robert Marko wrote:
> > Currently, .clk_bit_rate is not being set in init_serial_data for debug
> > UART, but its then used uart_dm_init() and this breaks debug UART on
> > IPQ40xx.
> >
> > So, lets populate .clk_bit_rate for debug UART as well.
> > IPQ40xx requires special value of 0xff, so set it if ARCH_IPQ40XX is
> > selected, otherwise default to the same value that regular DM UART
> > will use.
>
> Ah, I have a patch lying around to configure this automatically, but
> didn't get around to sending it. Could you give it a test on your IPQ
> board if I send it your way?

Sure, that would be great.
Regards,
Robert

>
> Kind regards,
> >
> > Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> > ---
> >  drivers/serial/serial_msm.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
> > index 8044d38518..80069f5cfb 100644
> > --- a/drivers/serial/serial_msm.c
> > +++ b/drivers/serial/serial_msm.c
> > @@ -242,6 +242,11 @@ U_BOOT_DRIVER(serial_msm) = {
> >
> >  static struct msm_serial_data init_serial_data = {
> >       .base = CONFIG_VAL(DEBUG_UART_BASE),
> > +#ifdef CONFIG_ARCH_IPQ40XX
> > +     .clk_bit_rate = 0xff,
> > +#else
> > +     .clk_bit_rate = UART_DM_CLK_RX_TX_BIT_RATE,
> > +#endif
> >  };
> >
> >  #include <debug_uart.h>
>
> --
> // Caleb (they/them)
diff mbox series

Patch

diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
index 8044d38518..80069f5cfb 100644
--- a/drivers/serial/serial_msm.c
+++ b/drivers/serial/serial_msm.c
@@ -242,6 +242,11 @@  U_BOOT_DRIVER(serial_msm) = {
 
 static struct msm_serial_data init_serial_data = {
 	.base = CONFIG_VAL(DEBUG_UART_BASE),
+#ifdef CONFIG_ARCH_IPQ40XX
+	.clk_bit_rate = 0xff,
+#else
+	.clk_bit_rate = UART_DM_CLK_RX_TX_BIT_RATE,
+#endif
 };
 
 #include <debug_uart.h>