Skip to content

Commit 0872b20

Browse files
committed
Make microframe schedule patch a little closer to denx version. Remove vestiges of HW2937_WORKAROUND
1 parent 5cc98c1 commit 0872b20

File tree

5 files changed

+13
-33
lines changed

5 files changed

+13
-33
lines changed

drivers/usb/host/dwc_otg/dwc_otg_cil.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2403,7 +2403,6 @@ void dwc_otg_hc_halt(dwc_otg_core_if_t * core_if,
24032403
dwc_otg_core_global_regs_t *global_regs;
24042404
dwc_otg_host_global_regs_t *host_global_regs;
24052405

2406-
DWC_DEBUGPL(DBG_HW2937, " dwc_otg_hc_halt(%d)\n", hc->hc_num);
24072406
hc_regs = core_if->host_if->hc_regs[hc->hc_num];
24082407
global_regs = core_if->core_global_regs;
24092408
host_global_regs = core_if->host_if->host_global_regs;

drivers/usb/host/dwc_otg/dwc_otg_cil.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#if !defined(__DWC_CIL_H__)
3535
#define __DWC_CIL_H__
3636

37-
#define DBG_HW2937 0x400
38-
3937
#include "dwc_list.h"
4038
#include "dwc_otg_dbg.h"
4139
#include "dwc_otg_regs.h"

drivers/usb/host/dwc_otg/dwc_otg_hcd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,8 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd)
13361336
ret_val = DWC_OTG_TRANSACTION_ALL;
13371337
}
13381338

1339-
hcd->non_periodic_channels++;
1339+
if (!microframe_schedule)
1340+
hcd->non_periodic_channels++;
13401341
}
13411342

13421343
#ifdef DEBUG_HOST_CHANNELS

drivers/usb/host/dwc_otg/dwc_otg_hcd.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,6 @@ typedef struct dwc_otg_qh {
369369

370370
DWC_CIRCLEQ_HEAD(hc_list, dwc_hc);
371371

372-
#ifdef HW2937_WORKAROUND
373-
374-
typedef enum {
375-
HW2937_XFER_MODE_IDLE,
376-
HW2937_XFER_MODE_IN,
377-
HW2937_XFER_MODE_OUT,
378-
HW2937_XFER_MODE_PAUSEIN /* Transitioning from IN to IDLE */
379-
} hw2937_xfer_mode_t;
380-
#endif
381-
382372
/**
383373
* This structure holds the state of the HCD, including the non-periodic and
384374
* periodic schedules.
@@ -572,14 +562,6 @@ struct dwc_otg_hcd {
572562
/** Frame List DMA address */
573563
dma_addr_t frame_list_dma;
574564

575-
#ifdef HW2937_WORKAROUND
576-
/** Current transfer mode (IN, OUT, or IDLE) */
577-
hw2937_xfer_mode_t hw2937_xfer_mode;
578-
579-
/** Mask of channels assigned to the current mode */
580-
uint32_t hw2937_assigned_channels;
581-
#endif
582-
583565
#ifdef DEBUG
584566
uint32_t frrem_samples;
585567
uint64_t frrem_accum;

drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -613,16 +613,16 @@ static int schedule_periodic(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh)
613613
}
614614

615615
status = check_periodic_bandwidth(hcd, qh);
616-
617-
if (status) {
618-
DWC_INFO("%s: Insufficient periodic bandwidth for " "periodic transfer.\n", __func__); //NOTICE
619-
return status;
620-
}
621-
622-
status = check_max_xfer_size(hcd, qh);
623616
}
624617
if (status) {
625-
DWC_INFO("%s: Channel max transfer size too small " "for periodic transfer.\n", __func__); //NOTICE
618+
DWC_INFO("%s: Insufficient periodic bandwidth for "
619+
"periodic transfer.\n", __func__);
620+
return status;
621+
}
622+
status = check_max_xfer_size(hcd, qh);
623+
if (status) {
624+
DWC_INFO("%s: Channel max transfer size too small "
625+
"for periodic transfer.\n", __func__);
626626
return status;
627627
}
628628

@@ -692,12 +692,12 @@ static void deschedule_periodic(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh)
692692
int i;
693693
DWC_LIST_REMOVE_INIT(&qh->qh_list_entry);
694694

695+
/* Update claimed usecs per (micro)frame. */
696+
hcd->periodic_usecs -= qh->usecs;
697+
695698
if (!microframe_schedule) {
696699
/* Release the periodic channel reservation. */
697700
hcd->periodic_channels--;
698-
699-
/* Update claimed usecs per (micro)frame. */
700-
hcd->periodic_usecs -= qh->usecs;
701701
} else {
702702
for (i = 0; i < 8; i++) {
703703
hcd->frame_usecs[i] += qh->frame_usecs[i];

0 commit comments

Comments
 (0)