blob: 2fd06b3bed76dacce498cc2a6585af8cbd4d6b66 [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>
8#include <asm/fsp/fsp_support.h>
9
10DECLARE_GLOBAL_DATA_PTR;
11
12void update_fsp_configs(struct fsp_config_data *config,
13 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}