dwusb: clean debug message

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
diff --git a/Drivers/Usb/DwUsb3Dxe/DwUsb3Dxe.c b/Drivers/Usb/DwUsb3Dxe/DwUsb3Dxe.c
index e9111f9..44c37fb 100644
--- a/Drivers/Usb/DwUsb3Dxe/DwUsb3Dxe.c
+++ b/Drivers/Usb/DwUsb3Dxe/DwUsb3Dxe.c
@@ -284,6 +284,7 @@
   if (own) {
     desc->control |= DSCCTL_HWO;
   }
+  ArmDataSynchronizationBarrier ();
 }
 
 STATIC
@@ -613,7 +614,7 @@
   CLEAR_EVENTBUF ();
 #else
   Data = MmioRead32 (GEVNTCOUNT (0));
-  DEBUG ((DEBUG_ERROR, "#%a, %d, pending int count:%d, siz:0x%x\n", __func__, __LINE__, Data, MmioRead32 (GEVNTSIZ (0))));
+//  DEBUG ((DEBUG_ERROR, "#%a, %d, pending int count:%d, siz:0x%x\n", __func__, __LINE__, Data, MmioRead32 (GEVNTSIZ (0))));
   MmioOr32 (GEVNTCOUNT (0), Data);
 #endif
   /* enable device interrupts */
@@ -628,7 +629,7 @@
 
   /* set RUN/STOP bit */
   MmioOr32 (DCTL, DCTL_RUN_STOP);
-DEBUG ((DEBUG_ERROR, "#%a, %d, DCTL:0x%x\n", __func__, __LINE__, MmioRead32 (DCTL)));
+//DEBUG ((DEBUG_ERROR, "#%a, %d, DCTL:0x%x\n", __func__, __LINE__, MmioRead32 (DCTL)));
 }
 
 #define ALIGN(x, a)     (((x) + ((a) - 1)) & ~((a) - 1))
@@ -712,10 +713,6 @@
   pcd->in_ep.ep_desc = (usb3_dma_desc_t *)UncachedAllocateAlignedZeroPool (64, 64);
   pcd->out_ep.ep_desc = (usb3_dma_desc_t *)UncachedAllocateAlignedZeroPool (64, 64);
 #endif
-DEBUG ((DEBUG_ERROR, "#%a, %d, ep0 setup:0x%x, ep0 in:0x%x, ep0 out:0x%x, epx in:0x%x, epx out:0x%x\n",
-	__func__, __LINE__, pcd->ep0_setup_desc, pcd->ep0_in_desc, pcd->ep0_out_desc, pcd->in_ep.ep_desc, pcd->out_ep.ep_desc));
-DEBUG ((DEBUG_ERROR, "#%a, %d, gEndPoint0SetupPacket:0x%x, gEndPoint0StatusBuf:0x%x\n", __func__, __LINE__,
-	(UINT64)gEndPoint0SetupPacket, (UINT64)gEndPoint0StatusBuf));
 }
 
 STATIC
