blob: 41d7d2a2b420bb3aa8192a24e422c1e74958e08b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Bin Meng5dbe3042016-02-17 00:16:21 -08002/*
3 * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
Bin Meng5dbe3042016-02-17 00:16:21 -08004 */
5
6#include <common.h>
7#include <fdtdec.h>
Simon Glass0f2af882020-05-10 11:40:05 -06008#include <log.h>
Simon Glass6c34fc12019-09-25 08:00:11 -06009#include <asm/fsp1/fsp_support.h>
Bin Meng5dbe3042016-02-17 00:16:21 -080010
11DECLARE_GLOBAL_DATA_PTR;
12
Simon Glass13724142019-09-25 08:11:25 -060013void fsp_update_configs(struct fsp_config_data *config,
Bin Meng5dbe3042016-02-17 00:16:21 -080014 struct fspinit_rtbuf *rt_buf)
15{
16 struct platform_config *plat_config = &config->plat_config;
17 struct memory_config *mem_config = &config->mem_config;
18 const void *blob = gd->fdt_blob;
19 int node;
20
21 node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_IVYBRIDGE_FSP);
22 if (node < 0) {
23 debug("%s: Cannot find FSP node\n", __func__);
24 return;
25 }
26
27 plat_config->enable_ht =
28 fdtdec_get_bool(blob, node, "fsp,enable-ht");
29 plat_config->enable_turbo =
30 fdtdec_get_bool(blob, node, "fsp,enable-turbo");
31 plat_config->enable_memory_down =
32 fdtdec_get_bool(blob, node, "fsp,enable-memory-down");
33 plat_config->enable_fast_boot =
34 fdtdec_get_bool(blob, node, "fsp,enable-fast-boot");
35
36 /* Initialize runtime buffer for fsp_init() */
37 rt_buf->stack_top = config->common.stack_top - 32;
38 rt_buf->boot_mode = config->common.boot_mode;
39 rt_buf->plat_config = plat_config;
40
41 if (plat_config->enable_memory_down)
42 rt_buf->mem_config = mem_config;
43 else
44 rt_buf->mem_config = NULL;
45}