Changeset a1732929 in mainline for uspace/drv/bus/usb/ehci
- Timestamp:
- 2018-01-15T17:04:34Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ff99e8
- Parents:
- c1a966e
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:32)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:34)
- Location:
- uspace/drv/bus/usb/ehci
- Files:
-
- 5 edited
-
ehci_batch.c (modified) (2 diffs)
-
ehci_rh.c (modified) (1 diff)
-
endpoint_list.c (modified) (4 diffs)
-
hc.c (modified) (5 diffs)
-
res.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_batch.c
rc1a966e ra1732929 143 143 batch_setup[ehci_batch->base.ep->transfer_type](ehci_batch); 144 144 145 usb_log_debug("Batch %p %s " USB_TRANSFER_BATCH_FMT " initialized. \n",145 usb_log_debug("Batch %p %s " USB_TRANSFER_BATCH_FMT " initialized.", 146 146 ehci_batch, usb_str_direction(ehci_batch->base.dir), 147 147 USB_TRANSFER_BATCH_ARGS(ehci_batch->base)); … … 163 163 assert(ehci_batch); 164 164 165 usb_log_debug("Batch %p: checking %zu td(s) for completion. \n",165 usb_log_debug("Batch %p: checking %zu td(s) for completion.", 166 166 ehci_batch, ehci_batch->td_count); 167 167 168 usb_log_debug2("Batch %p: QH: %08x:%08x:%08x:%08x:%08x:%08x. \n",168 usb_log_debug2("Batch %p: QH: %08x:%08x:%08x:%08x:%08x:%08x.", 169 169 ehci_batch, 170 170 ehci_batch->qh->ep_char, ehci_batch->qh->ep_cap, -
uspace/drv/bus/usb/ehci/ehci_rh.c
rc1a966e ra1732929 107 107 (EHCI_RD(caps->hcsparams) >> EHCI_CAPS_HCS_N_PORTS_SHIFT) & 108 108 EHCI_CAPS_HCS_N_PORTS_MASK; 109 usb_log_debug2("RH(%p): hcsparams: %x. \n", instance,109 usb_log_debug2("RH(%p): hcsparams: %x.", instance, 110 110 EHCI_RD(caps->hcsparams)); 111 usb_log_info("RH(%p): Found %u ports. \n", instance,111 usb_log_info("RH(%p): Found %u ports.", instance, 112 112 instance->port_count); 113 113 -
uspace/drv/bus/usb/ehci/endpoint_list.c
rc1a966e ra1732929 97 97 assert(ep); 98 98 assert(ep->qh); 99 usb_log_debug2("EPL(%p-%s): Append endpoint(%p). \n",99 usb_log_debug2("EPL(%p-%s): Append endpoint(%p).", 100 100 instance, instance->name, ep); 101 101 … … 128 128 ehci_endpoint_t *first = ehci_endpoint_list_instance( 129 129 list_first(&instance->endpoint_list)); 130 usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p). \n",130 usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p).", 131 131 instance, instance->name, ep, first, first->qh); 132 132 if (last_qh == instance->list_head) { 133 usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x. \n",133 usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x.", 134 134 instance, instance->name, last_qh, 135 135 addr_to_phys(instance->list_head), … … 153 153 fibril_mutex_lock(&instance->guard); 154 154 155 usb_log_debug2("EPL(%p-%s): removing EP(%p). \n",155 usb_log_debug2("EPL(%p-%s): removing EP(%p).", 156 156 instance, instance->name, ep); 157 157 … … 172 172 write_barrier(); 173 173 174 usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x. \n",174 usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x.", 175 175 instance, instance->name, ep, qpos, ep->qh->horizontal); 176 176 -
uspace/drv/bus/usb/ehci/hc.c
rc1a966e ra1732929 134 134 EHCI_WR(code->cmds[1].value, EHCI_USED_INTERRUPTS); 135 135 136 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d. \n",136 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.", 137 137 RNGABSPTR(regs), RNGSZ(regs), hw_res->irqs.irqs[0]); 138 138 … … 160 160 if (ret != EOK) { 161 161 usb_log_error("HC(%p): Failed to gain access to device " 162 "registers: %s. \n", instance, str_error(ret));162 "registers: %s.", instance, str_error(ret)); 163 163 return ret; 164 164 } … … 211 211 assert(ep); 212 212 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 213 usb_log_debug("HC(%p) enqueue EP(%d:%d:%s:%s) \n", instance,213 usb_log_debug("HC(%p) enqueue EP(%d:%d:%s:%s)", instance, 214 214 ep->device->address, ep->endpoint, 215 215 usb_str_transfer_type_short(ep->transfer_type), … … 235 235 assert(ep); 236 236 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 237 usb_log_debug("HC(%p) dequeue EP(?:%d:%s:%s) \n", instance,237 usb_log_debug("HC(%p) dequeue EP(?:%d:%s:%s)", instance, 238 238 ep->endpoint, 239 239 usb_str_transfer_type_short(ep->transfer_type), … … 423 423 usb_log_debug("HC(%p): HW started.", instance); 424 424 425 usb_log_debug2("HC(%p): Registers: \n"426 "\tUSBCMD(%p): %x(0x00080000 = at least 1ms between interrupts) \n"427 "\tUSBSTS(%p): %x(0x00001000 = HC halted) \n"428 "\tUSBINT(%p): %x(0x0 = no interrupts). \n"429 "\tCONFIG(%p): %x(0x0 = ports controlled by companion hc). \n",425 usb_log_debug2("HC(%p): Registers: " 426 "\tUSBCMD(%p): %x(0x00080000 = at least 1ms between interrupts)" 427 "\tUSBSTS(%p): %x(0x00001000 = HC halted)" 428 "\tUSBINT(%p): %x(0x0 = no interrupts)." 429 "\tCONFIG(%p): %x(0x0 = ports controlled by companion hc).", 430 430 instance, 431 431 &instance->registers->usbcmd, EHCI_RD(instance->registers->usbcmd), -
uspace/drv/bus/usb/ehci/res.c
rc1a966e ra1732929 74 74 eecp + USBLEGSUP_OFFSET, &usblegsup); 75 75 if (ret != EOK) { 76 usb_log_error("Failed to read USBLEGSUP: %s. \n", str_error(ret));77 return ret; 78 } 79 usb_log_debug2("USBLEGSUP: %" PRIx32 ". \n", usblegsup);76 usb_log_error("Failed to read USBLEGSUP: %s.", str_error(ret)); 77 return ret; 78 } 79 usb_log_debug2("USBLEGSUP: %" PRIx32 ".", usblegsup); 80 80 81 81 /* Request control from firmware/BIOS by writing 1 to highest 82 82 * byte. (OS Control semaphore)*/ 83 usb_log_debug("Requesting OS control. \n");83 usb_log_debug("Requesting OS control."); 84 84 ret = pci_config_space_write_8(parent_sess, 85 85 eecp + USBLEGSUP_OFFSET + 3, 1); 86 86 if (ret != EOK) { 87 usb_log_error("Failed to request OS EHCI control: %s. \n",87 usb_log_error("Failed to request OS EHCI control: %s.", 88 88 str_error(ret)); 89 89 return ret; … … 103 103 104 104 if ((usblegsup & USBLEGSUP_BIOS_CONTROL) == 0) { 105 usb_log_info("BIOS released control after %zu usec. \n", wait);105 usb_log_info("BIOS released control after %zu usec.", wait); 106 106 return EOK; 107 107 } … … 109 109 /* BIOS failed to hand over control, this should not happen. */ 110 110 usb_log_warning( "BIOS failed to release control after " 111 "%zu usecs, force it. \n", wait);111 "%zu usecs, force it.", wait); 112 112 ret = pci_config_space_write_32(parent_sess, 113 113 eecp + USBLEGSUP_OFFSET, USBLEGSUP_OS_CONTROL); 114 114 if (ret != EOK) { 115 usb_log_error("Failed to force OS control: %s. \n",115 usb_log_error("Failed to force OS control: %s.", 116 116 str_error(ret)); 117 117 return ret; … … 130 130 eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts); 131 131 if (ret != EOK) { 132 usb_log_error("Failed to get USBLEGCTLSTS: %s. \n",132 usb_log_error("Failed to get USBLEGCTLSTS: %s.", 133 133 str_error(ret)); 134 134 return ret; 135 135 } 136 usb_log_debug2("USBLEGCTLSTS: %" PRIx32 ". \n", usblegctlsts);136 usb_log_debug2("USBLEGCTLSTS: %" PRIx32 ".", usblegctlsts); 137 137 /* 138 138 * Zero SMI enables in legacy control register. … … 143 143 eecp + USBLEGCTLSTS_OFFSET, 0xe0000000); 144 144 if (ret != EOK) { 145 usb_log_error("Failed to zero USBLEGCTLSTS: %s \n",145 usb_log_error("Failed to zero USBLEGCTLSTS: %s", 146 146 str_error(ret)); 147 147 return ret; … … 153 153 eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts); 154 154 if (ret != EOK) { 155 usb_log_error("Failed to get USBLEGCTLSTS 2: %s. \n",155 usb_log_error("Failed to get USBLEGCTLSTS 2: %s.", 156 156 str_error(ret)); 157 157 return ret; 158 158 } 159 usb_log_debug2("Zeroed USBLEGCTLSTS: %" PRIx32 ". \n",159 usb_log_debug2("Zeroed USBLEGCTLSTS: %" PRIx32 ".", 160 160 usblegctlsts); 161 161 } … … 165 165 eecp + USBLEGSUP_OFFSET, &usblegsup); 166 166 if (ret != EOK) { 167 usb_log_error("Failed to read USBLEGSUP: %s. \n",168 str_error(ret)); 169 return ret; 170 } 171 usb_log_debug2("USBLEGSUP: %" PRIx32 ". \n", usblegsup);167 usb_log_error("Failed to read USBLEGSUP: %s.", 168 str_error(ret)); 169 return ret; 170 } 171 usb_log_debug2("USBLEGSUP: %" PRIx32 ".", usblegsup); 172 172 return ret; 173 173 } … … 181 181 return ENOMEM; 182 182 183 usb_log_debug("Disabling EHCI legacy support. \n");183 usb_log_debug("Disabling EHCI legacy support."); 184 184 185 185 186 186 const uint32_t hcc_params = EHCI_RD(hc->caps->hccparams); 187 usb_log_debug2("Value of hcc params register: %x. \n", hcc_params);187 usb_log_debug2("Value of hcc params register: %x.", hcc_params); 188 188 189 189 /* Read value of EHCI Extended Capabilities Pointer … … 191 191 const uint32_t eecp = 192 192 (hcc_params >> EHCI_CAPS_HCC_EECP_SHIFT) & EHCI_CAPS_HCC_EECP_MASK; 193 usb_log_debug2("Value of EECP: %x. \n", eecp);193 usb_log_debug2("Value of EECP: %x.", eecp); 194 194 195 195 int ret = disable_extended_caps(parent_sess, eecp); 196 196 if (ret != EOK) { 197 usb_log_error("Failed to disable extended capabilities: %s. \n",197 usb_log_error("Failed to disable extended capabilities: %s.", 198 198 str_error(ret)); 199 199 goto clean;
Note:
See TracChangeset
for help on using the changeset viewer.
