[PATCH] ns16550: Fix DM serial operation with non-DM SPL

Andre Przywara andre.przywara at arm.com
Tue Jan 17 17:13:59 CET 2023


On Tue, 17 Jan 2023 16:12:54 +0300
Sergei Antonov <saproj at gmail.com> wrote:

Hi Sergei,

> On Tue, 17 Jan 2023 at 15:10, Andre Przywara <andre.przywara at arm.com> wrote:
> 
> > -#if CONFIG_IS_ENABLED(DM_SERIAL) && !defined(CONFIG_SYS_NS16550_REG_SIZE)
> > +#if CONFIG_IS_ENABLED(DM_SERIAL)
> >  /*
> >   * For driver model we always use one byte per register, and sort out the
> >   * differences in the driver
> >   */
> > +#undef CONFIG_SYS_NS16550_REG_SIZE
> >  #define CONFIG_SYS_NS16550_REG_SIZE (-1)
> >  #endif  
> 
> What if I have DM_SERIAL and a 16550 UART with 32-bit registers?

So does that break for you?
Because it should still work, I think, since (as the comment says) we just
use the struct to get the register *number*. The actual register size is
worked out from the DT, and multiplied in later.

> Before 9591b63531fa the register size of 8 was enforced for DM_SERIAL.

8? Or 4?
What does your reg-shift DT property say? Is that in your DT?

Cheers,
Andre



More information about the U-Boot mailing list