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

Function get_rcba_phys

util/intelmetool/src/rcba.c:13–41  ·  view source on GitHub ↗

Returns the physical RCBA base address or zero on error. */

Source from the content-addressed store, hash-verified

11
12/* Returns the physical RCBA base address or zero on error. */
13u32 get_rcba_phys(void)
14{
15 struct pci_access *pacc;
16 struct pci_dev *sb;
17 uint32_t rcba_phys;
18
19 pacc = pci_alloc();
20 pacc->method = PCI_ACCESS_I386_TYPE1;
21
22 pci_init(pacc);
23 pci_scan_bus(pacc);
24
25 sb = pci_get_dev(pacc, 0, 0, 0x1f, 0);
26 if (!sb) {
27 printf("Uh oh, southbridge not on BDF(0:31:0), please report "
28 "this error, exiting.\n");
29 pci_cleanup(pacc);
30 return 0;
31 }
32 pci_fill_info(sb, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_SIZES |
33 PCI_FILL_CLASS);
34
35 rcba_phys = pci_read_long(sb, 0xf0) & 0xfffffffe;
36
37 pci_free_dev(sb);
38 pci_cleanup(pacc);
39
40 return rcba_phys;
41}
42
43/*
44 * Writes 'val' to RCBA register at address 'addr'.

Callers 4

write_rcba32Function · 0.85
read_rcba32Function · 0.85
activate_meFunction · 0.85
rehide_meFunction · 0.85

Calls 8

pci_allocFunction · 0.85
pci_get_devFunction · 0.85
printfFunction · 0.85
pci_cleanupFunction · 0.85
pci_read_longFunction · 0.85
pci_free_devFunction · 0.85
pci_initFunction · 0.50
pci_scan_busFunction · 0.50

Tested by

no test coverage detected