[PATCH] Fully disabled seemingly unsupported zynq_uart_set_attributes handler

Joel Sherrill joel at rtems.org
Wed Mar 27 18:28:40 UTC 2019


On Wed, Mar 27, 2019 at 1:10 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> 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 ...
>

We discussed this alternative with Chris and this was the end result.

git blame shows that Chris added the if 0 and then you added the return
false
which broke the callers. From that point forward, no interactive test ran
successfully.


> > +#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.
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20190327/c478470c/attachment-0002.html>


More information about the devel mailing list