/* roothub.portstatus [i] bits */ #define RH_PS_CCS 0x00000001 /* current connect status */ #define RH_PS_PES 0x00000002 /* port enable status*/ #define RH_PS_PSS 0x00000004 /* port suspend status */ #define RH_PS_POCI 0x00000008 /* port over current indicator */ #define RH_PS_PRS 0x00000010 /* port reset status */ #define RH_PS_PPS 0x00000100 /* port power status */ #define RH_PS_LSDA 0x00000200 /* low speed device attached */ #define RH_PS_CSC 0x00010000 /* connect status change */ #define RH_PS_PESC 0x00020000 /* port enable status change */ #define RH_PS_PSSC 0x00040000 /* port suspend status change */ #define RH_PS_OCIC 0x00080000 /* over current indicator change */ #define RH_PS_PRSC 0x00100000 /* port reset status change */
/* roothub.status bits */ #define RH_HS_LPS 0x00000001 /* local power status */ #define RH_HS_OCI 0x00000002 /* over current indicator */ #define RH_HS_DRWE 0x00008000 /* device remote wakeup enable */ #define RH_HS_LPSC 0x00010000 /* local power status change */ #define RH_HS_OCIC 0x00020000 /* over current indicator change */ #define RH_HS_CRWE 0x80000000 /* clear remote wakeup enable */
/* roothub.b masks */ #define RH_B_DR 0x0000ffff /* device removable flags */ #define RH_B_PPCM 0xffff0000 /* port power control mask */
/* roothub.a masks */ #define RH_A_NDP (0xff << 0) /* number of downstream ports */ #define RH_A_PSM (1 << 8) /* power switching mode */ #define RH_A_NPS (1 << 9) /* no power switching */ #define RH_A_DT (1 << 10) /* device type (mbz) */ #define RH_A_OCPM (1 << 11) /* over current protection mode */ #define RH_A_NOCP (1 << 12) /* no over current protection */ #define RH_A_POTPGT (0xff << 24) /* power on to power good time */
#define FI 0x2edf /* 12000 bits per frame (-1) */ #define FSMP(fi) (0x7fff & ((6 * ((fi) - 210)) / 7)) #define LSTHRESH 0x628 /* lowspeed bit threshold */
u8 maxpacket;
u8 epnum;
u8 nextpid;
u16 error_count;
u16 length; /* of current packet */
s16 ptd_offset; /* buffer offset in ISP1362 where PTD has been stored
(for access thru HCDIRDATA) */ int ptd_index; int num_ptds; void *data; /* to databuf */ /* queue of active EPs (the ones transmitted to the chip) */ struct list_head active;
/* async schedule */ struct list_head schedule; /* list of all EPs that need processing */ struct list_head remove_list; int num_req;
};
struct isp1362_ep_queue { struct list_head active; /* list of PTDs currently processed by HC */
atomic_t finishing; unsignedlong buf_map; unsignedlong skip_map; int free_ptd;
u16 buf_start;
u16 buf_size;
u16 blk_size; /* PTD buffer block size for ATL and INTL */
u8 buf_count;
u8 buf_avail; char name[16];
/* for statistical tracking */
u8 stat_maxptds; /* Max # of ptds seen simultaneously in fifo */
u8 ptd_count; /* number of ptds submitted to this queue */
};
/* Schedules for the current frame */ struct isp1362_ep_queue atl_queue; struct isp1362_ep_queue intl_queue; struct isp1362_ep_queue istl_queue[2];
/* list of PTDs retrieved from HC */ struct list_head remove_list; enum {
ISP1362_INT_SOF,
ISP1362_INT_ISTL0,
ISP1362_INT_ISTL1,
ISP1362_INT_EOT,
ISP1362_INT_OPR,
ISP1362_INT_SUSP,
ISP1362_INT_CLKRDY,
ISP1362_INT_INTL,
ISP1362_INT_ATL,
ISP1362_INT_OTG,
NUM_ISP1362_IRQS
} IRQ_NAMES; unsignedint irq_stat[NUM_ISP1362_IRQS]; int req_serial;
};
staticinlineconstchar *ISP1362_INT_NAME(int n)
{ switch (n) { case ISP1362_INT_SOF: return"SOF"; case ISP1362_INT_ISTL0: return"ISTL0"; case ISP1362_INT_ISTL1: return"ISTL1"; case ISP1362_INT_EOT: return"EOT"; case ISP1362_INT_OPR: return"OPR"; case ISP1362_INT_SUSP: return"SUSP"; case ISP1362_INT_CLKRDY: return"CLKRDY"; case ISP1362_INT_INTL: return"INTL"; case ISP1362_INT_ATL: return"ATL"; case ISP1362_INT_OTG: return"OTG"; default: return"unknown";
}
}
/* basic access functions for ISP1362 chip registers */ /* NOTE: The contents of the address pointer register cannot be read back! The driver must ensure, * that all register accesses are performed with interrupts disabled, since the interrupt * handler has no way of restoring the previous state.
*/ staticvoid isp1362_write_addr(struct isp1362_hcd *isp1362_hcd, isp1362_reg_t reg)
{
REG_ACCESS_TEST(reg);
DUMMY_DELAY_ACCESS;
writew(ISP1362_REG_NO(reg), isp1362_hcd->addr_reg);
DUMMY_DELAY_ACCESS;
isp1362_delay(isp1362_hcd, 1);
}
#if USE_32BIT
DUMMY_DELAY_ACCESS;
val = readl(isp1362_hcd->data_reg); #else
DUMMY_DELAY_ACCESS;
val = (u32)readw(isp1362_hcd->data_reg);
DUMMY_DELAY_ACCESS;
val |= (u32)readw(isp1362_hcd->data_reg) << 16; #endif return val;
}
/* use readsw/writesw to access the fifo whenever possible */ /* assume HCDIRDATA or XFERCTR & addr_reg have been set up */ staticvoid isp1362_read_fifo(struct isp1362_hcd *isp1362_hcd, void *buf, u16 len)
{
u8 *dp = buf;
u16 data;
if (!len) return;
RDBG("%s: Reading %d byte from fifo to mem @ %p\n", __func__, len, buf); #if USE_32BIT if (len >= 4) {
RDBG("%s: Using readsl for %d dwords\n", __func__, len >> 2);
readsl(isp1362_hcd->data_reg, dp, len >> 2);
dp += len & ~3;
len &= 3;
} #endif if (len >= 2) {
RDBG("%s: Using readsw for %d words\n", __func__, len >> 1);
insw((unsignedlong)isp1362_hcd->data_reg, dp, len >> 1);
dp += len & ~1;
len &= 1;
}
BUG_ON(len & ~1); if (len > 0) {
data = isp1362_read_data16(isp1362_hcd);
RDBG("%s: Reading trailing byte %02x to mem @ %08x\n", __func__,
(u8)data, (u32)dp);
*dp = (u8)data;
}
}
if ((unsignedlong)dp & 0x1) { /* not aligned */ for (; len > 1; len -= 2) {
data = *dp++;
data |= *dp++ << 8;
isp1362_write_data16(isp1362_hcd, data);
} if (len)
isp1362_write_data16(isp1362_hcd, *dp); return;
}
RDBG("%s: Writing %d byte to fifo from memory @%p\n", __func__, len, buf); #if USE_32BIT if (len >= 4) {
RDBG("%s: Using writesl for %d dwords\n", __func__, len >> 2);
writesl(isp1362_hcd->data_reg, dp, len >> 2);
dp += len & ~3;
len &= 3;
} #endif if (len >= 2) {
RDBG("%s: Using writesw for %d words\n", __func__, len >> 1);
outsw((unsignedlong)isp1362_hcd->data_reg, dp, len >> 1);
dp += len & ~1;
len &= 1;
}
BUG_ON(len & ~1); if (len > 0) { /* finally write any trailing byte; we don't need to care * about the high byte of the last word written
*/
data = (u16)*dp;
RDBG("%s: Sending trailing byte %02x from mem @ %08x\n", __func__,
data, (u32)dp);
isp1362_write_data16(isp1362_hcd, data);
}
}
dbg_level = 1;
list_for_each_entry(ep, &epq->active, active) {
dump_ptd(&ep->ptd);
dump_data(ep->data, ep->length);
}
dbg_level = dbg;
} #else #define dump_ptd(ptd) do {} while (0) #define dump_ptd_in_data(ptd, buf) do {} while (0) #define dump_ptd_out_data(ptd, buf) do {} while (0) #define dump_ptd_data(ptd, buf) do {} while (0) #define dump_ptd_queue(epq) do {} while (0) #endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.