Skip to content

Commit ddfb482

Browse files
wuliangfengrkhuangtao
authored andcommitted
usb: dwc2: gadget: config GAHBCFG from core parameter
The ahbcfg of dwc2_core_params can be used to overwrite the default value of the GAHBCFG register. But the current code don't use this parameter for dwc2 gadget, and always set the burst length of GAHBCFG to INCR4. This patch sets the the burst length of GAHBCFG to INCR4 only if ahbcfg is -1, otherwise, overwrite the GAHBCFG with the ahbcfg value. Change-Id: I78ed8f797a4b94b34f610789ee3bd61bcc8ed985 Signed-off-by: William Wu <william.wu@rock-chips.com>
1 parent 93b078a commit ddfb482

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/usb/dwc2/gadget.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,15 +2563,16 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
25632563

25642564
dwc2_writel(intmsk, hsotg->regs + GINTMSK);
25652565

2566-
if (using_dma(hsotg))
2567-
dwc2_writel(GAHBCFG_GLBL_INTR_EN | GAHBCFG_DMA_EN |
2568-
(GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT),
2566+
if (using_dma(hsotg)) {
2567+
val = hsotg->core_params->ahbcfg & ~GAHBCFG_CTRL_MASK;
2568+
dwc2_writel(GAHBCFG_GLBL_INTR_EN | GAHBCFG_DMA_EN | val,
25692569
hsotg->regs + GAHBCFG);
2570-
else
2570+
} else {
25712571
dwc2_writel(((hsotg->dedicated_fifos) ?
25722572
(GAHBCFG_NP_TXF_EMP_LVL |
25732573
GAHBCFG_P_TXF_EMP_LVL) : 0) |
25742574
GAHBCFG_GLBL_INTR_EN, hsotg->regs + GAHBCFG);
2575+
}
25752576

25762577
/*
25772578
* If INTknTXFEmpMsk is enabled, it's important to disable ep interrupts

0 commit comments

Comments
 (0)