| 1 |
|
| 2 |
|
| 3 |
#ifndef AMD_BLOCK_AGESAWRAPPER_CALL_H |
| 4 |
#define AMD_BLOCK_AGESAWRAPPER_CALL_H |
| 5 |
|
| 6 |
#include <amdblocks/agesawrapper.h> |
| 7 |
#include <stdint.h> |
| 8 |
#include <console/console.h> |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
static const char *decodeAGESA_STATUS(AGESA_STATUS sret) |
| 23 |
{ |
| 24 |
const char *statusStrings[] = { "AGESA_SUCCESS", "AGESA_UNSUPPORTED", |
| 25 |
"AGESA_BOUNDS_CHK", "AGESA_ALERT", |
| 26 |
"AGESA_WARNING", "AGESA_ERROR", |
| 27 |
"AGESA_CRITICAL", "AGESA_FATAL" |
| 28 |
}; |
| 29 |
if (sret >= ARRAY_SIZE(statusStrings)) |
| 30 |
return "unknown"; |
| 31 |
return statusStrings[sret]; |
| 32 |
} |
| 33 |
|
| 34 |
static inline u32 do_agesawrapper(AGESA_STRUCT_NAME func, const char *name) |
| 35 |
{ |
| 36 |
AGESA_STATUS ret; |
| 37 |
printk(BIOS_DEBUG, "agesawrapper_%s() entry\n", name); |
| 38 |
ret = agesa_execute_state(func); |
| 39 |
printk(BIOS_DEBUG, "agesawrapper_%s() returned %s\n", |
| 40 |
name, decodeAGESA_STATUS(ret)); |
| 41 |
return (u32)ret; |
| 42 |
} |
| 43 |
|
| 44 |
#endif |