* [PATCH v3 0/2] serial: 8250_dw: Add support for UltraRISC DP1000 uart
@ 2026-04-21 5:58 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 5:58 ` [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for " Jia Wang
0 siblings, 2 replies; 13+ messages in thread
From: Jia Wang @ 2026-04-21 5:58 UTC (permalink / raw)
To: Ilpo Järvinen, Andy Shevchenko, Greg Kroah-Hartman,
Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-kernel, linux-serial, linux-riscv, devicetree, Jia Wang
This patch series adds support for the UltraRISC DP1000 UART controller.
The series includes two patches:
1. Document the DP1000-specific compatible string for this UART variant.
2. Update 8250_dw to use a fixed CPR value for the DP1000 UART.
The patches have been tested on Ultrarisc DP1000 development board with
Linux v7.0-rc7, verifying basic UART functionality.
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
Changes in v3:
- Rebased on Linux v7.0-rc7.
- Patch 1:
* Removed separate `items` entry for DP1000, merging it into the
existing `enum` to comply with the schema.
* Updated commit message to describe DP1000 UART hardware differences.
- Patch 2:
* Drop the custom quirk for missing CPR register.
* Switch to using DW_UART_QUIRK_CPR_VALUE to provide a fixed CPR value.
- Link to v2: https://patch.msgid.link/20260316-ultrarisc-serial-v2-0-6ab3e7fa891c@ultrarisc.com
Changes in v2:
- Rebased on Linux v7.0-rc4 (previously on v7.0-rc2).
- Reordered patch series: DT binding patch comes before driver changes.
- Updated commit message for DT binding patch.
- Link to v1: https://patch.msgid.link/20260316-ultrarisc-serial-v1-0-c464f3e933a5@ultrarisc.com
---
Jia Wang (2):
dt-bindings: serial: snps-dw-apb-uart: Add UltraRISC DP1000 UART
serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 +
drivers/tty/serial/8250/8250_dw.c | 7 +++++++
2 files changed, 8 insertions(+)
---
base-commit: e774d5f1bc27a85f858bce7688509e866f8e8a4e
change-id: 20260309-ultrarisc-serial-64ff637edf26
Best regards,
--
Jia Wang <wangjia@ultrarisc.com>
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH v3 1/2] dt-bindings: serial: snps-dw-apb-uart: Add UltraRISC DP1000 UART 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 ` 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 1 sibling, 1 reply; 13+ messages in thread From: Jia Wang @ 2026-04-21 5:58 UTC (permalink / raw) To: Ilpo Järvinen, Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-kernel, linux-serial, linux-riscv, devicetree, Jia Wang UltraRISC DP1000 integrates a Synopsys DesignWare APB UART, but it does not provide the standard CPR and UCV registers. Signed-off-by: Jia Wang <wangjia@ultrarisc.com> --- Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml index 6efe43089a74..f84600f66df8 100644 --- a/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml +++ b/Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml @@ -77,6 +77,7 @@ properties: - starfive,jh7100-hsuart - starfive,jh7100-uart - starfive,jh7110-uart + - ultrarisc,dp1000-uart - const: snps,dw-apb-uart - const: snps,dw-apb-uart -- 2.34.1 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: serial: snps-dw-apb-uart: Add UltraRISC DP1000 UART 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 0 siblings, 0 replies; 13+ messages in thread From: Conor Dooley @ 2026-04-21 17:06 UTC (permalink / raw) To: Jia Wang Cc: Ilpo Järvinen, Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-kernel, linux-serial, linux-riscv, devicetree [-- Attachment #1: Type: text/plain, Size: 295 bytes --] On Tue, Apr 21, 2026 at 01:58:51PM +0800, Jia Wang wrote: > UltraRISC DP1000 integrates a Synopsys DesignWare APB UART, but it does > not provide the standard CPR and UCV registers. > > Signed-off-by: Jia Wang <wangjia@ultrarisc.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 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 5:58 ` Jia Wang 2026-04-21 12:18 ` Ilpo Järvinen 1 sibling, 1 reply; 13+ messages in thread From: Jia Wang @ 2026-04-21 5:58 UTC (permalink / raw) To: Ilpo Järvinen, Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley Cc: linux-kernel, linux-serial, linux-riscv, devicetree, Jia Wang 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, + .quirks = DW_UART_QUIRK_CPR_VALUE, +}; + static const struct of_device_id dw8250_of_match[] = { { .compatible = "snps,dw-apb-uart", .data = &dw8250_dw_apb }, { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data }, @@ -969,6 +975,7 @@ static const struct of_device_id dw8250_of_match[] = { { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data }, { .compatible = "sophgo,sg2044-uart", .data = &dw8250_skip_set_rate_data }, { .compatible = "starfive,jh7100-uart", .data = &dw8250_skip_set_rate_data }, + { .compatible = "ultrarisc,dp1000-uart", .data = &dw8250_ultrarisc_dp1000_data }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, dw8250_of_match); -- 2.34.1 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 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 0 siblings, 1 reply; 13+ messages in thread From: Ilpo Järvinen @ 2026-04-21 12:18 UTC (permalink / raw) To: Jia Wang Cc: Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree 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). > + .quirks = DW_UART_QUIRK_CPR_VALUE, > +}; > + > static const struct of_device_id dw8250_of_match[] = { > { .compatible = "snps,dw-apb-uart", .data = &dw8250_dw_apb }, > { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data }, > @@ -969,6 +975,7 @@ static const struct of_device_id dw8250_of_match[] = { > { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data }, > { .compatible = "sophgo,sg2044-uart", .data = &dw8250_skip_set_rate_data }, > { .compatible = "starfive,jh7100-uart", .data = &dw8250_skip_set_rate_data }, > + { .compatible = "ultrarisc,dp1000-uart", .data = &dw8250_ultrarisc_dp1000_data }, > { /* Sentinel */ } > }; > MODULE_DEVICE_TABLE(of, dw8250_of_match); > > -- i. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 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 9:01 ` Ilpo Järvinen 0 siblings, 2 replies; 13+ messages in thread From: Jia Wang @ 2026-04-22 0:57 UTC (permalink / raw) To: Ilpo Järvinen Cc: Jia Wang, Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree 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 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. > > + .quirks = DW_UART_QUIRK_CPR_VALUE, > > +}; > > + > > static const struct of_device_id dw8250_of_match[] = { > > { .compatible = "snps,dw-apb-uart", .data = &dw8250_dw_apb }, > > { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data }, > > @@ -969,6 +975,7 @@ static const struct of_device_id dw8250_of_match[] = { > > { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data }, > > { .compatible = "sophgo,sg2044-uart", .data = &dw8250_skip_set_rate_data }, > > { .compatible = "starfive,jh7100-uart", .data = &dw8250_skip_set_rate_data }, > > + { .compatible = "ultrarisc,dp1000-uart", .data = &dw8250_ultrarisc_dp1000_data }, > > { /* Sentinel */ } > > }; > > MODULE_DEVICE_TABLE(of, dw8250_of_match); > > > > > > -- > i. > > Regards, Jia ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 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:01 ` Ilpo Järvinen 1 sibling, 1 reply; 13+ messages in thread From: Andy Shevchenko @ 2026-04-22 8:45 UTC (permalink / raw) To: Jia Wang Cc: Ilpo Järvinen, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree On Wed, Apr 22, 2026 at 08:57:56AM +0800, Jia Wang wrote: > On 2026-04-21 15:18 +0300, Ilpo Järvinen wrote: > > On Tue, 21 Apr 2026, Jia Wang wrote: ... > > > +static const struct dw8250_platform_data dw8250_ultrarisc_dp1000_data = { > > > + .usr_reg = DW_UART_USR, > > > + .cpr_value = 0x00022022, > > > > 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 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. My understanding that you want to send a patch series of 3 patches: - moving DW_UART_CPR_* values from C-file to h-file - modify existing Renesas case - add support for your HW (this patch in updated form) -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 2026-04-22 8:45 ` Andy Shevchenko @ 2026-04-22 8:46 ` Andy Shevchenko 2026-04-22 9:39 ` Jia Wang 0 siblings, 1 reply; 13+ messages in thread From: Andy Shevchenko @ 2026-04-22 8:46 UTC (permalink / raw) To: Jia Wang Cc: Ilpo Järvinen, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree On Wed, Apr 22, 2026 at 11:45:44AM +0300, Andy Shevchenko wrote: > On Wed, Apr 22, 2026 at 08:57:56AM +0800, Jia Wang wrote: ... > > 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 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. > > My understanding that you want to send a patch series of 3 patches: > - moving DW_UART_CPR_* values from C-file to h-file > - modify existing Renesas case - DT binding for new HW (patch 1 of this series) > - add support for your HW (this patch in updated form) And I forgot that you have a DT binging one... So 4 patches after all. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 2026-04-22 8:46 ` Andy Shevchenko @ 2026-04-22 9:39 ` Jia Wang 2026-04-22 9:43 ` Andy Shevchenko 0 siblings, 1 reply; 13+ messages in thread From: Jia Wang @ 2026-04-22 9:39 UTC (permalink / raw) To: Andy Shevchenko Cc: Jia Wang, Ilpo Järvinen, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree On 2026-04-22 11:46 +0300, Andy Shevchenko wrote: > On Wed, Apr 22, 2026 at 11:45:44AM +0300, Andy Shevchenko wrote: > > On Wed, Apr 22, 2026 at 08:57:56AM +0800, Jia Wang wrote: > > ... > > > > 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 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. > > > > My understanding that you want to send a patch series of 3 patches: > > - moving DW_UART_CPR_* values from C-file to h-file > > - modify existing Renesas case > > - DT binding for new HW (patch 1 of this series) > > > - add support for your HW (this patch in updated form) > Yes, I will follow this order and resend the series in v4. > And I forgot that you have a DT binging one... So 4 patches after all. > > -- > With Best Regards, > Andy Shevchenko > > > Regards, Jia Wang ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 2026-04-22 9:39 ` Jia Wang @ 2026-04-22 9:43 ` Andy Shevchenko 2026-04-22 9:51 ` Jia Wang 0 siblings, 1 reply; 13+ messages in thread From: Andy Shevchenko @ 2026-04-22 9:43 UTC (permalink / raw) To: Jia Wang Cc: Ilpo Järvinen, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree On Wed, Apr 22, 2026 at 05:39:41PM +0800, Jia Wang wrote: > On 2026-04-22 11:46 +0300, Andy Shevchenko wrote: > > On Wed, Apr 22, 2026 at 11:45:44AM +0300, Andy Shevchenko wrote: > > > On Wed, Apr 22, 2026 at 08:57:56AM +0800, Jia Wang wrote: ... > > > > 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 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. > > > > > > My understanding that you want to send a patch series of 3 patches: > > > - moving DW_UART_CPR_* values from C-file to h-file > > > - modify existing Renesas case > > > > - DT binding for new HW (patch 1 of this series) > > > > > - add support for your HW (this patch in updated form) > > Yes, I will follow this order and resend the series in v4. Thanks, and since Ilpo mentioned, move all DW_UART_* register offsets/bitfields to the header file (in patch 1 of a new series). > > And I forgot that you have a DT binging one... So 4 patches after all. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 2026-04-22 9:43 ` Andy Shevchenko @ 2026-04-22 9:51 ` Jia Wang 0 siblings, 0 replies; 13+ messages in thread From: Jia Wang @ 2026-04-22 9:51 UTC (permalink / raw) To: Andy Shevchenko Cc: Jia Wang, Ilpo Järvinen, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree On 2026-04-22 12:43 +0300, Andy Shevchenko wrote: > On Wed, Apr 22, 2026 at 05:39:41PM +0800, Jia Wang wrote: > > On 2026-04-22 11:46 +0300, Andy Shevchenko wrote: > > > On Wed, Apr 22, 2026 at 11:45:44AM +0300, Andy Shevchenko wrote: > > > > On Wed, Apr 22, 2026 at 08:57:56AM +0800, Jia Wang wrote: > > ... > > > > > > 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 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. > > > > > > > > My understanding that you want to send a patch series of 3 patches: > > > > - moving DW_UART_CPR_* values from C-file to h-file > > > > - modify existing Renesas case > > > > > > - DT binding for new HW (patch 1 of this series) > > > > > > > - add support for your HW (this patch in updated form) > > > > Yes, I will follow this order and resend the series in v4. > > Thanks, and since Ilpo mentioned, move all DW_UART_* register offsets/bitfields > to the header file (in patch 1 of a new series). > Thanks, got it. I’ll follow this in v4. > > > And I forgot that you have a DT binging one... So 4 patches after all. > > -- > With Best Regards, > Andy Shevchenko > > > Regards, Jia Wang ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 2026-04-22 0:57 ` Jia Wang 2026-04-22 8:45 ` Andy Shevchenko @ 2026-04-22 9:01 ` Ilpo Järvinen 2026-04-22 9:45 ` Jia Wang 1 sibling, 1 reply; 13+ messages in thread From: Ilpo Järvinen @ 2026-04-22 9:01 UTC (permalink / raw) To: Jia Wang Cc: Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree [-- Attachment #1: Type: text/plain, Size: 3124 bytes --] 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). > 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. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 2/2] serial: 8250_dw: Use a fixed CPR value for UltraRISC DP1000 UART 2026-04-22 9:01 ` Ilpo Järvinen @ 2026-04-22 9:45 ` Jia Wang 0 siblings, 0 replies; 13+ messages in thread From: Jia Wang @ 2026-04-22 9:45 UTC (permalink / raw) To: Ilpo Järvinen Cc: Jia Wang, Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby, Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski, Conor Dooley, LKML, linux-serial, linux-riscv, devicetree 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-04-22 9:51 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox