71c5ca764f
Use the MRC cache API for asurada, and sync dramc_param.h with dram blob (CL:*3674585). With this change, the checksum, originally stored in flash, is replaced with a hash in TPM. In addition, in recovery boot, full calibration will always ne performed, and the cached calibration data will be cleared from flash. This change increases ROMSTAGE size from 236K to 264K. Most of the increase is caused by TPM-related functions. Add new API mtk_dram_init() to emi.h, so that 'dramc_parameter' can be moved to soc folder. With this CL, there is no significant change in boot time. Normal AP reboot time (fast calibration) is consistently 0.98s as before, so this change should not affect the result of platform_BootPerf. BUG=b:170687062 TEST=emerge-asurada coreboot TEST=Hayato boots with both full and fast calibration BRANCH=none Cq-Depend: chrome-internal:3674585, chrome-internal:3704751 Change-Id: Ief942048ce530433a57e8205d3a68ad56235b427 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51620 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
36 lines
946 B
C
36 lines
946 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <console/console.h>
|
|
#include <string.h>
|
|
#include <soc/dramc_param.h>
|
|
|
|
#define print(_x_...) printk(BIOS_INFO, _x_)
|
|
|
|
struct dramc_param *get_dramc_param_from_blob(void *blob)
|
|
{
|
|
return (struct dramc_param *)blob;
|
|
}
|
|
|
|
void dump_param_header(const void *blob)
|
|
{
|
|
const struct dramc_param *dparam = blob;
|
|
const struct dramc_param_header *header = &dparam->header;
|
|
|
|
print("header.status = %#x\n", header->status);
|
|
print("header.version = %#x (expected: %#x)\n",
|
|
header->version, DRAMC_PARAM_HEADER_VERSION);
|
|
print("header.size = %#x (expected: %#lx)\n",
|
|
header->size, sizeof(*dparam));
|
|
print("header.flags = %#x\n", header->flags);
|
|
}
|
|
|
|
int initialize_dramc_param(void *blob)
|
|
{
|
|
struct dramc_param *param = blob;
|
|
struct dramc_param_header *hdr = ¶m->header;
|
|
|
|
memset(hdr, 0, sizeof(*hdr));
|
|
hdr->version = DRAMC_PARAM_HEADER_VERSION;
|
|
hdr->size = sizeof(*param);
|
|
return 0;
|
|
}
|