]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: dwc2: gadget: Enable descriptor DMA mode
authorVahram Aharonyan <vahrama@synopsys.com>
Tue, 15 Nov 2016 03:16:34 +0000 (19:16 -0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 18 Nov 2016 11:54:46 +0000 (13:54 +0200)
Add DCFG register field macro for descriptor DMA mode and update core
initialization routine to set that bit accordingly.

Signed-off-by: Vahram Aharonyan <vahrama@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/gadget.c
drivers/usb/dwc2/hw.h

index e5d095924fb4e4acdaf61941837173b3cbcc325c..e12b1f0b0b729152222e07a10a5e97b3bbad6c81 100644 (file)
@@ -2888,15 +2888,21 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
 
        dwc2_writel(intmsk, hsotg->regs + GINTMSK);
 
-       if (using_dma(hsotg))
+       if (using_dma(hsotg)) {
                dwc2_writel(GAHBCFG_GLBL_INTR_EN | GAHBCFG_DMA_EN |
                            (GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT),
                            hsotg->regs + GAHBCFG);
-       else
+
+               /* Set DDMA mode support in the core if needed */
+               if (using_desc_dma(hsotg))
+                       __orr32(hsotg->regs + DCFG, DCFG_DESCDMA_EN);
+
+       } else {
                dwc2_writel(((hsotg->dedicated_fifos) ?
                                                (GAHBCFG_NP_TXF_EMP_LVL |
                                                 GAHBCFG_P_TXF_EMP_LVL) : 0) |
                            GAHBCFG_GLBL_INTR_EN, hsotg->regs + GAHBCFG);
+       }
 
        /*
         * If INTknTXFEmpMsk is enabled, it's important to disable ep interrupts
index 0e5bfb38b2dfa1cb34999798d8199fbf90a364e1..631396ba733ffbad082073e5041b3253a53d99a0 100644 (file)
 /* Device mode registers */
 
 #define DCFG                           HSOTG_REG(0x800)
+#define DCFG_DESCDMA_EN                        (1 << 23)
 #define DCFG_EPMISCNT_MASK             (0x1f << 18)
 #define DCFG_EPMISCNT_SHIFT            18
 #define DCFG_EPMISCNT_LIMIT            0x1f