@@ -882,11 +879,9 @@
 {
   switch (Event & GEVNT_DEVT_MASK) {
   case GEVNT_DEVT_USBRESET:
-DEBUG ((DEBUG_ERROR, "#%a, %d RST\n", __func__, __LINE__));
     DwUsb3HandleUsbResetInterrupt (pcd);
     break;
   case GEVNT_DEVT_CONNDONE:
-DEBUG ((DEBUG_ERROR, "#%a, %d CONNDONE\n", __func__, __LINE__));
     DwUsb3HandleConnectDoneInterrupt (pcd);
     break;
   default:
@@ -1040,8 +1035,6 @@
   desc = req->trb;
   desc_dma = req->trbdma;
 
-DEBUG ((DEBUG_ERROR, "#%a, %d, dma:0x%x, dir:%a, state:%d, three_stage:%d\n",
-			__func__, __LINE__, desc_dma, ep0->is_in ? "IN" : "OUT", pcd->ep0state, ep0->three_stage));
   if (ep0->is_in) {
     // start DMA on EP0 IN
     // DMA Descriptor (TRB) setup
@@ -1058,7 +1051,6 @@
       desc_type = TRBCTL_CTLDATA_1ST;
       //desc_type = DSCCTL_TRBCTL (TRBCTL_CTLDATA_1ST);
     }
-DEBUG ((DEBUG_ERROR, "#%a, %d, IN TRB %x\n", __func__, __LINE__, desc_type));
     DwUsb3FillDesc (
       desc,
       (UINT64)req->bufdma,
@@ -1068,21 +1060,12 @@
       DSCCTL_IOC | DSCCTL_ISP | DSCCTL_LST,
       1
       );
-DEBUG ((DEBUG_ERROR, "#%a, %d, IN %x-%x-%x-%x\n", __func__, __LINE__, desc->bptl, desc->bpth, desc->status, desc->control));
     // issue DEPSTRTXFER command to EP0 IN
     ep0->tri_in = DwUsb3DepStartXfer (EP_IN_IDX (0), desc_dma, 0);
-    {
-       UINTN Index;
-       for (Index = 0; Index < 10; Index++) {
-DEBUG ((DEBUG_ERROR, "#%a, %d, OUT %x-%x-%x-%x\n", __func__, __LINE__, desc->bptl, desc->bpth, desc->status, desc->control));
-         MicroSecondDelay (20);
-       }
-    }
   } else {
     // start DMA on EP0 OUT
     // DMA Descriptor (TRB) setup
     len = ALIGN (req->length, ep0->maxpacket);
-//DEBUG ((DEBUG_ERROR, "#%a, %d, len:%d\n", __func__, __LINE__, len));
     //len = (req->length + ep0->maxpacket - 1) & ~(ep0->maxpacket - 1);
     if (pcd->ep0state == EP0_OUT_STATUS_PHASE) {
       if (ep0->three_stage) {
@@ -1096,7 +1079,6 @@
       desc_type = TRBCTL_CTLDATA_1ST;
       //desc_type = DSCCTL_TRBCTL (TRBCTL_CTLDATA_1ST);
     }
-DEBUG ((DEBUG_ERROR, "#%a, %d, OUT TRB %x\n", __func__, __LINE__, desc_type));
     DwUsb3FillDesc (
       desc,
       (UINT64)req->bufdma,
@@ -1106,16 +1088,8 @@
       DSCCTL_IOC | DSCCTL_ISP | DSCCTL_LST,
       1
       );
-DEBUG ((DEBUG_ERROR, "#%a, %d, OUT %x-%x-%x-%x\n", __func__, __LINE__, desc->bptl, desc->bpth, desc->status, desc->control));
     // issue DEPSTRTXFER command to EP0 OUT
     ep0->tri_out = DwUsb3DepStartXfer (EP_OUT_IDX (0), desc_dma, 0);
-    {
-       UINTN Index;
-       for (Index = 0; Index < 10; Index++) {
-DEBUG ((DEBUG_ERROR, "#%a, %d, OUT %x-%x-%x-%x\n", __func__, __LINE__, desc->bptl, desc->bpth, desc->status, desc->control));
-         MicroSecondDelay (20);
-       }
-    }
   }
 }
 
@@ -1227,7 +1201,6 @@
   pcd->ep0_req.bufdma = buf;
   pcd->ep0_req.length = 0;
   pcd->ep0_req.actual = 0;
-DEBUG ((DEBUG_ERROR, "#%a, %d, bufdma:0x%x, length:0x%x\n", __func__, __LINE__, pcd->ep0_req.bufdma, pcd->ep0_req.length));
   DwUsb3EndPoint0StartTransfer (pcd, &pcd->ep0_req);
 }
 
@@ -1243,13 +1216,11 @@
   if (pcd->ep0state == EP0_STALL)
     return;
 
-//DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
   ep0->is_in = 0;
   pcd->ep0state = EP0_OUT_STATUS_PHASE;
   pcd->ep0_req.bufdma = buf;
   pcd->ep0_req.length = 0;
   pcd->ep0_req.actual = 0;
-DEBUG ((DEBUG_ERROR, "#%a, %d, bufdma:0x%x, length:0x%x\n", __func__, __LINE__, pcd->ep0_req.bufdma, pcd->ep0_req.length));
   DwUsb3EndPoint0StartTransfer (pcd, &pcd->ep0_req);
 }
 
@@ -1265,7 +1236,6 @@
   usb3_dma_desc_t     *desc;
   UINT32              byte_count, len;
 
