MCPcopy Create free account
hub / github.com/F-Stack/f-stack / octopci_write_config

Function octopci_write_config

freebsd/mips/cavium/octopci.c:379–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379static void
380octopci_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
421static int
422octopci_route_interrupt(device_t dev, device_t child, int pin)

Callers 3

octopci_attachFunction · 0.85
octopci_init_barFunction · 0.85
octopci_init_deviceFunction · 0.85

Calls 6

device_get_softcFunction · 0.85
octeon_has_featureFunction · 0.85
cvmx_pcie_config_write32Function · 0.85
cvmx_pcie_config_write16Function · 0.85
cvmx_pcie_config_write8Function · 0.85
octopci_cs_addrFunction · 0.85

Tested by

no test coverage detected