fsp_configs.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
  4. */
  5. #include <common.h>
  6. #include <fdtdec.h>
  7. #include <asm/fsp/fsp_support.h>
  8. DECLARE_GLOBAL_DATA_PTR;
  9. void update_fsp_configs(struct fsp_config_data *config,
  10. struct fspinit_rtbuf *rt_buf)
  11. {
  12. struct platform_config *plat_config = &config->plat_config;
  13. struct memory_config *mem_config = &config->mem_config;
  14. const void *blob = gd->fdt_blob;
  15. int node;
  16. node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_IVYBRIDGE_FSP);
  17. if (node < 0) {
  18. debug("%s: Cannot find FSP node\n", __func__);
  19. return;
  20. }
  21. plat_config->enable_ht =
  22. fdtdec_get_bool(blob, node, "fsp,enable-ht");
  23. plat_config->enable_turbo =
  24. fdtdec_get_bool(blob, node, "fsp,enable-turbo");
  25. plat_config->enable_memory_down =
  26. fdtdec_get_bool(blob, node, "fsp,enable-memory-down");
  27. plat_config->enable_fast_boot =
  28. fdtdec_get_bool(blob, node, "fsp,enable-fast-boot");
  29. /* Initialize runtime buffer for fsp_init() */
  30. rt_buf->stack_top = config->common.stack_top - 32;
  31. rt_buf->boot_mode = config->common.boot_mode;
  32. rt_buf->plat_config = plat_config;
  33. if (plat_config->enable_memory_down)
  34. rt_buf->mem_config = mem_config;
  35. else
  36. rt_buf->mem_config = NULL;
  37. }