-DEBUG ((DEBUG_ERROR, "#%a, %d, state:%d\n", __func__, __LINE__, pcd->ep0state));
   switch (pcd->ep0state) {
   case EP0_IN_DATA_PHASE:
     if (req == NULL) {
@@ -1662,17 +1632,13 @@
 {
   usb_device_request_t *ctrl = &gEndPoint0SetupPacket->req;
 
-DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
   if (ctrl->bmRequestType == UT_DEVICE) {
-DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
     SET_DEVADDR (ctrl->wValue);
     pcd->ep0.is_in = 1;
     pcd->ep0state = EP0_IN_WAIT_NRDY;
     if (ctrl->wValue) {
-DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
       pcd->state = USB3_STATE_ADDRESSED;
     } else {
-DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
       pcd->state = USB3_STATE_DEFAULT;
     }
   }
@@ -1770,7 +1736,6 @@
   UINT16  wvalue = ctrl->wValue;
   usb3_pcd_ep_t  *ep;
 
-DEBUG ((DEBUG_ERROR, "#%a, %d, wvalue:0x%x\n", __func__, __LINE__, wvalue));
   if (ctrl->bmRequestType != (UT_WRITE | UT_STANDARD | UT_DEVICE)) {
     EndPoint0DoStall (pcd);
     return;
@@ -1798,7 +1763,6 @@
     } else {
       pcd->state = USB3_STATE_ADDRESSED;
     }
-DEBUG ((DEBUG_ERROR, "#%a, %d, state:%d\n", __func__, __LINE__, pcd->state));
     pcd->ep0.is_in = 1;
     pcd->ep0state = EP0_IN_WAIT_NRDY;
   } else {
@@ -1824,7 +1788,6 @@
     return;
   }
 
-DEBUG ((DEBUG_ERROR, "#%a, %d, dt:0x%x\n", __func__, __LINE__, dt));
   switch (dt) {
   case UDESC_DEVICE:
     {
@@ -2016,7 +1979,6 @@
     return;
   }
 
-DEBUG ((DEBUG_ERROR, "#%a, %d, bRequest:0x%x, three stage:%d\n", __func__, __LINE__, ctrl->bRequest, ep0->three_stage));
   switch (ctrl->bRequest) {
   case UR_GET_STATUS:
     DwUsb3DoGetStatus (pcd);
@@ -2149,7 +2111,6 @@
   is_in = (UINT32)PhySep & 1;
   epnum = ((UINT32)PhySep >> 1) & 0xF;
 
-//DEBUG ((DEBUG_ERROR, "#%a, %d, dir:%a, epnum:%d\n", __func__, __LINE__, is_in ? "IN" : "OUT", epnum));
   // Get the EP pointer
   if (is_in) {
     ep = DwUsb3GetInEndPoint (pcd, epnum);
@@ -2159,7 +2120,6 @@
 
   switch (event & GEVNT_DEPEVT_INTTYPE_MASK) {
   case GEVNT_DEPEVT_INTTYPE_XFER_CMPL:
-DEBUG ((DEBUG_ERROR, "#%a, %d, XFER CMPL, DIR:%a\n", __func__, __LINE__, ep->is_in ? "IN" : "OUT"));
     ep->xfer_started = 0;
     // complete the transfer
     if (epnum == 0) {
@@ -2169,25 +2129,21 @@
     }
     break;
   case GEVNT_DEPEVT_INTTYPE_XFER_IN_PROG:
-DEBUG ((DEBUG_ERROR, "#%a, %d, XFER IN PROG, DIR:%a\n", __func__, __LINE__, ep->is_in ? "IN" : "OUT"));
     break;
   case GEVNT_DEPEVT_INTTYPE_XFER_NRDY:
     if (epnum == 0) {
-DEBUG ((DEBUG_ERROR, "#%a, %d, EP0 %a XFER NRDY\n", __func__, __LINE__, ep->is_in ? "IN" : "OUT"));
       switch (pcd->ep0state) {
 #if 1
       case EP0_IN_WAIT_NRDY:
         if (is_in) {
           DwUsb3OsHandleEndPoint0 (pcd, event);
         } else {
-DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
         }
         break;
       case EP0_OUT_WAIT_NRDY:
         if (!is_in) {
           DwUsb3OsHandleEndPoint0 (pcd, event);
         } else {
-DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
         }
         break;
 #else
@@ -2200,7 +2156,6 @@
         break;
       }
     } else {
-DEBUG ((DEBUG_ERROR, "#%a, %d, EPx XFER NRDY\n", __func__, __LINE__));
     }
     break;
   default:
@@ -2238,12 +2193,9 @@
       Intr = Event & GEVNT_INTTYPE_MASK;
       if (Intr == GEVNT_INTTYPE (EVENT_DEV_INT)) {
         DwUsb3HandleDeviceInterrupt (pcd, Event);
-      } else {
-DEBUG ((DEBUG_ERROR, "#%a, %d\n", __func__, __LINE__));
       }
     } else {
       PhySep = (Event & GEVNT_DEPEVT_EPNUM_MASK) >> GEVNT_DEPEVT_EPNUM_SHIFT;
-//DEBUG ((DEBUG_ERROR, "#%a, %d epnum:%d, event:0x%x\n", __func__, __LINE__, PhySep, Event));
       DwUsb3HandleEndPointInterrupt (pcd, PhySep, Event);
     }
   }