| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#ifndef __DWC2_REGISTERS__ |
| 15 |
#define __DWC2_REGISTERS__ |
| 16 |
|
| 17 |
#define MAX_EPS_CHANNELS 16 |
| 18 |
|
| 19 |
typedef struct core_reg { |
| 20 |
uint32_t gotgctl; |
| 21 |
uint32_t gotgint; |
| 22 |
uint32_t gahbcfg; |
| 23 |
uint32_t gusbcfg; |
| 24 |
uint32_t grstctl; |
| 25 |
uint32_t gintsts; |
| 26 |
uint32_t gintmsk; |
| 27 |
uint32_t grxstsr; |
| 28 |
uint32_t grxstsp; |
| 29 |
uint32_t grxfsiz; |
| 30 |
uint32_t gnptxfsiz; |
| 31 |
uint32_t gnptxsts; |
| 32 |
uint32_t gi2cctl; |
| 33 |
uint32_t gpvndctl; |
| 34 |
uint32_t ggpio; |
| 35 |
uint32_t guid; |
| 36 |
uint32_t gsnpsid; |
| 37 |
uint32_t ghwcfg1; |
| 38 |
uint32_t ghwcfg2; |
| 39 |
uint32_t ghwcfg3; |
| 40 |
uint32_t ghwcfg4; |
| 41 |
uint32_t reserved1[(0x100 - 0x54) / 4]; |
| 42 |
uint32_t hptxfsiz; |
| 43 |
uint32_t dptxfsiz_dieptxf[MAX_EPS_CHANNELS - 1]; |
| 44 |
uint32_t reserved2[(0x400 - 0x140) / 4]; |
| 45 |
} core_reg_t; |
| 46 |
|
| 47 |
typedef struct hc_reg { |
| 48 |
uint32_t hccharn; |
| 49 |
uint32_t hcspltn; |
| 50 |
uint32_t hcintn; |
| 51 |
uint32_t hcintmaskn; |
| 52 |
uint32_t hctsizn; |
| 53 |
uint32_t hcdman; |
| 54 |
uint32_t reserved[2]; |
| 55 |
} hc_reg_t; |
| 56 |
|
| 57 |
|
| 58 |
typedef struct host_reg { |
| 59 |
uint32_t hcfg; |
| 60 |
uint32_t hfir; |
| 61 |
uint32_t hfnum; |
| 62 |
uint32_t reserved0; |
| 63 |
uint32_t hptxsts; |
| 64 |
uint32_t haint; |
| 65 |
uint32_t haintmsk; |
| 66 |
uint32_t reserved1[(0x440 - 0x41c) / 4]; |
| 67 |
uint32_t hprt; |
| 68 |
uint32_t reserved2[(0x500 - 0x444) / 4]; |
| 69 |
hc_reg_t hchn[MAX_EPS_CHANNELS]; |
| 70 |
uint32_t reserved3[(0x800 - 0x700) / 4]; |
| 71 |
} host_reg_t; |
| 72 |
|
| 73 |
typedef struct ep_reg { |
| 74 |
uint32_t depctl; |
| 75 |
uint32_t reserved04; |
| 76 |
uint32_t depint; |
| 77 |
uint32_t reserved0c; |
| 78 |
uint32_t deptsiz; |
| 79 |
uint32_t depdma; |
| 80 |
uint32_t reserved18; |
| 81 |
uint32_t depdmab; |
| 82 |
} dwc2_ep_reg_t; |
| 83 |
|
| 84 |
|
| 85 |
typedef struct device_reg { |
| 86 |
uint32_t dcfg; |
| 87 |
uint32_t dctl; |
| 88 |
uint32_t dsts; |
| 89 |
uint32_t unused; |
| 90 |
uint32_t diepmsk; |
| 91 |
uint32_t doepmsk; |
| 92 |
uint32_t daint; |
| 93 |
uint32_t daintmsk; |
| 94 |
uint32_t dtknqr1; |
| 95 |
uint32_t dtknqr2; |
| 96 |
uint32_t dvbusdis; |
| 97 |
uint32_t dvbuspulse; |
| 98 |
uint32_t dtknqr3_dthrctl; |
| 99 |
uint32_t dtknqr4_fifoemptymsk; |
| 100 |
uint32_t reserved1[(0x900 - 0x838) / 4]; |
| 101 |
|
| 102 |
dwc2_ep_reg_t inep[MAX_EPS_CHANNELS]; |
| 103 |
dwc2_ep_reg_t outep[MAX_EPS_CHANNELS]; |
| 104 |
uint32_t reserved8[(0xe00 - 0xd00) / 4]; |
| 105 |
} device_reg_t; |
| 106 |
|
| 107 |
typedef struct pwr_clk_ctrl_reg { |
| 108 |
uint32_t pcgcctl; |
| 109 |
uint32_t reserved[(0x1000 - 0xe04) / 4]; |
| 110 |
} pwr_clk_ctrl_reg_t; |
| 111 |
|
| 112 |
typedef struct data_fifo { |
| 113 |
uint32_t dataport; |
| 114 |
uint32_t reserved[(0x1000 - 0x004) / 4]; |
| 115 |
} data_fifo_t; |
| 116 |
|
| 117 |
typedef struct dwc2_otg_reg { |
| 118 |
core_reg_t core; |
| 119 |
host_reg_t host; |
| 120 |
device_reg_t device; |
| 121 |
pwr_clk_ctrl_reg_t pcgr; |
| 122 |
data_fifo_t dfifo[MAX_EPS_CHANNELS]; |
| 123 |
uint32_t reserved[(0x40000 - 0x11000) / 4]; |
| 124 |
} dwc2_reg_t; |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
typedef union { |
| 131 |
|
| 132 |
uint32_t d32; |
| 133 |
|
| 134 |
struct { |
| 135 |
unsigned glblintrmsk:1; |
| 136 |
#define GLBINT_ENABLE 1 |
| 137 |
|
| 138 |
unsigned hbstlen:4; |
| 139 |
#define DMA_BURST_SINGLE 0 |
| 140 |
#define DMA_BURST_INCR 1 |
| 141 |
#define DMA_BURST_INCR4 3 |
| 142 |
#define DMA_BURST_INCR8 5 |
| 143 |
#define DMA_BURST_INCR16 7 |
| 144 |
|
| 145 |
unsigned dmaen:1; |
| 146 |
unsigned reserved:1; |
| 147 |
unsigned nptxfemplvl:1; |
| 148 |
unsigned ptxfemplvl:1; |
| 149 |
unsigned reserved9_31:23; |
| 150 |
}; |
| 151 |
} gahbcfg_t; |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
typedef union { |
| 158 |
|
| 159 |
uint32_t d32; |
| 160 |
|
| 161 |
struct { |
| 162 |
unsigned toutcal:3; |
| 163 |
unsigned phyif:1; |
| 164 |
unsigned ulpiutmisel:1; |
| 165 |
unsigned fsintf:1; |
| 166 |
unsigned physel:1; |
| 167 |
unsigned ddrsel:1; |
| 168 |
unsigned srpcap:1; |
| 169 |
unsigned hnpcap:1; |
| 170 |
unsigned usbtrdtim:4; |
| 171 |
unsigned reserved14:1; |
| 172 |
unsigned phylpwrclksel:1; |
| 173 |
unsigned otgi2csel:1; |
| 174 |
unsigned ulpifsls:1; |
| 175 |
unsigned ulpiautores:1; |
| 176 |
unsigned ulpiclksusm:1; |
| 177 |
unsigned ulpiextvbusdrv:1; |
| 178 |
unsigned ulpiextvbusindicator:1; |
| 179 |
unsigned termseldlpulse:1; |
| 180 |
unsigned reserved23_28:6; |
| 181 |
unsigned forcehstmode:1; |
| 182 |
unsigned forcedevmode:1; |
| 183 |
unsigned cortxpkt:1; |
| 184 |
}; |
| 185 |
} gusbcfg_t; |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
typedef union { |
| 192 |
|
| 193 |
uint32_t d32; |
| 194 |
|
| 195 |
struct { |
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
unsigned csftrst:1; |
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
unsigned hsftrst:1; |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
unsigned frmcntrrst:1; |
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
unsigned intknqflsh:1; |
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
unsigned rxfflsh:1; |
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
unsigned txfflsh:1; |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
unsigned txfnum:5; |
| 299 |
|
| 300 |
unsigned reserved11_29:19; |
| 301 |
|
| 302 |
|
| 303 |
unsigned dmareq:1; |
| 304 |
|
| 305 |
|
| 306 |
unsigned ahbidle:1; |
| 307 |
}; |
| 308 |
} grstctl_t; |
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
typedef union { |
| 315 |
|
| 316 |
uint32_t d32; |
| 317 |
|
| 318 |
struct { |
| 319 |
unsigned curmod:1; |
| 320 |
unsigned modemis:1; |
| 321 |
unsigned otgint:1; |
| 322 |
unsigned sof:1; |
| 323 |
unsigned rxflvl:1; |
| 324 |
unsigned nptxfemp:1; |
| 325 |
unsigned ginnakeff:1; |
| 326 |
unsigned goutnakeff:1; |
| 327 |
unsigned reserved8:1; |
| 328 |
unsigned i2cint:1; |
| 329 |
unsigned erlysusp:1; |
| 330 |
unsigned usbsusp:1; |
| 331 |
unsigned usbrst:1; |
| 332 |
unsigned enumdone:1; |
| 333 |
unsigned isooutdrop:1; |
| 334 |
unsigned eopf:1; |
| 335 |
unsigned reserved16:1; |
| 336 |
unsigned epmis:1; |
| 337 |
unsigned iepint:1; |
| 338 |
unsigned oepint:1; |
| 339 |
unsigned incompisoin:1; |
| 340 |
unsigned incompip:1; |
| 341 |
unsigned reserved22_23:2; |
| 342 |
unsigned prtint:1; |
| 343 |
unsigned hchint:1; |
| 344 |
unsigned ptxfemp:1; |
| 345 |
unsigned reserved27:1; |
| 346 |
unsigned conidstschng:1; |
| 347 |
unsigned disconnint:1; |
| 348 |
unsigned sessreqint:1; |
| 349 |
unsigned wkupint:1; |
| 350 |
}; |
| 351 |
} gintmsk_t; |
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
typedef union { |
| 358 |
|
| 359 |
uint32_t d32; |
| 360 |
|
| 361 |
struct { |
| 362 |
unsigned txfstaddr:16; |
| 363 |
unsigned txfdep:16; |
| 364 |
}; |
| 365 |
} gtxfsiz_t; |
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
typedef union { |
| 372 |
|
| 373 |
uint32_t d32; |
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
struct { |
| 378 |
unsigned rxfdep:16; |
| 379 |
unsigned reserved:16; |
| 380 |
}; |
| 381 |
} grxfsiz_t; |
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
typedef union { |
| 388 |
|
| 389 |
uint32_t d32; |
| 390 |
|
| 391 |
struct { |
| 392 |
unsigned dtxfstaddr:16; |
| 393 |
unsigned dtxfdep:16; |
| 394 |
}; |
| 395 |
} dtxfsiz_t; |
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
typedef union { |
| 402 |
|
| 403 |
uint32_t d32; |
| 404 |
#define SOF_INTR_MASK 0x0008 |
| 405 |
|
| 406 |
struct { |
| 407 |
unsigned curmod:1; |
| 408 |
#define HOST_MODE 1 |
| 409 |
#define DEVICE_MODE 0 |
| 410 |
unsigned modemis:1; |
| 411 |
unsigned otgint:1; |
| 412 |
unsigned sof:1; |
| 413 |
unsigned rxflvl:1; |
| 414 |
unsigned nptxfemp:1; |
| 415 |
unsigned ginnakeff:1; |
| 416 |
unsigned goutnakeff:1; |
| 417 |
unsigned reserved8:1; |
| 418 |
unsigned i2cint:1; |
| 419 |
unsigned erlysusp:1; |
| 420 |
unsigned usbsusp:1; |
| 421 |
unsigned usbrst:1; |
| 422 |
unsigned enumdone:1; |
| 423 |
unsigned isooutdrop:1; |
| 424 |
unsigned eopf:1; |
| 425 |
unsigned reserved16_17:2; |
| 426 |
unsigned iepint:1; |
| 427 |
unsigned oepint:1; |
| 428 |
unsigned reserved20:1; |
| 429 |
unsigned incompip:1; |
| 430 |
unsigned reserved22_23:2; |
| 431 |
unsigned prtint:1; |
| 432 |
unsigned hchint:1; |
| 433 |
unsigned ptxfemp:1; |
| 434 |
unsigned reserved27:1; |
| 435 |
unsigned conidstschng:1; |
| 436 |
unsigned disconnint:1; |
| 437 |
unsigned sessreqint:1; |
| 438 |
unsigned wkupint:1; |
| 439 |
}; |
| 440 |
} gintsts_t; |
| 441 |
|
| 442 |
#define GINTSTS_WKUPINT (1 << 31) |
| 443 |
#define GINTSTS_SESSREQINT (1 << 30) |
| 444 |
#define GINTSTS_DISCONNINT (1 << 29) |
| 445 |
#define GINTSTS_CONIDSTSCHNG (1 << 28) |
| 446 |
#define GINTSTS_LPMTRANRCVD (1 << 27) |
| 447 |
#define GINTSTS_PTXFEMP (1 << 26) |
| 448 |
#define GINTSTS_HCHINT (1 << 25) |
| 449 |
#define GINTSTS_PRTINT (1 << 24) |
| 450 |
#define GINTSTS_RESETDET (1 << 23) |
| 451 |
#define GINTSTS_FET_SUSP (1 << 22) |
| 452 |
#define GINTSTS_INCOMPL_IP (1 << 21) |
| 453 |
#define GINTSTS_INCOMPL_SOIN (1 << 20) |
| 454 |
#define GINTSTS_OEPINT (1 << 19) |
| 455 |
#define GINTSTS_IEPINT (1 << 18) |
| 456 |
#define GINTSTS_EPMIS (1 << 17) |
| 457 |
#define GINTSTS_RESTOREDONE (1 << 16) |
| 458 |
#define GINTSTS_EOPF (1 << 15) |
| 459 |
#define GINTSTS_ISOUTDROP (1 << 14) |
| 460 |
#define GINTSTS_ENUMDONE (1 << 13) |
| 461 |
#define GINTSTS_USBRST (1 << 12) |
| 462 |
#define GINTSTS_USBSUSP (1 << 11) |
| 463 |
#define GINTSTS_ERLYSUSP (1 << 10) |
| 464 |
#define GINTSTS_I2CINT (1 << 9) |
| 465 |
#define GINTSTS_ULPI_CK_INT (1 << 8) |
| 466 |
#define GINTSTS_GOUTNAKEFF (1 << 7) |
| 467 |
#define GINTSTS_GINNAKEFF (1 << 6) |
| 468 |
#define GINTSTS_NPTXFEMP (1 << 5) |
| 469 |
#define GINTSTS_RXFLVL (1 << 4) |
| 470 |
#define GINTSTS_SOF (1 << 3) |
| 471 |
#define GINTSTS_OTGINT (1 << 2) |
| 472 |
#define GINTSTS_MODEMIS (1 << 1) |
| 473 |
#define GINTSTS_CURMODE_HOST (1 << 0) |
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
typedef union { |
| 480 |
|
| 481 |
uint32_t d32; |
| 482 |
|
| 483 |
struct { |
| 484 |
unsigned reserved:16; |
| 485 |
unsigned dfifodepth:16; |
| 486 |
}; |
| 487 |
} ghwcfg3_t; |
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
typedef union { |
| 493 |
|
| 494 |
uint32_t d32; |
| 495 |
|
| 496 |
|
| 497 |
struct { |
| 498 |
|
| 499 |
unsigned fslspclksel:2; |
| 500 |
#define PHYCLK_30_60_MHZ 0 |
| 501 |
#define PHYCLK_48_MHZ 1 |
| 502 |
#define PHYCLK_6_MHZ 2 |
| 503 |
|
| 504 |
|
| 505 |
unsigned fslssupp:1; |
| 506 |
}; |
| 507 |
} hcfg_t; |
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
typedef union { |
| 514 |
|
| 515 |
uint32_t d32; |
| 516 |
|
| 517 |
|
| 518 |
struct { |
| 519 |
|
| 520 |
unsigned frnum:16; |
| 521 |
|
| 522 |
unsigned frrem:16; |
| 523 |
}; |
| 524 |
} hfnum_t; |
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
typedef union { |
| 531 |
|
| 532 |
uint32_t d32; |
| 533 |
|
| 534 |
struct { |
| 535 |
unsigned prtconnsts:1; |
| 536 |
unsigned prtconndet:1; |
| 537 |
unsigned prtena:1; |
| 538 |
unsigned prtenchng:1; |
| 539 |
unsigned prtovrcurract:1; |
| 540 |
unsigned prtovrcurrchng:1; |
| 541 |
unsigned prtres:1; |
| 542 |
unsigned prtsusp:1; |
| 543 |
unsigned prtrst:1; |
| 544 |
unsigned reserved9:1; |
| 545 |
unsigned prtlnsts:2; |
| 546 |
unsigned prtpwr:1; |
| 547 |
unsigned prttstctl:4; |
| 548 |
unsigned prtspd:2; |
| 549 |
#define PRTSPD_HIGH 0 |
| 550 |
#define PRTSPD_FULL 1 |
| 551 |
#define PRTSPD_LOW 2 |
| 552 |
unsigned reserved19_31:13; |
| 553 |
}; |
| 554 |
} hprt_t; |
| 555 |
|
| 556 |
#define HPRT_W1C_MASK (~((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5))) |
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
typedef union { |
| 563 |
|
| 564 |
uint32_t d32; |
| 565 |
|
| 566 |
|
| 567 |
struct { |
| 568 |
|
| 569 |
unsigned mps:11; |
| 570 |
|
| 571 |
unsigned epnum:4; |
| 572 |
|
| 573 |
unsigned epdir:1; |
| 574 |
unsigned reserved:1; |
| 575 |
|
| 576 |
unsigned lspddev:1; |
| 577 |
|
| 578 |
unsigned eptype:2; |
| 579 |
|
| 580 |
unsigned multicnt:2; |
| 581 |
|
| 582 |
unsigned devaddr:7; |
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
unsigned oddfrm:1; |
| 588 |
|
| 589 |
unsigned chdis:1; |
| 590 |
|
| 591 |
unsigned chen:1; |
| 592 |
}; |
| 593 |
} hcchar_t; |
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
typedef union { |
| 600 |
|
| 601 |
uint32_t d32; |
| 602 |
|
| 603 |
|
| 604 |
struct { |
| 605 |
|
| 606 |
unsigned prtaddr:7; |
| 607 |
|
| 608 |
unsigned hubaddr:7; |
| 609 |
|
| 610 |
unsigned xactpos:2; |
| 611 |
|
| 612 |
unsigned compsplt:1; |
| 613 |
unsigned reserved:14; |
| 614 |
|
| 615 |
unsigned spltena:1; |
| 616 |
}; |
| 617 |
} hcsplit_t; |
| 618 |
|
| 619 |
typedef enum { |
| 620 |
EPDIR_OUT = 0, |
| 621 |
EPDIR_IN, |
| 622 |
} ep_dir_t; |
| 623 |
|
| 624 |
|
| 625 |
|
| 626 |
|
| 627 |
|
| 628 |
typedef union { |
| 629 |
|
| 630 |
uint32_t d32; |
| 631 |
|
| 632 |
struct { |
| 633 |
|
| 634 |
unsigned xfercomp:1; |
| 635 |
|
| 636 |
unsigned chhltd:1; |
| 637 |
|
| 638 |
unsigned ahberr:1; |
| 639 |
|
| 640 |
unsigned stall:1; |
| 641 |
|
| 642 |
unsigned nak:1; |
| 643 |
|
| 644 |
unsigned ack:1; |
| 645 |
|
| 646 |
unsigned nyet:1; |
| 647 |
|
| 648 |
unsigned xacterr:1; |
| 649 |
|
| 650 |
unsigned bblerr:1; |
| 651 |
|
| 652 |
unsigned frmovrun:1; |
| 653 |
|
| 654 |
unsigned datatglerr:1; |
| 655 |
|
| 656 |
unsigned reserved:21; |
| 657 |
}; |
| 658 |
} hcint_t; |
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
typedef union { |
| 665 |
|
| 666 |
uint32_t d32; |
| 667 |
|
| 668 |
|
| 669 |
struct { |
| 670 |
|
| 671 |
unsigned xfersize:19; |
| 672 |
|
| 673 |
unsigned pktcnt:10; |
| 674 |
|
| 675 |
|
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
|
| 680 |
|
| 681 |
unsigned pid:2; |
| 682 |
#define PID_DATA0 0 |
| 683 |
#define PID_DATA1 2 |
| 684 |
#define PID_DATA2 1 |
| 685 |
#define PID_MDATA 3 |
| 686 |
#define PID_SETUP 3 |
| 687 |
|
| 688 |
unsigned dopng:1; |
| 689 |
}; |
| 690 |
} hctsiz_t; |
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
|
| 695 |
|
| 696 |
typedef union { |
| 697 |
|
| 698 |
uint32_t d32; |
| 699 |
|
| 700 |
struct { |
| 701 |
unsigned xfercomp:1; |
| 702 |
unsigned chhltd:1; |
| 703 |
unsigned ahberr:1; |
| 704 |
unsigned stall:1; |
| 705 |
unsigned nak:1; |
| 706 |
unsigned ack:1; |
| 707 |
unsigned nyet:1; |
| 708 |
unsigned xacterr:1; |
| 709 |
unsigned bblerr:1; |
| 710 |
unsigned frmovrun:1; |
| 711 |
unsigned datatglerr:1; |
| 712 |
unsigned reserved:21; |
| 713 |
}; |
| 714 |
} hcintmsk_t; |
| 715 |
|
| 716 |
typedef union { |
| 717 |
|
| 718 |
uint32_t d32; |
| 719 |
|
| 720 |
struct { |
| 721 |
unsigned devspd:2; |
| 722 |
unsigned nzstsouthshk:1; |
| 723 |
unsigned ena32ksusp:1; |
| 724 |
unsigned devaddr:7; |
| 725 |
unsigned perfrint:2; |
| 726 |
unsigned endevoutnak:1; |
| 727 |
unsigned reservedi14_17:4; |
| 728 |
unsigned epmiscnt:5; |
| 729 |
unsigned reserved26_31:9; |
| 730 |
}; |
| 731 |
} dcfg_t; |
| 732 |
|
| 733 |
typedef union { |
| 734 |
|
| 735 |
uint32_t d32; |
| 736 |
|
| 737 |
struct { |
| 738 |
unsigned suspsts:1; |
| 739 |
unsigned enumspd:2; |
| 740 |
unsigned errticerr:1; |
| 741 |
unsigned reserved4_31:28; |
| 742 |
}; |
| 743 |
} dsts_t; |
| 744 |
|
| 745 |
typedef union { |
| 746 |
|
| 747 |
uint32_t d32; |
| 748 |
|
| 749 |
struct { |
| 750 |
unsigned rmtwkupsig:1; |
| 751 |
unsigned sftdiscon:1; |
| 752 |
unsigned gnpinnaksts:1; |
| 753 |
unsigned goutnaksts:1; |
| 754 |
unsigned tstctl:3; |
| 755 |
unsigned sgnpinnak:1; |
| 756 |
unsigned cgnpinnak:1; |
| 757 |
unsigned sgoutnak:1; |
| 758 |
unsigned cgoutnak:1; |
| 759 |
unsigned pwronprgdone:1; |
| 760 |
unsigned reserved12:1; |
| 761 |
unsigned gmc:2; |
| 762 |
unsigned ignrfrmnum:1; |
| 763 |
unsigned nakonbble:1; |
| 764 |
unsigned encontbna:1; |
| 765 |
unsigned reserved19_31:14; |
| 766 |
}; |
| 767 |
} dctl_t; |
| 768 |
|
| 769 |
typedef union { |
| 770 |
|
| 771 |
uint32_t d32; |
| 772 |
|
| 773 |
struct { |
| 774 |
#define D0EPCTL_MPS_SHIFT 0 |
| 775 |
#define D0EPCTL_MPS_64 0 |
| 776 |
#define D0EPCTL_MPS_32 1 |
| 777 |
#define D0EPCTL_MPS_16 2 |
| 778 |
#define D0EPCTL_MPS_8 3 |
| 779 |
unsigned mps:11; |
| 780 |
unsigned nextep:4; |
| 781 |
unsigned usbactep:1; |
| 782 |
unsigned dpid:1; |
| 783 |
unsigned naksts:1; |
| 784 |
unsigned eptype:2; |
| 785 |
unsigned reserved20:1; |
| 786 |
unsigned stall:1; |
| 787 |
unsigned txfnum:4; |
| 788 |
unsigned cnak:1; |
| 789 |
unsigned snak:1; |
| 790 |
unsigned setd0pid:1; |
| 791 |
unsigned setd1pid:1; |
| 792 |
unsigned epdis:1; |
| 793 |
unsigned epena:1; |
| 794 |
}; |
| 795 |
} depctl_t; |
| 796 |
|
| 797 |
typedef union { |
| 798 |
|
| 799 |
uint32_t d32; |
| 800 |
|
| 801 |
struct { |
| 802 |
unsigned xfercompl:1; |
| 803 |
unsigned epdisbld:1; |
| 804 |
unsigned ahberr:1; |
| 805 |
unsigned setup:1; |
| 806 |
unsigned reserved4_14:12; |
| 807 |
unsigned stuppktrcvd:1; |
| 808 |
unsigned reserved16_31:15; |
| 809 |
}; |
| 810 |
} depint_t; |
| 811 |
|
| 812 |
#define DXEPINT_SETUP_RCVD (1 << 15) |
| 813 |
#define DXEPINT_INEPNAKEFF (1 << 6) |
| 814 |
#define DXEPINT_BACK2BACKSETUP (1 << 6) |
| 815 |
#define DXEPINT_INTKNEPMIS (1 << 5) |
| 816 |
#define DXEPINT_INTKNTXFEMP (1 << 4) |
| 817 |
#define DXEPINT_OUTTKNEPDIS (1 << 4) |
| 818 |
#define DXEPINT_TIMEOUT (1 << 3) |
| 819 |
#define DXEPINT_SETUP (1 << 3) |
| 820 |
#define DXEPINT_AHBERR (1 << 2) |
| 821 |
#define DXEPINT_EPDISBLD (1 << 1) |
| 822 |
#define DXEPINT_XFERCOMPL (1 << 0) |
| 823 |
|
| 824 |
typedef union { |
| 825 |
|
| 826 |
uint32_t d32; |
| 827 |
|
| 828 |
struct { |
| 829 |
unsigned xfersize:19; |
| 830 |
unsigned pktcnt:10; |
| 831 |
unsigned mc:2; |
| 832 |
unsigned reserved31:1; |
| 833 |
}; |
| 834 |
} depsiz_t; |
| 835 |
|
| 836 |
#define DAINT_OUTEP_SHIFT MAX_EPS_CHANNELS |
| 837 |
|
| 838 |
#endif |