public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jia Wang <wangjia@ultrarisc.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Jia Wang <wangjia@ultrarisc.com>,
	 Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jiri Slaby <jirislaby@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Alexandre Ghiti <alex@ghiti.fr>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	 linux-serial <linux-serial@vger.kernel.org>,
	 linux-riscv@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART
Date: Wed, 22 Apr 2026 17:45:06 +0800	[thread overview]
Message-ID: <177685110619.768471.8296280075168950467.b4-reply@b4> (raw)
In-Reply-To: <446bf928-002a-456a-ae50-28220883dade@linux.intel.com>

On 2026-04-22 12:01 +0300, Ilpo Järvinen wrote:
> On Wed, 22 Apr 2026, Jia Wang wrote:
> 
> > On 2026-04-21 15:18 +0300, Ilpo Järvinen wrote:
> > > On Tue, 21 Apr 2026, Jia Wang wrote:
> > > 
> > > > The UltraRISC DP1000 UART does not provide the standard CPR register used
> > > > by 8250_dw to discover port capabilities.
> > > > 
> > > > Provide a fixed CPR value for the DP1000-specific compatible so the
> > > > driver can configure the port correctly.
> > > > 
> > > > Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
> > > > ---
> > > >  drivers/tty/serial/8250/8250_dw.c | 7 +++++++
> > > >  1 file changed, 7 insertions(+)
> > > > 
> > > > diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> > > > index 94beadb4024d..ca6dbdf75918 100644
> > > > --- a/drivers/tty/serial/8250/8250_dw.c
> > > > +++ b/drivers/tty/serial/8250/8250_dw.c
> > > > @@ -962,6 +962,12 @@ static const struct dw8250_platform_data dw8250_intc10ee = {
> > > >  	.quirks = DW_UART_QUIRK_IER_KICK,
> > > >  };
> > > >  
> > > > +static const struct dw8250_platform_data dw8250_ultrarisc_dp1000_data = {
> > > > +	.usr_reg = DW_UART_USR,
> > > > +	.cpr_value = 0x00022022,
> > > 
> > > Hi,
> > > 
> > > Please construct the cpr_value by ORing DW_UART_CPR_* defines together.
> > > For fields, FIELD_PREP_CONST() may be useful.
> > > 
> > > In order to be able to use the DW_UART_CPR_* defines, they need to be 
> > > moved into 8250_dwlib.h (I'd move all DW_UART register defines in a 
> > > preparatory patch).
> > > 
> > > I know the existing Renesas' .cpr_value doesn't follow this convention but 
> > > that could be converted as well (in another patch, or leave the Renesas 
> > > entry conversion to me if you don't want to do that).
> > >
> > 
> > Thanks for the review.
> > 
> > Just to confirm: since you mentioned that the preparatory patch moving
> > the DW_UART register defines is already in place, I don't need to move
> > them again, correct?
> 
> I'm not sure where that preparatory patch is. Those defines still appear 
> in 8250_dwlib.c AFAICT.
> 
> To be clear, DW_UART_CPR_* defines are in 8250_dwlib.c but you're 
> modifying 8250_dw.c file here so you cannot use those pre-existing defines 
> as is in 8250_dw.c. To solve that, please add a preparatory patch into 
> your series which relocates all those defines from 8250_dwlib.c to 
> 8250_dwlib.h. If there's a patch which does that already, it has missed my 
> radar.
> 
> And my suggestion is to move not just DW_UART_CPR_* defines into 
> 8250_dwlib.h but all DW UART specific register defines to keep them in 
> the same place.
> 
> Hopefully this clears up any misunderstanding.
> 
> 
> My main point all along is that do not do the define move in the same 
> patch where you're adding UltraRISC DP1000 UART (which is a common pitfall 
> to many submitters so I try to give pro-active instructions while 
> reviewing to avoid extra versions because of them).
>

Thanks.

Understood. I will add a preparatory patch to move all DW_UART register
defines into 8250_dwlib.h, and update the UltraRISC DP1000 support accordingly.

I will also follow the ordering suggested during review and resend the
series as v4.
 
> > I will update my patch to use the DW_UART_CPR_* macros and
> > FIELD_PREP_CONST() accordingly, and I’m happy to add a separate patch in
> > the next revision to convert the Renesas .cpr_value as well.
> 
> Great, thanks.
> 
> > > > +	.quirks = DW_UART_QUIRK_CPR_VALUE,
> > > > +};
> 
> -- 
>  i.

Regards,
Jia Wang


      reply	other threads:[~2026-04-22  9:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21  5:58 [PATCH v3 0/2] serial: 8250_dw: Add support for UltraRISC DP1000 uart Jia Wang
2026-04-21  5:58 ` [PATCH v3 1/2] dt-bindings: serial: snps-dw-apb-uart: Add UltraRISC DP1000 UART Jia Wang
2026-04-21 17:06   ` Conor Dooley
2026-04-21  5:58 ` [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for " Jia Wang
2026-04-21 12:18   ` Ilpo Järvinen
2026-04-22  0:57     ` Jia Wang
2026-04-22  8:45       ` Andy Shevchenko
2026-04-22  8:46         ` Andy Shevchenko
2026-04-22  9:39           ` Jia Wang
2026-04-22  9:43             ` Andy Shevchenko
2026-04-22  9:51               ` Jia Wang
2026-04-22  9:01       ` Ilpo Järvinen
2026-04-22  9:45         ` Jia Wang [this message]

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=177685110619.768471.8296280075168950467.b4-reply@b4 \
    --to=wangjia@ultrarisc.com \
    --cc=alex@ghiti.fr \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox