Changeset a1732929 in mainline for uspace/drv/bus/usb/ehci/res.c
- Timestamp:
- 2018-01-15T17:04:34Z (7 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.