Re: [PATCH v4 2/4] serial: 8250_dw: build Renesas RZN1 CPR value from DW_UART_CPR_* definitions

Ilpo Järvinen
2026-04-24T14:09:55Z

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

On Fri, 24 Apr 2026, Andy Shevchenko wrote:

> On Fri, Apr 24, 2026 at 02:38:56PM +0300, Ilpo Järvinen wrote:
> > On Fri, 24 Apr 2026, Jia Wang wrote:
>
> ...
>
> > Hmm, maybe there should also be macro also for this one which takes the
> > fifosize as input and converts it to CPR field vlaue (effectively, the
> > macro is an inverse of DW_UART_CPR_FIFO_SIZE()). It would be more readable
> > than the literal.
>
> But this can be done separately, right?

It's logically part of the cpr_value literal to defines conversion (of
course one could introduce it in own patch without users but I don't see
much benefit from that).

> > Also include BUILD_BUG_ON(!IS_ALIGNED(fifosize, 16) + bounds checks)
> > inside that macro to catch invalid fifo sizes (+ don't forget the
> > necessary headers for those two new things).
>
> Hmm... Some devices may have FIFO = 8 or 4 bytes (Intel Quark IIRC has less
> than 16 and it's DW IP).

Perhaps but according the DW databook I've at hand, there are no values in
FIFO_MODE field for such FIFO sizes. So what would CPR contain in those
cases for FIFO_MODE field?

--
i.