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

Function pch_iobp_read

util/inteltool/iobp.c:36–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static u32 pch_iobp_read(volatile uint8_t *rcba, u32 address)
37{
38 u16 status;
39
40 if (!iobp_poll(rcba))
41 return 0;
42
43 /* Set the address */
44 RCBA32(rcba, IOBPIRI) = address;
45
46 /* READ OPCODE */
47 status = RCBA16(rcba, IOBPS);
48 status &= ~IOBPS_MASK;
49 status |= IOBPS_READ;
50 RCBA16(rcba, IOBPS) = status;
51
52 /* Undocumented magic */
53 RCBA16(rcba, IOBPU) = IOBPU_MAGIC;
54
55 /* Set ready bit */
56 status = RCBA16(rcba, IOBPS);
57 status |= IOBPS_READY;
58 RCBA16(rcba, IOBPS) = status;
59
60 if (!iobp_poll(rcba))
61 return 0;
62
63 /* Check for successful transaction */
64 status = RCBA16(rcba, IOBPS);
65 if (status & IOBPS_TX_MASK) {
66 printf("IOBP: read 0x%08x failed\n", address);
67 return 0;
68 }
69
70 /* Read IOBP data */
71 return RCBA32(rcba, IOBPD);
72}
73
74struct iobp_register {
75 u32 addr;

Callers 1

print_iobpFunction · 0.70

Calls 2

printfFunction · 0.85
iobp_pollFunction · 0.70

Tested by

no test coverage detected