Skip to content

Commit

Permalink
Make microframe schedule patch a little closer to denx version. Remov…
Browse files Browse the repository at this point in the history
…e vestiges of HW2937_WORKAROUND
  • Loading branch information
popcornmix committed Aug 19, 2012
1 parent 5cc98c1 commit 0872b20
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 33 deletions.
1 change: 0 additions & 1 deletion drivers/usb/host/dwc_otg/dwc_otg_cil.c
Original file line number Diff line number Diff line change
Expand Up @@ -2403,7 +2403,6 @@ void dwc_otg_hc_halt(dwc_otg_core_if_t * core_if,
dwc_otg_core_global_regs_t *global_regs;
dwc_otg_host_global_regs_t *host_global_regs;

DWC_DEBUGPL(DBG_HW2937, " dwc_otg_hc_halt(%d)\n", hc->hc_num);
hc_regs = core_if->host_if->hc_regs[hc->hc_num];
global_regs = core_if->core_global_regs;
host_global_regs = core_if->host_if->host_global_regs;
Expand Down
2 changes: 0 additions & 2 deletions drivers/usb/host/dwc_otg/dwc_otg_cil.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#if !defined(__DWC_CIL_H__)
#define __DWC_CIL_H__

#define DBG_HW2937 0x400

#include "dwc_list.h"
#include "dwc_otg_dbg.h"
#include "dwc_otg_regs.h"
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/host/dwc_otg/dwc_otg_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,8 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd)
ret_val = DWC_OTG_TRANSACTION_ALL;
}

hcd->non_periodic_channels++;
if (!microframe_schedule)
hcd->non_periodic_channels++;
}

#ifdef DEBUG_HOST_CHANNELS
Expand Down
18 changes: 0 additions & 18 deletions drivers/usb/host/dwc_otg/dwc_otg_hcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,6 @@ typedef struct dwc_otg_qh {

DWC_CIRCLEQ_HEAD(hc_list, dwc_hc);

#ifdef HW2937_WORKAROUND

typedef enum {
HW2937_XFER_MODE_IDLE,
HW2937_XFER_MODE_IN,
HW2937_XFER_MODE_OUT,
HW2937_XFER_MODE_PAUSEIN /* Transitioning from IN to IDLE */
} hw2937_xfer_mode_t;
#endif

/**
* This structure holds the state of the HCD, including the non-periodic and
* periodic schedules.
Expand Down Expand Up @@ -572,14 +562,6 @@ struct dwc_otg_hcd {
/** Frame List DMA address */
dma_addr_t frame_list_dma;

#ifdef HW2937_WORKAROUND
/** Current transfer mode (IN, OUT, or IDLE) */
hw2937_xfer_mode_t hw2937_xfer_mode;

/** Mask of channels assigned to the current mode */
uint32_t hw2937_assigned_channels;
#endif

#ifdef DEBUG
uint32_t frrem_samples;
uint64_t frrem_accum;
Expand Down
22 changes: 11 additions & 11 deletions drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,16 +613,16 @@ static int schedule_periodic(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh)
}

status = check_periodic_bandwidth(hcd, qh);

if (status) {
DWC_INFO("%s: Insufficient periodic bandwidth for " "periodic transfer.\n", __func__); //NOTICE
return status;
}

status = check_max_xfer_size(hcd, qh);
}
if (status) {
DWC_INFO("%s: Channel max transfer size too small " "for periodic transfer.\n", __func__); //NOTICE
DWC_INFO("%s: Insufficient periodic bandwidth for "
"periodic transfer.\n", __func__);
return status;
}
status = check_max_xfer_size(hcd, qh);
if (status) {
DWC_INFO("%s: Channel max transfer size too small "
"for periodic transfer.\n", __func__);
return status;
}

Expand Down Expand Up @@ -692,12 +692,12 @@ static void deschedule_periodic(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh)
int i;
DWC_LIST_REMOVE_INIT(&qh->qh_list_entry);

/* Update claimed usecs per (micro)frame. */
hcd->periodic_usecs -= qh->usecs;

if (!microframe_schedule) {
/* Release the periodic channel reservation. */
hcd->periodic_channels--;

/* Update claimed usecs per (micro)frame. */
hcd->periodic_usecs -= qh->usecs;
} else {
for (i = 0; i < 8; i++) {
hcd->frame_usecs[i] += qh->frame_usecs[i];
Expand Down

0 comments on commit 0872b20

Please sign in to comment.