blob: 0e6453c84778f9227219d6bfda62dc4f36d56f1b [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 Glass6c34fc12019-09-25 08:00:11 -06008#include <asm/fsp1/fsp_support.h>
Bin Meng5dbe3042016-02-17 00:16:21 -08009
10DECLARE_GLOBAL_DATA_PTR;
11
Simon Glass13724142019-09-25 08:11:25 -060012void fsp_update_configs(struct fsp_config_data *config,
Bin Meng5dbe3042016-02-17 00:16:21 -080013 struct fspinit_rtbuf *rt_buf)
14{
15 struct platform_config *plat_config = &config->plat_config;
16 struct memory_config *mem_config = &config->mem_config;
17 const void *blob = gd->fdt_blob;
18 int node;
19
20 node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_IVYBRIDGE_FSP);
21 if (node < 0) {
22 debug("%s: Cannot find FSP node\n", __func__);
23 return;
24 }
25
26 plat_config->enable_ht =
27 fdtdec_get_bool(blob, node, "fsp,enable-ht");
28 plat_config->enable_turbo =
29 fdtdec_get_bool(blob, node, "fsp,enable-turbo");
30 plat_config->enable_memory_down =
31 fdtdec_get_bool(blob, node, "fsp,enable-memory-down");
32 plat_config->enable_fast_boot =
33 fdtdec_get_bool(blob, node, "fsp,enable-fast-boot");
34
35 /* Initialize runtime buffer for fsp_init() */
36 rt_buf->stack_top = config->common.stack_top - 32;
37 rt_buf->boot_mode = config->common.boot_mode;
38 rt_buf->plat_config = plat_config;
39
40 if (plat_config->enable_memory_down)
41 rt_buf->mem_config = mem_config;
42 else
43 rt_buf->mem_config = NULL;
44}