Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Bin Meng | 5dbe304 | 2016-02-17 00:16:21 -0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com> |
Bin Meng | 5dbe304 | 2016-02-17 00:16:21 -0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <fdtdec.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 8 | #include <log.h> |
Simon Glass | 6c34fc1 | 2019-09-25 08:00:11 -0600 | [diff] [blame] | 9 | #include <asm/fsp1/fsp_support.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 10 | #include <asm/global_data.h> |
Bin Meng | 5dbe304 | 2016-02-17 00:16:21 -0800 | [diff] [blame] | 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
Simon Glass | 1372414 | 2019-09-25 08:11:25 -0600 | [diff] [blame] | 14 | void fsp_update_configs(struct fsp_config_data *config, |
Bin Meng | 5dbe304 | 2016-02-17 00:16:21 -0800 | [diff] [blame] | 15 | struct fspinit_rtbuf *rt_buf) |
| 16 | { |
| 17 | struct platform_config *plat_config = &config->plat_config; |
| 18 | struct memory_config *mem_config = &config->mem_config; |
| 19 | const void *blob = gd->fdt_blob; |
| 20 | int node; |
| 21 | |
| 22 | node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_IVYBRIDGE_FSP); |
| 23 | if (node < 0) { |
| 24 | debug("%s: Cannot find FSP node\n", __func__); |
| 25 | return; |
| 26 | } |
| 27 | |
| 28 | plat_config->enable_ht = |
| 29 | fdtdec_get_bool(blob, node, "fsp,enable-ht"); |
| 30 | plat_config->enable_turbo = |
| 31 | fdtdec_get_bool(blob, node, "fsp,enable-turbo"); |
| 32 | plat_config->enable_memory_down = |
| 33 | fdtdec_get_bool(blob, node, "fsp,enable-memory-down"); |
| 34 | plat_config->enable_fast_boot = |
| 35 | fdtdec_get_bool(blob, node, "fsp,enable-fast-boot"); |
| 36 | |
| 37 | /* Initialize runtime buffer for fsp_init() */ |
| 38 | rt_buf->stack_top = config->common.stack_top - 32; |
| 39 | rt_buf->boot_mode = config->common.boot_mode; |
| 40 | rt_buf->plat_config = plat_config; |
| 41 | |
| 42 | if (plat_config->enable_memory_down) |
| 43 | rt_buf->mem_config = mem_config; |
| 44 | else |
| 45 | rt_buf->mem_config = NULL; |
| 46 | } |