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

Function recv_ec_data

util/ectool/ec.c:81–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81uint8_t recv_ec_data(void)
82{
83 int timeout;
84 uint8_t data;
85
86 timeout = 0x7fff;
87 while (--timeout) { // Wait for OBF = 1
88 if (inb(ec_sc) & EC_OBF)
89 break;
90
91 usleep(10);
92 if ((timeout & 0xff) == 0)
93 debug(".");
94 }
95 if (!timeout) {
96 debug("\nTimeout while receiving data from EC!\n");
97 // return -1;
98 }
99
100 data = inb(ec_data);
101 debug("recv_ec_data: 0x%02x\n", data);
102
103 return data;
104}
105
106uint8_t ec_read(uint8_t addr)
107{

Callers 3

ec_readFunction · 0.70
ec_ext_readFunction · 0.70
ec_queryFunction · 0.70

Calls 1

inbFunction · 0.70

Tested by

no test coverage detected