[PATCH] Fully disabled seemingly unsupported zynq_uart_set_attributes handler

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Mar 27 06:10:07 UTC 2019


On 26/03/2019 15:17, Lou Woods wrote:
> From: Lou Woods <Lou.Woods at OARCorp.com>
>
> ---
>   bsps/arm/xilinx-zynq/console/zynq-uart.c | 16 +++++++++++-----
>   1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/bsps/arm/xilinx-zynq/console/zynq-uart.c b/bsps/arm/xilinx-zynq/console/zynq-uart.c
> index fa91f3f..9c21f6f 100644
> --- a/bsps/arm/xilinx-zynq/console/zynq-uart.c
> +++ b/bsps/arm/xilinx-zynq/console/zynq-uart.c
> @@ -262,12 +262,16 @@ static void zynq_uart_write_support(
>   #endif
>   }
>   
> +/*
> + * Disable this because the initialization is done by code generated
> + * by the Xilinx code generator.
> + */

The main purpose of the set attributes function is to apply the settings 
specified by the user via the Termios interface. Returning false just 
indicates that this function is not implemented. If you want to hide 
this fact from the user, then you can simply return true ...

> +#if 0
>   static bool zynq_uart_set_attributes(
>     rtems_termios_device_context *context,
>     const struct termios *term
>   )
>   {
> -#if 0
>     volatile zynq_uart *regs = zynq_uart_get_regs(minor);
>     uint32_t brgr = 0;
>     uint32_t bauddiv = 0;
> @@ -283,14 +287,16 @@ static bool zynq_uart_set_attributes(
>     regs->control |= ZYNQ_UART_CONTROL_RXEN | ZYNQ_UART_CONTROL_TXEN;
>   
>     return true;
> -#else
> -  return false;

... here.

> -#endif
>   }
> +#endif
>   
>   const rtems_termios_device_handler zynq_uart_handler = {
>     .first_open = zynq_uart_first_open,
> -  .set_attributes = zynq_uart_set_attributes,
> +#if 0
> +  .set_attributes = zynq_uart_set_attributes;
> +#else
> +  .set_attributes = NULL,
> +#endif
>     .write = zynq_uart_write_support,
>   #ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
>     .last_close = zynq_uart_last_close,

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list