| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <string.h> |
| 5 |
#include <soc/dramc_param.h> |
| 6 |
|
| 7 |
#define print(_x_...) printk(BIOS_INFO, _x_) |
| 8 |
|
| 9 |
struct dramc_param *get_dramc_param_from_blob(void *blob) |
| 10 |
{ |
| 11 |
return (struct dramc_param *)blob; |
| 12 |
} |
| 13 |
|
| 14 |
void dump_param_header(const void *blob) |
| 15 |
{ |
| 16 |
const struct dramc_param *dparam = blob; |
| 17 |
const struct dramc_param_header *header = &dparam->header; |
| 18 |
|
| 19 |
print("header.status = %#x\n", header->status); |
| 20 |
print("header.version = %#x (expected: %#x)\n", |
| 21 |
header->version, DRAMC_PARAM_HEADER_VERSION); |
| 22 |
print("header.size = %#x (expected: %#lx)\n", |
| 23 |
header->size, sizeof(*dparam)); |
| 24 |
print("header.flags = %#x\n", header->flags); |
| 25 |
} |
| 26 |
|
| 27 |
int initialize_dramc_param(void *blob) |
| 28 |
{ |
| 29 |
struct dramc_param *param = blob; |
| 30 |
struct dramc_param_header *hdr = ¶m->header; |
| 31 |
|
| 32 |
memset(hdr, 0, sizeof(*hdr)); |
| 33 |
hdr->version = DRAMC_PARAM_HEADER_VERSION; |
| 34 |
hdr->size = sizeof(*param); |
| 35 |
return 0; |
| 36 |
} |