.. | .. |
---|
2236 | 2236 | { |
---|
2237 | 2237 | u32 temp, port_offset, port_count; |
---|
2238 | 2238 | int i; |
---|
2239 | | - u8 major_revision, minor_revision; |
---|
| 2239 | + u8 major_revision, minor_revision, tmp_minor_revision; |
---|
2240 | 2240 | struct xhci_hub *rhub; |
---|
2241 | 2241 | struct device *dev = xhci_to_hcd(xhci)->self.sysdev; |
---|
2242 | 2242 | struct xhci_port_cap *port_cap; |
---|
.. | .. |
---|
2256 | 2256 | */ |
---|
2257 | 2257 | if (minor_revision > 0x00 && minor_revision < 0x10) |
---|
2258 | 2258 | minor_revision <<= 4; |
---|
| 2259 | + /* |
---|
| 2260 | + * Some zhaoxin's xHCI controller that follow usb3.1 spec |
---|
| 2261 | + * but only support Gen1. |
---|
| 2262 | + */ |
---|
| 2263 | + if (xhci->quirks & XHCI_ZHAOXIN_HOST) { |
---|
| 2264 | + tmp_minor_revision = minor_revision; |
---|
| 2265 | + minor_revision = 0; |
---|
| 2266 | + } |
---|
| 2267 | + |
---|
2259 | 2268 | } else if (major_revision <= 0x02) { |
---|
2260 | 2269 | rhub = &xhci->usb2_rhub; |
---|
2261 | 2270 | } else { |
---|
.. | .. |
---|
2265 | 2274 | /* Ignoring port protocol we can't understand. FIXME */ |
---|
2266 | 2275 | return; |
---|
2267 | 2276 | } |
---|
2268 | | - rhub->maj_rev = XHCI_EXT_PORT_MAJOR(temp); |
---|
2269 | | - |
---|
2270 | | - if (rhub->min_rev < minor_revision) |
---|
2271 | | - rhub->min_rev = minor_revision; |
---|
2272 | 2277 | |
---|
2273 | 2278 | /* Port offset and count in the third dword, see section 7.2 */ |
---|
2274 | 2279 | temp = readl(addr + 2); |
---|
.. | .. |
---|
2287 | 2292 | if (xhci->num_port_caps > max_caps) |
---|
2288 | 2293 | return; |
---|
2289 | 2294 | |
---|
2290 | | - port_cap->maj_rev = major_revision; |
---|
2291 | | - port_cap->min_rev = minor_revision; |
---|
2292 | 2295 | port_cap->psi_count = XHCI_EXT_PORT_PSIC(temp); |
---|
2293 | 2296 | |
---|
2294 | 2297 | if (port_cap->psi_count) { |
---|
.. | .. |
---|
2309 | 2312 | XHCI_EXT_PORT_PSIV(port_cap->psi[i - 1]))) |
---|
2310 | 2313 | port_cap->psi_uid_count++; |
---|
2311 | 2314 | |
---|
| 2315 | + if (xhci->quirks & XHCI_ZHAOXIN_HOST && |
---|
| 2316 | + major_revision == 0x03 && |
---|
| 2317 | + XHCI_EXT_PORT_PSIV(port_cap->psi[i]) >= 5) |
---|
| 2318 | + minor_revision = tmp_minor_revision; |
---|
| 2319 | + |
---|
2312 | 2320 | xhci_dbg(xhci, "PSIV:%d PSIE:%d PLT:%d PFD:%d LP:%d PSIM:%d\n", |
---|
2313 | 2321 | XHCI_EXT_PORT_PSIV(port_cap->psi[i]), |
---|
2314 | 2322 | XHCI_EXT_PORT_PSIE(port_cap->psi[i]), |
---|
.. | .. |
---|
2318 | 2326 | XHCI_EXT_PORT_PSIM(port_cap->psi[i])); |
---|
2319 | 2327 | } |
---|
2320 | 2328 | } |
---|
| 2329 | + |
---|
| 2330 | + rhub->maj_rev = major_revision; |
---|
| 2331 | + |
---|
| 2332 | + if (rhub->min_rev < minor_revision) |
---|
| 2333 | + rhub->min_rev = minor_revision; |
---|
| 2334 | + |
---|
| 2335 | + port_cap->maj_rev = major_revision; |
---|
| 2336 | + port_cap->min_rev = minor_revision; |
---|
| 2337 | + |
---|
2321 | 2338 | /* cache usb2 port capabilities */ |
---|
2322 | 2339 | if (major_revision < 0x03 && xhci->num_ext_caps < max_caps) |
---|
2323 | 2340 | xhci->ext_caps[xhci->num_ext_caps++] = temp; |
---|
.. | .. |
---|
2568 | 2585 | * and our use of dma addresses in the trb_address_map radix tree needs |
---|
2569 | 2586 | * TRB_SEGMENT_SIZE alignment, so we pick the greater alignment need. |
---|
2570 | 2587 | */ |
---|
2571 | | - xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, |
---|
2572 | | - TRB_SEGMENT_SIZE, TRB_SEGMENT_SIZE, xhci->page_size); |
---|
| 2588 | + if (xhci->quirks & XHCI_ZHAOXIN_TRB_FETCH) |
---|
| 2589 | + xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, |
---|
| 2590 | + TRB_SEGMENT_SIZE * 2, TRB_SEGMENT_SIZE * 2, xhci->page_size * 2); |
---|
| 2591 | + else |
---|
| 2592 | + xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, |
---|
| 2593 | + TRB_SEGMENT_SIZE, TRB_SEGMENT_SIZE, xhci->page_size); |
---|
2573 | 2594 | |
---|
2574 | 2595 | /* See Table 46 and Note on Figure 55 */ |
---|
2575 | 2596 | xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, |
---|