All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Antonov <saproj@gmail.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de,  linux-sunxi@lists.linux.dev,
	Samuel Holland <samuel@sholland.org>
Subject: Re: [PATCH] ns16550: Fix DM serial operation with non-DM SPL
Date: Wed, 18 Jan 2023 16:08:37 +0300	[thread overview]
Message-ID: <CABikg9xq7TJLqhJ8VWjU-eToTkB=OXWzN6inrM0vkh5XEz1NJw@mail.gmail.com> (raw)
In-Reply-To: <20230117161359.358ae7a3@donnerap.cambridge.arm.com>

On Tue, 17 Jan 2023 at 19:14, Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Tue, 17 Jan 2023 16:12:54 +0300
> Sergei Antonov <saproj@gmail.com> wrote:
>
> Hi Sergei,
>
> > On Tue, 17 Jan 2023 at 15:10, Andre Przywara <andre.przywara@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?

Oh, I meant 8-bit. So under DM_SERIAL:
CONFIG_SYS_NS16550_REG_SIZE is -1
UART_REG(x) is unsigned char x

> What does your reg-shift DT property say? Is that in your DT?

I did not have "reg-shift" property. Thanks for telling about it. Now
that I have these properties in DT my UART works.
  reg-io-width = <4>;
  reg-shift = <2>;

I also had to add this config parameter to make debug uart work:
CONFIG_DEBUG_UART_SHIFT=2

Thanks!

  reply	other threads:[~2023-01-18 13:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 12:09 [PATCH] ns16550: Fix DM serial operation with non-DM SPL Andre Przywara
2023-01-17 13:12 ` Sergei Antonov
2023-01-17 16:13   ` Andre Przywara
2023-01-18 13:08     ` Sergei Antonov [this message]
2023-01-17 16:16   ` Tom Rini
2023-01-17 13:15 ` Tom Rini
2023-01-17 15:55   ` Tom Rini
2023-01-17 16:09   ` Andre Przywara
2023-01-17 16:14     ` Tom Rini
2023-01-17 22:15       ` Andre Przywara
2023-01-17 22:23         ` Tom Rini
2023-01-17 23:35           ` Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABikg9xq7TJLqhJ8VWjU-eToTkB=OXWzN6inrM0vkh5XEz1NJw@mail.gmail.com' \
    --to=saproj@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=samuel@sholland.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.