[PATCH] usb: dwc2: Set AHB burst size to INCR

From: Razmik Karapetyan
Date: Wed Apr 19 2017 - 07:14:07 EST


Changed AHB burst size from INCR4 to INCR by default.
With this value driver show excellent DMA performance.

Signed-off-by: Razmik Karapetyan <razmik@xxxxxxxxxxxx>
---
drivers/usb/dwc2/gadget.c | 2 +-
drivers/usb/dwc2/params.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 98a4a79..ebf3a63 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3315,7 +3315,7 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,

if (using_dma(hsotg)) {
dwc2_writel(GAHBCFG_GLBL_INTR_EN | GAHBCFG_DMA_EN |
- (GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT),
+ hsotg->params.ahbcfg,
hsotg->regs + GAHBCFG);

/* Set DDMA mode support in the core if needed */
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index ba52ef9..6420a17 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -266,7 +266,7 @@ static void dwc2_set_default_params(struct dwc2_hsotg *hsotg)
p->hibernation = false;
p->max_packet_count = hw->max_packet_count;
p->max_transfer_size = hw->max_transfer_size;
- p->ahbcfg = GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT;
+ p->ahbcfg = GAHBCFG_HBSTLEN_INCR << GAHBCFG_HBSTLEN_SHIFT;

if ((hsotg->dr_mode == USB_DR_MODE_HOST) ||
(hsotg->dr_mode == USB_DR_MODE_OTG)) {
--
2.7.4