| 377 | } |
| 378 | |
| 379 | static void |
| 380 | octopci_write_config(device_t dev, u_int bus, u_int slot, u_int func, |
| 381 | u_int reg, uint32_t data, int bytes) |
| 382 | { |
| 383 | struct octopci_softc *sc; |
| 384 | uint64_t addr; |
| 385 | |
| 386 | sc = device_get_softc(dev); |
| 387 | |
| 388 | if (octeon_has_feature(OCTEON_FEATURE_PCIE)) { |
| 389 | switch (bytes) { |
| 390 | case 4: |
| 391 | cvmx_pcie_config_write32(sc->sc_domain, bus, slot, func, reg, data); |
| 392 | return; |
| 393 | case 2: |
| 394 | cvmx_pcie_config_write16(sc->sc_domain, bus, slot, func, reg, data); |
| 395 | return; |
| 396 | case 1: |
| 397 | cvmx_pcie_config_write8(sc->sc_domain, bus, slot, func, reg, data); |
| 398 | return; |
| 399 | default: |
| 400 | return; |
| 401 | } |
| 402 | } |
| 403 | |
| 404 | addr = octopci_cs_addr(bus, slot, func, reg); |
| 405 | |
| 406 | switch (bytes) { |
| 407 | case 4: |
| 408 | cvmx_write64_uint32(addr, htole32(data)); |
| 409 | return; |
| 410 | case 2: |
| 411 | cvmx_write64_uint16(addr, htole16(data)); |
| 412 | return; |
| 413 | case 1: |
| 414 | cvmx_write64_uint8(addr, data); |
| 415 | return; |
| 416 | default: |
| 417 | return; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | static int |
| 422 | octopci_route_interrupt(device_t dev, device_t child, int pin) |
no test coverage detected