mb/google/fatcat: Move CSE sync at payload
[coreboot.git] / src / soc / mediatek / common / dramc_param.c
blobc596adb20805fab8d6aef5adbebda3817c58db7f
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <string.h>
5 #include <soc/dramc_param.h>
7 #define print(_x_...) printk(BIOS_INFO, _x_)
9 struct dramc_param *get_dramc_param_from_blob(void *blob)
11 return (struct dramc_param *)blob;
14 void dump_param_header(const void *blob)
16 const struct dramc_param *dparam = blob;
17 const struct dramc_param_header *header = &dparam->header;
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);
27 int initialize_dramc_param(void *blob)
29 struct dramc_param *param = blob;
30 struct dramc_param_header *hdr = &param->header;
32 memset(hdr, 0, sizeof(*hdr));
33 hdr->version = DRAMC_PARAM_HEADER_VERSION;
34 hdr->size = sizeof(*param);
35 return 0;