usb: musb: da8xx: Add DMA support
Subsystems (3)
v7 cover usb: musb: da8xx: Add DMA support
This series update MUSB driver to add DMA support to DA8xx. It should be applied on top of:
"[PATCH v4 0/3] dmaengine: cppi41: Add dma support to da8xx" and "[PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine"
Changes in v7:
- Remove the patch that was adding runtime PM.
It was breaking system suspend.
- Use of_dev_auxdata to map the DT node name to the name expected by the clock.
Changes in v6:
- Rebased on linux-next. Some patches were conflicting with a series adding suspend and resume support.
Changes in v5:
- Fix a typo in commit message of patch 4
Changes in v4:
- Update and clarify the commit message of patch 5
- Fix the typo in patch 3
Changes in v3:
- Remove PM runtime callbacks.
I have update arch/arm/mach-davinci/pm_domain.c to let PM runtime control the usb20 clock.
- Only use PM runtime sync operation.
Changes in v2:
- Clock and IRQ management has been moved to MUSB DA8xx glue (was in CPPI 4.1 driver)
- I have added a partial support PM runtime. The goal was to use PM runtime to manage clock of MUSB and CPPI 4.1 (they use the same clock).
- CPPI 4.1 is now achild of MUSB DA8xx glue.
Alexandre Bailon (3):
usb: musb: Use shared irq
usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx
usb: musb: musb_cppi41: Workaround DMA stall issue during teardown
drivers/usb/musb/Kconfig | 4 ++-- drivers/usb/musb/da8xx.c | 43 +++++++++++++++++++++++++++++++++++++++++- drivers/usb/musb/musb_core.c | 2 +- drivers/usb/musb/musb_core.h | 1 + drivers/usb/musb/musb_cppi41.c | 4 ++++ 5 files changed, 50 insertions(+), 4 deletions(-)
Signature · 6 lines
2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170329162432.27299-1-abailon-rdvid1DuHRBWk0Htik3J/[email protected]
PATCH v7 1/3 usb: musb: Use shared irq
In the DA8xx, USB and CPPI 4.1 are sharing the same interrupt line. Update the driver to request a shared irq.
--- drivers/usb/musb/musb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/musb/musb_core.c +1 -1
@@ -2332,7 +2332,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)setup_timer (&musb->otg_timer, musb_otg_timer_func, (unsigned long ) musb);/* attach to the IRQ */ -if (request_irq (nIrq, musb->isr,0 ,dev_name (dev), musb)) { +if (request_irq (nIrq, musb->isr,IRQF_SHARED ,dev_name (dev), musb)) {dev_err (dev,"request_irq %d failed!\n" , nIrq); status = -ENODEV ; goto fail3;
Signature · 6 lines
2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v7 2/3 usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx
In reply to a message not in the archiveCurrently, only the PIO mode is supported. This add support of CPPI 4.1 to DA8xx.
As the In DA8xx the CPPI 4.1 DMA is a part of the USB. Create the CPPI 4.1 device as a child of USB.
--- drivers/usb/musb/Kconfig | 4 ++-- drivers/usb/musb/da8xx.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-)
drivers/usb/musb/Kconfig +2 -2
@@ -160,8 +160,8 @@ config USB_TI_CPPI_DMA Enable DMA transfers when TI CPPI DMA is available. config USB_TI_CPPI41_DMA - bool 'TI CPPI 4.1 (AM335x)' - depends on ARCH_OMAP && DMADEVICES + bool 'TI CPPI 4.1' + depends on (ARCH_OMAP || ARCH_DAVINCI_DA8XX) && DMADEVICES select TI_CPPI41 config USB_TUSB_OMAP_DMA
drivers/usb/musb/da8xx.c +42 -1
72 lines not on this page · raw message
Signature · 6 lines
2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20170329162432.27299-3-abailon-rdvid1DuHRBWk0Htik3J/[email protected]
Re: [PATCH v7 2/3] usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx
Quoted 4 lines · Alexandre Bailon
Currently, only the PIO mode is supported. This add support of CPPI 4.1 to DA8xx.
As the In DA8xx the CPPI 4.1 DMA is a part of the USB. Create the CPPI 4.1 device as a child of USB.
As in DA8xx the CPPI 4.1 DMA is a part of the USBSS, create the CPPI 4.1 device as a child of USB.
Regards,
-Bin.
Quoted 1 line
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v7 2/3] usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx
In reply to a message not in the archiveQuoted 16 lines · Alexandre Bailon
Currently, only the PIO mode is supported. This add support of CPPI 4.1 to DA8xx.
As the In DA8xx the CPPI 4.1 DMA is a part of the USB. Create the CPPI 4.1 device as a child of USB.--- drivers/usb/musb/Kconfig | 4 ++-- drivers/usb/musb/da8xx.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-)drivers/usb/musb/Kconfig +0
-0
drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 165
Quoted 8 lines
drivers/usb/musb/Kconfig +2
-2@@ -160,8 +160,8 @@ config USB_TI_CPPI_DMA Enable DMA transfers when TI CPPI DMA is available. config USB_TI_CPPI41_DMA - bool 'TI CPPI 4.1 (AM335x)' - depends on ARCH_OMAP && DMADEVICES + bool 'TI CPPI 4.1' + depends on (ARCH_OMAP || ARCH_DAVINCI_DA8XX) && DMADEVICES select TI_CPPI41
TI_CPPI41 also should depend on ARCH_DAVINCI_DA8XX due to this patch. You might need the following change for dma Kconfig as well.
drivers/dma/Kconfig +2 -2
@@ -514,8 +514,8 @@ config TIMB_DMA Enable support for the Timberdale FPGA DMA engine. config TI_CPPI41 - tristate "AM33xx CPPI41 DMA support" - depends on ARCH_OMAP + tristate "CPPI41 DMA support" + depends on ARCH_OMAP || ARCH_DAVINCI_DA8XX select DMA_ENGINE help The Communications Port Programming Interface (CPPI) 4.1 DMA engine
Regards,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v7 2/3] usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx
Quoted 19 lines · Bin Liu
Quoted 18 lines · Alexandre Bailon
Currently, only the PIO mode is supported. This add support of CPPI 4.1 to DA8xx.
As the In DA8xx the CPPI 4.1 DMA is a part of the USB. Create the CPPI 4.1 device as a child of USB.--- drivers/usb/musb/Kconfig | 4 ++-- drivers/usb/musb/da8xx.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-)drivers/usb/musb/Kconfig +0
-0@@ -160,8 +160,8 @@ config USB_TI_CPPI_DMA Enable DMA transfers when TI CPPI DMA is available.
Quoted 8 lines
drivers/usb/musb/Kconfig config USB_TI_CPPI_DMA · line 165
Quoted 6 lines
drivers/usb/musb/Kconfig +2
-2config USB_TI_CPPI41_DMA - bool 'TI CPPI 4.1 (AM335x)' - depends on ARCH_OMAP && DMADEVICES + bool 'TI CPPI 4.1' + depends on (ARCH_OMAP || ARCH_DAVINCI_DA8XX) && DMADEVICES select TI_CPPI41
TI_CPPI41also should depend onARCH_DAVINCI_DA8XXdue to this patch. You might need the following change for dmaKconfigas well.
This change has been done in the series "dmaengine: cppi41: Add dma support to da8xx".
Quoted 17 lines
drivers/dma/Kconfig +2
-2@@ -514,8 +514,8 @@ config TIMB_DMA Enable support for the Timberdale FPGA DMA engine. config TI_CPPI41 - tristate "AM33xx CPPI41 DMA support" - depends on ARCH_OMAP + tristate "CPPI41 DMA support" + depends on ARCH_OMAP || ARCH_DAVINCI_DA8XX select DMA_ENGINE help The Communications Port Programming Interface (CPPI) 4.1 DMA engine
Quoted 2 lines
Regards,
-Bin.
Regards,
Alexandre
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v7 3/3 usb: musb: musb_cppi41: Workaround DMA stall issue during teardown
In reply to a message not in the archiveThe DMA may hang up if a teardown is initiated while an endpoint is still active (Advisory 2.3.27 of DA8xx errata).
To workaround this issue, add a delay before to initiate the teardown.
--- drivers/usb/musb/da8xx.c | 2 +- drivers/usb/musb/musb_core.h | 1 + drivers/usb/musb/musb_cppi41.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/usb/musb/da8xx.c +1 -1
@@ -483,7 +483,7 @@ da8xx_dma_controller_create(struct musb *musb, void __iomem *base)static const struct musb_platform_ops da8xx_ops = { .quirks =MUSB_INDEXED_EP |MUSB_PRESERVE_SESSION | -MUSB_DMA_CPPI41 , +MUSB_DMA_CPPI41 |MUSB_DA8XX , .init = da8xx_musb_init, .exit = da8xx_musb_exit,
drivers/usb/musb/musb_core.h +1 -0
@@ -172,6 +172,7 @@ struct musb_io;*/ struct musb_platform_ops { +#define MUSB_DA8XX BIT(8)#define MUSB_PRESERVE_SESSION BIT(7)#define MUSB_DMA_UX500 BIT(6)#define MUSB_DMA_CPPI41 BIT(5)
drivers/usb/musb/musb_cppi41.c +4 -0
@@ -571,6 +571,10 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) } } +/* DA8xx Advisory 2.3.27: wait 250 ms before to start the teardown */ +if (musb->io.quirks &MUSB_DA8XX ) +mdelay (250 ); + tdbit =1 << cppi41_channel->port_num;if (is_tx) tdbit <<=16 ;
Signature · 6 lines
2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Alexandre Bailon
This series update MUSB driver to add DMA support to DA8xx. It should be applied on top of:
"[PATCH v4 0/3] dmaengine: cppi41: Add dma support to da8xx" and "[PATCH] ARM: davinci: Add the clock for the CPPI 4.1 DMA engine"
Applied and sent for v4.12-rc1 merge window.
Regards,
-Bin.
Quoted 35 lines
Changes in v7:
- Remove the patch that was adding runtime PM.
It was breaking system suspend.
- Useof_dev_auxdatato map the DT node name to the name expected by the clock.Changes in v6:
- Rebased on linux-next. Some patches were conflicting with a series adding suspend and resume support.Changes in v5:
- Fix a typo in commit message of patch 4Changes in v4:
- Update and clarify the commit message of patch 5
- Fix the typo in patch 3Changes in v3:
- Remove PM runtime callbacks.
I have updatearch/arm/mach-davinci/pm_domain.cto let PM runtime control the usb20 clock.
- Only use PM runtime sync operation.Changes in v2:
- Clock and IRQ management has been moved to MUSB DA8xx glue (was in CPPI 4.1 driver)
- I have added a partial support PM runtime. The goal was to use PM runtime to manage clock of MUSB and CPPI 4.1 (they use the same clock).
- CPPI 4.1 is now achild of MUSB DA8xx glue.Alexandre Bailon (3):
usb: musb: Use shared irq
usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx
usb: musb:musb_cppi41: Workaround DMA stall issue during teardown
Quoted 10 lines
drivers/usb/musb/Kconfig | 4 ++-- drivers/usb/musb/da8xx.c | 43 +++++++++++++++++++++++++++++++++++++++++- drivers/usb/musb/musb_core.c | 2 +- drivers/usb/musb/musb_core.h | 1 + drivers/usb/musb/musb_cppi41.c | 4 ++++ 5 files changed, 50 insertions(+), 4 deletions(-)Signature · 1 line
2.10.2
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html