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

Function dump_amb

util/inteltool/amb.c:337–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335};
336
337static void dump_amb(volatile void *ambconfig, int branch, int channel, int amb)
338{
339 struct amb_register *reg;
340 static int lastreg, lastfn;
341 int bytes;
342
343 volatile void *base = ambconfig + \
344 ((branch << 16) | (channel << 15) | (amb << 11));
345
346 if ((amb_read_config32(base, 0, 0) == 0xffffffff) |
347 (amb_read_config32(base, 0, 0) == 0x00000000))
348 return;
349
350 printf("AMB %d, branch %d, channel %d register dump:\n"
351 "============================================\n",
352 amb, branch, channel);
353
354 for(reg = amb_registers; reg->name; reg++) {
355 if (reg->fn == lastfn && reg->offset > 0 && reg->offset - lastreg) {
356 bytes = reg->offset - lastreg;
357
358 do {
359 if (!(lastreg & 3) && bytes >= 4) {
360 amb_printreg32(base, reg->fn, lastreg, "RESERVED", 0);
361 bytes -= 4;
362 lastreg += 4;
363 } else if (!(lastreg & 1) && bytes >= 2) {
364 amb_printreg16(base, reg->fn, lastreg, "RESERVED", 0);
365 bytes -= 2;
366 lastreg += 2;
367 } else {
368 amb_printreg8(base, reg->fn, lastreg, "RESERVED", 0);
369 bytes -= 1;
370 lastreg += 1;
371 }
372 } while(bytes > 0);
373 }
374
375 switch(reg->width) {
376 case 1:
377 amb_printreg8(base, reg->fn, reg->offset, reg->name, 1);
378 break;
379 case 2:
380 amb_printreg16(base, reg->fn, reg->offset, reg->name, 1);
381 break;
382
383 case 3:
384 amb_printreg24(base, reg->fn, reg->offset, reg->name, 1);
385 break;
386
387 case 4:
388 amb_printreg32(base, reg->fn, reg->offset, reg->name, 1);
389 break;
390
391 default:
392 break;
393 }
394

Callers 1

print_ambsFunction · 0.85

Calls 6

amb_read_config32Function · 0.85
printfFunction · 0.85
amb_printreg32Function · 0.85
amb_printreg16Function · 0.85
amb_printreg8Function · 0.85
amb_printreg24Function · 0.85

Tested by

no test coverage detected