Changeset 7c3fb9b in mainline for uspace/drv/bus/usb/uhci
- Timestamp:
- 2018-05-17T08:29:01Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- Location:
- uspace/drv/bus/usb/uhci
- Files:
-
- 6 edited
-
hw_struct/queue_head.h (modified) (2 diffs)
-
hw_struct/transfer_descriptor.c (modified) (2 diffs)
-
hw_struct/transfer_descriptor.h (modified) (1 diff)
-
main.c (modified) (1 diff)
-
uhci_batch.c (modified) (1 diff)
-
uhci_rh.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hw_struct/queue_head.h
rfac0ac7 r7c3fb9b 78 78 static inline void qh_set_next_qh(qh_t *instance, qh_t *next) 79 79 { 80 /* Physical address has to be below 4GB, 80 /* 81 * Physical address has to be below 4GB, 81 82 * it is an UHCI limitation and malloc32 82 * should guarantee this */ 83 * should guarantee this 84 */ 83 85 const uint32_t pa = addr_to_phys(next); 84 86 if (pa) { … … 98 100 static inline void qh_set_element_td(qh_t *instance, td_t *td) 99 101 { 100 /* Physical address has to be below 4GB, 102 /* 103 * Physical address has to be below 4GB, 101 104 * it is an UHCI limitation and malloc32 102 * should guarantee this */ 105 * should guarantee this 106 */ 103 107 const uint32_t pa = addr_to_phys(td); 104 108 if (pa) { -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c
rfac0ac7 r7c3fb9b 127 127 return EIO; 128 128 129 /* CRC or timeout error, like device not present or bad data, 130 * it won't be reported unless err count reached zero */ 129 /* 130 * CRC or timeout error, like device not present or bad data, 131 * it won't be reported unless err count reached zero 132 */ 131 133 if ((instance->status & TD_STATUS_ERROR_CRC) != 0) 132 134 return EBADCHECKSUM; … … 144 146 return EIO; 145 147 146 /* Stall might represent err count reaching zero or stall response from 147 * the device. If err count reached zero, one of the above is reported*/ 148 /* 149 * Stall might represent err count reaching zero or stall response from 150 * the device. If err count reached zero, one of the above is reported 151 */ 148 152 if ((instance->status & TD_STATUS_ERROR_STALLED) != 0) 149 153 return ESTALL; -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h
rfac0ac7 r7c3fb9b 90 90 volatile uint32_t buffer_ptr; 91 91 92 /* According to UHCI design guide, there is 16 bytes of 92 /* 93 * According to UHCI design guide, there is 16 bytes of 93 94 * data available here. 94 95 * According to Linux kernel the hardware does not care, -
uspace/drv/bus/usb/uhci/main.c
rfac0ac7 r7c3fb9b 76 76 return ENOMEM; 77 77 78 /* See UHCI design guide page 45 for these values. 79 * Write all WC bits in USB legacy register */ 78 /* 79 * See UHCI design guide page 45 for these values. 80 * Write all WC bits in USB legacy register 81 */ 80 82 return pci_config_space_write_16(parent_sess, 0xc0, 0xaf00); 81 83 } -
uspace/drv/bus/usb/uhci/uhci_batch.c
rfac0ac7 r7c3fb9b 87 87 } 88 88 89 /* Prepares batch for commiting. 89 /* 90 * Prepares batch for committing. 90 91 * 91 92 * Determines the number of needed transfer descriptors (TDs). -
uspace/drv/bus/usb/uhci/uhci_rh.c
rfac0ac7 r7c3fb9b 153 153 while ((port_status = pio_read_16(port)) & STATUS_IN_RESET) 154 154 ; 155 /* PIO delay, should not be longer than 3ms as the device might 156 * enter suspend state. */ 155 /* 156 * PIO delay, should not be longer than 3ms as the device might 157 * enter suspend state. 158 */ 157 159 udelay(10); 158 /* Drop ConnectionChange as some UHCI hw 159 * sets this bit after reset, that is incorrect */ 160 /* 161 * Drop ConnectionChange as some UHCI hw 162 * sets this bit after reset, that is incorrect 163 */ 160 164 port_status &= ~STATUS_WC_BITS; 161 165 pio_write_16(port, port_status | STATUS_ENABLED | STATUS_CONNECTED_CHANGED); … … 376 380 RH_DEBUG(hub, port, "Set port change flag (status %" PRIx16 377 381 ")", status); 378 /* These are voluntary and don't have to be set 379 * there is no way we could do it on UHCI anyway */ 382 /* 383 * These are voluntary and don't have to be set 384 * there is no way we could do it on UHCI anyway 385 */ 380 386 break; 381 387 default: … … 459 465 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE), 460 466 .name = "ClearHubFeature", 461 /* Hub features are overcurrent and supply good, 462 * this request may only clear changes that we never report*/ 467 /* 468 * Hub features are overcurrent and supply good, 469 * this request may only clear changes that we never report 470 */ 463 471 .callback = req_nop, 464 472 }, … … 471 479 CLASS_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_HUB_REQUEST_GET_STATUS), 472 480 .name = "GetHubStatus", 473 /* UHCI can't report OC condition or, 474 * lose power source */ 481 /* 482 * UHCI can't report OC condition or, 483 * lose power source 484 */ 475 485 .callback = virthub_base_get_null_status, 476 486 }, … … 483 493 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_DEVICE, USB_HUB_REQUEST_SET_FEATURE), 484 494 .name = "SetHubFeature", 485 /* Hub features are overcurrent and supply good, 486 * this request may only set changes that we never report*/ 495 /* 496 * Hub features are overcurrent and supply good, 497 * this request may only set changes that we never report 498 */ 487 499 .callback = req_nop, 488 500 },
Note:
See TracChangeset
for help on using the changeset viewer.
