11 #if defined(CONFIG_BLACKFIN)
15 #define MAX_ROOT_PORTS 2
16 #define USE_PLATFORM_DELAY 0
19 #define DUMMY_DELAY_ACCESS \
21 bfin_read16(ASYNC_BANK0_BASE); \
22 bfin_read16(ASYNC_BANK0_BASE); \
23 bfin_read16(ASYNC_BANK0_BASE); \
29 #define insw delayed_insw
30 #define outsw delayed_outsw
32 static inline void delayed_outsw(
unsigned int addr,
void *
buf,
int len)
34 unsigned short *bp = (
unsigned short *)buf;
41 static inline void delayed_insw(
unsigned int addr,
void *buf,
int len)
43 unsigned short *bp = (
unsigned short *)buf;
52 #define MAX_ROOT_PORTS 2
57 #define USE_PLATFORM_DELAY 0
60 #define DUMMY_DELAY_ACCESS do {} while (0)
67 #define USB_RESET_WIDTH 50
68 #define MAX_XFER_SIZE 1023
71 #define ISP1362_BUF_SIZE 4096
72 #define ISP1362_ISTL_BUFSIZE 512
73 #define ISP1362_INTL_BLKSIZE 64
74 #define ISP1362_INTL_BUFFERS 16
75 #define ISP1362_ATL_BLKSIZE 64
77 #define ISP1362_REG_WRITE_OFFSET 0x80
82 #define REG_WIDTH_16 0x000
83 #define REG_WIDTH_32 0x100
84 #define REG_WIDTH_MASK 0x100
85 #define REG_NO_MASK 0x0ff
87 #define REG_ACCESS_R 0x200
88 #define REG_ACCESS_W 0x400
89 #define REG_ACCESS_RW 0x600
90 #define REG_ACCESS_MASK 0x600
92 #define ISP1362_REG_NO(r) ((r) & REG_NO_MASK)
94 #define _BUG_ON(x) BUG_ON(x)
95 #define _WARN_ON(x) WARN_ON(x)
97 #define ISP1362_REG(name, addr, width, rw) \
98 static isp1362_reg_t ISP1362_REG_##name = ((addr) | (width) | (rw))
100 #define REG_ACCESS_TEST(r) BUG_ON(((r) & ISP1362_REG_WRITE_OFFSET) && !((r) & REG_ACCESS_W))
101 #define REG_WIDTH_TEST(r, w) BUG_ON(((r) & REG_WIDTH_MASK) != (w))
104 #define ISP1362_REG_NO(r) (r)
105 #define _BUG_ON(x) do {} while (0)
106 #define _WARN_ON(x) do {} while (0)
108 #define ISP1362_REG(name, addr, width, rw) \
109 static isp1362_reg_t ISP1362_REG_##name = addr
111 #define REG_ACCESS_TEST(r) do {} while (0)
112 #define REG_WIDTH_TEST(r, w) do {} while (0)
140 #define HCHWCFG_DISABLE_SUSPEND (1 << 15)
141 #define HCHWCFG_GLOBAL_PWRDOWN (1 << 14)
142 #define HCHWCFG_PULLDOWN_DS2 (1 << 13)
143 #define HCHWCFG_PULLDOWN_DS1 (1 << 12)
144 #define HCHWCFG_CLKNOTSTOP (1 << 11)
145 #define HCHWCFG_ANALOG_OC (1 << 10)
146 #define HCHWCFG_ONEINT (1 << 9)
147 #define HCHWCFG_DACK_MODE (1 << 8)
148 #define HCHWCFG_ONEDMA (1 << 7)
149 #define HCHWCFG_DACK_POL (1 << 6)
150 #define HCHWCFG_DREQ_POL (1 << 5)
151 #define HCHWCFG_DBWIDTH_MASK (0x03 << 3)
152 #define HCHWCFG_DBWIDTH(n) (((n) << 3) & HCHWCFG_DBWIDTH_MASK)
153 #define HCHWCFG_INT_POL (1 << 2)
154 #define HCHWCFG_INT_TRIGGER (1 << 1)
155 #define HCHWCFG_INT_ENABLE (1 << 0)
158 #define HCDMACFG_CTR_ENABLE (1 << 7)
159 #define HCDMACFG_BURST_LEN_MASK (0x03 << 5)
160 #define HCDMACFG_BURST_LEN(n) (((n) << 5) & HCDMACFG_BURST_LEN_MASK)
161 #define HCDMACFG_BURST_LEN_1 HCDMACFG_BURST_LEN(0)
162 #define HCDMACFG_BURST_LEN_4 HCDMACFG_BURST_LEN(1)
163 #define HCDMACFG_BURST_LEN_8 HCDMACFG_BURST_LEN(2)
164 #define HCDMACFG_DMA_ENABLE (1 << 4)
165 #define HCDMACFG_BUF_TYPE_MASK (0x07 << 1)
166 #define HCDMACFG_BUF_TYPE(n) (((n) << 1) & HCDMACFG_BUF_TYPE_MASK)
167 #define HCDMACFG_BUF_ISTL0 HCDMACFG_BUF_TYPE(0)
168 #define HCDMACFG_BUF_ISTL1 HCDMACFG_BUF_TYPE(1)
169 #define HCDMACFG_BUF_INTL HCDMACFG_BUF_TYPE(2)
170 #define HCDMACFG_BUF_ATL HCDMACFG_BUF_TYPE(3)
171 #define HCDMACFG_BUF_DIRECT HCDMACFG_BUF_TYPE(4)
172 #define HCDMACFG_DMA_RW_SELECT (1 << 0)
177 #define HCuPINT_SOF (1 << 0)
178 #define HCuPINT_ISTL0 (1 << 1)
179 #define HCuPINT_ISTL1 (1 << 2)
180 #define HCuPINT_EOT (1 << 3)
181 #define HCuPINT_OPR (1 << 4)
182 #define HCuPINT_SUSP (1 << 5)
183 #define HCuPINT_CLKRDY (1 << 6)
184 #define HCuPINT_INTL (1 << 7)
185 #define HCuPINT_ATL (1 << 8)
186 #define HCuPINT_OTG (1 << 9)
192 #define HCCHIPID_MASK 0xff00
193 #define HCCHIPID_MAGIC 0x3600
198 #define HCSWRES_MAGIC 0x00f6
201 #define HCBUFSTAT_ISTL0_FULL (1 << 0)
202 #define HCBUFSTAT_ISTL1_FULL (1 << 1)
203 #define HCBUFSTAT_INTL_ACTIVE (1 << 2)
204 #define HCBUFSTAT_ATL_ACTIVE (1 << 3)
205 #define HCBUFSTAT_RESET_HWPP (1 << 4)
206 #define HCBUFSTAT_ISTL0_ACTIVE (1 << 5)
207 #define HCBUFSTAT_ISTL1_ACTIVE (1 << 6)
208 #define HCBUFSTAT_ISTL0_DONE (1 << 8)
209 #define HCBUFSTAT_ISTL1_DONE (1 << 9)
210 #define HCBUFSTAT_PAIRED_PTDPP (1 << 10)
212 ISP1362_REG(HCDIRADDR, 0x32, REG_WIDTH_32, REG_ACCESS_RW);
213 #define HCDIRADDR_ADDR_MASK 0x0000ffff
214 #define HCDIRADDR_ADDR(n) (((n) << 0) & HCDIRADDR_ADDR_MASK)
215 #define HCDIRADDR_COUNT_MASK 0xffff0000
216 #define HCDIRADDR_COUNT(n) (((n) << 16) & HCDIRADDR_COUNT_MASK)
217 ISP1362_REG(HCDIRDATA, 0x45, REG_WIDTH_16, REG_ACCESS_RW);
219 ISP1362_REG(HCISTLBUFSZ, 0x30, REG_WIDTH_16, REG_ACCESS_RW);
220 ISP1362_REG(HCISTL0PORT, 0x40, REG_WIDTH_16, REG_ACCESS_RW);
221 ISP1362_REG(HCISTL1PORT, 0x42, REG_WIDTH_16, REG_ACCESS_RW);
222 ISP1362_REG(HCISTLRATE, 0x47, REG_WIDTH_16, REG_ACCESS_RW);
224 ISP1362_REG(HCINTLBUFSZ, 0x33, REG_WIDTH_16, REG_ACCESS_RW);
225 ISP1362_REG(HCINTLPORT, 0x43, REG_WIDTH_16, REG_ACCESS_RW);
226 ISP1362_REG(HCINTLBLKSZ, 0x53, REG_WIDTH_16, REG_ACCESS_RW);
227 ISP1362_REG(HCINTLDONE, 0x17, REG_WIDTH_32, REG_ACCESS_R);
228 ISP1362_REG(HCINTLSKIP, 0x18, REG_WIDTH_32, REG_ACCESS_RW);
229 ISP1362_REG(HCINTLLAST, 0x19, REG_WIDTH_32, REG_ACCESS_RW);
230 ISP1362_REG(HCINTLCURR, 0x1a, REG_WIDTH_16, REG_ACCESS_R);
232 ISP1362_REG(HCATLBUFSZ, 0x34, REG_WIDTH_16, REG_ACCESS_RW);
234 ISP1362_REG(HCATLBLKSZ, 0x54, REG_WIDTH_16, REG_ACCESS_RW);
235 ISP1362_REG(HCATLDONE, 0x1b, REG_WIDTH_32, REG_ACCESS_R);
236 ISP1362_REG(HCATLSKIP, 0x1c, REG_WIDTH_32, REG_ACCESS_RW);
237 ISP1362_REG(HCATLLAST, 0x1d, REG_WIDTH_32, REG_ACCESS_RW);
238 ISP1362_REG(HCATLCURR, 0x1e, REG_WIDTH_16, REG_ACCESS_R);
240 ISP1362_REG(HCATLDTC, 0x51, REG_WIDTH_16, REG_ACCESS_RW);
241 ISP1362_REG(HCATLDTCTO, 0x52, REG_WIDTH_16, REG_ACCESS_RW);
244 ISP1362_REG(OTGCONTROL, 0x62, REG_WIDTH_16, REG_ACCESS_RW);
245 ISP1362_REG(OTGSTATUS, 0x67, REG_WIDTH_16, REG_ACCESS_R);
246 ISP1362_REG(OTGINT, 0x68, REG_WIDTH_16, REG_ACCESS_RW);
247 ISP1362_REG(OTGINTENB, 0x69, REG_WIDTH_16, REG_ACCESS_RW);
248 ISP1362_REG(OTGTIMER, 0x6A, REG_WIDTH_16, REG_ACCESS_RW);
249 ISP1362_REG(OTGALTTMR, 0x6C, REG_WIDTH_16, REG_ACCESS_RW);
254 #define PTD_COUNT_MSK (0x3ff << 0)
255 #define PTD_TOGGLE_MSK (1 << 10)
256 #define PTD_ACTIVE_MSK (1 << 11)
257 #define PTD_CC_MSK (0xf << 12)
259 #define PTD_MPS_MSK (0x3ff << 0)
260 #define PTD_SPD_MSK (1 << 10)
261 #define PTD_LAST_MSK (1 << 11)
262 #define PTD_EP_MSK (0xf << 12)
264 #define PTD_LEN_MSK (0x3ff << 0)
265 #define PTD_DIR_MSK (3 << 10)
266 #define PTD_DIR_SETUP (0)
267 #define PTD_DIR_OUT (1)
268 #define PTD_DIR_IN (2)
270 #define PTD_FA_MSK (0x7f << 0)
272 #define PTD_SF_ISO_MSK (0xff << 8)
273 #define PTD_SF_INT_MSK (0x1f << 8)
274 #define PTD_PR_MSK (0x07 << 13)
276 #define PTD_HEADER_SIZE sizeof(struct ptd)
283 #define PTD_CC_NOERROR 0x00
284 #define PTD_CC_CRC 0x01
285 #define PTD_CC_BITSTUFFING 0x02
286 #define PTD_CC_DATATOGGLEM 0x03
287 #define PTD_CC_STALL 0x04
288 #define PTD_DEVNOTRESP 0x05
289 #define PTD_PIDCHECKFAIL 0x06
290 #define PTD_UNEXPECTEDPID 0x07
291 #define PTD_DATAOVERRUN 0x08
292 #define PTD_DATAUNDERRUN 0x09
294 #define PTD_BUFFEROVERRUN 0x0C
295 #define PTD_BUFFERUNDERRUN 0x0D
297 #define PTD_NOTACCESSED 0x0F
301 static const int cc_to_error[16] = {
324 #define OHCI_CTRL_HCFS (3 << 6)
325 #define OHCI_CTRL_RWC (1 << 9)
326 #define OHCI_CTRL_RWE (1 << 10)
329 # define OHCI_USB_RESET (0 << 6)
330 # define OHCI_USB_RESUME (1 << 6)
331 # define OHCI_USB_OPER (2 << 6)
332 # define OHCI_USB_SUSPEND (3 << 6)
337 #define OHCI_HCR (1 << 0)
338 #define OHCI_SOC (3 << 16)
346 #define OHCI_INTR_SO (1 << 0)
347 #define OHCI_INTR_WDH (1 << 1)
348 #define OHCI_INTR_SF (1 << 2)
349 #define OHCI_INTR_RD (1 << 3)
350 #define OHCI_INTR_UE (1 << 4)
351 #define OHCI_INTR_FNO (1 << 5)
352 #define OHCI_INTR_RHSC (1 << 6)
353 #define OHCI_INTR_OC (1 << 30)
354 #define OHCI_INTR_MIE (1 << 31)
357 #define RH_PS_CCS 0x00000001
358 #define RH_PS_PES 0x00000002
359 #define RH_PS_PSS 0x00000004
360 #define RH_PS_POCI 0x00000008
361 #define RH_PS_PRS 0x00000010
362 #define RH_PS_PPS 0x00000100
363 #define RH_PS_LSDA 0x00000200
364 #define RH_PS_CSC 0x00010000
365 #define RH_PS_PESC 0x00020000
366 #define RH_PS_PSSC 0x00040000
367 #define RH_PS_OCIC 0x00080000
368 #define RH_PS_PRSC 0x00100000
371 #define RH_HS_LPS 0x00000001
372 #define RH_HS_OCI 0x00000002
373 #define RH_HS_DRWE 0x00008000
374 #define RH_HS_LPSC 0x00010000
375 #define RH_HS_OCIC 0x00020000
376 #define RH_HS_CRWE 0x80000000
379 #define RH_B_DR 0x0000ffff
380 #define RH_B_PPCM 0xffff0000
383 #define RH_A_NDP (0xff << 0)
384 #define RH_A_PSM (1 << 8)
385 #define RH_A_NPS (1 << 9)
386 #define RH_A_DT (1 << 10)
387 #define RH_A_OCPM (1 << 11)
388 #define RH_A_NOCP (1 << 12)
389 #define RH_A_POTPGT (0xff << 24)
392 #define FSMP(fi) (0x7fff & ((6 * ((fi) - 210)) / 7))
393 #define LSTHRESH 0x628
398 #define PTD_GET_COUNT(p) (((p)->count & PTD_COUNT_MSK) >> 0)
399 #define PTD_COUNT(v) (((v) << 0) & PTD_COUNT_MSK)
400 #define PTD_GET_TOGGLE(p) (((p)->count & PTD_TOGGLE_MSK) >> 10)
401 #define PTD_TOGGLE(v) (((v) << 10) & PTD_TOGGLE_MSK)
402 #define PTD_GET_ACTIVE(p) (((p)->count & PTD_ACTIVE_MSK) >> 11)
403 #define PTD_ACTIVE(v) (((v) << 11) & PTD_ACTIVE_MSK)
404 #define PTD_GET_CC(p) (((p)->count & PTD_CC_MSK) >> 12)
405 #define PTD_CC(v) (((v) << 12) & PTD_CC_MSK)
406 #define PTD_GET_MPS(p) (((p)->mps & PTD_MPS_MSK) >> 0)
407 #define PTD_MPS(v) (((v) << 0) & PTD_MPS_MSK)
408 #define PTD_GET_SPD(p) (((p)->mps & PTD_SPD_MSK) >> 10)
409 #define PTD_SPD(v) (((v) << 10) & PTD_SPD_MSK)
410 #define PTD_GET_LAST(p) (((p)->mps & PTD_LAST_MSK) >> 11)
411 #define PTD_LAST(v) (((v) << 11) & PTD_LAST_MSK)
412 #define PTD_GET_EP(p) (((p)->mps & PTD_EP_MSK) >> 12)
413 #define PTD_EP(v) (((v) << 12) & PTD_EP_MSK)
414 #define PTD_GET_LEN(p) (((p)->len & PTD_LEN_MSK) >> 0)
415 #define PTD_LEN(v) (((v) << 0) & PTD_LEN_MSK)
416 #define PTD_GET_DIR(p) (((p)->len & PTD_DIR_MSK) >> 10)
417 #define PTD_DIR(v) (((v) << 10) & PTD_DIR_MSK)
418 #define PTD_GET_FA(p) (((p)->faddr & PTD_FA_MSK) >> 0)
419 #define PTD_FA(v) (((v) << 0) & PTD_FA_MSK)
420 #define PTD_GET_SF_INT(p) (((p)->faddr & PTD_SF_INT_MSK) >> 8)
421 #define PTD_SF_INT(v) (((v) << 8) & PTD_SF_INT_MSK)
422 #define PTD_GET_SF_ISO(p) (((p)->faddr & PTD_SF_ISO_MSK) >> 8)
423 #define PTD_SF_ISO(v) (((v) << 8) & PTD_SF_ISO_MSK)
424 #define PTD_GET_PR(p) (((p)->faddr & PTD_PR_MSK) >> 13)
425 #define PTD_PR(v) (((v) << 13) & PTD_PR_MSK)
427 #define LOG2_PERIODIC_SIZE 5
428 #define PERIODIC_SIZE (1 << LOG2_PERIODIC_SIZE)
431 struct usb_host_endpoint *
hep;
542 static inline const char *ISP1362_INT_NAME(
int n)
545 case ISP1362_INT_SOF:
return "SOF";
546 case ISP1362_INT_ISTL0:
return "ISTL0";
547 case ISP1362_INT_ISTL1:
return "ISTL1";
548 case ISP1362_INT_EOT:
return "EOT";
549 case ISP1362_INT_OPR:
return "OPR";
550 case ISP1362_INT_SUSP:
return "SUSP";
551 case ISP1362_INT_CLKRDY:
return "CLKRDY";
552 case ISP1362_INT_INTL:
return "INTL";
553 case ISP1362_INT_ATL:
return "ATL";
554 case ISP1362_INT_OTG:
return "OTG";
555 default:
return "unknown";
561 unsigned long p = (
unsigned long)ptr;
565 isp1362_hcd->
stat8++;
567 isp1362_hcd->
stat4++;
569 isp1362_hcd->
stat2++;
571 isp1362_hcd->
stat1++;
574 static inline struct isp1362_hcd *hcd_to_isp1362_hcd(
struct usb_hcd *hcd)
576 return (
struct isp1362_hcd *) (hcd->hcd_priv);
579 static inline struct usb_hcd *isp1362_hcd_to_hcd(
struct isp1362_hcd *isp1362_hcd)
581 return container_of((
void *)isp1362_hcd,
struct usb_hcd, hcd_priv);
584 #define frame_before(f1, f2) ((s16)((u16)f1 - (u16)f2) < 0)
591 #define DBG(level, fmt...) \
593 if (dbg_level > level) \
596 #define _DBG(level, fmt...) \
598 if (dbg_level > level) \
602 #define DBG(fmt...) do {} while (0)
607 # define VDBG(fmt...) DBG(3, fmt)
609 # define VDBG(fmt...) do {} while (0)
613 # define RDBG(fmt...) DBG(1, fmt)
615 # define RDBG(fmt...) do {} while (0)
619 #define URB_DBG(fmt...) DBG(0, fmt)
621 #define URB_DBG(fmt...) do {} while (0)
625 #if USE_PLATFORM_DELAY
627 #error USE_PLATFORM_DELAY and USE_NDELAY defined simultaneously.
629 #define isp1362_delay(h, d) (h)->board->delay(isp1362_hcd_to_hcd(h)->self.controller, d)
631 #define isp1362_delay(h, d) ndelay(d)
633 #define isp1362_delay(h, d) do {} while (0)
636 #define get_urb(ep) ({ \
637 BUG_ON(list_empty(&ep->hep->urb_list)); \
638 container_of(ep->hep->urb_list.next, struct urb, urb_list); \
646 static void isp1362_write_addr(
struct isp1362_hcd *isp1362_hcd, isp1362_reg_t
reg)
657 static void isp1362_write_data16(
struct isp1362_hcd *isp1362_hcd,
u16 val)
664 static u16 isp1362_read_data16(
struct isp1362_hcd *isp1362_hcd)
675 static void isp1362_write_data32(
struct isp1362_hcd *isp1362_hcd,
u32 val)
689 static u32 isp1362_read_data32(
struct isp1362_hcd *isp1362_hcd)
708 static void isp1362_read_fifo(
struct isp1362_hcd *isp1362_hcd,
void *buf,
u16 len)
718 RDBG(
"%s: Reading %d byte from fifo to mem @ %p\n", __func__, len, buf);
721 RDBG(
"%s: Using readsl for %d dwords\n", __func__, len >> 2);
728 RDBG(
"%s: Using readsw for %d words\n", __func__, len >> 1);
729 insw((
unsigned long)isp1362_hcd->
data_reg, dp, len >> 1);
736 data = isp1362_read_data16(isp1362_hcd);
737 RDBG(
"%s: Reading trailing byte %02x to mem @ %08x\n", __func__,
743 static void isp1362_write_fifo(
struct isp1362_hcd *isp1362_hcd,
void *buf,
u16 len)
751 if ((
unsigned long)dp & 0x1) {
753 for (; len > 1; len -= 2) {
756 isp1362_write_data16(isp1362_hcd, data);
759 isp1362_write_data16(isp1362_hcd, *dp);
765 RDBG(
"%s: Writing %d byte to fifo from memory @%p\n", __func__, len, buf);
768 RDBG(
"%s: Using writesl for %d dwords\n", __func__, len >> 2);
775 RDBG(
"%s: Using writesw for %d words\n", __func__, len >> 1);
787 RDBG(
"%s: Sending trailing byte %02x from mem @ %08x\n", __func__,
789 isp1362_write_data16(isp1362_hcd, data);
793 #define isp1362_read_reg16(d, r) ({ \
795 REG_WIDTH_TEST(ISP1362_REG_##r, REG_WIDTH_16); \
796 isp1362_write_addr(d, ISP1362_REG_##r); \
797 __v = isp1362_read_data16(d); \
798 RDBG("%s: Read %04x from %s[%02x]\n", __func__, __v, #r, \
799 ISP1362_REG_NO(ISP1362_REG_##r)); \
803 #define isp1362_read_reg32(d, r) ({ \
805 REG_WIDTH_TEST(ISP1362_REG_##r, REG_WIDTH_32); \
806 isp1362_write_addr(d, ISP1362_REG_##r); \
807 __v = isp1362_read_data32(d); \
808 RDBG("%s: Read %08x from %s[%02x]\n", __func__, __v, #r, \
809 ISP1362_REG_NO(ISP1362_REG_##r)); \
813 #define isp1362_write_reg16(d, r, v) { \
814 REG_WIDTH_TEST(ISP1362_REG_##r, REG_WIDTH_16); \
815 isp1362_write_addr(d, (ISP1362_REG_##r) | ISP1362_REG_WRITE_OFFSET); \
816 isp1362_write_data16(d, (u16)(v)); \
817 RDBG("%s: Wrote %04x to %s[%02x]\n", __func__, (u16)(v), #r, \
818 ISP1362_REG_NO(ISP1362_REG_##r)); \
821 #define isp1362_write_reg32(d, r, v) { \
822 REG_WIDTH_TEST(ISP1362_REG_##r, REG_WIDTH_32); \
823 isp1362_write_addr(d, (ISP1362_REG_##r) | ISP1362_REG_WRITE_OFFSET); \
824 isp1362_write_data32(d, (u32)(v)); \
825 RDBG("%s: Wrote %08x to %s[%02x]\n", __func__, (u32)(v), #r, \
826 ISP1362_REG_NO(ISP1362_REG_##r)); \
829 #define isp1362_set_mask16(d, r, m) { \
831 __v = isp1362_read_reg16(d, r); \
832 if ((__v | m) != __v) \
833 isp1362_write_reg16(d, r, __v | m); \
836 #define isp1362_clr_mask16(d, r, m) { \
838 __v = isp1362_read_reg16(d, r); \
839 if ((__v & ~m) != __v) \
840 isp1362_write_reg16(d, r, __v & ~m); \
843 #define isp1362_set_mask32(d, r, m) { \
845 __v = isp1362_read_reg32(d, r); \
846 if ((__v | m) != __v) \
847 isp1362_write_reg32(d, r, __v | m); \
850 #define isp1362_clr_mask32(d, r, m) { \
852 __v = isp1362_read_reg32(d, r); \
853 if ((__v & ~m) != __v) \
854 isp1362_write_reg32(d, r, __v & ~m); \
858 #define isp1362_show_reg(d, r) { \
859 if ((ISP1362_REG_##r & REG_WIDTH_MASK) == REG_WIDTH_32) \
860 DBG(0, "%-12s[%02x]: %08x\n", #r, \
861 ISP1362_REG_NO(ISP1362_REG_##r), isp1362_read_reg32(d, r)); \
863 DBG(0, "%-12s[%02x]: %04x\n", #r, \
864 ISP1362_REG_NO(ISP1362_REG_##r), isp1362_read_reg16(d, r)); \
867 #define isp1362_show_reg(d, r) do {} while (0)
893 DBG(0,
"%-12s[%02x]: %04x\n",
"HCuPINTENB",
924 static void isp1362_write_diraddr(
struct isp1362_hcd *isp1362_hcd,
u16 offset,
u16 len)
930 len = (len + 1) & ~1;
937 static void isp1362_read_buffer(
struct isp1362_hcd *isp1362_hcd,
void *buf,
u16 offset,
int len)
941 isp1362_write_diraddr(isp1362_hcd, offset, len);
943 DBG(3,
"%s: Reading %d byte from buffer @%04x to memory @ %p\n",
944 __func__, len, offset, buf);
949 isp1362_write_addr(isp1362_hcd, ISP1362_REG_HCDIRDATA);
951 isp1362_read_fifo(isp1362_hcd, buf, len);
957 static void isp1362_write_buffer(
struct isp1362_hcd *isp1362_hcd,
void *buf,
u16 offset,
int len)
961 isp1362_write_diraddr(isp1362_hcd, offset, len);
963 DBG(3,
"%s: Writing %d byte to buffer @%04x from memory @ %p\n",
964 __func__, len, offset, buf);
970 isp1362_write_fifo(isp1362_hcd, buf, len);
983 for (k = 0; k < len; ++
k) {
1005 #if defined(ISP1362_DEBUG) && defined(PTD_TRACE)
1009 DBG(0,
"EP %p: CC=%x EP=%d DIR=%x CNT=%d LEN=%d MPS=%d TGL=%x ACT=%x FA=%d SPD=%x SF=%x PR=%x LST=%x\n",
1020 if (dbg_level > 0) {
1022 DBG(0,
"--out->\n");
1030 if (dbg_level > 0) {
1032 DBG(0,
"<--in--\n");
1042 int dbg = dbg_level;
1052 #define dump_ptd(ptd) do {} while (0)
1053 #define dump_ptd_in_data(ptd, buf) do {} while (0)
1054 #define dump_ptd_out_data(ptd, buf) do {} while (0)
1055 #define dump_ptd_data(ptd, buf) do {} while (0)
1056 #define dump_ptd_queue(epq) do {} while (0)