summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Kconfig21
-rw-r--r--src/lib/fw_config.c33
2 files changed, 27 insertions, 27 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 89849eca02..e30152d2e5 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -395,16 +395,6 @@ config FW_CONFIG
Enable support for probing devices with fw_config. This is a simple
bitmask broken into fields and options for probing.
-config FW_CONFIG_SOURCE_CBFS
- bool "Obtain Firmware Configuration value from CBFS"
- depends on FW_CONFIG
- default n
- help
- With this option enabled coreboot will look for the 32bit firmware
- configuration value in CBFS at the selected prefix with the file name
- "fw_config". This option will override other sources and allow the
- local image to preempt the mainboard selected source.
-
config FW_CONFIG_SOURCE_CHROMEEC_CBI
bool "Obtain Firmware Configuration value from Google Chrome EC CBI"
depends on FW_CONFIG && EC_GOOGLE_CHROMEEC
@@ -415,6 +405,17 @@ config FW_CONFIG_SOURCE_CHROMEEC_CBI
is not tried if FW_CONFIG_SOURCE_CBFS is enabled and the value was
found in CBFS.
+config FW_CONFIG_SOURCE_CBFS
+ bool "Obtain Firmware Configuration value from CBFS"
+ depends on FW_CONFIG
+ default n
+ help
+ With this option enabled coreboot will look for the 32bit firmware
+ configuration value in CBFS at the selected prefix with the file name
+ "fw_config". This option will override other sources and allow the
+ local image to preempt the mainboard selected source and can be used as
+ FW_CONFIG_SOURCE_CHROMEEC_CBI fallback option.
+
config HAVE_RAMPAYLOAD
bool
diff --git a/src/lib/fw_config.c b/src/lib/fw_config.c
index 8e45c004fb..3546736b7b 100644
--- a/src/lib/fw_config.c
+++ b/src/lib/fw_config.c
@@ -21,30 +21,29 @@ uint64_t fw_config_get(void)
if (fw_config_value_initialized)
return fw_config_value;
fw_config_value_initialized = true;
+ fw_config_value = UNDEFINED_FW_CONFIG;
+
+ /* Read the value from EC CBI. */
+ if (CONFIG(FW_CONFIG_SOURCE_CHROMEEC_CBI)) {
+ if (google_chromeec_cbi_get_fw_config(&fw_config_value))
+ printk(BIOS_WARNING, "%s: Could not get fw_config from CBI\n",
+ __func__);
+ else
+ printk(BIOS_INFO, "FW_CONFIG value from CBI is 0x%" PRIx64 "\n",
+ fw_config_value);
+ }
/* Look in CBFS to allow override of value. */
- if (CONFIG(FW_CONFIG_SOURCE_CBFS)) {
+ if (CONFIG(FW_CONFIG_SOURCE_CBFS) && fw_config_value == UNDEFINED_FW_CONFIG) {
if (cbfs_load(CONFIG_CBFS_PREFIX "/fw_config", &fw_config_value,
- sizeof(fw_config_value)) != sizeof(fw_config_value)) {
+ sizeof(fw_config_value)) != sizeof(fw_config_value))
printk(BIOS_WARNING, "%s: Could not get fw_config from CBFS\n",
- __func__);
- fw_config_value = UNDEFINED_FW_CONFIG;
- } else {
+ __func__);
+ else
printk(BIOS_INFO, "FW_CONFIG value from CBFS is 0x%" PRIx64 "\n",
- fw_config_value);
- return fw_config_value;
- }
- }
-
- /* Read the value from EC CBI. */
- if (CONFIG(FW_CONFIG_SOURCE_CHROMEEC_CBI)) {
- if (google_chromeec_cbi_get_fw_config(&fw_config_value)) {
- printk(BIOS_WARNING, "%s: Could not get fw_config from EC\n", __func__);
- fw_config_value = UNDEFINED_FW_CONFIG;
- }
+ fw_config_value);
}
- printk(BIOS_INFO, "FW_CONFIG value is 0x%" PRIx64 "\n", fw_config_value);
return fw_config_value;
}