mbox series

[0/2] usb: dwc3: Add cache type configuration support for freescale layerscape

Message ID 20240703-dwc-v1-0-9cbc93d49180@nxp.com (mailing list archive)
Headers show
Series usb: dwc3: Add cache type configuration support for freescale layerscape | expand

Message

Frank Li July 3, 2024, 11:06 p.m. UTC
There are several attempt to upstream this code in past year.

The first attempt:
https://lore.kernel.org/linux-usb/20191121095356.GB7503@b29397-desktop/

cache type is dwc core setting, not glue layer. So It'd better change in
dwc core instead of glue layer code.

The second attempt:
https://lore.kernel.org/linux-usb/20240123170206.3702413-1-Frank.Li@nxp.com/#t

DT team think there are not variable for property 'snps,dat-wr-reqinfo'.
And suggest use vendor compatible string.

This is third attempt:
Compared with first attempt:
- reduce compatible string to one 'fsl,ls-dwc3' because all setting are the
same.
- move update burst type code into dwc3_set_incr_burst_type(). and check
compatible string 'fsl,ls-dwc3'.
- Using bit field help macro.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Ran Wang (2):
      dt-bindings: usb: Add chip-specific compatible string 'fsl,ls-dwc3'
      usb: dwc3: Set cache type to 'snoop' for freescale layerscape chip

 Documentation/devicetree/bindings/usb/snps,dwc3.yaml |  1 +
 drivers/usb/dwc3/core.c                              | 12 ++++++++++++
 drivers/usb/dwc3/core.h                              |  4 ++++
 3 files changed, 17 insertions(+)
---
base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
change-id: 20240703-dwc-5be3e378ddbe

Best regards,
---
Frank Li <Frank.Li@nxp.com>

Comments

Thinh Nguyen July 3, 2024, 11:33 p.m. UTC | #1
Hi Frank,

On Wed, Jul 03, 2024, Frank Li wrote:
> There are several attempt to upstream this code in past year.
> 
> The first attempt:
> https://urldefense.com/v3/__https://lore.kernel.org/linux-usb/20191121095356.GB7503@b29397-desktop/__;!!A4F2R9G_pg!cdNydVZ64br9EHG13lgP3lKWe5VuXQvvfvA1CzKJqhXZZB1H9vcJlwI1vj1EF3ynRFl2u8tD3lYqRvrJFSs2$ 
> 
> cache type is dwc core setting, not glue layer. So It'd better change in
> dwc core instead of glue layer code.

Why not glue layer?

> 
> The second attempt:
> https://urldefense.com/v3/__https://lore.kernel.org/linux-usb/20240123170206.3702413-1-Frank.Li@nxp.com/*t__;Iw!!A4F2R9G_pg!cdNydVZ64br9EHG13lgP3lKWe5VuXQvvfvA1CzKJqhXZZB1H9vcJlwI1vj1EF3ynRFl2u8tD3lYqRh7SiHmM$ 
> 
> DT team think there are not variable for property 'snps,dat-wr-reqinfo'.
> And suggest use vendor compatible string.
> 
> This is third attempt:
> Compared with first attempt:
> - reduce compatible string to one 'fsl,ls-dwc3' because all setting are the
> same.
> - move update burst type code into dwc3_set_incr_burst_type(). and check
> compatible string 'fsl,ls-dwc3'.
> - Using bit field help macro.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Ran Wang (2):
>       dt-bindings: usb: Add chip-specific compatible string 'fsl,ls-dwc3'
>       usb: dwc3: Set cache type to 'snoop' for freescale layerscape chip
> 
>  Documentation/devicetree/bindings/usb/snps,dwc3.yaml |  1 +
>  drivers/usb/dwc3/core.c                              | 12 ++++++++++++
>  drivers/usb/dwc3/core.h                              |  4 ++++
>  3 files changed, 17 insertions(+)
> ---
> base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
> change-id: 20240703-dwc-5be3e378ddbe
> 
> Best regards,
> ---
> Frank Li <Frank.Li@nxp.com>
> 

This may blow up the dwc3 core from various platforms and compatible
strings. This can be handled in the glue driver and create the software
property instead.

Radhey Shyam is working on this also. You can check his work here:

https://lore.kernel.org/linux-usb/1717657279-2631757-1-git-send-email-radhey.shyam.pandey@amd.com/

Thanks,
Thinh
Frank Li July 4, 2024, 4 p.m. UTC | #2
On Wed, Jul 03, 2024 at 11:33:23PM +0000, Thinh Nguyen wrote:
> Hi Frank,
> 
> On Wed, Jul 03, 2024, Frank Li wrote:
> > There are several attempt to upstream this code in past year.
> > 
> > The first attempt:
> > https://urldefense.com/v3/__https://lore.kernel.org/linux-usb/20191121095356.GB7503@b29397-desktop/__;!!A4F2R9G_pg!cdNydVZ64br9EHG13lgP3lKWe5VuXQvvfvA1CzKJqhXZZB1H9vcJlwI1vj1EF3ynRFl2u8tD3lYqRvrJFSs2$ 
> > 
> > cache type is dwc core setting, not glue layer. So It'd better change in
> > dwc core instead of glue layer code.
> 
> Why not glue layer?

I understand glue layer is what provide clock, reset, power and other
control for dwc usb core and have a seperate mmio register space. All dwc
core register access should belong to dwc-core part. You may have
difference defination for glue layer.

> 
> > 
> > The second attempt:
> > https://urldefense.com/v3/__https://lore.kernel.org/linux-usb/20240123170206.3702413-1-Frank.Li@nxp.com/*t__;Iw!!A4F2R9G_pg!cdNydVZ64br9EHG13lgP3lKWe5VuXQvvfvA1CzKJqhXZZB1H9vcJlwI1vj1EF3ynRFl2u8tD3lYqRh7SiHmM$ 
> > 
> > DT team think there are not variable for property 'snps,dat-wr-reqinfo'.
> > And suggest use vendor compatible string.
> > 
> > This is third attempt:
> > Compared with first attempt:
> > - reduce compatible string to one 'fsl,ls-dwc3' because all setting are the
> > same.
> > - move update burst type code into dwc3_set_incr_burst_type(). and check
> > compatible string 'fsl,ls-dwc3'.
> > - Using bit field help macro.
> > 
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > Ran Wang (2):
> >       dt-bindings: usb: Add chip-specific compatible string 'fsl,ls-dwc3'
> >       usb: dwc3: Set cache type to 'snoop' for freescale layerscape chip
> > 
> >  Documentation/devicetree/bindings/usb/snps,dwc3.yaml |  1 +
> >  drivers/usb/dwc3/core.c                              | 12 ++++++++++++
> >  drivers/usb/dwc3/core.h                              |  4 ++++
> >  3 files changed, 17 insertions(+)
> > ---
> > base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233
> > change-id: 20240703-dwc-5be3e378ddbe
> > 
> > Best regards,
> > ---
> > Frank Li <Frank.Li@nxp.com>
> > 
> 
> This may blow up the dwc3 core from various platforms and compatible
> strings. This can be handled in the glue driver and create the software
> property instead.
> 
> Radhey Shyam is working on this also. You can check his work here:
> 
> https://lore.kernel.org/linux-usb/1717657279-2631757-1-git-send-email-radhey.shyam.pandey@amd.com/

This is quite good.

Frank

> 
> Thanks,
> Thinh