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

Function write_rcba32

util/intelmetool/src/rcba.c:47–67  ·  view source on GitHub ↗

* Writes 'val' to RCBA register at address 'addr'. * Returns 1 on error and 0 on success. */

Source from the content-addressed store, hash-verified

45 * Returns 1 on error and 0 on success.
46 */
47int write_rcba32(uint32_t addr, uint32_t val)
48{
49 volatile uint8_t *rcba;
50 const uint32_t rcba_phys = get_rcba_phys();
51
52 if (!rcba_phys) {
53 printf("Could not get RCBA address\n");
54 return 1;
55 }
56
57 rcba = map_physical((off_t)rcba_phys, size);
58 if (rcba == NULL) {
59 printf("Could not map RCBA\n"
60 "Do you have kernel cmdline argument 'iomem=relaxed' set ?\n");
61 return 1;
62 }
63 *(uint32_t *)(rcba + addr) = val;
64
65 munmap((void *)rcba, size);
66 return 0;
67}
68
69/*
70 * Reads RCBA register at address 'addr' and stores it in 'val'.

Callers 2

activate_meFunction · 0.85
rehide_meFunction · 0.85

Calls 3

get_rcba_physFunction · 0.85
printfFunction · 0.85
map_physicalFunction · 0.70

Tested by

no test coverage detected