[PATCH] dm: serial: introduce puts hook

Simon Glass sjg at chromium.org
Mon May 4 17:21:46 CEST 2020


Hi Peng,

On Mon, 4 May 2020 at 08:24, Peng Fan <peng.fan at nxp.com> wrote:
>
> Hi Simon,
>
> > Subject: Re: [PATCH] dm: serial: introduce puts hook
> >
> > Hi Peng,
> >
> > On Sun, 3 May 2020 at 06:42, Peng Fan <peng.fan at nxp.com> wrote:
> > >
> > > Introduce puts hook for dm serial driver.
> > >
> > > Signed-off-by: Peng Fan <peng.fan at nxp.com>
> > > ---
> > >  drivers/serial/serial-uclass.c | 13 +++++++++++--
> > >  include/serial.h               |  8 ++++++++
> > >  2 files changed, 19 insertions(+), 2 deletions(-)
> >
> > I'm just wondering why we need this? Isn't serial_putc() enough?
>
> This is to let u-boot could run in a XEN hypervisor DomU virtual machine.
> It is low efficiently if each time, we use putc to let xen dom0 print uboot
> log.

OK that is the sort of thing that should be in the commit message :-)

>
> We could pass a string, not a char to improve performance.

If we are going to do that, I think it would be better to add a
write() call, with a length. It should return the number of bytes
written, since sometimes the port might be full.

The uclass itself needs a serial_write() call which would then fall
back to writing characters if the driver doesn't have the write
method.

Also should have a test.

Regards,
Simon


More information about the U-Boot mailing list