MCPcopy Create free account
hub / github.com/coreboot/coreboot / get_espibar_phys

Function get_espibar_phys

util/inteltool/spi.c:385–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385static int get_espibar_phys(struct pci_dev *sb, struct pci_access *pacc, uint8_t func, uint8_t offset, uint32_t mask, uint32_t *addr) {
386 struct pci_dev *spidev;
387
388 if (!(spidev = pci_get_dev(pacc, sb->domain, sb->bus, sb->dev, func))) {
389 fprintf(stderr, "Error: no spi device 0:31.%x\n", func);
390 return 1;
391 }
392
393 *addr = pci_read_long(spidev, offset) & mask;
394 if (!*addr) {
395 fprintf(stderr, "Error: no valid bar 0 of device 0:31.%x found %x\n", func, *addr);
396 return 1;
397 }
398
399 return 0;
400}
401
402static int print_spibar(struct pci_dev *sb, struct pci_access *pacc) {
403 int i, size = 0, rcba_size = 0x4000;

Callers 1

print_spibarFunction · 0.85

Calls 3

pci_get_devFunction · 0.85
fprintfFunction · 0.85
pci_read_longFunction · 0.85

Tested by

no test coverage detected